@manyducks.co/dolla 2.0.0-alpha.66 → 2.0.0-alpha.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -75
- package/dist/core/context.d.ts +11 -25
- package/dist/{hooks/index.d.ts → core/hooks.d.ts} +19 -26
- package/dist/core/index.d.ts +5 -4
- package/dist/core/markup.d.ts +6 -31
- package/dist/core/nodes/dynamic.d.ts +1 -1
- package/dist/core/nodes/element.d.ts +0 -1
- package/dist/core/ref.d.ts +1 -0
- package/dist/core/signals.d.ts +26 -19
- package/dist/core/views/for.d.ts +2 -2
- package/dist/core/views/show.d.ts +3 -3
- package/dist/http.js +1 -1
- package/dist/i18n.js +121 -122
- package/dist/i18n.js.map +1 -1
- package/dist/{index-BEDDzyd9.js → index-BLYt-mrI.js} +23 -24
- package/dist/index-BLYt-mrI.js.map +1 -0
- package/dist/index.js +145 -97
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/logger-IE5c3t-c.js +566 -0
- package/dist/logger-IE5c3t-c.js.map +1 -0
- package/dist/markup-8Olu6qoy.js +1063 -0
- package/dist/markup-8Olu6qoy.js.map +1 -0
- package/dist/router.js +1 -1
- package/dist/{typeChecking-_dGK_0uR.js → typeChecking-Cw-4pIto.js} +7 -3
- package/dist/{typeChecking-_dGK_0uR.js.map → typeChecking-Cw-4pIto.js.map} +1 -1
- package/docs/hooks.md +17 -17
- package/docs/mixins.md +10 -7
- package/docs/ref.md +14 -14
- package/docs/router.md +8 -5
- package/package.json +1 -5
- package/vite.config.js +0 -1
- package/dist/core/scheduler.d.ts +0 -25
- package/dist/hooks.js +0 -70
- package/dist/hooks.js.map +0 -1
- package/dist/index-BEDDzyd9.js.map +0 -1
- package/dist/logger-CmXtRdEI.js +0 -82
- package/dist/logger-CmXtRdEI.js.map +0 -1
- package/dist/markup-DjDexAN5.js +0 -1179
- package/dist/markup-DjDexAN5.js.map +0 -1
- package/dist/ref-BD79iqlg.js +0 -15
- package/dist/ref-BD79iqlg.js.map +0 -1
- package/dist/signals-CkfFHd0d.js +0 -488
- package/dist/signals-CkfFHd0d.js.map +0 -1
- /package/dist/{hooks/index.test.d.ts → core/hooks.test.d.ts} +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/core/views/default-crash-view.ts","../src/core/app.ts","../src/core/views/for.ts","../src/core/views/show.ts","../src/core/views/portal.ts"],"sourcesContent":["import { when, m } from \"../markup.js\";\n\n/**\n * Props passed to the crash view when a crash occurs.\n */\nexport interface CrashViewProps {\n /**\n * JavaScript Error object.\n */\n error: Error;\n\n /**\n * A string to identify the logger that reported this error.\n */\n loggerName: string;\n\n /**\n * Unique identifier to pinpoint the specific view that reported the crash.\n */\n tag?: string;\n\n /**\n * Label for the tag.\n */\n tagName?: string;\n}\n\n/**\n * The crash view displayed unless you specify your own.\n */\nexport function DefaultCrashView(props: CrashViewProps) {\n return m(\"div\", {\n style: {\n backgroundColor: \"#880000\",\n color: \"#fff\",\n padding: \"2rem\",\n position: \"fixed\",\n inset: 0,\n fontSize: \"20px\",\n },\n children: [\n m(\"h1\", { style: { marginBottom: \"0.5rem\" }, children: \"The app has crashed\" }),\n m(\"p\", {\n style: { marginBottom: \"0.25rem\" },\n children: [\n m(\"span\", {\n style: { fontFamily: \"monospace\" },\n children: props.loggerName,\n }),\n when(\n props.tag,\n m(\"span\", {\n style: { fontFamily: \"monospace\", opacity: 0.5 },\n children: ` [${props.tagName ? `${props.tagName}: ` : \"\"}${props.tag}]`,\n }),\n ),\n \" says:\",\n ],\n }),\n m(\"blockquote\", {\n style: {\n backgroundColor: \"#991111\",\n padding: \"0.25em\",\n borderRadius: \"6px\",\n fontFamily: \"monospace\",\n marginBottom: \"1rem\",\n },\n children: [\n m(\"span\", {\n style: {\n display: \"inline-block\",\n backgroundColor: \"red\",\n padding: \"0.1em 0.4em\",\n marginRight: \"0.5em\",\n borderRadius: \"4px\",\n fontSize: \"0.9em\",\n fontWeight: \"bold\",\n },\n children: props.error.name,\n }),\n props.error.message,\n ],\n }),\n m(\"p\", { children: \"Please see the browser console for details.\" }),\n ],\n });\n}\n","import { createRouter } from \"../router\";\nimport { MOUNT, ROUTER, Router, RouterOptions, UNMOUNT } from \"../router/router\";\nimport { typeOf } from \"../typeChecking\";\nimport { View } from \"../types\";\nimport { Context, LifecycleEvent } from \"./context\";\nimport { LoggerCrashProps, onLoggerCrash } from \"./logger\";\nimport { MarkupNode } from \"./markup\";\nimport { ViewNode } from \"./nodes/view\";\nimport { DefaultCrashView } from \"./views/default-crash-view\";\nimport { Fragment } from \"./views/fragment\";\n\ninterface AppOptions {\n view?: View<{}>;\n router?: Router;\n context?: Context;\n}\n\nclass App {\n #root!: MarkupNode;\n #context: Context;\n #view: View<{}>;\n #router?: Router;\n #mounted = false;\n #crashView: View<LoggerCrashProps> = DefaultCrashView;\n\n #cleanup: (() => void)[] = [];\n\n get context() {\n return this.#context;\n }\n\n constructor(options: AppOptions) {\n this.#view = options.view ?? Fragment;\n this.#router = options.router;\n this.#context = options.context ?? new Context(\"App\");\n }\n\n setCrashView(view: View<LoggerCrashProps>) {\n this.#crashView = view;\n return this;\n }\n\n async mount(element: string | Element): Promise<void> {\n if (this.#mounted) return Promise.resolve();\n\n const parentElement = this.#getElement(element);\n\n this.#cleanup.push(\n onLoggerCrash((props) => {\n if (this.#mounted) {\n this.unmount();\n }\n new ViewNode(this.#context, this.#crashView, props).mount(parentElement);\n }),\n );\n\n Context.emit(this.#context, LifecycleEvent.WILL_MOUNT);\n\n if (this.#router) {\n this.#root = await this.#router[MOUNT](parentElement, this.#context);\n this.#context.setState(ROUTER, this.#router);\n } else {\n this.#root = new ViewNode(this.#context, this.#view, {});\n }\n this.#root.mount(parentElement);\n this.#mounted = true;\n\n Context.emit(this.#context, LifecycleEvent.DID_MOUNT);\n }\n\n async unmount() {\n if (!this.#mounted) return Promise.resolve();\n\n Context.emit(this.#context, LifecycleEvent.WILL_UNMOUNT);\n this.#mounted = false;\n\n this.#root.unmount(false);\n if (this.#router) {\n await this.#router[UNMOUNT]();\n }\n\n for (const callback of this.#cleanup) {\n callback();\n }\n this.#cleanup = [];\n\n Context.emit(this.#context, LifecycleEvent.DID_UNMOUNT);\n }\n\n #getElement(element: string | Element): Element {\n if (typeof element === \"string\") {\n const match = document.querySelector(element);\n if (!match) {\n throw new Error(`Selector '${element}' did not many any element.`);\n }\n return match;\n } else if (element instanceof Element) {\n return element;\n } else {\n throw new Error(\"Expected a selector string or DOM element.\");\n }\n }\n}\n\nexport interface CreateAppOptions {\n context?: Context;\n}\n\nexport function createApp(view: View<{}>, options?: CreateAppOptions): App;\nexport function createApp(routerOptions: RouterOptions, options?: CreateAppOptions): App;\nexport function createApp(router: Router, options?: CreateAppOptions): App;\n\nexport function createApp(entry: View<{}> | RouterOptions | Router, options?: CreateAppOptions) {\n if (entry instanceof Router) {\n return new App({ ...options, router: entry });\n } else if (typeOf(entry) === \"object\") {\n return new App({ ...options, router: createRouter(entry as RouterOptions) });\n } else {\n return new App({ ...options, view: entry as View<{}> });\n }\n}\n","import type { Renderable } from \"../../types\";\nimport type { Context } from \"../context\";\nimport { type Key, RepeatNode } from \"../nodes/repeat\";\nimport { type Signal } from \"../signals\";\n\nexport interface ForProps<T> {\n /**\n * An array of items to render.\n */\n each: Signal<T[]>;\n /**\n * A function to extract a unique key that identifies each item.\n * If no `key` function is passed, object identity (===) will be used.\n */\n key?: (item: T, index: number) => Key;\n /**\n * A render function. Takes the item and its index in signal form and returns something to display for each item.\n */\n children: (item: Signal<T>, index: Signal<number>, ctx: Context) => Renderable;\n}\n\nconst defaultKeyFn = (x: any) => x;\n\n/**\n *\n */\nexport function For<T>(props: ForProps<T>, context: Context) {\n return new RepeatNode(context, props.each, props.key ?? defaultKeyFn, props.children);\n}\n","import type { Renderable } from \"../../types\";\nimport type { Context } from \"../context\";\nimport { DynamicNode } from \"../nodes/dynamic\";\nimport { get, type Signal } from \"../signals\";\n\nexport interface ShowProps {\n /**\n * If present, children will be rendered only when this signal holds a truthy value.\n */\n when?: Signal<any>;\n\n /**\n * If present, children will be rendered only when this signal holds a falsy value.\n */\n unless?: Signal<any>;\n\n /**\n * Content to render if conditions permit.\n */\n children: Renderable;\n\n /**\n * Content to render when conditions don't permit `children` to render.\n */\n fallback?: Renderable;\n}\n\n/**\n * Conditionally display children.\n */\nexport function Show(props: ShowProps, context: Context) {\n return new DynamicNode(context, () => {\n let shouldShow = true;\n\n if (props.when != null && props.unless != null) {\n shouldShow = get(props.when) && !get(props.unless);\n } else if (props.when != null) {\n shouldShow = get(props.when);\n } else if (props.unless != null) {\n shouldShow = !get(props.unless);\n }\n\n if (shouldShow) {\n return props.children;\n } else {\n return props.fallback;\n }\n });\n}\n","import { isString } from \"../../typeChecking\";\nimport type { Renderable } from \"../../types\";\nimport type { Context } from \"../context\";\nimport { Markup, MarkupType } from \"../markup\";\n\nexport interface PortalProps {\n /**\n * The parent element or a selector that will match it.\n */\n into: Element | string;\n\n /**\n * Content to render inside the `into` element.\n */\n children: Renderable;\n}\n\n/**\n * Render content into any element on the page.\n */\nexport function Portal(props: PortalProps, ctx: Context) {\n let parent: Element;\n\n if (isString(props.into)) {\n const match = document.querySelector(props.into);\n if (match == null) {\n throw ctx.crash(new Error(`Portal: selector '${props.into}' did not match any element`));\n }\n parent = match;\n } else {\n parent = props.into;\n }\n\n return new Markup(MarkupType.Portal, {\n parent: props.into,\n content: props.children,\n });\n}\n"],"names":["DefaultCrashView","props","m","when","App","options","__privateAdd","_App_instances","_root","_context","_view","_router","_mounted","_crashView","_cleanup","__privateSet","Fragment","Context","__privateGet","view","element","parentElement","__privateMethod","getElement_fn","onLoggerCrash","ViewNode","LifecycleEvent","MOUNT","ROUTER","UNMOUNT","callback","match","createApp","entry","Router","typeOf","createRouter","defaultKeyFn","x","For","context","RepeatNode","Show","DynamicNode","shouldShow","get","Port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AGC,GAAS,QAAQ+B,EAAaH,CAAsB,GAAG,IAEpE,IAAI7B,EAAI,EAAE,GAAGC,GAAS,MAAM4B,GAAmB;AAE1D;ACnGA,MAAMI,IAAe,CAACC,MAAWA;AAKjB,SAAAC,EAAOtC,GAAoBuC,GAAkB;AACpD,SAAA,IAAIC,EAAWD,GAASvC,EAAM,MAAMA,EAAM,OAAOoC,GAAcpC,EAAM,QAAQ;AACtF;ACEgB,SAAAyC,EAAKzC,GAAkBuC,GAAkB;AAChD,SAAA,IAAIG,EAAYH,GAAS,MAAM;AACpC,QAAII,IAAa;AAUjB,WARI3C,EAAM,QAAQ,QAAQA,EAAM,UAAU,OACxC2C,IAAaC,EAAI5C,EAAM,IAAI,KAAK,CAAC4C,EAAI5C,EAAM,MAAM,IACxCA,EAAM,QAAQ,OACV2C,IAAAC,EAAI5C,EAAM,IAAI,IAClBA,EAAM,UAAU,SACZ2C,IAAA,CAACC,EAAI5C,EAAM,MAAM,IAG5B2C,IACK3C,EAAM,WAENA,EAAM;AAAA,EACf,CACD;AACH;AC5BgB,SAAA6C,EAAO7C,GAAoB8C,GAAc;AAGnD,MAAAC,EAAS/C,EAAM,IAAI;AAErB,QADc,SAAS,cAAcA,EAAM,IAAI,KAClC;AACL,YAAA8C,EAAI,MAAM,IAAI,MAAM,qBAAqB9C,EAAM,IAAI,6BAA6B,CAAC;AAAA;AAIhF,IAAAA,EAAM;AAGV,SAAA,IAAIgD,EAAOC,EAAW,QAAQ;AAAA,IACnC,QAAQjD,EAAM;AAAA,IACd,SAASA,EAAM;AAAA,EAAA,CAChB;AACH;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/core/views/default-crash-view.ts","../src/core/app.ts","../src/core/hooks.ts","../src/core/views/for.ts","../src/core/views/portal.ts","../src/core/views/show.ts"],"sourcesContent":["import { createMarkup as m } from \"../markup.js\";\n\n/**\n * Props passed to the crash view when a crash occurs.\n */\nexport interface CrashViewProps {\n /**\n * JavaScript Error object.\n */\n error: Error;\n\n /**\n * A string to identify the logger that reported this error.\n */\n loggerName: string;\n\n /**\n * Unique identifier to pinpoint the specific view that reported the crash.\n */\n tag?: string;\n\n /**\n * Label for the tag.\n */\n tagName?: string;\n}\n\n/**\n * The crash view displayed unless you specify your own.\n */\nexport function DefaultCrashView(props: CrashViewProps) {\n return m(\"div\", {\n style: {\n backgroundColor: \"#880000\",\n color: \"#fff\",\n padding: \"2rem\",\n position: \"fixed\",\n inset: 0,\n fontSize: \"20px\",\n },\n children: [\n m(\"h1\", { style: { marginBottom: \"0.5rem\" }, children: \"The app has crashed\" }),\n m(\"p\", {\n style: { marginBottom: \"0.25rem\" },\n children: [\n m(\"span\", {\n style: { fontFamily: \"monospace\" },\n children: props.loggerName,\n }),\n props.tag &&\n m(\"span\", {\n style: { fontFamily: \"monospace\", opacity: 0.5 },\n children: ` [${props.tagName ? `${props.tagName}: ` : \"\"}${props.tag}]`,\n }),\n \" says:\",\n ],\n }),\n m(\"blockquote\", {\n style: {\n backgroundColor: \"#991111\",\n padding: \"0.25em\",\n borderRadius: \"6px\",\n fontFamily: \"monospace\",\n marginBottom: \"1rem\",\n },\n children: [\n m(\"span\", {\n style: {\n display: \"inline-block\",\n backgroundColor: \"red\",\n padding: \"0.1em 0.4em\",\n marginRight: \"0.5em\",\n borderRadius: \"4px\",\n fontSize: \"0.9em\",\n fontWeight: \"bold\",\n },\n children: props.error.name,\n }),\n props.error.message,\n ],\n }),\n m(\"p\", { children: \"Please see the browser console for details.\" }),\n ],\n });\n}\n","import { createRouter } from \"../router\";\nimport { MOUNT, ROUTER, Router, RouterOptions, UNMOUNT } from \"../router/router\";\nimport { typeOf } from \"../typeChecking\";\nimport { View } from \"../types\";\nimport { Context, LifecycleEvent } from \"./context\";\nimport { LoggerCrashProps, onLoggerCrash } from \"./logger\";\nimport { MarkupNode } from \"./markup\";\nimport { ViewNode } from \"./nodes/view\";\nimport { DefaultCrashView } from \"./views/default-crash-view\";\nimport { Fragment } from \"./views/fragment\";\n\ninterface AppOptions {\n view?: View<{}>;\n router?: Router;\n context?: Context;\n}\n\nclass App {\n #root!: MarkupNode;\n #context: Context;\n #view: View<{}>;\n #router?: Router;\n #mounted = false;\n #crashView: View<LoggerCrashProps> = DefaultCrashView;\n\n #cleanup: (() => void)[] = [];\n\n get context() {\n return this.#context;\n }\n\n constructor(options: AppOptions) {\n this.#view = options.view ?? Fragment;\n this.#router = options.router;\n this.#context = options.context ?? new Context(\"App\");\n }\n\n setCrashView(view: View<LoggerCrashProps>) {\n this.#crashView = view;\n return this;\n }\n\n async mount(element: string | Element): Promise<void> {\n if (this.#mounted) return Promise.resolve();\n\n const parentElement = this.#getElement(element);\n\n this.#cleanup.push(\n onLoggerCrash((props) => {\n if (this.#mounted) {\n this.unmount();\n }\n new ViewNode(this.#context, this.#crashView, props).mount(parentElement);\n }),\n );\n\n Context.emit(this.#context, LifecycleEvent.WILL_MOUNT);\n\n if (this.#router) {\n this.#root = await this.#router[MOUNT](parentElement, this.#context);\n this.#context.setState(ROUTER, this.#router);\n } else {\n this.#root = new ViewNode(this.#context, this.#view, {});\n }\n this.#root.mount(parentElement);\n this.#mounted = true;\n\n Context.emit(this.#context, LifecycleEvent.DID_MOUNT);\n }\n\n async unmount() {\n if (!this.#mounted) return Promise.resolve();\n\n Context.emit(this.#context, LifecycleEvent.WILL_UNMOUNT);\n this.#mounted = false;\n\n this.#root.unmount(false);\n if (this.#router) {\n await this.#router[UNMOUNT]();\n }\n\n for (const callback of this.#cleanup) {\n callback();\n }\n this.#cleanup = [];\n\n Context.emit(this.#context, LifecycleEvent.DID_UNMOUNT);\n }\n\n #getElement(element: string | Element): Element {\n if (typeof element === \"string\") {\n const match = document.querySelector(element);\n if (!match) {\n throw new Error(`Selector '${element}' did not many any element.`);\n }\n return match;\n } else if (element instanceof Element) {\n return element;\n } else {\n throw new Error(\"Expected a selector string or DOM element.\");\n }\n }\n}\n\nexport interface CreateAppOptions {\n context?: Context;\n}\n\nexport function createApp(view: View<{}>, options?: CreateAppOptions): App;\nexport function createApp(routerOptions: RouterOptions, options?: CreateAppOptions): App;\nexport function createApp(router: Router, options?: CreateAppOptions): App;\n\nexport function createApp(entry: View<{}> | RouterOptions | Router, options?: CreateAppOptions) {\n if (entry instanceof Router) {\n return new App({ ...options, router: entry });\n } else if (typeOf(entry) === \"object\") {\n return new App({ ...options, router: createRouter(entry as RouterOptions) });\n } else {\n return new App({ ...options, view: entry as View<{}> });\n }\n}\n","import { type Context, ref, type Ref, type Store } from \"../core\";\nimport {\n type EffectFn,\n get,\n getCurrentContext,\n type MaybeSignal,\n memo,\n type Setter,\n signal,\n type Signal,\n type SignalOptions,\n untracked,\n} from \"../core/signals\";\n\n/**\n * Returns the Context object of the `View`, `Store` or `Mixin` this hook is called in.\n *\n * @param name - If passed, the context will be renamed. Context takes the name of the component function by default.\n */\nexport function useContext(name?: MaybeSignal<string>): Context {\n const context = getCurrentContext();\n if (!context) {\n throw new Error(`No context found; hooks can only be called in the body of a View, Store or Mixin.`);\n }\n if (name != null) {\n context.setName(name);\n }\n return context;\n}\n\n/**\n * Returns the nearest instance of a Store provided to this context.\n */\nexport function useStore<T>(store: Store<any, T>): T {\n return useContext().getStore(store);\n}\n\n/**\n * Adds a store to this context and returns the store instance.\n */\nexport function useStoreProvider<T, O>(store: Store<O, T>, options?: O): T {\n return useContext().addStore(store, options).getStore(store);\n}\n\n/**\n * Schedules `callback` to run just after the component is mounted.\n * If `callback` returns a function, that function will run when the context is unmounted.\n */\nexport function useMount(callback: () => void | (() => void)): void {\n const context = useContext();\n context.onLifecycleTransition(\"didMount\", () => {\n const result = callback();\n if (result) context.onLifecycleTransition(\"didUnmount\", result);\n });\n}\n\n/**\n * Schedules `callback` to run when the context is unmounted.\n */\nexport function useUnmount(callback: () => void): void {\n useContext().onLifecycleTransition(\"didUnmount\", callback);\n}\n\n/**\n * Creates a new read-only Signal. Returns bound Getter and Setter functions.\n *\n * @example\n * const [$count, setCount] = useSignal(5);\n * $count(); // 5\n * setCount(6);\n * setCount((current) => current + 1);\n * $count(); // 7\n */\nexport function useSignal<T>(value: T, options?: SignalOptions<T>): [Signal<T>, Setter<T>];\nexport function useSignal<T>(\n value: undefined,\n options: SignalOptions<T>,\n): [Signal<T | undefined>, Setter<T | undefined>];\nexport function useSignal<T>(): [Signal<T | undefined>, Setter<T | undefined>];\nexport function useSignal<T>(value?: T, options?: SignalOptions<T>): [Signal<T>, Setter<T>] {\n useContext(); // Ensure we're called within a context.\n return signal(value as T, options);\n}\n\nexport function useMemo<T>(\n compute: (current?: T) => MaybeSignal<T>,\n deps?: Signal<any>[],\n options?: SignalOptions<T>,\n): Signal<T> {\n useContext(); // Ensure we're called within a context.\n return memo(compute, { ...options, deps });\n}\n\n/**\n * Takes the current state and a dispatched action. Returns a new state based on the action.\n * Typically the body of this function will be a large switch statement.\n */\nexport type Reducer<State, Action> = (state: State, action: Action) => State;\n\n/**\n * Dispatches an action to this reducer, causing the state to update.\n */\nexport type Dispatcher<Action> = (action: Action) => void;\n\n/**\n *\n */\nexport function useReducer<State, Action>(\n reducer: Reducer<State, Action>,\n initialState: State,\n): [Signal<State>, Dispatcher<Action>] {\n const [$state, setState] = useSignal(initialState);\n const dispatch = (action: Action) => {\n setState((current) => reducer(current, action));\n };\n return [$state, dispatch];\n}\n\n/**\n * Creates an effect bound to the current context.\n * The `fn` is called when the component is mounted, then again each time the dependencies are updated until the component is unmounted.\n */\nexport function useEffect(fn: EffectFn, deps?: Signal<any>[]): void {\n const context = useContext();\n if (deps) {\n context.effect(() => {\n for (const dep of deps) get(dep);\n return untracked(fn);\n });\n } else {\n context.effect(fn);\n }\n}\n\n/**\n * A hybrid Ref which is both a function ref and a React-style object ref with a `current` property.\n * Both the `current` property and the function syntax access the same value.\n */\nexport interface HybridRef<T> extends Ref<T> {\n current: T;\n}\n\n/**\n * Creates a Ref. Useful for getting references to DOM nodes.\n *\n * @deprecated use ref()\n */\nexport function useRef<T>(initialValue?: T): HybridRef<T>;\n\nexport function useRef<T>(...value: [T]): HybridRef<T> {\n useContext(); // assert that we're in a valid context\n const valueRef = ref(...value);\n Object.defineProperty(valueRef, \"current\", { get: valueRef, set: valueRef });\n return valueRef as HybridRef<T>;\n}\n","import type { Renderable } from \"../../types\";\nimport type { Context } from \"../context\";\nimport { type Key, RepeatNode } from \"../nodes/repeat\";\nimport { type MaybeSignal, readable, type Signal } from \"../signals\";\n\nexport interface ForProps<T> {\n /**\n * An array of items to render.\n */\n each: MaybeSignal<T[]>;\n /**\n * A function to extract a unique key that identifies each item.\n * If no `key` function is passed, object identity (===) will be used.\n */\n key?: (item: T, index: number) => Key;\n /**\n * A render function. Takes the item and its index in signal form and returns something to display for each item.\n */\n children: (item: Signal<T>, index: Signal<number>, ctx: Context) => Renderable;\n}\n\nconst defaultKeyFn = (x: any) => x;\n\n/**\n *\n */\nexport function For<T>(props: ForProps<T>, context: Context) {\n return new RepeatNode(context, readable(props.each), props.key ?? defaultKeyFn, props.children);\n}\n","import { isString } from \"../../typeChecking\";\nimport type { Renderable } from \"../../types\";\nimport type { Context } from \"../context\";\nimport { Markup, MarkupType } from \"../markup\";\n\nexport interface PortalProps {\n /**\n * The parent element or a selector that will match it.\n */\n into: Element | string;\n\n /**\n * Content to render inside the `into` element.\n */\n children: Renderable;\n}\n\n/**\n * Render content into any element on the page.\n */\nexport function Portal(props: PortalProps, ctx: Context) {\n let parent: Element;\n\n if (isString(props.into)) {\n const match = document.querySelector(props.into);\n if (match == null) {\n throw ctx.crash(new Error(`Portal: selector '${props.into}' did not match any element`));\n }\n parent = match;\n } else {\n parent = props.into;\n }\n\n return new Markup(MarkupType.Portal, {\n parent: props.into,\n content: props.children,\n });\n}\n","import type { Renderable } from \"../../types\";\nimport type { Context } from \"../context\";\nimport { DynamicNode } from \"../nodes/dynamic\";\nimport { get, type MaybeSignal, memo, readable } from \"../signals\";\n\nexport interface ShowProps {\n /**\n * If present, children will be rendered only when this signal holds a truthy value.\n */\n when?: MaybeSignal<any>;\n\n /**\n * If present, children will be rendered only when this signal holds a falsy value.\n */\n unless?: MaybeSignal<any>;\n\n /**\n * Content to render if conditions permit.\n */\n children: Renderable;\n\n /**\n * Content to render when conditions don't permit `children` to render.\n */\n fallback?: Renderable;\n}\n\n/**\n * Conditionally display children.\n */\nexport function Show(props: ShowProps, context: Context) {\n // Memoize conditions to avoid unnecessarily triggering DynamicNode updates.\n const when = props.when ? readable(props.when) : null;\n const unless = props.unless ? readable(props.unless) : null;\n\n return new DynamicNode(context, () => {\n let shouldShow = true;\n\n if (when != null && unless != null) {\n shouldShow = get(when) && !get(unless);\n } else if (when != null) {\n shouldShow = get(when);\n } else if (unless != null) {\n shouldShow = !get(unless);\n }\n\n if (shouldShow) {\n return props.children;\n } else {\n return props.fallback;\n }\n });\n}\n"],"names":["DefaultCrashView","props","m","App","options","__privateAdd","_App_instances","_root","_context","_view","_router","_mounted","_crashView","_cleanup","__privateSet","Fragment","Context","__privateGet","view","element","parentElement","__privateMethod","getElement_fn","onLoggerCrash","ViewNode","LifecycleEvent","MOUNT","ROUTER","UNMOUNT","callback","match","createApp","entry","Router","typeOf","createRouter","useContext","name","context","getCurrentContext","useStore","store","useStoreProvider","useMount","result","useUnmount","useSignal","value","signal","useMemo","compute","deps","memo","useReducer","reducer","initialState","$state","setState","action","current","useEffect","fn","dep","get","untracked","useRef","valueRef","ref","defaultKeyFn","x","For","RepeatNode","readable","Portal","ctx","isString","Markup","MarkupType","Show","when","unless","DynamicNode","shouldShow"],"mappings":";;;;;;;;;;;;AA8BO,SAASA,EAAiBC,GAAuB;AACtD,SAAOC,EAAE,OAAO;AAAA,IACd,OAAO;AAAA,MACL,iBAAiB;AAAA,MACjB,OAAO;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACRA,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,SAAS,GAAG,UAAU,uBAAuB;AAAA,MAC9EA,EAAE,KAAK;AAAA,QACL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AA,IAAIiC,EAAWjC,GAASkC,EAASvE,EAAM,IAAI,GAAGA,EAAM,OAAOmE,GAAcnE,EAAM,QAAQ;AAChG;ACRgB,SAAAwE,GAAOxE,GAAoByE,GAAc;AAGnD,MAAAC,EAAS1E,EAAM,IAAI;AAErB,QADc,SAAS,cAAcA,EAAM,IAAI,KAClC;AACL,YAAAyE,EAAI,MAAM,IAAI,MAAM,qBAAqBzE,EAAM,IAAI,6BAA6B,CAAC;AAAA;AAIhF,IAAAA,EAAM;AAGV,SAAA,IAAI2E,EAAOC,EAAW,QAAQ;AAAA,IACnC,QAAQ5E,EAAM;AAAA,IACd,SAASA,EAAM;AAAA,EAAA,CAChB;AACH;ACPgB,SAAA6E,GAAK7E,GAAkBqC,GAAkB;AAEvD,QAAMyC,IAAO9E,EAAM,OAAOuE,EAASvE,EAAM,IAAI,IAAI,MAC3C+E,IAAS/E,EAAM,SAASuE,EAASvE,EAAM,MAAM,IAAI;AAEhD,SAAA,IAAIgF,EAAY3C,GAAS,MAAM;AACpC,QAAI4C,IAAa;AAUjB,WARIH,KAAQ,QAAQC,KAAU,OAC5BE,IAAanB,EAAIgB,CAAI,KAAK,CAAChB,EAAIiB,CAAM,IAC5BD,KAAQ,OACjBG,IAAanB,EAAIgB,CAAI,IACZC,KAAU,SACNE,IAAA,CAACnB,EAAIiB,CAAM,IAGtBE,IACKjF,EAAM,WAENA,EAAM;AAAA,EACf,CACD;AACH;"}
|
package/dist/jsx-dev-runtime.js
CHANGED
package/dist/jsx-runtime.js
CHANGED
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import { t as M, b, i as ne } from "./typeChecking-Cw-4pIto.js";
|
|
2
|
+
const re = () => {
|
|
3
|
+
};
|
|
4
|
+
let D = 1;
|
|
5
|
+
function de() {
|
|
6
|
+
return D = D % Number.MAX_SAFE_INTEGER + 1, D.toString(36) + Date.now().toString(36);
|
|
7
|
+
}
|
|
8
|
+
let T = 0;
|
|
9
|
+
function ge() {
|
|
10
|
+
return T = T % Number.MAX_SAFE_INTEGER + 1, T;
|
|
11
|
+
}
|
|
12
|
+
function N(e, t) {
|
|
13
|
+
return Object.is(e, t);
|
|
14
|
+
}
|
|
15
|
+
function pe(e, t) {
|
|
16
|
+
if (Object.is(e, t)) return !0;
|
|
17
|
+
const r = M(e);
|
|
18
|
+
if (r !== M(t))
|
|
19
|
+
return !1;
|
|
20
|
+
switch (r) {
|
|
21
|
+
case "object":
|
|
22
|
+
let n = 0;
|
|
23
|
+
for (const u in e) {
|
|
24
|
+
if (e[u] !== t[u]) return !1;
|
|
25
|
+
n++;
|
|
26
|
+
}
|
|
27
|
+
return Object.keys(t).length === n;
|
|
28
|
+
case "array":
|
|
29
|
+
if (e.length !== t.length) return !1;
|
|
30
|
+
for (let u = 0; u < e.length; u++)
|
|
31
|
+
if (e[u] !== t[u]) return !1;
|
|
32
|
+
return !0;
|
|
33
|
+
case "map":
|
|
34
|
+
if (e.size !== t.size) return !1;
|
|
35
|
+
for (const u of e.keys())
|
|
36
|
+
if (e[u] !== t[u]) return !1;
|
|
37
|
+
return !0;
|
|
38
|
+
case "set":
|
|
39
|
+
if (b(e.symmetricDifference))
|
|
40
|
+
return e.symmetricDifference(t).size === 0;
|
|
41
|
+
for (const u of e.keys())
|
|
42
|
+
if (e[u] !== t.get(u)) return !1;
|
|
43
|
+
return !0;
|
|
44
|
+
}
|
|
45
|
+
return !1;
|
|
46
|
+
}
|
|
47
|
+
function C(e, t) {
|
|
48
|
+
if (e === t) return !0;
|
|
49
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
50
|
+
if (e.constructor !== t.constructor) return !1;
|
|
51
|
+
var r, n, u;
|
|
52
|
+
if (Array.isArray(e)) {
|
|
53
|
+
if (r = e.length, r != t.length) return !1;
|
|
54
|
+
for (n = r; n-- !== 0; ) if (!C(e[n], t[n])) return !1;
|
|
55
|
+
return !0;
|
|
56
|
+
}
|
|
57
|
+
if (e instanceof Map && t instanceof Map) {
|
|
58
|
+
if (e.size !== t.size) return !1;
|
|
59
|
+
for (n of e.entries()) if (!t.has(n[0])) return !1;
|
|
60
|
+
for (n of e.entries()) if (!C(n[1], t.get(n[0]))) return !1;
|
|
61
|
+
return !0;
|
|
62
|
+
}
|
|
63
|
+
if (e instanceof Set && t instanceof Set) {
|
|
64
|
+
if (e.size !== t.size) return !1;
|
|
65
|
+
for (n of e.entries()) if (!t.has(n[0])) return !1;
|
|
66
|
+
return !0;
|
|
67
|
+
}
|
|
68
|
+
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
|
|
69
|
+
if (r = e.length, r != t.length) return !1;
|
|
70
|
+
for (n = r; n-- !== 0; ) if (e[n] !== t[n]) return !1;
|
|
71
|
+
return !0;
|
|
72
|
+
}
|
|
73
|
+
if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
|
|
74
|
+
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
|
|
75
|
+
if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
|
|
76
|
+
if (u = Object.keys(e), r = u.length, r !== Object.keys(t).length) return !1;
|
|
77
|
+
for (n = r; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(t, u[n])) return !1;
|
|
78
|
+
for (n = r; n-- !== 0; ) {
|
|
79
|
+
var d = u[n];
|
|
80
|
+
if (!C(e[d], t[d])) return !1;
|
|
81
|
+
}
|
|
82
|
+
return !0;
|
|
83
|
+
}
|
|
84
|
+
return e !== e && t !== t;
|
|
85
|
+
}
|
|
86
|
+
function ve(e, t) {
|
|
87
|
+
const r = {};
|
|
88
|
+
for (const n in t)
|
|
89
|
+
e.includes(n) || (r[n] = t[n]);
|
|
90
|
+
return r;
|
|
91
|
+
}
|
|
92
|
+
function he(e) {
|
|
93
|
+
return Array.isArray(e) ? e : [e];
|
|
94
|
+
}
|
|
95
|
+
function be(e) {
|
|
96
|
+
return e.replace(/-./g, (t) => t[1].toUpperCase());
|
|
97
|
+
}
|
|
98
|
+
function xe(e, t, r) {
|
|
99
|
+
"moveBefore" in e ? e.moveBefore(t, r) : e.insertBefore(t, r);
|
|
100
|
+
}
|
|
101
|
+
function se(e) {
|
|
102
|
+
let t = 0;
|
|
103
|
+
for (let r = 0; r < e.length; r++)
|
|
104
|
+
t = (t + e.charCodeAt(r) * 10) % 360;
|
|
105
|
+
return `oklch(0.68 0.15 ${t}deg)`;
|
|
106
|
+
}
|
|
107
|
+
function I(e) {
|
|
108
|
+
if (e instanceof RegExp)
|
|
109
|
+
return (n) => e.test(n);
|
|
110
|
+
const t = {
|
|
111
|
+
positive: [],
|
|
112
|
+
negative: []
|
|
113
|
+
}, r = e.split(",").map((n) => n.trim()).filter((n) => n !== "");
|
|
114
|
+
for (let n of r) {
|
|
115
|
+
let u = "positive";
|
|
116
|
+
n.startsWith("-") && (u = "negative", n = n.slice(1)), n === "*" ? t[u].push(function() {
|
|
117
|
+
return !0;
|
|
118
|
+
}) : n.endsWith("*") ? t[u].push(function(d) {
|
|
119
|
+
return d.startsWith(n.slice(0, n.length - 1));
|
|
120
|
+
}) : t[u].push(function(d) {
|
|
121
|
+
return d === n;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return function(n) {
|
|
125
|
+
const { positive: u, negative: d } = t;
|
|
126
|
+
return !(d.some((g) => g(n)) || u.length > 0 && !u.some((g) => g(n)));
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
let $ = "production";
|
|
130
|
+
function ue() {
|
|
131
|
+
return $;
|
|
132
|
+
}
|
|
133
|
+
function Se(e) {
|
|
134
|
+
$ = e;
|
|
135
|
+
}
|
|
136
|
+
var V;
|
|
137
|
+
(function(e) {
|
|
138
|
+
e[e.None = 0] = "None", e[e.Mutable = 1] = "Mutable", e[e.Watching = 2] = "Watching", e[e.RecursedCheck = 4] = "RecursedCheck", e[e.Recursed = 8] = "Recursed", e[e.Dirty = 16] = "Dirty", e[e.Pending = 32] = "Pending";
|
|
139
|
+
})(V || (V = {}));
|
|
140
|
+
function fe({ update: e, notify: t, unwatched: r }) {
|
|
141
|
+
return {
|
|
142
|
+
link: n,
|
|
143
|
+
unlink: u,
|
|
144
|
+
propagate: d,
|
|
145
|
+
checkDirty: te,
|
|
146
|
+
endTracking: ee,
|
|
147
|
+
startTracking: g,
|
|
148
|
+
shallowPropagate: m
|
|
149
|
+
};
|
|
150
|
+
function n(s, f) {
|
|
151
|
+
const l = f.depsTail;
|
|
152
|
+
if (l !== void 0 && l.dep === s)
|
|
153
|
+
return;
|
|
154
|
+
let i;
|
|
155
|
+
const c = f.flags & 4;
|
|
156
|
+
if (c && (i = l !== void 0 ? l.nextDep : f.deps, i !== void 0 && i.dep === s)) {
|
|
157
|
+
f.depsTail = i;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const o = s.subsTail;
|
|
161
|
+
if (o !== void 0 && o.sub === f && (!c || L(o, f)))
|
|
162
|
+
return;
|
|
163
|
+
const a = f.depsTail = s.subsTail = {
|
|
164
|
+
dep: s,
|
|
165
|
+
sub: f,
|
|
166
|
+
prevDep: l,
|
|
167
|
+
nextDep: i,
|
|
168
|
+
prevSub: o,
|
|
169
|
+
nextSub: void 0
|
|
170
|
+
};
|
|
171
|
+
i !== void 0 && (i.prevDep = a), l !== void 0 ? l.nextDep = a : f.deps = a, o !== void 0 ? o.nextSub = a : s.subs = a;
|
|
172
|
+
}
|
|
173
|
+
function u(s, f = s.sub) {
|
|
174
|
+
const l = s.dep, i = s.prevDep, c = s.nextDep, o = s.nextSub, a = s.prevSub;
|
|
175
|
+
return c !== void 0 ? c.prevDep = i : f.depsTail = i, i !== void 0 ? i.nextDep = c : f.deps = c, o !== void 0 ? o.prevSub = a : l.subsTail = a, a !== void 0 ? a.nextSub = o : (l.subs = o) === void 0 && r(l), c;
|
|
176
|
+
}
|
|
177
|
+
function d(s) {
|
|
178
|
+
let f = s.nextSub, l;
|
|
179
|
+
e: do {
|
|
180
|
+
const i = s.sub;
|
|
181
|
+
let c = i.flags;
|
|
182
|
+
if (c & 3 && (c & 60 ? c & 12 ? c & 4 ? !(c & 48) && L(s, i) ? (i.flags = c | 40, c &= 1) : c = 0 : i.flags = c & -9 | 32 : c = 0 : i.flags = c | 32, c & 2 && t(i), c & 1)) {
|
|
183
|
+
const o = i.subs;
|
|
184
|
+
if (o !== void 0) {
|
|
185
|
+
s = o, o.nextSub !== void 0 && (l = { value: f, prev: l }, f = s.nextSub);
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if ((s = f) !== void 0) {
|
|
190
|
+
f = s.nextSub;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
for (; l !== void 0; )
|
|
194
|
+
if (s = l.value, l = l.prev, s !== void 0) {
|
|
195
|
+
f = s.nextSub;
|
|
196
|
+
continue e;
|
|
197
|
+
}
|
|
198
|
+
break;
|
|
199
|
+
} while (!0);
|
|
200
|
+
}
|
|
201
|
+
function g(s) {
|
|
202
|
+
s.depsTail = void 0, s.flags = s.flags & -57 | 4;
|
|
203
|
+
}
|
|
204
|
+
function ee(s) {
|
|
205
|
+
const f = s.depsTail;
|
|
206
|
+
let l = f !== void 0 ? f.nextDep : s.deps;
|
|
207
|
+
for (; l !== void 0; )
|
|
208
|
+
l = u(l, s);
|
|
209
|
+
s.flags &= -5;
|
|
210
|
+
}
|
|
211
|
+
function te(s, f) {
|
|
212
|
+
let l, i = 0;
|
|
213
|
+
e: do {
|
|
214
|
+
const c = s.dep, o = c.flags;
|
|
215
|
+
let a = !1;
|
|
216
|
+
if (f.flags & 16)
|
|
217
|
+
a = !0;
|
|
218
|
+
else if ((o & 17) === 17) {
|
|
219
|
+
if (e(c)) {
|
|
220
|
+
const h = c.subs;
|
|
221
|
+
h.nextSub !== void 0 && m(h), a = !0;
|
|
222
|
+
}
|
|
223
|
+
} else if ((o & 33) === 33) {
|
|
224
|
+
(s.nextSub !== void 0 || s.prevSub !== void 0) && (l = { value: s, prev: l }), s = c.deps, f = c, ++i;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (!a && s.nextDep !== void 0) {
|
|
228
|
+
s = s.nextDep;
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
for (; i; ) {
|
|
232
|
+
--i;
|
|
233
|
+
const h = f.subs, z = h.nextSub !== void 0;
|
|
234
|
+
if (z ? (s = l.value, l = l.prev) : s = h, a) {
|
|
235
|
+
if (e(f)) {
|
|
236
|
+
z && m(h), f = s.sub;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
} else
|
|
240
|
+
f.flags &= -33;
|
|
241
|
+
if (f = s.sub, s.nextDep !== void 0) {
|
|
242
|
+
s = s.nextDep;
|
|
243
|
+
continue e;
|
|
244
|
+
}
|
|
245
|
+
a = !1;
|
|
246
|
+
}
|
|
247
|
+
return a;
|
|
248
|
+
} while (!0);
|
|
249
|
+
}
|
|
250
|
+
function m(s) {
|
|
251
|
+
do {
|
|
252
|
+
const f = s.sub, l = s.nextSub, i = f.flags;
|
|
253
|
+
(i & 48) === 32 && (f.flags = i | 16, i & 2 && t(f)), s = l;
|
|
254
|
+
} while (s !== void 0);
|
|
255
|
+
}
|
|
256
|
+
function L(s, f) {
|
|
257
|
+
const l = f.depsTail;
|
|
258
|
+
if (l !== void 0) {
|
|
259
|
+
let i = f.deps;
|
|
260
|
+
do {
|
|
261
|
+
if (i === s)
|
|
262
|
+
return !0;
|
|
263
|
+
if (i === l)
|
|
264
|
+
break;
|
|
265
|
+
i = i.nextDep;
|
|
266
|
+
} while (i !== void 0);
|
|
267
|
+
}
|
|
268
|
+
return !1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const O = [], { link: _, unlink: q, propagate: ie, checkDirty: P, endTracking: W, startTracking: G, shallowPropagate: U } = fe({
|
|
272
|
+
update(e) {
|
|
273
|
+
return "getter" in e ? X(e) : k(e, e.value);
|
|
274
|
+
},
|
|
275
|
+
notify: H,
|
|
276
|
+
unwatched(e) {
|
|
277
|
+
if ("getter" in e) {
|
|
278
|
+
let t = e.deps;
|
|
279
|
+
if (t !== void 0) {
|
|
280
|
+
e.flags = 17;
|
|
281
|
+
do
|
|
282
|
+
t = q(t, e);
|
|
283
|
+
while (t !== void 0);
|
|
284
|
+
}
|
|
285
|
+
} else "previousValue" in e || Z.call(e);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
let E = 0, S = 0, j = 0, p, A;
|
|
289
|
+
function v(e) {
|
|
290
|
+
const t = p;
|
|
291
|
+
return p = e, t;
|
|
292
|
+
}
|
|
293
|
+
function ye() {
|
|
294
|
+
return A;
|
|
295
|
+
}
|
|
296
|
+
function we(e) {
|
|
297
|
+
const t = A;
|
|
298
|
+
return A = e, t;
|
|
299
|
+
}
|
|
300
|
+
function X(e) {
|
|
301
|
+
const t = v(e);
|
|
302
|
+
G(e);
|
|
303
|
+
try {
|
|
304
|
+
const r = e.value, n = { value: e.value };
|
|
305
|
+
return !e.equals(r, e.value = e.getter.call(n));
|
|
306
|
+
} finally {
|
|
307
|
+
v(t), W(e);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function k(e, t) {
|
|
311
|
+
return e.flags = 1, !e.equals(e.previousValue, e.previousValue = t);
|
|
312
|
+
}
|
|
313
|
+
function H(e) {
|
|
314
|
+
const t = e.flags;
|
|
315
|
+
if (!(t & 64)) {
|
|
316
|
+
e.flags = t | 64;
|
|
317
|
+
const r = e.subs;
|
|
318
|
+
r !== void 0 ? H(r.sub) : O[j++] = e;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function J(e, t) {
|
|
322
|
+
if (t & 16 || t & 32 && P(e.deps, e)) {
|
|
323
|
+
const n = v(e);
|
|
324
|
+
G(e);
|
|
325
|
+
try {
|
|
326
|
+
"cleanup" in e && e.cleanup !== void 0 && e.cleanup();
|
|
327
|
+
const u = e.fn();
|
|
328
|
+
"cleanup" in e && b(u) && (e.cleanup = u);
|
|
329
|
+
} finally {
|
|
330
|
+
v(n), W(e);
|
|
331
|
+
}
|
|
332
|
+
return;
|
|
333
|
+
} else t & 32 && (e.flags = t & -33);
|
|
334
|
+
let r = e.deps;
|
|
335
|
+
for (; r !== void 0; ) {
|
|
336
|
+
const n = r.dep, u = n.flags;
|
|
337
|
+
u & 64 && J(
|
|
338
|
+
n,
|
|
339
|
+
n.flags = u & -65
|
|
340
|
+
/* Queued */
|
|
341
|
+
), r = r.nextDep;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function K() {
|
|
345
|
+
for (; S < j; ) {
|
|
346
|
+
const e = O[S];
|
|
347
|
+
O[S++] = void 0, J(
|
|
348
|
+
e,
|
|
349
|
+
e.flags &= -65
|
|
350
|
+
/* Queued */
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
S = 0, j = 0;
|
|
354
|
+
}
|
|
355
|
+
function le() {
|
|
356
|
+
const e = this.flags;
|
|
357
|
+
if (e & 16 || e & 32 && P(this.deps, this)) {
|
|
358
|
+
if (X(this)) {
|
|
359
|
+
const t = this.subs;
|
|
360
|
+
t !== void 0 && U(t);
|
|
361
|
+
}
|
|
362
|
+
} else e & 32 && (this.flags = e & -33);
|
|
363
|
+
return p !== void 0 && _(this, p), this.value;
|
|
364
|
+
}
|
|
365
|
+
function Q() {
|
|
366
|
+
const e = this.value;
|
|
367
|
+
if (this.flags & 16 && k(this, e)) {
|
|
368
|
+
const t = this.subs;
|
|
369
|
+
t !== void 0 && U(t);
|
|
370
|
+
}
|
|
371
|
+
return p !== void 0 && _(this, p), e;
|
|
372
|
+
}
|
|
373
|
+
function Y(e) {
|
|
374
|
+
let t = b(e) ? x(e(this.value)) : e;
|
|
375
|
+
if (!this.equals(this.value, t)) {
|
|
376
|
+
this.value = t, this.flags = 17;
|
|
377
|
+
const r = this.subs;
|
|
378
|
+
r !== void 0 && (ie(r), E || K());
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function Z() {
|
|
382
|
+
let e = this.deps;
|
|
383
|
+
for (; e !== void 0; )
|
|
384
|
+
e = q(e, this);
|
|
385
|
+
const t = this.subs;
|
|
386
|
+
t !== void 0 && q(t), this.flags = 0, "cleanup" in this && this.cleanup != null && this.cleanup();
|
|
387
|
+
}
|
|
388
|
+
function me(e, t) {
|
|
389
|
+
const r = {
|
|
390
|
+
previousValue: e,
|
|
391
|
+
value: e,
|
|
392
|
+
equals: (t == null ? void 0 : t.equals) ?? N,
|
|
393
|
+
subs: void 0,
|
|
394
|
+
subsTail: void 0,
|
|
395
|
+
flags: 1
|
|
396
|
+
}, n = Q.bind(r);
|
|
397
|
+
return n.set = Y.bind(r), n;
|
|
398
|
+
}
|
|
399
|
+
function De(e) {
|
|
400
|
+
return ce(() => e);
|
|
401
|
+
}
|
|
402
|
+
function Te(e, t) {
|
|
403
|
+
const r = {
|
|
404
|
+
previousValue: e,
|
|
405
|
+
value: e,
|
|
406
|
+
equals: (t == null ? void 0 : t.equals) ?? N,
|
|
407
|
+
subs: void 0,
|
|
408
|
+
subsTail: void 0,
|
|
409
|
+
flags: 1
|
|
410
|
+
};
|
|
411
|
+
return [Q.bind(r), Y.bind(r)];
|
|
412
|
+
}
|
|
413
|
+
function ce(e, t) {
|
|
414
|
+
return le.bind({
|
|
415
|
+
value: void 0,
|
|
416
|
+
subs: void 0,
|
|
417
|
+
subsTail: void 0,
|
|
418
|
+
deps: void 0,
|
|
419
|
+
depsTail: void 0,
|
|
420
|
+
flags: 17,
|
|
421
|
+
getter: function() {
|
|
422
|
+
if (t != null && t.deps) {
|
|
423
|
+
for (let r of t.deps) x(r);
|
|
424
|
+
return x(R(() => e(this.value)));
|
|
425
|
+
}
|
|
426
|
+
return x(e(this.value));
|
|
427
|
+
},
|
|
428
|
+
equals: (t == null ? void 0 : t.equals) ?? N
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function Ce(e) {
|
|
432
|
+
++E, e(), --E || K();
|
|
433
|
+
}
|
|
434
|
+
function R(e) {
|
|
435
|
+
if (b(e)) {
|
|
436
|
+
let t;
|
|
437
|
+
const r = v(void 0);
|
|
438
|
+
return t = e(), v(r), t;
|
|
439
|
+
} else
|
|
440
|
+
return e;
|
|
441
|
+
}
|
|
442
|
+
function x(e) {
|
|
443
|
+
return b(e) ? e() : e;
|
|
444
|
+
}
|
|
445
|
+
function Oe(e) {
|
|
446
|
+
var n;
|
|
447
|
+
const t = {
|
|
448
|
+
fn: e,
|
|
449
|
+
subs: void 0,
|
|
450
|
+
subsTail: void 0,
|
|
451
|
+
deps: void 0,
|
|
452
|
+
depsTail: void 0,
|
|
453
|
+
flags: 2
|
|
454
|
+
};
|
|
455
|
+
p !== void 0 && _(t, p);
|
|
456
|
+
const r = v(t);
|
|
457
|
+
try {
|
|
458
|
+
(n = t.cleanup) == null || n.call(t);
|
|
459
|
+
const u = t.fn();
|
|
460
|
+
t.cleanup = b(u) ? u : void 0;
|
|
461
|
+
} finally {
|
|
462
|
+
v(r);
|
|
463
|
+
}
|
|
464
|
+
return Z.bind(t);
|
|
465
|
+
}
|
|
466
|
+
let y = {
|
|
467
|
+
info: "development",
|
|
468
|
+
log: "development",
|
|
469
|
+
warn: "development",
|
|
470
|
+
error: !0
|
|
471
|
+
}, F = I("*,-dolla.*"), w = [], B = !1;
|
|
472
|
+
function qe(e) {
|
|
473
|
+
return w.push(e), function() {
|
|
474
|
+
w.splice(w.indexOf(e), 1);
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
function Ee(e, t) {
|
|
478
|
+
const r = (t == null ? void 0 : t.console) ?? oe(), n = (u) => {
|
|
479
|
+
let d = R(e);
|
|
480
|
+
if (y[u] === !1 || ne(y[u]) && y[u] !== ue() || !F(d))
|
|
481
|
+
return re;
|
|
482
|
+
{
|
|
483
|
+
let g = `%c${d}`;
|
|
484
|
+
return t != null && t.tag ? t.tagName ? g += ` %c[${t.tagName}: %c${t.tag}%c]` : g += ` %c[%c${t.tag}%c]` : g += "%c%c%c", r[u].bind(
|
|
485
|
+
r,
|
|
486
|
+
g,
|
|
487
|
+
`color:${se(g)};font-weight:bold`,
|
|
488
|
+
"color:#777",
|
|
489
|
+
"color:#aaa",
|
|
490
|
+
"color:#777"
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
return {
|
|
495
|
+
get info() {
|
|
496
|
+
return n("info");
|
|
497
|
+
},
|
|
498
|
+
get log() {
|
|
499
|
+
return n("log");
|
|
500
|
+
},
|
|
501
|
+
get warn() {
|
|
502
|
+
return n("warn");
|
|
503
|
+
},
|
|
504
|
+
get error() {
|
|
505
|
+
return n("error");
|
|
506
|
+
},
|
|
507
|
+
crash(u) {
|
|
508
|
+
if (!B) {
|
|
509
|
+
B = !0;
|
|
510
|
+
const d = {
|
|
511
|
+
error: u,
|
|
512
|
+
loggerName: x(e),
|
|
513
|
+
tag: t == null ? void 0 : t.tag,
|
|
514
|
+
tagName: t == null ? void 0 : t.tagName
|
|
515
|
+
};
|
|
516
|
+
for (const g of w)
|
|
517
|
+
g(d);
|
|
518
|
+
throw u;
|
|
519
|
+
}
|
|
520
|
+
return u;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function je(e) {
|
|
525
|
+
F = I(e);
|
|
526
|
+
}
|
|
527
|
+
function Ae(e) {
|
|
528
|
+
for (const t in e) {
|
|
529
|
+
const r = e[t];
|
|
530
|
+
r && (y[t] = r);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function oe() {
|
|
534
|
+
if (typeof window < "u" && window.console)
|
|
535
|
+
return window.console;
|
|
536
|
+
if (typeof global < "u" && global.console)
|
|
537
|
+
return global.console;
|
|
538
|
+
}
|
|
539
|
+
export {
|
|
540
|
+
ye as a,
|
|
541
|
+
Ce as b,
|
|
542
|
+
pe as c,
|
|
543
|
+
C as d,
|
|
544
|
+
Oe as e,
|
|
545
|
+
N as f,
|
|
546
|
+
x as g,
|
|
547
|
+
ue as h,
|
|
548
|
+
Se as i,
|
|
549
|
+
Ee as j,
|
|
550
|
+
je as k,
|
|
551
|
+
Ae as l,
|
|
552
|
+
ce as m,
|
|
553
|
+
de as n,
|
|
554
|
+
qe as o,
|
|
555
|
+
we as p,
|
|
556
|
+
xe as q,
|
|
557
|
+
De as r,
|
|
558
|
+
Te as s,
|
|
559
|
+
he as t,
|
|
560
|
+
R as u,
|
|
561
|
+
ge as v,
|
|
562
|
+
me as w,
|
|
563
|
+
ve as x,
|
|
564
|
+
be as y
|
|
565
|
+
};
|
|
566
|
+
//# sourceMappingURL=logger-IE5c3t-c.js.map
|