This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Slot, component$ } from "@builder.io/qwik"; | |
import type { JSX } from "@builder.io/qwik/jsx-runtime"; | |
import { twMerge } from "tailwind-merge"; | |
/** Comes from {@link tw} template. */ | |
type TwString = string & { | |
_tw: true; | |
}; | |
/** This applies types to somethign like `tw.div` or `tw.h1`, which will leverage the types from `JSX.IntrinsicElements` */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { NoSerialize, Signal } from "@builder.io/qwik"; | |
import { noSerialize, useSignal, useVisibleTask$ } from "@builder.io/qwik"; | |
import type { IFuseOptions } from "fuse.js"; | |
import Fuse from "fuse.js"; | |
export function useFuseSearch<T>( | |
config: { | |
items: Signal<T[]> | T[]; | |
search: Signal<string> | string; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Readable } from "svelte/store"; | |
const UNSET = Symbol(); | |
export function read<T>(store: Readable<T>): T { | |
let value: T | typeof UNSET = UNSET; | |
store.subscribe((v) => (value = v))(); | |
if (UNSET === value) { | |
throw new Error("Readable did not react synchronously"); | |
} | |
return value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ChangeNotifier { | |
callbacks: Array<() => void> = []; | |
onChange(callback: () => void) { | |
this.callbacks.push(callback); | |
return () => { | |
const index = this.callbacks.indexOf(callback); | |
if (index >= 0) { | |
this.callbacks.splice(index, 1); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IDisposable { | |
dispose(): void; | |
} | |
export class DisposePool implements IDisposable { | |
#fns: null | (() => void)[] = []; | |
#pool: null | IDisposable[] = []; | |
get disposed() { | |
return this.#pool === null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Object3D, PerspectiveCamera, Scene, | |
WebGLRenderer | |
} from "three"; | |
import { CleanupFn } from "./CleanupFn"; | |
import { DisposePool, isDisposable } from "./DisposePool"; | |
import { merge } from "./merge"; | |
import { ISheet } from "@theatre/core"; | |
import { TheatreMergeable, theatreMerge } from "./theatreMerge"; | |
import { EventsPool } from "./EventsPool"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jsReplacer() { | |
const seen = new WeakSet(); | |
return (key: string, value: any) => { | |
if (typeof value === "object" && value !== null) { | |
if (seen.has(value)) return "[Circular]"; | |
seen.add(value); | |
} | |
if (value instanceof RegExp) return { regexp: value.toString() }; | |
if (value instanceof Function) return { function: value.toString() }; | |
if (value instanceof Error) return { error: value.toString() }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ignore: string[] = [ | |
// "ui/generated.slint" | |
]; | |
const dirs = { ui: "ui" }; | |
const whitespaceRE = /^(\s*)(.*?)(\/*|\/\/)?(.*)$/; | |
const indentBy = " "; | |
file: for await (const file of Deno.readDir(dirs.ui)) { | |
if ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
AttributeSpec, | |
DOMOutputSpec, | |
Fragment, | |
Mark, | |
Node as PMNode, | |
NodeSpec, | |
NodeType, | |
ParseRule, | |
} from "prosemirror-model"; |