frosty 0.0.90 → 0.0.92
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/dist/_native.js +1 -1
- package/dist/_native.mjs +1 -1
- package/dist/dom.js +2 -2
- package/dist/dom.mjs +2 -2
- package/dist/internals/{common-DmBH-tsg.mjs → common-8aOatOjL.mjs} +16 -10
- package/dist/internals/{common-DmBH-tsg.mjs.map → common-8aOatOjL.mjs.map} +1 -1
- package/dist/internals/{common-CnL8ftw8.js → common-DYvTqDME.js} +16 -10
- package/dist/internals/{common-CnL8ftw8.js.map → common-DYvTqDME.js.map} +1 -1
- package/dist/internals/common-jmXMOod4.d.ts.map +1 -1
- package/dist/internals/{renderer-Dn64xymQ.mjs → renderer-C3Lq-xHV.mjs} +8 -8
- package/dist/internals/renderer-C3Lq-xHV.mjs.map +1 -0
- package/dist/internals/{renderer-DCxs31Tn.js → renderer-CdsGzt2W.js} +8 -8
- package/dist/internals/renderer-CdsGzt2W.js.map +1 -0
- package/dist/internals/renderer-D4aiCZGU.d.ts.map +1 -1
- package/dist/server-dom.js +2 -2
- package/dist/server-dom.mjs +2 -2
- package/dist/web.d.ts +1 -2
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +2 -2
- package/dist/web.js.map +1 -1
- package/dist/web.mjs +3 -3
- package/dist/web.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/internals/renderer-DCxs31Tn.js.map +0 -1
- package/dist/internals/renderer-Dn64xymQ.mjs.map +0 -1
package/dist/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sources":["../../src/web/document.ts","../../src/web/window.ts","../../src/web/location.ts","../../src/web/observer.ts","../../src/web/online.ts","../../src/renderer/minify/decompress.ts","../../src/web/server.ts","../../src/web/storage.ts","../../src/web/visibility.ts"],"sourcesContent":["//\n// document.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useDocument = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useDocument must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.document;\n } else {\n throw Error('Unsupported renderer.');\n }\n}","//\n// window.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { uniqueId } from '../core/utils';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useWindow = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useWindow must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.window;\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n\nconst emptyInsets = { top: 0, left: 0, right: 0, bottom: 0 };\nconst safeAreaInsets = (window: ReturnType<typeof useWindow>) => {\n let support;\n if (!('CSS' in window) || !_.isFunction(window.CSS.supports)) {\n return emptyInsets;\n }\n if (window.CSS.supports('top: env(safe-area-inset-top)')) {\n support = 'env'\n } else if (window.CSS.supports('top: constant(safe-area-inset-top)')) {\n support = 'constant'\n } else {\n return emptyInsets;\n }\n const id = uniqueId();\n const style = document.createElement('style');\n style.textContent = `:root {\n --${id}-top: ${support}(safe-area-inset-top);\n --${id}-left: ${support}(safe-area-inset-left);\n --${id}-right: ${support}(safe-area-inset-right);\n --${id}-bottom: ${support}(safe-area-inset-bottom);\n }`;\n document.head.appendChild(style);\n const computedStyle = getComputedStyle(document.documentElement);\n const insets = {\n top: computedStyle.getPropertyValue(`--${id}-top`),\n left: computedStyle.getPropertyValue(`--${id}-left`),\n right: computedStyle.getPropertyValue(`--${id}-right`),\n bottom: computedStyle.getPropertyValue(`--${id}-bottom`),\n };\n style.remove();\n return _.mapValues(insets, v => parseFloat(v));\n}\n\nexport const useWindowMetrics = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('resize', onStoreChange);\n return () => {\n window.removeEventListener('resize', onStoreChange);\n };\n }, () => ({\n safeAreaInsets: safeAreaInsets(window),\n devicePixelRatio: window.devicePixelRatio,\n outerWidth: window.outerWidth,\n outerHeight: window.outerHeight,\n innerWidth: window.innerWidth,\n innerHeight: window.innerHeight,\n }));\n}\n\nexport const useVisualViewportMetrics = () => {\n const { visualViewport } = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n visualViewport?.addEventListener('resize', onStoreChange);\n return () => {\n visualViewport?.removeEventListener('resize', onStoreChange);\n };\n }, () => visualViewport && ({\n width: visualViewport.width,\n height: visualViewport.height,\n scale: visualViewport.scale,\n }));\n}\n\nexport const useWindowScroll = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('scroll', onStoreChange);\n return () => {\n window.removeEventListener('scroll', onStoreChange);\n };\n }, () => ({\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n }));\n}\n\nconst colorSchemeDarkCache = new WeakMap<ReturnType<typeof useWindow>, MediaQueryList | undefined>();\n\nexport const useColorScheme = () => {\n const window = useWindow();\n if (!colorSchemeDarkCache.has(window)) colorSchemeDarkCache.set(window, window.matchMedia?.('(prefers-color-scheme: dark)'));\n const colorSchemeDark = colorSchemeDarkCache.get(window);\n return useSyncExternalStore((onStoreChange) => {\n colorSchemeDark?.addEventListener('change', onStoreChange);\n return () => {\n colorSchemeDark?.removeEventListener('change', onStoreChange);\n };\n }, () => colorSchemeDark?.matches ? 'dark' : 'light');\n}\n","//\n// location.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useMemo } from '../core/hooks/memo';\nimport { useCallback } from '../core/hooks/callback';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { EventEmitter } from '../core/reconciler/events';\nimport { SetStateAction } from '../core/types/common';\nimport { useWindow } from './window';\n\nconst emitters = new WeakMap<Document, EventEmitter>();\nconst emitterFor = (document: Document) => {\n if (!emitters.has(document)) emitters.set(document, new EventEmitter());\n return emitters.get(document)!;\n}\n\n/**\n * A hook that provides the current browser location and methods to manipulate the browser history.\n *\n * @returns An object with the following properties and methods:\n * - `hash`: The fragment identifier of the URL.\n * - `host`: The hostname and port number.\n * - `hostname`: The domain name.\n * - `href`: The full URL.\n * - `origin`: The protocol, hostname, and port.\n * - `pathname`: The path of the URL.\n * - `port`: The port number.\n * - `protocol`: The protocol scheme.\n * - `search`: The query string.\n * - `state`: The current state object associated with the history entry.\n * - `back()`: Navigates to the previous entry in the history stack.\n * - `forward()`: Navigates to the next entry in the history stack.\n * - `pushState(data, url)`: Pushes a new entry onto the history stack.\n * - `replaceState(data, url)`: Replaces the current history entry.\n *\n * The hook subscribes to changes in the browser's history and location, causing components to re-render when navigation occurs.\n *\n * @example\n * const location = useLocation();\n * console.log(location.pathname); // e.g., \"/about\"\n * location.pushState({ some: 'state' }, '/new-path');\n */\nexport const useLocation = () => {\n const window = useWindow();\n const emitter = emitterFor(window.document);\n const result = (history?: History) => ({\n ..._.pick(window.document.location, 'hash', 'host', 'hostname', 'href', 'origin', 'pathname', 'port', 'protocol', 'search'),\n state: history?.state ?? null,\n back: () => {\n history?.back();\n },\n forward: () => {\n history?.forward();\n emitter.emit('change');\n },\n pushState: (data: any, url?: string | URL | null) => {\n history?.pushState(data, '', url);\n emitter.emit('change');\n },\n replaceState: (data: any, url?: string | URL | null) => {\n history?.replaceState(data, '', url);\n emitter.emit('change');\n },\n });\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('popstate', onStoreChange);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('popstate', onStoreChange);\n event.remove();\n }\n }, () => result(window.history));\n}\n\ntype URLSearchParamsInit = ConstructorParameters<typeof URLSearchParams>[0];\n\n/**\n * A hook for reading and updating the URL's query string (search parameters).\n *\n * @returns A tuple:\n * - The first element is a `URLSearchParams` instance representing the current query string.\n * - The second element is a function to update the search parameters, which accepts any valid\n * `URLSearchParams` initializer (string, array, or object).\n *\n * Updating the search parameters will push a new history entry and update the URL in the address bar.\n *\n * @example\n * const [searchParams, setSearchParams] = useSearchParams();\n * const page = searchParams.get('page');\n * setSearchParams({ page: '2', filter: 'active' });\n */\nexport const useSearchParams = () => {\n const location = useLocation();\n const searchParams = useMemo(() => new URLSearchParams(location.search), [location.search]);\n const setSearchParams = useCallback((\n dispatch: SetStateAction<URLSearchParamsInit, URLSearchParams>,\n config?: {\n replace?: boolean;\n },\n ) => {\n const params = _.isFunction(dispatch) ? dispatch(new URLSearchParams(location.search)) : dispatch;\n const newParams = new URLSearchParams(params);\n if (config?.replace === false) {\n location.pushState(location.state, `?${newParams.toString()}`);\n } else {\n location.replaceState(location.state, `?${newParams.toString()}`);\n }\n });\n return [searchParams, setSearchParams] as const;\n}\n","//\n// observer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useEffect } from '../core/hooks/effect';\nimport { useCallback } from '../core/hooks/callback';\nimport { RefObject } from '../core/types/common';\n\ninterface _Observer<T> {\n observe(target: Element, options?: T): void;\n unobserve(target: Element): void;\n}\n\nconst createObserver = <E extends { target: Element; }, T>(\n constructor: new (callback: (entries: E[]) => void) => _Observer<T>\n) => {\n const listeners = new WeakMap<Element, ((entry: E) => void)[]>();\n const observer = new constructor((entries) => {\n for (const entry of entries) {\n for (const listener of listeners.get(entry.target) ?? []) {\n (async () => {\n try {\n await listener(entry);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }\n });\n return {\n observe: (target: Element, callback: (entry: E) => void, options?: T) => {\n observer.observe(target, options);\n listeners.set(target, [...listeners.get(target) ?? [], callback]);\n },\n unobserve: (target: Element, callback: (entry: E) => void) => {\n const list = _.filter(listeners.get(target), x => x !== callback);\n listeners.set(target, list);\n if (_.isEmpty(list)) observer.unobserve?.(target);\n },\n };\n};\n\nconst observer = typeof window === 'undefined' ? undefined : {\n resize: createObserver(ResizeObserver),\n intersection: createObserver(IntersectionObserver),\n};\n\nexport const useResizeObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: ResizeObserverEntry) => void,\n options?: ResizeObserverOptions,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.resize.observe(_target, _callback, options);\n return () => observer.resize.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useIntersectionObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: IntersectionObserverEntry) => void,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.intersection.observe(_target, _callback);\n return () => observer.intersection.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useMutationObserver = (\n target: RefObject<Node | null | undefined> | Node | null | undefined,\n callback: MutationCallback,\n options?: MutationObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (typeof window === 'undefined' || !_target) return;\n const observer = new MutationObserver(_callback);\n observer.observe(_target, options);\n return () => observer.disconnect();\n }, [target]);\n}\n\nexport const usePerformanceObserver = (\n callback: PerformanceObserverCallback,\n options?: PerformanceObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n if (typeof window === 'undefined') return;\n const observer = new PerformanceObserver(_callback);\n observer.observe(options);\n return () => observer.disconnect();\n }, []);\n}\n","//\n// online.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\n\nexport const useOnline = () => useSyncExternalStore((onStoreChange) => {\n window.addEventListener('offline', onStoreChange);\n window.addEventListener('online', onStoreChange);\n return () => {\n window.removeEventListener('offline', onStoreChange);\n window.removeEventListener('online', onStoreChange);\n };\n}, () => navigator.onLine, () => false);","//\n// decompress.js\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n// @ts-nocheck\nexport const decompress = (o: string) => {\n function r(r) {\n for (i = f = 0; i < r; )\n A < 2 && ((A = 64), (a = 92 < (a = o.charCodeAt(C++)) ? a - 59 : a - 58)),\n (f |= (0 < (a & (A /= 2))) << i),\n ++i;\n }\n for (var n, f, i, t, a, e = [], u = 1, _ = 3, c = 1, h = [], A = 0, C = 0;;) {\n if ((r(c + 1), 2 == f)) return h.join(\"\");\n -2 & (t = f) ||\n (r(8 * f + 8),\n (e[(t = _++)] = String.fromCharCode(f)),\n --u || (u = 2 << c++)),\n h.push((t = e[t] || n + n[0])),\n n && ((e[_++] = n + t[0]), --u || (u = 2 << c++)),\n (n = t);\n }\n};\n","//\n// server.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\nimport { decompress } from '../renderer/minify/decompress';\n\nconst decodedSsrData = new WeakMap<Document, any>();\n\nexport const useServerResource = (key: string, resource?: () => string): string | undefined => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useServerResource must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n if (state.renderer._server) {\n const data = resource?.();\n if (!_.isString(data)) throw Error('Invalid return type of resource');\n state.renderer._tracked_server_resource.set(key, data);\n return data;\n } else {\n const cached = decodedSsrData.get(state.renderer.document);\n if (!_.isNil(cached)) return cached[key];\n const ssrData = state.renderer.document.querySelector('script[data-frosty-ssr-data]');\n if (ssrData instanceof HTMLElement) {\n try {\n const decoded = JSON.parse(decompress(ssrData.innerText.trim()));\n decodedSsrData.set(state.renderer.document, decoded);\n return decoded[key];\n } catch (e) {\n console.error(e);\n decodedSsrData.set(state.renderer.document, {});\n }\n ssrData.remove();\n } else {\n decodedSsrData.set(state.renderer.document, {});\n }\n }\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n","//\n// storage.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useCallback } from '../core/hooks/callback';\nimport { SetStateAction } from '../core/types/common';\nimport { EventEmitter } from '../core/reconciler/events';\n\nconst emitters = new WeakMap<Storage, EventEmitter>();\nconst emitterFor = (storage: Storage) => {\n if (!emitters.has(storage)) emitters.set(storage, new EventEmitter());\n return emitters.get(storage)!;\n}\n\nconst _useStorage = (\n storage: () => Storage,\n key: string,\n initialValue?: string | null\n) => {\n const state = useSyncExternalStore((onStoreChange) => {\n const _storage = storage();\n const emitter = emitterFor(_storage);\n const callback = (ev: StorageEvent) => { \n if (!ev.storageArea || ev.storageArea === _storage) onStoreChange();\n };\n window.addEventListener('storage', callback);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('storage', callback);\n event.remove();\n }\n }, () => storage().getItem(key), () => undefined);\n const setState = useCallback((v: SetStateAction<string | null | undefined>) => {\n try {\n const _storage = storage();\n const newValue = _.isFunction(v) ? v(state) : v;\n if (_.isNil(newValue)) {\n _storage.removeItem(key);\n } else {\n _storage.setItem(key, newValue);\n }\n const emitter = emitterFor(_storage);\n emitter.emit('change');\n } catch (e) {\n console.error(e);\n }\n }, [key]);\n return [state ?? initialValue ?? null, setState] as const;\n}\n\nexport const useLocalStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.localStorage, key, initialValue);\n\nexport const useSessionStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.sessionStorage, key, initialValue);\n","//\n// visibility.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useDocument } from './document';\n\nexport const useVisibility = () => {\n const document = useDocument();\n return useSyncExternalStore((onStoreChange) => {\n document.addEventListener('visibilitychange', onStoreChange);\n return () => {\n document.removeEventListener('visibilitychange', onStoreChange);\n }\n }, () => {\n if (document.hasFocus()) {\n return 'active' as const;\n } else if (document.visibilityState === 'visible') {\n return 'inactive' as const;\n } else {\n return 'background' as const;\n }\n }, () => 'unknown' as const);\n}\n"],"names":["state","reconciler","_DOMRenderer","uniqueId","useSyncExternalStore","emitters","emitterFor","EventEmitter","useMemo","useCallback","useEffect"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAM,W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AqB;QAC9B;AACF,IAAA,CAAC,EAAE,MAAM,SAAkB,CAAC;AAC9B;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"web.js","sources":["../../src/web/document.ts","../../src/web/window.ts","../../src/web/location.ts","../../src/web/observer.ts","../../src/web/online.ts","../../src/renderer/minify/decompress.ts","../../src/web/server.ts","../../src/web/storage.ts","../../src/web/visibility.ts"],"sourcesContent":["//\n// document.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useDocument = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useDocument must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.document;\n } else {\n throw Error('Unsupported renderer.');\n }\n}","//\n// window.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { uniqueId } from '../core/utils';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useWindow = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useWindow must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.window;\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n\nconst emptyInsets = { top: 0, left: 0, right: 0, bottom: 0 };\nconst safeAreaInsets = (window: ReturnType<typeof useWindow>) => {\n let support;\n if (!('CSS' in window) || !_.isFunction(window.CSS.supports)) {\n return emptyInsets;\n }\n if (window.CSS.supports('top: env(safe-area-inset-top)')) {\n support = 'env'\n } else if (window.CSS.supports('top: constant(safe-area-inset-top)')) {\n support = 'constant'\n } else {\n return emptyInsets;\n }\n const id = uniqueId();\n const style = document.createElement('style');\n style.textContent = `:root {\n --${id}-top: ${support}(safe-area-inset-top);\n --${id}-left: ${support}(safe-area-inset-left);\n --${id}-right: ${support}(safe-area-inset-right);\n --${id}-bottom: ${support}(safe-area-inset-bottom);\n }`;\n document.head.appendChild(style);\n const computedStyle = getComputedStyle(document.documentElement);\n const insets = {\n top: computedStyle.getPropertyValue(`--${id}-top`),\n left: computedStyle.getPropertyValue(`--${id}-left`),\n right: computedStyle.getPropertyValue(`--${id}-right`),\n bottom: computedStyle.getPropertyValue(`--${id}-bottom`),\n };\n style.remove();\n return _.mapValues(insets, v => parseFloat(v));\n}\n\nexport const useWindowMetrics = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('resize', onStoreChange);\n return () => {\n window.removeEventListener('resize', onStoreChange);\n };\n }, () => ({\n safeAreaInsets: safeAreaInsets(window),\n devicePixelRatio: window.devicePixelRatio,\n outerWidth: window.outerWidth,\n outerHeight: window.outerHeight,\n innerWidth: window.innerWidth,\n innerHeight: window.innerHeight,\n }));\n}\n\nexport const useVisualViewportMetrics = () => {\n const { visualViewport } = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n visualViewport?.addEventListener('resize', onStoreChange);\n return () => {\n visualViewport?.removeEventListener('resize', onStoreChange);\n };\n }, () => visualViewport && ({\n width: visualViewport.width,\n height: visualViewport.height,\n scale: visualViewport.scale,\n }));\n}\n\nexport const useWindowScroll = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('scroll', onStoreChange);\n return () => {\n window.removeEventListener('scroll', onStoreChange);\n };\n }, () => ({\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n }));\n}\n\nconst colorSchemeDarkCache = new WeakMap<ReturnType<typeof useWindow>, MediaQueryList | undefined>();\n\nexport const useColorScheme = () => {\n const window = useWindow();\n if (!colorSchemeDarkCache.has(window)) colorSchemeDarkCache.set(window, window.matchMedia?.('(prefers-color-scheme: dark)'));\n const colorSchemeDark = colorSchemeDarkCache.get(window);\n return useSyncExternalStore((onStoreChange) => {\n colorSchemeDark?.addEventListener('change', onStoreChange);\n return () => {\n colorSchemeDark?.removeEventListener('change', onStoreChange);\n };\n }, () => colorSchemeDark?.matches ? 'dark' : 'light');\n}\n","//\n// location.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useMemo } from '../core/hooks/memo';\nimport { useCallback } from '../core/hooks/callback';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { EventEmitter } from '../core/reconciler/events';\nimport { SetStateAction } from '../core/types/common';\nimport { useWindow } from './window';\n\nconst emitters = new WeakMap<Document, EventEmitter>();\nconst emitterFor = (document: Document) => {\n if (!emitters.has(document)) emitters.set(document, new EventEmitter());\n return emitters.get(document)!;\n}\n\n/**\n * A hook that provides the current browser location and methods to manipulate the browser history.\n *\n * @returns An object with the following properties and methods:\n * - `hash`: The fragment identifier of the URL.\n * - `host`: The hostname and port number.\n * - `hostname`: The domain name.\n * - `href`: The full URL.\n * - `origin`: The protocol, hostname, and port.\n * - `pathname`: The path of the URL.\n * - `port`: The port number.\n * - `protocol`: The protocol scheme.\n * - `search`: The query string.\n * - `state`: The current state object associated with the history entry.\n * - `back()`: Navigates to the previous entry in the history stack.\n * - `forward()`: Navigates to the next entry in the history stack.\n * - `pushState(data, url)`: Pushes a new entry onto the history stack.\n * - `replaceState(data, url)`: Replaces the current history entry.\n *\n * The hook subscribes to changes in the browser's history and location, causing components to re-render when navigation occurs.\n *\n * @example\n * const location = useLocation();\n * console.log(location.pathname); // e.g., \"/about\"\n * location.pushState({ some: 'state' }, '/new-path');\n */\nexport const useLocation = () => {\n const window = useWindow();\n const emitter = emitterFor(window.document);\n const result = (history?: History) => ({\n ..._.pick(window.document.location, 'hash', 'host', 'hostname', 'href', 'origin', 'pathname', 'port', 'protocol', 'search'),\n state: history?.state ?? null,\n back: () => {\n history?.back();\n },\n forward: () => {\n history?.forward();\n emitter.emit('change');\n },\n pushState: (data: any, url?: string | URL | null) => {\n history?.pushState(data, '', url);\n emitter.emit('change');\n },\n replaceState: (data: any, url?: string | URL | null) => {\n history?.replaceState(data, '', url);\n emitter.emit('change');\n },\n });\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('popstate', onStoreChange);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('popstate', onStoreChange);\n event.remove();\n }\n }, () => result(window.history));\n}\n\n/**\n * A hook for reading and updating the URL's query string (search parameters).\n *\n * @returns A tuple:\n * - The first element is a `URLSearchParams` instance representing the current query string.\n * - The second element is a function to update the search parameters, which accepts any valid\n * `URLSearchParams` initializer (string, array, or object).\n *\n * Updating the search parameters will push a new history entry and update the URL in the address bar.\n *\n * @example\n * const [searchParams, setSearchParams] = useSearchParams();\n * const page = searchParams.get('page');\n * setSearchParams({ page: '2', filter: 'active' });\n */\nexport const useSearchParams = () => {\n const location = useLocation();\n const searchParams = useMemo(() => new URLSearchParams(location.search), [location.search]);\n type URLSearchParamsInit = ConstructorParameters<typeof URLSearchParams>[0];\n const setSearchParams = useCallback((\n dispatch: SetStateAction<URLSearchParamsInit, URLSearchParams>,\n config?: {\n replace?: boolean;\n },\n ) => {\n const params = _.isFunction(dispatch) ? dispatch(new URLSearchParams(location.search)) : dispatch;\n const newParams = new URLSearchParams(params);\n if (config?.replace === false) {\n location.pushState(location.state, `?${newParams.toString()}`);\n } else {\n location.replaceState(location.state, `?${newParams.toString()}`);\n }\n });\n return [searchParams, setSearchParams] as const;\n}\n","//\n// observer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useEffect } from '../core/hooks/effect';\nimport { useCallback } from '../core/hooks/callback';\nimport { RefObject } from '../core/types/common';\n\ninterface _Observer<T> {\n observe(target: Element, options?: T): void;\n unobserve(target: Element): void;\n}\n\nconst createObserver = <E extends { target: Element; }, T>(\n constructor: new (callback: (entries: E[]) => void) => _Observer<T>\n) => {\n const listeners = new WeakMap<Element, ((entry: E) => void)[]>();\n const observer = new constructor((entries) => {\n for (const entry of entries) {\n for (const listener of listeners.get(entry.target) ?? []) {\n (async () => {\n try {\n await listener(entry);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }\n });\n return {\n observe: (target: Element, callback: (entry: E) => void, options?: T) => {\n observer.observe(target, options);\n listeners.set(target, [...listeners.get(target) ?? [], callback]);\n },\n unobserve: (target: Element, callback: (entry: E) => void) => {\n const list = _.filter(listeners.get(target), x => x !== callback);\n listeners.set(target, list);\n if (_.isEmpty(list)) observer.unobserve?.(target);\n },\n };\n};\n\nconst observer = typeof window === 'undefined' ? undefined : {\n resize: createObserver(ResizeObserver),\n intersection: createObserver(IntersectionObserver),\n};\n\nexport const useResizeObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: ResizeObserverEntry) => void,\n options?: ResizeObserverOptions,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.resize.observe(_target, _callback, options);\n return () => observer.resize.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useIntersectionObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: IntersectionObserverEntry) => void,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.intersection.observe(_target, _callback);\n return () => observer.intersection.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useMutationObserver = (\n target: RefObject<Node | null | undefined> | Node | null | undefined,\n callback: MutationCallback,\n options?: MutationObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (typeof window === 'undefined' || !_target) return;\n const observer = new MutationObserver(_callback);\n observer.observe(_target, options);\n return () => observer.disconnect();\n }, [target]);\n}\n\nexport const usePerformanceObserver = (\n callback: PerformanceObserverCallback,\n options?: PerformanceObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n if (typeof window === 'undefined') return;\n const observer = new PerformanceObserver(_callback);\n observer.observe(options);\n return () => observer.disconnect();\n }, []);\n}\n","//\n// online.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\n\nexport const useOnline = () => useSyncExternalStore((onStoreChange) => {\n window.addEventListener('offline', onStoreChange);\n window.addEventListener('online', onStoreChange);\n return () => {\n window.removeEventListener('offline', onStoreChange);\n window.removeEventListener('online', onStoreChange);\n };\n}, () => navigator.onLine, () => false);","//\n// decompress.js\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n// @ts-nocheck\nexport const decompress = (o: string) => {\n function r(r) {\n for (i = f = 0; i < r; )\n A < 2 && ((A = 64), (a = 92 < (a = o.charCodeAt(C++)) ? a - 59 : a - 58)),\n (f |= (0 < (a & (A /= 2))) << i),\n ++i;\n }\n for (var n, f, i, t, a, e = [], u = 1, _ = 3, c = 1, h = [], A = 0, C = 0;;) {\n if ((r(c + 1), 2 == f)) return h.join(\"\");\n -2 & (t = f) ||\n (r(8 * f + 8),\n (e[(t = _++)] = String.fromCharCode(f)),\n --u || (u = 2 << c++)),\n h.push((t = e[t] || n + n[0])),\n n && ((e[_++] = n + t[0]), --u || (u = 2 << c++)),\n (n = t);\n }\n};\n","//\n// server.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\nimport { decompress } from '../renderer/minify/decompress';\n\nconst decodedSsrData = new WeakMap<Document, any>();\n\nexport const useServerResource = (key: string, resource?: () => string): string | undefined => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useServerResource must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n if (state.renderer._server) {\n const data = resource?.();\n if (!_.isString(data)) throw Error('Invalid return type of resource');\n state.renderer._tracked_server_resource.set(key, data);\n return data;\n } else {\n const cached = decodedSsrData.get(state.renderer.document);\n if (!_.isNil(cached)) return cached[key];\n const ssrData = state.renderer.document.querySelector('script[data-frosty-ssr-data]');\n if (ssrData instanceof HTMLElement) {\n try {\n const decoded = JSON.parse(decompress(ssrData.innerText.trim()));\n decodedSsrData.set(state.renderer.document, decoded);\n return decoded[key];\n } catch (e) {\n console.error(e);\n decodedSsrData.set(state.renderer.document, {});\n }\n ssrData.remove();\n } else {\n decodedSsrData.set(state.renderer.document, {});\n }\n }\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n","//\n// storage.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useCallback } from '../core/hooks/callback';\nimport { SetStateAction } from '../core/types/common';\nimport { EventEmitter } from '../core/reconciler/events';\n\nconst emitters = new WeakMap<Storage, EventEmitter>();\nconst emitterFor = (storage: Storage) => {\n if (!emitters.has(storage)) emitters.set(storage, new EventEmitter());\n return emitters.get(storage)!;\n}\n\nconst _useStorage = (\n storage: () => Storage,\n key: string,\n initialValue?: string | null\n) => {\n const state = useSyncExternalStore((onStoreChange) => {\n const _storage = storage();\n const emitter = emitterFor(_storage);\n const callback = (ev: StorageEvent) => { \n if (!ev.storageArea || ev.storageArea === _storage) onStoreChange();\n };\n window.addEventListener('storage', callback);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('storage', callback);\n event.remove();\n }\n }, () => storage().getItem(key), () => undefined);\n const setState = useCallback((v: SetStateAction<string | null | undefined>) => {\n try {\n const _storage = storage();\n const newValue = _.isFunction(v) ? v(state) : v;\n if (_.isNil(newValue)) {\n _storage.removeItem(key);\n } else {\n _storage.setItem(key, newValue);\n }\n const emitter = emitterFor(_storage);\n emitter.emit('change');\n } catch (e) {\n console.error(e);\n }\n }, [key]);\n return [state ?? initialValue ?? null, setState] as const;\n}\n\nexport const useLocalStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.localStorage, key, initialValue);\n\nexport const useSessionStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.sessionStorage, key, initialValue);\n","//\n// visibility.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useDocument } from './document';\n\nexport const useVisibility = () => {\n const document = useDocument();\n return useSyncExternalStore((onStoreChange) => {\n document.addEventListener('visibilitychange', onStoreChange);\n return () => {\n document.removeEventListener('visibilitychange', onStoreChange);\n }\n }, () => {\n if (document.hasFocus()) {\n return 'active' as const;\n } else if (document.visibilityState === 'visible') {\n return 'inactive' as const;\n } else {\n return 'background' as const;\n }\n }, () => 'unknown' as const);\n}\n"],"names":["state","reconciler","_DOMRenderer","uniqueId","useSyncExternalStore","emitters","emitterFor","EventEmitter","useMemo","useCallback","useEffect"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAM,WAAW,GAAG,MAAK;AAC9B,IAAA,MAAMA,OAAK,GAAGC,gBAAU,CAAC,gBAAgB;AACzC,IAAA,IAAI,CAACD,OAAK;AAAE,QAAA,MAAM,KAAK,CAAC,oDAAoD,CAAC;AAC7E,IAAA,IAAIA,OAAK,CAAC,QAAQ,YAAYE,mBAAY,EAAE;AAC1C,QAAA,OAAOF,OAAK,CAAC,QAAQ,CAAC,QAAQ;IAChC;SAAO;AACL,QAAA,MAAM,KAAK,CAAC,uBAAuB,CAAC;IACtC;AACF;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAM,SAAS,GAAG,MAAK;AAC5B,IAAA,MAAMA,OAAK,GAAGC,gBAAU,CAAC,gBAAgB;AACzC,IAAA,IAAI,CAACD,OAAK;AAAE,QAAA,MAAM,KAAK,CAAC,kDAAkD,CAAC;AAC3E,IAAA,IAAIA,OAAK,CAAC,QAAQ,YAAYE,mBAAY,EAAE;AAC1C,QAAA,OAAOF,OAAK,CAAC,QAAQ,CAAC,MAAM;IAC9B;SAAO;AACL,QAAA,MAAM,KAAK,CAAC,uBAAuB,CAAC;IACtC;AACF;AAEA,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EA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AAa,CAAC;AAC5D,QAAA,OAAO,MAAK;AACV,YAAA,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC;AACjE,QAAA,CAAC;IACH,CAAC,EAAE,MAAK;AACN,QAAA,IAAI,QAAQ,CAAC,QAAQ,EAAE,EAAE;AACvB,YAAA,OAAO,QAAiB;QAC1B;AAAO,aAAA,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE;AACjD,YAAA,OAAO,UAAmB;QAC5B;aAAO;AACL,YAAA,OAAO,YAAqB;QAC9B;AACF,IAAA,CAAC,EAAE,MAAM,SAAkB,CAAC;AAC9B;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/web.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as reconciler, a as uniqueId, b as EventEmitter } from './internals/state-BRL-17Kd.mjs';
|
|
2
|
-
import { _ as _DOMRenderer } from './internals/common-
|
|
3
|
-
export { D as DOMNativeNode } from './internals/common-
|
|
2
|
+
import { _ as _DOMRenderer } from './internals/common-8aOatOjL.mjs';
|
|
3
|
+
export { D as DOMNativeNode } from './internals/common-8aOatOjL.mjs';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { d as useSyncExternalStore, b as useMemo, u as useCallback, c as useEffect } from './internals/sync-CagQh1jI.mjs';
|
|
6
6
|
import './internals/component-BzurKp_J.mjs';
|
|
7
7
|
import 'myers.js';
|
|
8
|
-
import './internals/renderer-
|
|
8
|
+
import './internals/renderer-C3Lq-xHV.mjs';
|
|
9
9
|
import 'nextick';
|
|
10
10
|
import 'postcss';
|
|
11
11
|
import 'postcss-js';
|
package/dist/web.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.mjs","sources":["../../src/web/document.ts","../../src/web/window.ts","../../src/web/location.ts","../../src/web/observer.ts","../../src/web/online.ts","../../src/renderer/minify/decompress.ts","../../src/web/server.ts","../../src/web/storage.ts","../../src/web/visibility.ts"],"sourcesContent":["//\n// document.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useDocument = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useDocument must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.document;\n } else {\n throw Error('Unsupported renderer.');\n }\n}","//\n// window.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { uniqueId } from '../core/utils';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useWindow = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useWindow must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.window;\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n\nconst emptyInsets = { top: 0, left: 0, right: 0, bottom: 0 };\nconst safeAreaInsets = (window: ReturnType<typeof useWindow>) => {\n let support;\n if (!('CSS' in window) || !_.isFunction(window.CSS.supports)) {\n return emptyInsets;\n }\n if (window.CSS.supports('top: env(safe-area-inset-top)')) {\n support = 'env'\n } else if (window.CSS.supports('top: constant(safe-area-inset-top)')) {\n support = 'constant'\n } else {\n return emptyInsets;\n }\n const id = uniqueId();\n const style = document.createElement('style');\n style.textContent = `:root {\n --${id}-top: ${support}(safe-area-inset-top);\n --${id}-left: ${support}(safe-area-inset-left);\n --${id}-right: ${support}(safe-area-inset-right);\n --${id}-bottom: ${support}(safe-area-inset-bottom);\n }`;\n document.head.appendChild(style);\n const computedStyle = getComputedStyle(document.documentElement);\n const insets = {\n top: computedStyle.getPropertyValue(`--${id}-top`),\n left: computedStyle.getPropertyValue(`--${id}-left`),\n right: computedStyle.getPropertyValue(`--${id}-right`),\n bottom: computedStyle.getPropertyValue(`--${id}-bottom`),\n };\n style.remove();\n return _.mapValues(insets, v => parseFloat(v));\n}\n\nexport const useWindowMetrics = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('resize', onStoreChange);\n return () => {\n window.removeEventListener('resize', onStoreChange);\n };\n }, () => ({\n safeAreaInsets: safeAreaInsets(window),\n devicePixelRatio: window.devicePixelRatio,\n outerWidth: window.outerWidth,\n outerHeight: window.outerHeight,\n innerWidth: window.innerWidth,\n innerHeight: window.innerHeight,\n }));\n}\n\nexport const useVisualViewportMetrics = () => {\n const { visualViewport } = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n visualViewport?.addEventListener('resize', onStoreChange);\n return () => {\n visualViewport?.removeEventListener('resize', onStoreChange);\n };\n }, () => visualViewport && ({\n width: visualViewport.width,\n height: visualViewport.height,\n scale: visualViewport.scale,\n }));\n}\n\nexport const useWindowScroll = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('scroll', onStoreChange);\n return () => {\n window.removeEventListener('scroll', onStoreChange);\n };\n }, () => ({\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n }));\n}\n\nconst colorSchemeDarkCache = new WeakMap<ReturnType<typeof useWindow>, MediaQueryList | undefined>();\n\nexport const useColorScheme = () => {\n const window = useWindow();\n if (!colorSchemeDarkCache.has(window)) colorSchemeDarkCache.set(window, window.matchMedia?.('(prefers-color-scheme: dark)'));\n const colorSchemeDark = colorSchemeDarkCache.get(window);\n return useSyncExternalStore((onStoreChange) => {\n colorSchemeDark?.addEventListener('change', onStoreChange);\n return () => {\n colorSchemeDark?.removeEventListener('change', onStoreChange);\n };\n }, () => colorSchemeDark?.matches ? 'dark' : 'light');\n}\n","//\n// location.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useMemo } from '../core/hooks/memo';\nimport { useCallback } from '../core/hooks/callback';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { EventEmitter } from '../core/reconciler/events';\nimport { SetStateAction } from '../core/types/common';\nimport { useWindow } from './window';\n\nconst emitters = new WeakMap<Document, EventEmitter>();\nconst emitterFor = (document: Document) => {\n if (!emitters.has(document)) emitters.set(document, new EventEmitter());\n return emitters.get(document)!;\n}\n\n/**\n * A hook that provides the current browser location and methods to manipulate the browser history.\n *\n * @returns An object with the following properties and methods:\n * - `hash`: The fragment identifier of the URL.\n * - `host`: The hostname and port number.\n * - `hostname`: The domain name.\n * - `href`: The full URL.\n * - `origin`: The protocol, hostname, and port.\n * - `pathname`: The path of the URL.\n * - `port`: The port number.\n * - `protocol`: The protocol scheme.\n * - `search`: The query string.\n * - `state`: The current state object associated with the history entry.\n * - `back()`: Navigates to the previous entry in the history stack.\n * - `forward()`: Navigates to the next entry in the history stack.\n * - `pushState(data, url)`: Pushes a new entry onto the history stack.\n * - `replaceState(data, url)`: Replaces the current history entry.\n *\n * The hook subscribes to changes in the browser's history and location, causing components to re-render when navigation occurs.\n *\n * @example\n * const location = useLocation();\n * console.log(location.pathname); // e.g., \"/about\"\n * location.pushState({ some: 'state' }, '/new-path');\n */\nexport const useLocation = () => {\n const window = useWindow();\n const emitter = emitterFor(window.document);\n const result = (history?: History) => ({\n ..._.pick(window.document.location, 'hash', 'host', 'hostname', 'href', 'origin', 'pathname', 'port', 'protocol', 'search'),\n state: history?.state ?? null,\n back: () => {\n history?.back();\n },\n forward: () => {\n history?.forward();\n emitter.emit('change');\n },\n pushState: (data: any, url?: string | URL | null) => {\n history?.pushState(data, '', url);\n emitter.emit('change');\n },\n replaceState: (data: any, url?: string | URL | null) => {\n history?.replaceState(data, '', url);\n emitter.emit('change');\n },\n });\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('popstate', onStoreChange);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('popstate', onStoreChange);\n event.remove();\n }\n }, () => result(window.history));\n}\n\ntype URLSearchParamsInit = ConstructorParameters<typeof URLSearchParams>[0];\n\n/**\n * A hook for reading and updating the URL's query string (search parameters).\n *\n * @returns A tuple:\n * - The first element is a `URLSearchParams` instance representing the current query string.\n * - The second element is a function to update the search parameters, which accepts any valid\n * `URLSearchParams` initializer (string, array, or object).\n *\n * Updating the search parameters will push a new history entry and update the URL in the address bar.\n *\n * @example\n * const [searchParams, setSearchParams] = useSearchParams();\n * const page = searchParams.get('page');\n * setSearchParams({ page: '2', filter: 'active' });\n */\nexport const useSearchParams = () => {\n const location = useLocation();\n const searchParams = useMemo(() => new URLSearchParams(location.search), [location.search]);\n const setSearchParams = useCallback((\n dispatch: SetStateAction<URLSearchParamsInit, URLSearchParams>,\n config?: {\n replace?: boolean;\n },\n ) => {\n const params = _.isFunction(dispatch) ? dispatch(new URLSearchParams(location.search)) : dispatch;\n const newParams = new URLSearchParams(params);\n if (config?.replace === false) {\n location.pushState(location.state, `?${newParams.toString()}`);\n } else {\n location.replaceState(location.state, `?${newParams.toString()}`);\n }\n });\n return [searchParams, setSearchParams] as const;\n}\n","//\n// observer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useEffect } from '../core/hooks/effect';\nimport { useCallback } from '../core/hooks/callback';\nimport { RefObject } from '../core/types/common';\n\ninterface _Observer<T> {\n observe(target: Element, options?: T): void;\n unobserve(target: Element): void;\n}\n\nconst createObserver = <E extends { target: Element; }, T>(\n constructor: new (callback: (entries: E[]) => void) => _Observer<T>\n) => {\n const listeners = new WeakMap<Element, ((entry: E) => void)[]>();\n const observer = new constructor((entries) => {\n for (const entry of entries) {\n for (const listener of listeners.get(entry.target) ?? []) {\n (async () => {\n try {\n await listener(entry);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }\n });\n return {\n observe: (target: Element, callback: (entry: E) => void, options?: T) => {\n observer.observe(target, options);\n listeners.set(target, [...listeners.get(target) ?? [], callback]);\n },\n unobserve: (target: Element, callback: (entry: E) => void) => {\n const list = _.filter(listeners.get(target), x => x !== callback);\n listeners.set(target, list);\n if (_.isEmpty(list)) observer.unobserve?.(target);\n },\n };\n};\n\nconst observer = typeof window === 'undefined' ? undefined : {\n resize: createObserver(ResizeObserver),\n intersection: createObserver(IntersectionObserver),\n};\n\nexport const useResizeObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: ResizeObserverEntry) => void,\n options?: ResizeObserverOptions,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.resize.observe(_target, _callback, options);\n return () => observer.resize.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useIntersectionObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: IntersectionObserverEntry) => void,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.intersection.observe(_target, _callback);\n return () => observer.intersection.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useMutationObserver = (\n target: RefObject<Node | null | undefined> | Node | null | undefined,\n callback: MutationCallback,\n options?: MutationObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (typeof window === 'undefined' || !_target) return;\n const observer = new MutationObserver(_callback);\n observer.observe(_target, options);\n return () => observer.disconnect();\n }, [target]);\n}\n\nexport const usePerformanceObserver = (\n callback: PerformanceObserverCallback,\n options?: PerformanceObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n if (typeof window === 'undefined') return;\n const observer = new PerformanceObserver(_callback);\n observer.observe(options);\n return () => observer.disconnect();\n }, []);\n}\n","//\n// online.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\n\nexport const useOnline = () => useSyncExternalStore((onStoreChange) => {\n window.addEventListener('offline', onStoreChange);\n window.addEventListener('online', onStoreChange);\n return () => {\n window.removeEventListener('offline', onStoreChange);\n window.removeEventListener('online', onStoreChange);\n };\n}, () => navigator.onLine, () => false);","//\n// decompress.js\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n// @ts-nocheck\nexport const decompress = (o: string) => {\n function r(r) {\n for (i = f = 0; i < r; )\n A < 2 && ((A = 64), (a = 92 < (a = o.charCodeAt(C++)) ? a - 59 : a - 58)),\n (f |= (0 < (a & (A /= 2))) << i),\n ++i;\n }\n for (var n, f, i, t, a, e = [], u = 1, _ = 3, c = 1, h = [], A = 0, C = 0;;) {\n if ((r(c + 1), 2 == f)) return h.join(\"\");\n -2 & (t = f) ||\n (r(8 * f + 8),\n (e[(t = _++)] = String.fromCharCode(f)),\n --u || (u = 2 << c++)),\n h.push((t = e[t] || n + n[0])),\n n && ((e[_++] = n + t[0]), --u || (u = 2 << c++)),\n (n = t);\n }\n};\n","//\n// server.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\nimport { decompress } from '../renderer/minify/decompress';\n\nconst decodedSsrData = new WeakMap<Document, any>();\n\nexport const useServerResource = (key: string, resource?: () => string): string | undefined => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useServerResource must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n if (state.renderer._server) {\n const data = resource?.();\n if (!_.isString(data)) throw Error('Invalid return type of resource');\n state.renderer._tracked_server_resource.set(key, data);\n return data;\n } else {\n const cached = decodedSsrData.get(state.renderer.document);\n if (!_.isNil(cached)) return cached[key];\n const ssrData = state.renderer.document.querySelector('script[data-frosty-ssr-data]');\n if (ssrData instanceof HTMLElement) {\n try {\n const decoded = JSON.parse(decompress(ssrData.innerText.trim()));\n decodedSsrData.set(state.renderer.document, decoded);\n return decoded[key];\n } catch (e) {\n console.error(e);\n decodedSsrData.set(state.renderer.document, {});\n }\n ssrData.remove();\n } else {\n decodedSsrData.set(state.renderer.document, {});\n }\n }\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n","//\n// storage.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useCallback } from '../core/hooks/callback';\nimport { SetStateAction } from '../core/types/common';\nimport { EventEmitter } from '../core/reconciler/events';\n\nconst emitters = new WeakMap<Storage, EventEmitter>();\nconst emitterFor = (storage: Storage) => {\n if (!emitters.has(storage)) emitters.set(storage, new EventEmitter());\n return emitters.get(storage)!;\n}\n\nconst _useStorage = (\n storage: () => Storage,\n key: string,\n initialValue?: string | null\n) => {\n const state = useSyncExternalStore((onStoreChange) => {\n const _storage = storage();\n const emitter = emitterFor(_storage);\n const callback = (ev: StorageEvent) => { \n if (!ev.storageArea || ev.storageArea === _storage) onStoreChange();\n };\n window.addEventListener('storage', callback);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('storage', callback);\n event.remove();\n }\n }, () => storage().getItem(key), () => undefined);\n const setState = useCallback((v: SetStateAction<string | null | undefined>) => {\n try {\n const _storage = storage();\n const newValue = _.isFunction(v) ? v(state) : v;\n if (_.isNil(newValue)) {\n _storage.removeItem(key);\n } else {\n _storage.setItem(key, newValue);\n }\n const emitter = emitterFor(_storage);\n emitter.emit('change');\n } catch (e) {\n console.error(e);\n }\n }, [key]);\n return [state ?? initialValue ?? null, setState] as const;\n}\n\nexport const useLocalStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.localStorage, key, initialValue);\n\nexport const useSessionStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.sessionStorage, key, initialValue);\n","//\n// visibility.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useDocument } from './document';\n\nexport const useVisibility = () => {\n const document = useDocument();\n return useSyncExternalStore((onStoreChange) => {\n document.addEventListener('visibilitychange', onStoreChange);\n return () => {\n document.removeEventListener('visibilitychange', onStoreChange);\n }\n }, () => {\n if (document.hasFocus()) {\n return 'active' as const;\n } else if (document.visibilityState === 'visible') {\n return 'inactive' as const;\n } else {\n return 'background' as const;\n }\n }, () => 'unknown' as const);\n}\n"],"names":["emitters","emitterFor"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,CAAC;AAC9B;;;;"}
|
|
1
|
+
{"version":3,"file":"web.mjs","sources":["../../src/web/document.ts","../../src/web/window.ts","../../src/web/location.ts","../../src/web/observer.ts","../../src/web/online.ts","../../src/renderer/minify/decompress.ts","../../src/web/server.ts","../../src/web/storage.ts","../../src/web/visibility.ts"],"sourcesContent":["//\n// document.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useDocument = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useDocument must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.document;\n } else {\n throw Error('Unsupported renderer.');\n }\n}","//\n// window.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { uniqueId } from '../core/utils';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\n\nexport const useWindow = () => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useWindow must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n return state.renderer.window;\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n\nconst emptyInsets = { top: 0, left: 0, right: 0, bottom: 0 };\nconst safeAreaInsets = (window: ReturnType<typeof useWindow>) => {\n let support;\n if (!('CSS' in window) || !_.isFunction(window.CSS.supports)) {\n return emptyInsets;\n }\n if (window.CSS.supports('top: env(safe-area-inset-top)')) {\n support = 'env'\n } else if (window.CSS.supports('top: constant(safe-area-inset-top)')) {\n support = 'constant'\n } else {\n return emptyInsets;\n }\n const id = uniqueId();\n const style = document.createElement('style');\n style.textContent = `:root {\n --${id}-top: ${support}(safe-area-inset-top);\n --${id}-left: ${support}(safe-area-inset-left);\n --${id}-right: ${support}(safe-area-inset-right);\n --${id}-bottom: ${support}(safe-area-inset-bottom);\n }`;\n document.head.appendChild(style);\n const computedStyle = getComputedStyle(document.documentElement);\n const insets = {\n top: computedStyle.getPropertyValue(`--${id}-top`),\n left: computedStyle.getPropertyValue(`--${id}-left`),\n right: computedStyle.getPropertyValue(`--${id}-right`),\n bottom: computedStyle.getPropertyValue(`--${id}-bottom`),\n };\n style.remove();\n return _.mapValues(insets, v => parseFloat(v));\n}\n\nexport const useWindowMetrics = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('resize', onStoreChange);\n return () => {\n window.removeEventListener('resize', onStoreChange);\n };\n }, () => ({\n safeAreaInsets: safeAreaInsets(window),\n devicePixelRatio: window.devicePixelRatio,\n outerWidth: window.outerWidth,\n outerHeight: window.outerHeight,\n innerWidth: window.innerWidth,\n innerHeight: window.innerHeight,\n }));\n}\n\nexport const useVisualViewportMetrics = () => {\n const { visualViewport } = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n visualViewport?.addEventListener('resize', onStoreChange);\n return () => {\n visualViewport?.removeEventListener('resize', onStoreChange);\n };\n }, () => visualViewport && ({\n width: visualViewport.width,\n height: visualViewport.height,\n scale: visualViewport.scale,\n }));\n}\n\nexport const useWindowScroll = () => {\n const window = useWindow();\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('scroll', onStoreChange);\n return () => {\n window.removeEventListener('scroll', onStoreChange);\n };\n }, () => ({\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n }));\n}\n\nconst colorSchemeDarkCache = new WeakMap<ReturnType<typeof useWindow>, MediaQueryList | undefined>();\n\nexport const useColorScheme = () => {\n const window = useWindow();\n if (!colorSchemeDarkCache.has(window)) colorSchemeDarkCache.set(window, window.matchMedia?.('(prefers-color-scheme: dark)'));\n const colorSchemeDark = colorSchemeDarkCache.get(window);\n return useSyncExternalStore((onStoreChange) => {\n colorSchemeDark?.addEventListener('change', onStoreChange);\n return () => {\n colorSchemeDark?.removeEventListener('change', onStoreChange);\n };\n }, () => colorSchemeDark?.matches ? 'dark' : 'light');\n}\n","//\n// location.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useMemo } from '../core/hooks/memo';\nimport { useCallback } from '../core/hooks/callback';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { EventEmitter } from '../core/reconciler/events';\nimport { SetStateAction } from '../core/types/common';\nimport { useWindow } from './window';\n\nconst emitters = new WeakMap<Document, EventEmitter>();\nconst emitterFor = (document: Document) => {\n if (!emitters.has(document)) emitters.set(document, new EventEmitter());\n return emitters.get(document)!;\n}\n\n/**\n * A hook that provides the current browser location and methods to manipulate the browser history.\n *\n * @returns An object with the following properties and methods:\n * - `hash`: The fragment identifier of the URL.\n * - `host`: The hostname and port number.\n * - `hostname`: The domain name.\n * - `href`: The full URL.\n * - `origin`: The protocol, hostname, and port.\n * - `pathname`: The path of the URL.\n * - `port`: The port number.\n * - `protocol`: The protocol scheme.\n * - `search`: The query string.\n * - `state`: The current state object associated with the history entry.\n * - `back()`: Navigates to the previous entry in the history stack.\n * - `forward()`: Navigates to the next entry in the history stack.\n * - `pushState(data, url)`: Pushes a new entry onto the history stack.\n * - `replaceState(data, url)`: Replaces the current history entry.\n *\n * The hook subscribes to changes in the browser's history and location, causing components to re-render when navigation occurs.\n *\n * @example\n * const location = useLocation();\n * console.log(location.pathname); // e.g., \"/about\"\n * location.pushState({ some: 'state' }, '/new-path');\n */\nexport const useLocation = () => {\n const window = useWindow();\n const emitter = emitterFor(window.document);\n const result = (history?: History) => ({\n ..._.pick(window.document.location, 'hash', 'host', 'hostname', 'href', 'origin', 'pathname', 'port', 'protocol', 'search'),\n state: history?.state ?? null,\n back: () => {\n history?.back();\n },\n forward: () => {\n history?.forward();\n emitter.emit('change');\n },\n pushState: (data: any, url?: string | URL | null) => {\n history?.pushState(data, '', url);\n emitter.emit('change');\n },\n replaceState: (data: any, url?: string | URL | null) => {\n history?.replaceState(data, '', url);\n emitter.emit('change');\n },\n });\n return useSyncExternalStore((onStoreChange) => {\n window.addEventListener('popstate', onStoreChange);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('popstate', onStoreChange);\n event.remove();\n }\n }, () => result(window.history));\n}\n\n/**\n * A hook for reading and updating the URL's query string (search parameters).\n *\n * @returns A tuple:\n * - The first element is a `URLSearchParams` instance representing the current query string.\n * - The second element is a function to update the search parameters, which accepts any valid\n * `URLSearchParams` initializer (string, array, or object).\n *\n * Updating the search parameters will push a new history entry and update the URL in the address bar.\n *\n * @example\n * const [searchParams, setSearchParams] = useSearchParams();\n * const page = searchParams.get('page');\n * setSearchParams({ page: '2', filter: 'active' });\n */\nexport const useSearchParams = () => {\n const location = useLocation();\n const searchParams = useMemo(() => new URLSearchParams(location.search), [location.search]);\n type URLSearchParamsInit = ConstructorParameters<typeof URLSearchParams>[0];\n const setSearchParams = useCallback((\n dispatch: SetStateAction<URLSearchParamsInit, URLSearchParams>,\n config?: {\n replace?: boolean;\n },\n ) => {\n const params = _.isFunction(dispatch) ? dispatch(new URLSearchParams(location.search)) : dispatch;\n const newParams = new URLSearchParams(params);\n if (config?.replace === false) {\n location.pushState(location.state, `?${newParams.toString()}`);\n } else {\n location.replaceState(location.state, `?${newParams.toString()}`);\n }\n });\n return [searchParams, setSearchParams] as const;\n}\n","//\n// observer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useEffect } from '../core/hooks/effect';\nimport { useCallback } from '../core/hooks/callback';\nimport { RefObject } from '../core/types/common';\n\ninterface _Observer<T> {\n observe(target: Element, options?: T): void;\n unobserve(target: Element): void;\n}\n\nconst createObserver = <E extends { target: Element; }, T>(\n constructor: new (callback: (entries: E[]) => void) => _Observer<T>\n) => {\n const listeners = new WeakMap<Element, ((entry: E) => void)[]>();\n const observer = new constructor((entries) => {\n for (const entry of entries) {\n for (const listener of listeners.get(entry.target) ?? []) {\n (async () => {\n try {\n await listener(entry);\n } catch (e) {\n console.error(e);\n }\n })();\n }\n }\n });\n return {\n observe: (target: Element, callback: (entry: E) => void, options?: T) => {\n observer.observe(target, options);\n listeners.set(target, [...listeners.get(target) ?? [], callback]);\n },\n unobserve: (target: Element, callback: (entry: E) => void) => {\n const list = _.filter(listeners.get(target), x => x !== callback);\n listeners.set(target, list);\n if (_.isEmpty(list)) observer.unobserve?.(target);\n },\n };\n};\n\nconst observer = typeof window === 'undefined' ? undefined : {\n resize: createObserver(ResizeObserver),\n intersection: createObserver(IntersectionObserver),\n};\n\nexport const useResizeObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: ResizeObserverEntry) => void,\n options?: ResizeObserverOptions,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.resize.observe(_target, _callback, options);\n return () => observer.resize.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useIntersectionObserver = (\n target: RefObject<Element | null | undefined> | Element | null | undefined,\n callback: (entry: IntersectionObserverEntry) => void,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (!observer || !_target) return;\n observer.intersection.observe(_target, _callback);\n return () => observer.intersection.unobserve(_target, _callback);\n }, [target]);\n}\n\nexport const useMutationObserver = (\n target: RefObject<Node | null | undefined> | Node | null | undefined,\n callback: MutationCallback,\n options?: MutationObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n const _target = target && 'current' in target ? target.current : target;\n if (typeof window === 'undefined' || !_target) return;\n const observer = new MutationObserver(_callback);\n observer.observe(_target, options);\n return () => observer.disconnect();\n }, [target]);\n}\n\nexport const usePerformanceObserver = (\n callback: PerformanceObserverCallback,\n options?: PerformanceObserverInit,\n) => {\n const _callback = useCallback(callback);\n useEffect(() => {\n if (typeof window === 'undefined') return;\n const observer = new PerformanceObserver(_callback);\n observer.observe(options);\n return () => observer.disconnect();\n }, []);\n}\n","//\n// online.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\n\nexport const useOnline = () => useSyncExternalStore((onStoreChange) => {\n window.addEventListener('offline', onStoreChange);\n window.addEventListener('online', onStoreChange);\n return () => {\n window.removeEventListener('offline', onStoreChange);\n window.removeEventListener('online', onStoreChange);\n };\n}, () => navigator.onLine, () => false);","//\n// decompress.js\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n// @ts-nocheck\nexport const decompress = (o: string) => {\n function r(r) {\n for (i = f = 0; i < r; )\n A < 2 && ((A = 64), (a = 92 < (a = o.charCodeAt(C++)) ? a - 59 : a - 58)),\n (f |= (0 < (a & (A /= 2))) << i),\n ++i;\n }\n for (var n, f, i, t, a, e = [], u = 1, _ = 3, c = 1, h = [], A = 0, C = 0;;) {\n if ((r(c + 1), 2 == f)) return h.join(\"\");\n -2 & (t = f) ||\n (r(8 * f + 8),\n (e[(t = _++)] = String.fromCharCode(f)),\n --u || (u = 2 << c++)),\n h.push((t = e[t] || n + n[0])),\n n && ((e[_++] = n + t[0]), --u || (u = 2 << c++)),\n (n = t);\n }\n};\n","//\n// server.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../core/reconciler/state';\nimport { _DOMRenderer } from '../renderer/common';\nimport { decompress } from '../renderer/minify/decompress';\n\nconst decodedSsrData = new WeakMap<Document, any>();\n\nexport const useServerResource = (key: string, resource?: () => string): string | undefined => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useServerResource must be used within a render function.');\n if (state.renderer instanceof _DOMRenderer) {\n if (state.renderer._server) {\n const data = resource?.();\n if (!_.isString(data)) throw Error('Invalid return type of resource');\n state.renderer._tracked_server_resource.set(key, data);\n return data;\n } else {\n const cached = decodedSsrData.get(state.renderer.document);\n if (!_.isNil(cached)) return cached[key];\n const ssrData = state.renderer.document.querySelector('script[data-frosty-ssr-data]');\n if (ssrData instanceof HTMLElement) {\n try {\n const decoded = JSON.parse(decompress(ssrData.innerText.trim()));\n decodedSsrData.set(state.renderer.document, decoded);\n return decoded[key];\n } catch (e) {\n console.error(e);\n decodedSsrData.set(state.renderer.document, {});\n }\n ssrData.remove();\n } else {\n decodedSsrData.set(state.renderer.document, {});\n }\n }\n } else {\n throw Error('Unsupported renderer.');\n }\n}\n","//\n// storage.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useCallback } from '../core/hooks/callback';\nimport { SetStateAction } from '../core/types/common';\nimport { EventEmitter } from '../core/reconciler/events';\n\nconst emitters = new WeakMap<Storage, EventEmitter>();\nconst emitterFor = (storage: Storage) => {\n if (!emitters.has(storage)) emitters.set(storage, new EventEmitter());\n return emitters.get(storage)!;\n}\n\nconst _useStorage = (\n storage: () => Storage,\n key: string,\n initialValue?: string | null\n) => {\n const state = useSyncExternalStore((onStoreChange) => {\n const _storage = storage();\n const emitter = emitterFor(_storage);\n const callback = (ev: StorageEvent) => { \n if (!ev.storageArea || ev.storageArea === _storage) onStoreChange();\n };\n window.addEventListener('storage', callback);\n const event = emitter.register('change', onStoreChange);\n return () => {\n window.removeEventListener('storage', callback);\n event.remove();\n }\n }, () => storage().getItem(key), () => undefined);\n const setState = useCallback((v: SetStateAction<string | null | undefined>) => {\n try {\n const _storage = storage();\n const newValue = _.isFunction(v) ? v(state) : v;\n if (_.isNil(newValue)) {\n _storage.removeItem(key);\n } else {\n _storage.setItem(key, newValue);\n }\n const emitter = emitterFor(_storage);\n emitter.emit('change');\n } catch (e) {\n console.error(e);\n }\n }, [key]);\n return [state ?? initialValue ?? null, setState] as const;\n}\n\nexport const useLocalStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.localStorage, key, initialValue);\n\nexport const useSessionStorage = (\n key: string,\n initialValue?: string | null\n) => _useStorage(() => window.sessionStorage, key, initialValue);\n","//\n// visibility.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { useSyncExternalStore } from '../core/hooks/sync';\nimport { useDocument } from './document';\n\nexport const useVisibility = () => {\n const document = useDocument();\n return useSyncExternalStore((onStoreChange) => {\n document.addEventListener('visibilitychange', onStoreChange);\n return () => {\n document.removeEventListener('visibilitychange', onStoreChange);\n }\n }, () => {\n if (document.hasFocus()) {\n return 'active' as const;\n } else if (document.visibilityState === 'visible') {\n return 'inactive' as const;\n } else {\n return 'background' as const;\n }\n }, () => 'unknown' as const);\n}\n"],"names":["emitters","emitterFor"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAM,WAAW,GAAG,MAAK;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB;AACzC,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,MAAM,KAAK,CAAC,oDAAoD,CAAC;AAC7E,IAAA,IAAI,KAAK,CAAC,QAAQ,YAAY,YAAY,EAAE;AAC1C,QAAA,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ;IAChC;SAAO;AACL,QAAA,MAAM,KAAK,CAAC,uBAAuB,CAAC;IACtC;AACF;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAM,SAAS,GAAG,MAAK;AAC5B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB;AACzC,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,MAAM,KAAK,CAAC,kDAAkD,CAAC;AAC3E,IAAA,IAAI,KAAK,CAAC,QAAQ,YAAY,YAAY,EAAE;AAC1C,QAAA,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM;IAC9B;SAAO;AACL,QAAA,MAAM,KAAK,CAAC,uBAAuB,CAAC;IACtC;AACF;AAEA,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;AAC5D,MAAM,cAAc,GAAG,CAAC,MAAoC,KAAI;AAC9D,IAAA,IAAI,OAAO;AACX,IAAA,IAAI,EAAE,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,CAA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,YAAA,OAAO,QAAiB;QAC1B;AAAO,aAAA,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE;AACjD,YAAA,OAAO,UAAmB;QAC5B;aAAO;AACL,YAAA,OAAO,YAAqB;QAC9B;AACF,IAAA,CAAC,EAAE,MAAM,SAAkB,CAAC;AAC9B;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-DCxs31Tn.js","sources":["../../../src/core/renderer.ts"],"sourcesContent":["//\n// renderer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { VNode } from './reconciler/vnode';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { reconciler } from './reconciler/state';\nimport nextick from 'nextick';\nimport { equalDeps } from './reconciler/utils';\n\nexport abstract class _Renderer<T> {\n\n protected abstract _beforeUpdate(): void;\n\n protected abstract _afterUpdate(): void;\n\n protected abstract _createElement(node: VNode, stack: VNode[]): T;\n\n protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[], stack: VNode[], force?: boolean): void;\n\n abstract get _server(): boolean;\n\n private async _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n const runtime = reconciler.buildVNodes(component, this);\n\n type _State = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const mountState = new Map<VNode, _State[]>();\n\n const children = (node: VNode, elements: Map<VNode, { native?: T }>): (string | T)[] => {\n return _.flatMap(node.children, x => _.isString(x) ? x : elements.get(x)?.native ?? children(x, elements));\n };\n\n const commit = (elements: Map<VNode, { native?: T }>) => {\n\n const _mount = (node: VNode, stack: VNode[]) => {\n for (const item of node.children) {\n if (item instanceof VNode) _mount(item, [...stack, node]);\n }\n const element = elements.get(node)?.native;\n if (element) {\n this._replaceChildren(node, element, children(node, elements), stack);\n }\n const state: _State[] = [];\n const prevState = mountState.get(node) ?? [];\n const curState = node.state;\n for (const i of _.range(Math.max(prevState.length, curState.length))) {\n const unmount = prevState[i]?.unmount;\n const changed = prevState[i]?.hook !== curState[i]?.hook || !equalDeps(prevState[i].deps, curState[i]?.deps);\n if (unmount && changed) unmount();\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : curState[i].mount?.(),\n });\n }\n mountState.set(node, state);\n };\n\n for (const [node, state] of mountState) {\n if (elements.has(node)) continue;\n for (const { unmount } of state) unmount?.();\n mountState.delete(node);\n }\n if (root) this._replaceChildren(\n runtime.node, root,\n _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)),\n [], true\n );\n _mount(runtime.node, []);\n };\n\n const update = async (elements?: Map<VNode, { native?: T }>) => {\n this._beforeUpdate();\n const map = new Map<VNode, { native?: T }>();\n for await (const { node, stack, updated } of runtime.excute()) {\n if (node.error) continue;\n if (_.isFunction(node.type) && !(node.type.prototype instanceof NativeElementType)) {\n map.set(node, {});\n continue;\n }\n if (updated) {\n let elem = elements?.get(node)?.native;\n if (elem) {\n this._updateElement(node, elem, stack);\n } else {\n elem = this._createElement(node, stack);\n }\n map.set(node, { native: elem });\n } else {\n map.set(node, { native: elements?.get(node)?.native ?? this._createElement(node, stack) });\n }\n }\n commit(map);\n if (elements) {\n for (const [node, element] of elements) {\n if (map.has(node) || !element.native) continue;\n this._destroyElement(node, element.native);\n }\n }\n this._afterUpdate();\n return map;\n };\n\n let update_count = 0;\n let render_count = 0;\n let destroyed = false;\n let elements = await update();\n\n const listener = runtime.event.register('onchange', () => {\n if (render_count !== update_count++) return;\n nextick(async () => {\n while (render_count !== update_count) {\n if (destroyed) return;\n const current = update_count;\n elements = await update(elements);\n render_count = current;\n }\n });\n });\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements));\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n if (root) this._replaceChildren(runtime.node, root, [], [], true);\n destroyed = true;\n listener.remove();\n for (const state of mountState.values()) {\n for (const { unmount } of state) unmount?.();\n }\n },\n };\n }\n\n createRoot(root?: T) {\n let state: Awaited<ReturnType<typeof this._createRoot>> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: async (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = await this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\n };\n }\n}"],"names":["component","reconciler","VNode","state","equalDeps","NativeElementType"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MASsB,SAAS,CAAA;AAgB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AAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAQ;AACzD,gBAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK;YAC9C,CAAC;YACD,OAAO,EAAE,MAAK;AACZ,gBAAA,IAAI,IAAI;AAAE,oBAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC;gBACjE,SAAS,GAAG,IAAI;gBAChB,QAAQ,CAAC,MAAM,EAAE;gBACjB,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE;AACvC,oBAAA,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK;wBAAE,OAAO,IAAI;gBAC9C;YACF,CAAC;SACF;IACH;AAEA,IAAA,UAAU,CAAC,IAAQ,EAAA;AACjB,QAAA,IAAI,KAA+D;QACnE,OAAO;AACL,YAAA,IAAI,IAAI,GAAA;gBACN,OAAO,KAAK,EAAE,IAAI;YACpB,CAAC;AACD,YAAA,KAAK,EAAE,OACL,SAAwB,EACxB,OAEC,KACC;AACF,gBAAA,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;YAClE,CAAC;YACD,OAAO,EAAE,MAAK;gBACZ,KAAK,EAAE,OAAO,EAAE;gBAChB,KAAK,GAAG,SAAS;YACnB,CAAC;SACF;IACH;AACD;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-Dn64xymQ.mjs","sources":["../../../src/core/renderer.ts"],"sourcesContent":["//\n// renderer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { VNode } from './reconciler/vnode';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { reconciler } from './reconciler/state';\nimport nextick from 'nextick';\nimport { equalDeps } from './reconciler/utils';\n\nexport abstract class _Renderer<T> {\n\n protected abstract _beforeUpdate(): void;\n\n protected abstract _afterUpdate(): void;\n\n protected abstract _createElement(node: VNode, stack: VNode[]): T;\n\n protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[], stack: VNode[], force?: boolean): void;\n\n abstract get _server(): boolean;\n\n private async _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n const runtime = reconciler.buildVNodes(component, this);\n\n type _State = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const mountState = new Map<VNode, _State[]>();\n\n const children = (node: VNode, elements: Map<VNode, { native?: T }>): (string | T)[] => {\n return _.flatMap(node.children, x => _.isString(x) ? x : elements.get(x)?.native ?? children(x, elements));\n };\n\n const commit = (elements: Map<VNode, { native?: T }>) => {\n\n const _mount = (node: VNode, stack: VNode[]) => {\n for (const item of node.children) {\n if (item instanceof VNode) _mount(item, [...stack, node]);\n }\n const element = elements.get(node)?.native;\n if (element) {\n this._replaceChildren(node, element, children(node, elements), stack);\n }\n const state: _State[] = [];\n const prevState = mountState.get(node) ?? [];\n const curState = node.state;\n for (const i of _.range(Math.max(prevState.length, curState.length))) {\n const unmount = prevState[i]?.unmount;\n const changed = prevState[i]?.hook !== curState[i]?.hook || !equalDeps(prevState[i].deps, curState[i]?.deps);\n if (unmount && changed) unmount();\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : curState[i].mount?.(),\n });\n }\n mountState.set(node, state);\n };\n\n for (const [node, state] of mountState) {\n if (elements.has(node)) continue;\n for (const { unmount } of state) unmount?.();\n mountState.delete(node);\n }\n if (root) this._replaceChildren(\n runtime.node, root,\n _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)),\n [], true\n );\n _mount(runtime.node, []);\n };\n\n const update = async (elements?: Map<VNode, { native?: T }>) => {\n this._beforeUpdate();\n const map = new Map<VNode, { native?: T }>();\n for await (const { node, stack, updated } of runtime.excute()) {\n if (node.error) continue;\n if (_.isFunction(node.type) && !(node.type.prototype instanceof NativeElementType)) {\n map.set(node, {});\n continue;\n }\n if (updated) {\n let elem = elements?.get(node)?.native;\n if (elem) {\n this._updateElement(node, elem, stack);\n } else {\n elem = this._createElement(node, stack);\n }\n map.set(node, { native: elem });\n } else {\n map.set(node, { native: elements?.get(node)?.native ?? this._createElement(node, stack) });\n }\n }\n commit(map);\n if (elements) {\n for (const [node, element] of elements) {\n if (map.has(node) || !element.native) continue;\n this._destroyElement(node, element.native);\n }\n }\n this._afterUpdate();\n return map;\n };\n\n let update_count = 0;\n let render_count = 0;\n let destroyed = false;\n let elements = await update();\n\n const listener = runtime.event.register('onchange', () => {\n if (render_count !== update_count++) return;\n nextick(async () => {\n while (render_count !== update_count) {\n if (destroyed) return;\n const current = update_count;\n elements = await update(elements);\n render_count = current;\n }\n });\n });\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements));\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n if (root) this._replaceChildren(runtime.node, root, [], [], true);\n destroyed = true;\n listener.remove();\n for (const state of mountState.values()) {\n for (const { unmount } of state) unmount?.();\n }\n },\n };\n }\n\n createRoot(root?: T) {\n let state: Awaited<ReturnType<typeof this._createRoot>> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: async (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = await this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\n };\n }\n}"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MASsB,SAAS,CAAA;AAgBrB,IAAA,MAAM,WAAW,CACvB,IAAc,EACd,SAAwB,EACxB,OAEC,EAAA;QAGD,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC;AAQvD,QAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB;AAE7C,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAE,QAAoC,KAAoB;AACrF,YAAA,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5G,QAAA,CA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