frosty 0.0.118 → 0.0.120
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.d.mts +3 -3
- package/dist/_native.d.ts +3 -3
- package/dist/_native.js +2 -2
- package/dist/_native.mjs +2 -2
- package/dist/dom.d.mts +3 -3
- package/dist/dom.d.ts +3 -3
- package/dist/dom.js +3 -3
- package/dist/dom.mjs +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/index.mjs +4 -4
- package/dist/internals/{common-bhZ4PXrN.d.mts → common-BYsSVxNk.d.mts} +2 -2
- package/dist/internals/{common-bhZ4PXrN.d.ts.map → common-BYsSVxNk.d.mts.map} +1 -1
- package/dist/internals/{common-bhZ4PXrN.d.ts → common-BYsSVxNk.d.ts} +2 -2
- package/dist/internals/common-BYsSVxNk.d.ts.map +1 -0
- package/dist/internals/{fragment-S8Jiu3HG.d.mts → fragment-B-zrdJZ8.d.mts} +2 -2
- package/dist/internals/{fragment-S8Jiu3HG.d.mts.map → fragment-B-zrdJZ8.d.mts.map} +1 -1
- package/dist/internals/{fragment-BTtOyGrt.d.ts → fragment-CRbC1VFN.d.ts} +2 -2
- package/dist/internals/{fragment-BTtOyGrt.d.ts.map → fragment-CRbC1VFN.d.ts.map} +1 -1
- package/dist/internals/{renderer-DFjLukA0.js → renderer-BJyESI8-.js} +4 -4
- package/dist/internals/renderer-BJyESI8-.js.map +1 -0
- package/dist/internals/{renderer-j_b3mDma.d.mts → renderer-BtOijeDS.d.mts} +3 -3
- package/dist/internals/{renderer-j_b3mDma.d.mts.map → renderer-BtOijeDS.d.mts.map} +1 -1
- package/dist/internals/{renderer-CjOb0eOL.mjs → renderer-CJA6vv86.mjs} +4 -4
- package/dist/internals/renderer-CJA6vv86.mjs.map +1 -0
- package/dist/internals/{renderer-oGiv2WIb.mjs → renderer-D7YbtgQX.mjs} +2 -2
- package/dist/internals/{renderer-oGiv2WIb.mjs.map → renderer-D7YbtgQX.mjs.map} +1 -1
- package/dist/internals/{renderer-BCXo_tVK.js → renderer-DK5OzE35.js} +2 -2
- package/dist/internals/{renderer-BCXo_tVK.js.map → renderer-DK5OzE35.js.map} +1 -1
- package/dist/internals/{renderer-CNDFwfGu.d.ts → renderer-DVEtzh7O.d.ts} +3 -3
- package/dist/internals/{renderer-CNDFwfGu.d.ts.map → renderer-DVEtzh7O.d.ts.map} +1 -1
- package/dist/internals/{renderer-dZplPv2-.d.ts → renderer-DlRiag_W.d.ts} +2 -2
- package/dist/internals/{renderer-dZplPv2-.d.ts.map → renderer-DlRiag_W.d.ts.map} +1 -1
- package/dist/internals/{renderer-Bb9ZwNV9.d.mts → renderer-eYwU4exf.d.mts} +2 -2
- package/dist/internals/{renderer-Bb9ZwNV9.d.mts.map → renderer-eYwU4exf.d.mts.map} +1 -1
- package/dist/internals/{state-C9_fGuhZ.js → state-BcId1rQb.js} +20 -4
- package/dist/internals/state-BcId1rQb.js.map +1 -0
- package/dist/internals/{state-k40d_k34.mjs → state-DQ2OKak8.mjs} +20 -4
- package/dist/internals/state-DQ2OKak8.mjs.map +1 -0
- package/dist/internals/{sync-DRp6Vg-9.mjs → sync-UIYH-wdf.mjs} +2 -2
- package/dist/internals/{sync-DRp6Vg-9.mjs.map → sync-UIYH-wdf.mjs.map} +1 -1
- package/dist/internals/{sync-D4YtyMaB.js → sync-bgrX6wfp.js} +2 -2
- package/dist/internals/{sync-D4YtyMaB.js.map → sync-bgrX6wfp.js.map} +1 -1
- package/dist/internals/{utils-CPic5-1I.d.mts → utils-C_f_laIp.d.mts} +2 -2
- package/dist/internals/{utils-CPic5-1I.d.mts.map → utils-C_f_laIp.d.mts.map} +1 -1
- package/dist/internals/{utils-BPbhSCHS.d.ts → utils-QOsIvm19.d.ts} +2 -2
- package/dist/internals/{utils-BPbhSCHS.d.ts.map → utils-QOsIvm19.d.ts.map} +1 -1
- package/dist/jsx-dev-runtime.d.mts +2 -2
- package/dist/jsx-dev-runtime.d.ts +2 -2
- package/dist/jsx-runtime.d.mts +2 -2
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/server-dom.d.mts +3 -3
- package/dist/server-dom.d.ts +3 -3
- package/dist/server-dom.js +3 -3
- package/dist/server-dom.mjs +3 -3
- package/dist/web.d.mts +3 -3
- package/dist/web.d.ts +3 -3
- package/dist/web.js +4 -4
- package/dist/web.mjs +5 -5
- package/package.json +1 -1
- package/packages/frosty-cli/yarn.lock +42 -37
- package/dist/internals/common-bhZ4PXrN.d.mts.map +0 -1
- package/dist/internals/renderer-CjOb0eOL.mjs.map +0 -1
- package/dist/internals/renderer-DFjLukA0.js.map +0 -1
- package/dist/internals/state-C9_fGuhZ.js.map +0 -1
- package/dist/internals/state-k40d_k34.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-D4YtyMaB.js","sources":["../../../src/core/reconciler/hooks.ts","../../../src/core/hooks/state.ts","../../../src/core/hooks/effect.ts","../../../src/core/hooks/callback.ts","../../../src/core/hooks/memo.ts","../../../src/core/hooks/storage.ts","../../../src/core/hooks/misc/resource/error.tsx","../../../src/core/hooks/sync.ts"],"sourcesContent":["//\n// index.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 './state';\nimport { equalDeps } from './utils';\n\nconst _useHookState = (hook: string) => {\n const state = reconciler.currentHookState;\n if (!state) throw Error(`${hook} must be used within a render function.`);\n const { prevState, state: newState } = state;\n if (prevState && prevState[newState.length]?.hook !== hook) {\n console.warn([\n `Hook \"${hook}\" is called conditionally.`,\n 'Hooks must be called in the exact same order in every component render.',\n 'Did you accidentally call a hook after an early return?'\n ].join(' '));\n }\n return state;\n};\n\nexport const _useEffect = (\n hook: string,\n effect: (state: ReturnType<typeof _useHookState>) => () => void,\n deps?: any\n) => {\n const state = _useHookState(hook);\n const { state: newState } = state;\n newState.push({\n mount: () => effect(state),\n deps,\n hook,\n });\n};\n\nexport const _useMemo = <T>(\n hook: string,\n factory: (state: ReturnType<typeof _useHookState>) => T,\n deps?: any\n): T => {\n const state = _useHookState(hook);\n const { prevState, state: newState } = state;\n const idx = newState.length;\n const changed = prevState?.[idx]?.hook !== hook || !equalDeps(prevState[idx].deps, deps);\n const data = changed ? factory(state) : prevState[idx].data;\n newState.push({\n deps,\n hook,\n data\n });\n return data;\n};\n","//\n// memo.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 '../reconciler/hooks';\nimport { SetStateAction } from '../types/common';\n\n/**\n * A hook function for managing state within a custom framework or library.\n *\n * @template T - The type of the state value.\n * @param - The initial state value or a function that returns the initial state.\n * @returns - A tuple containing the current state value and a function to update the state.\n *\n * The `useState` function provides a way to manage stateful values. It returns the current state\n * and a setter function that can update the state. The setter function accepts either a new value\n * or a function that receives the current state and returns the updated state.\n *\n * Example:\n * ```typescript\n * const [count, setCount] = useState(0);\n * setCount(5); // Updates the state to 5\n * setCount(prev => prev + 1); // Updates the state to the previous value + 1\n * ```\n */\nexport function useState<T>(initialState: T | (() => T)): [T, (dispatch: SetStateAction<T>) => void];\nexport function useState<T = undefined>(): [T | undefined, (dispatch: SetStateAction<T | undefined>) => void];\n\nexport function useState(initialState?: any) {\n const { value, setValue } = _useMemo('useState', ({ node }) => {\n const state = {\n value: _.isFunction(initialState) ? initialState() : initialState,\n setValue: (dispatch: SetStateAction<any>) => {\n const oldValue = state.value;\n const newValue = _.isFunction(dispatch) ? dispatch(oldValue) : dispatch;\n if (oldValue === newValue) return;\n state.value = newValue;\n node?._setDirty();\n },\n };\n return state;\n }, null);\n return [value, setValue];\n}\n","//\n// effect.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 { Awaitable } from '@o2ter/utils-js';\nimport { _useEffect } from '../reconciler/hooks';\n\n/**\n * A hook that manages side effects with support for an `AbortSignal`.\n * It ensures proper cleanup logic and handles asynchronous operations effectively.\n *\n * @param effect - \n * A function that receives an `AbortSignal` and performs side effects. \n * It can optionally return a cleanup function or a promise that resolves to a cleanup function.\n *\n * @param deps - \n * An optional dependencies that determines when the effect should be re-executed.\n *\n * @example\n * useEffect((signal) => {\n * fetch('/api/data', { signal })\n * .then(response => response.json())\n * .then(data => console.log(data))\n * .catch(err => {\n * if (err.name === 'AbortError') {\n * console.log('Fetch aborted');\n * } else {\n * console.error(err);\n * }\n * });\n * \n * return () => {\n * console.log('Cleanup logic here');\n * };\n * }, []);\n */\nexport const useEffect = (\n effect: (\n signal: AbortSignal,\n ) => Awaitable<void | (() => Awaitable<void>)>,\n deps?: any,\n) => _useEffect('useEffect', () => {\n const abort = new AbortController();\n try {\n const destructor = effect(abort.signal);\n return () => {\n abort.abort();\n (async () => {\n try {\n const _destructor = await destructor;\n if (_.isFunction(_destructor)) _destructor();\n } catch (e) {\n console.error(e);\n }\n })();\n };\n } catch (e) {\n console.error(e);\n return () => abort.abort();\n }\n}, deps);","//\n// memo.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 '../reconciler/hooks';\n\n/**\n * A hook that memoizes a callback function, ensuring that it only changes\n * if its dependencies change. This is useful for optimizing performance by preventing\n * unnecessary re-creations of functions.\n *\n * @template T - The type of the callback function.\n * @param callback - The callback function to be memoized.\n * @param deps - An optional dependencies. If provided, the callback\n * will only be updated when one of these dependencies changes.\n * If not provided, the callback will remain stable.\n * @returns - A stable version of the callback function that will not change unless\n * its dependencies change.\n *\n * @example\n * const memoizedCallback = useCallback(() => {\n * console.log('This function is memoized!');\n * }, [dependency]);\n */\n\nexport function useCallback<T extends (...args: any) => any>(\n callback: T,\n deps?: any\n): T;\n\nexport function useCallback<T extends ((...args: any) => any) | _.Falsey>(\n callback: T,\n deps?: any\n): T;\n\nexport function useCallback<T extends ((...args: any) => any) | _.Falsey>(\n callback: T,\n deps?: any\n): T {\n if (!_.isUndefined(deps)) return _useMemo('useCallback', () => callback, deps);\n const store = _useMemo('useCallback', () => {\n const store = {\n current: callback,\n stable: function (this: any, ...args: any) {\n if (_.isFunction(store.current))\n return store.current.call(this, ...args);\n },\n };\n return store;\n }, null);\n if (_.isFunction(callback)) store.current = callback;\n return callback && (store.stable as T);\n}\n","//\n// memo.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 '../reconciler/hooks';\n\n/**\n * A utility function that memoizes the result of a factory function.\n * \n * @template T The type of the value returned by the factory function.\n * @param factory A function that produces a value to be memoized.\n * @param deps An optional dependency array. The memoized value is recalculated \n * only when the dependencies change.\n * @returns The memoized value produced by the factory function.\n */\nexport const useMemo = <T>(\n factory: () => T,\n deps?: any,\n) => _useMemo('useMemo', () => factory(), deps);\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 { reconciler } from '../reconciler/state';\n\nconst storage = new WeakMap<any, Map<any, any>>();\n\n/**\n * Returns a persistent storage Map associated with the current renderer instance.\n * This hook allows components to store and retrieve values that persist across renders,\n * scoped to the renderer. Must be called within a render function.\n *\n * @throws Error if called outside of a render function.\n * @returns {Map<any, any>} The storage map for the current renderer.\n */\nexport const useRendererStorage = (\n persist = true\n) => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useRendererStorage must be used within a render function.');\n if (!persist) return state.renderer.renderStorage;\n const found = storage.get(state.renderer);\n const store = found ?? new Map<any, any>();\n if (!found) storage.set(state.renderer, store);\n return store;\n};\n","//\n// error.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 { Awaitable } from '@o2ter/utils-js';\nimport { ComponentType, PropsWithChildren, SetStateAction } from '../../../types/common';\nimport { createContext } from '../../context';\nimport { useContext } from '../../context';\nimport { useState } from '../../state';\nimport { useMemo } from '../../memo';\nimport { useRendererStorage } from '../../storage';\n\ntype Errors = {\n token: string;\n error: any;\n refresh: () => Awaitable<void>;\n refreshing: boolean;\n loading: boolean;\n}[];\n\ntype ContextValue = {\n errors: Errors;\n setErrors: (values: SetStateAction<Errors>) => void;\n};\n\nconst defaultStorageKey = Symbol();\nconst Context = createContext<ContextValue>();\n\n/**\n * A context provider component for managing asynchronous resource errors.\n * \n * This component provides a shared context for tracking errors encountered during\n * asynchronous operations. It allows child components to access and manage these errors\n * using the `useResourceErrors` hook.\n * \n * ### Usage:\n * Wrap your application or specific parts of it with this component to enable error tracking:\n * \n * ```tsx\n * <ResourceErrors>\n * <YourComponent />\n * </ResourceErrors>\n * ```\n * \n * @param children - The child components that will have access to the error context.\n * \n * @returns A context provider that wraps the provided children.\n */\nexport const ResourceErrors: ComponentType<PropsWithChildren<{}>> = ({\n children\n}) => {\n const [errors, setErrors] = useState<Errors>([]);\n const value = useMemo(() => ({ errors, setErrors }), [errors, setErrors]);\n return (\n <Context value={value}>{children}</Context>\n );\n}\n\nexport const useErrorContext = () => {\n const value = useContext(Context);\n if (value) return value;\n const storage = useRendererStorage();\n const found = storage.get(defaultStorageKey);\n if (found) return found as ContextValue;\n const store: ContextValue = {\n errors: [],\n setErrors: (values: SetStateAction<Errors>) => {\n store.errors = _.isFunction(values) ? values(store.errors) : values;\n },\n };\n storage.set(defaultStorageKey, store);\n return store;\n};\n\n/**\n * A hook to access the list of asynchronous resource errors.\n * \n * This hook allows components to retrieve the current list of errors being tracked\n * in the `ResourceErrors` context. It must be used within a component that is\n * a descendant of the `ResourceErrors` provider.\n * \n * ### Usage:\n * ```tsx\n * import { useEffect, useResourceErrors } from 'frosty';\n * \n * const errors = useResourceErrors();\n * \n * useEffect(() => {\n * errors.forEach(({ token, error, refresh }) => {\n * console.error(`Error [${token}]:`, error);\n * // Optionally call refresh() to retry the operation\n * });\n * }, [errors]);\n * ```\n * \n * @returns The list of errors currently being tracked in the context. Each error includes:\n * - `token`: A unique identifier for the error.\n * - `error`: The error object or message.\n * - `refresh`: A function to retry the operation that caused the error.\n */\nexport const useResourceErrors = () => useErrorContext().errors;\n","//\n// sync.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 { Awaitable } from '@o2ter/utils-js';\nimport { _useEffect } from '../reconciler/hooks';\nimport { reconciler } from '../reconciler/state';\n\n/**\n * A hook utility for synchronizing with an external store.\n *\n * @template Snapshot - The type of the snapshot returned by the store.\n * @param subscribe - A function that sets up a subscription to the external store.\n * - `onStoreChange`: A callback to invoke when the store changes.\n * - `signal`: An `AbortSignal` to handle cleanup when the subscription is no longer needed.\n * - Returns an optional cleanup function or a promise resolving to one.\n * @param getSnapshot - A function that retrieves the current snapshot of the store.\n * @param getServerSnapshot - (Optional) A function that retrieves the snapshot of the store\n * in a server environment.\n * @returns The current snapshot of the store.\n *\n * @throws Will throw an error if used outside of a valid render context.\n */\nexport const useSyncExternalStore = <Snapshot>(\n subscribe: (\n onStoreChange: () => void,\n signal: AbortSignal,\n ) => Awaitable<void | (() => Awaitable<void>)>,\n getSnapshot: () => Snapshot,\n getServerSnapshot?: () => Snapshot,\n) => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useSyncExternalStore must be used within a render function.');\n _useEffect('useSyncExternalStore', ({ node }) => {\n const abort = new AbortController();\n try {\n const destructor = subscribe(() => { node?._setDirty(); }, abort.signal);\n return () => {\n abort.abort();\n (async () => {\n try {\n const _destructor = await destructor;\n if (_.isFunction(_destructor)) _destructor();\n } catch (e) {\n console.error(e);\n }\n })();\n };\n } catch (e) {\n console.error(e);\n return () => abort.abort();\n }\n }, null);\n if (getServerSnapshot && state.renderer._server) {\n return getServerSnapshot();\n }\n return getSnapshot();\n};"],"names":["state","reconciler","equalDeps","createContext","_jsx","useContext"],"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;AAMA,MAAM,aAAa,GAAG,CAAC,IAAY,KAAI;AACrC,IAAA,MAAMA,OAAK,GAAGC,gBAAU,CAAC,gBAAgB;AACzC,IAAA,IAAI,CAACD,OAAK;AAAE,QAAA,MAAM,KAAK,CAAC,CAAA,EAAG,IAAI,CAAA,uCAAA,CAAyC,CAAC;IACzE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAGA,OAAK;AAC5C,IAAA,IAAI,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,KAAK,IAAI,EAAE;QAC1D,OAAO,CAAC,IAAI,CAAC;AACX,YAAA,CAAA,MAAA,EAAS,IAAI,CAAA,0BAAA,CAA4B;YACzC,yEAAyE;YACzE;AACD,SAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACd;AACA,IAAA,OAAOA,OAAK;AACd,CAAC;AAEM,MAAM,UAAU,GAAG,CACxB,IAAY,EACZ,MAA+D,EAC/D,IAAU,KACR;AACF,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC;AACjC,IAAA,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK;IACjC,QAAQ,CAAC,IAAI,CAAC;AACZ,QAAA,KAAK,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI;QACJ,IAAI;AACL,KAAA,CAAC;AACJ;AAEO,MAAM,QAAQ,GAAG,CACtB,IAAY,EACZ,OAAuD,EACvD,IAAU,KACL;AACL,IAAA,MAAMA,OAA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AO,CAAC,KAAK,CAAC,CAAC,CAAC;AAChB,YAAA,OAAO,MAAM,KAAK,CAAC,KAAK,EAAE;QAC5B;IACF,CAAC,EAAE,IAAI,CAAC;IACR,IAAI,iBAAiB,IAAIA,OAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;QAC/C,OAAO,iBAAiB,EAAE;IAC5B;IACA,OAAO,WAAW,EAAE;AACtB;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sync-bgrX6wfp.js","sources":["../../../src/core/reconciler/hooks.ts","../../../src/core/hooks/state.ts","../../../src/core/hooks/effect.ts","../../../src/core/hooks/callback.ts","../../../src/core/hooks/memo.ts","../../../src/core/hooks/storage.ts","../../../src/core/hooks/misc/resource/error.tsx","../../../src/core/hooks/sync.ts"],"sourcesContent":["//\n// index.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 './state';\nimport { equalDeps } from './utils';\n\nconst _useHookState = (hook: string) => {\n const state = reconciler.currentHookState;\n if (!state) throw Error(`${hook} must be used within a render function.`);\n const { prevState, state: newState } = state;\n if (prevState && prevState[newState.length]?.hook !== hook) {\n console.warn([\n `Hook \"${hook}\" is called conditionally.`,\n 'Hooks must be called in the exact same order in every component render.',\n 'Did you accidentally call a hook after an early return?'\n ].join(' '));\n }\n return state;\n};\n\nexport const _useEffect = (\n hook: string,\n effect: (state: ReturnType<typeof _useHookState>) => () => void,\n deps?: any\n) => {\n const state = _useHookState(hook);\n const { state: newState } = state;\n newState.push({\n mount: () => effect(state),\n deps,\n hook,\n });\n};\n\nexport const _useMemo = <T>(\n hook: string,\n factory: (state: ReturnType<typeof _useHookState>) => T,\n deps?: any\n): T => {\n const state = _useHookState(hook);\n const { prevState, state: newState } = state;\n const idx = newState.length;\n const changed = prevState?.[idx]?.hook !== hook || !equalDeps(prevState[idx].deps, deps);\n const data = changed ? factory(state) : prevState[idx].data;\n newState.push({\n deps,\n hook,\n data\n });\n return data;\n};\n","//\n// memo.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 '../reconciler/hooks';\nimport { SetStateAction } from '../types/common';\n\n/**\n * A hook function for managing state within a custom framework or library.\n *\n * @template T - The type of the state value.\n * @param - The initial state value or a function that returns the initial state.\n * @returns - A tuple containing the current state value and a function to update the state.\n *\n * The `useState` function provides a way to manage stateful values. It returns the current state\n * and a setter function that can update the state. The setter function accepts either a new value\n * or a function that receives the current state and returns the updated state.\n *\n * Example:\n * ```typescript\n * const [count, setCount] = useState(0);\n * setCount(5); // Updates the state to 5\n * setCount(prev => prev + 1); // Updates the state to the previous value + 1\n * ```\n */\nexport function useState<T>(initialState: T | (() => T)): [T, (dispatch: SetStateAction<T>) => void];\nexport function useState<T = undefined>(): [T | undefined, (dispatch: SetStateAction<T | undefined>) => void];\n\nexport function useState(initialState?: any) {\n const { value, setValue } = _useMemo('useState', ({ node }) => {\n const state = {\n value: _.isFunction(initialState) ? initialState() : initialState,\n setValue: (dispatch: SetStateAction<any>) => {\n const oldValue = state.value;\n const newValue = _.isFunction(dispatch) ? dispatch(oldValue) : dispatch;\n if (oldValue === newValue) return;\n state.value = newValue;\n node?._setDirty();\n },\n };\n return state;\n }, null);\n return [value, setValue];\n}\n","//\n// effect.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 { Awaitable } from '@o2ter/utils-js';\nimport { _useEffect } from '../reconciler/hooks';\n\n/**\n * A hook that manages side effects with support for an `AbortSignal`.\n * It ensures proper cleanup logic and handles asynchronous operations effectively.\n *\n * @param effect - \n * A function that receives an `AbortSignal` and performs side effects. \n * It can optionally return a cleanup function or a promise that resolves to a cleanup function.\n *\n * @param deps - \n * An optional dependencies that determines when the effect should be re-executed.\n *\n * @example\n * useEffect((signal) => {\n * fetch('/api/data', { signal })\n * .then(response => response.json())\n * .then(data => console.log(data))\n * .catch(err => {\n * if (err.name === 'AbortError') {\n * console.log('Fetch aborted');\n * } else {\n * console.error(err);\n * }\n * });\n * \n * return () => {\n * console.log('Cleanup logic here');\n * };\n * }, []);\n */\nexport const useEffect = (\n effect: (\n signal: AbortSignal,\n ) => Awaitable<void | (() => Awaitable<void>)>,\n deps?: any,\n) => _useEffect('useEffect', () => {\n const abort = new AbortController();\n try {\n const destructor = effect(abort.signal);\n return () => {\n abort.abort();\n (async () => {\n try {\n const _destructor = await destructor;\n if (_.isFunction(_destructor)) _destructor();\n } catch (e) {\n console.error(e);\n }\n })();\n };\n } catch (e) {\n console.error(e);\n return () => abort.abort();\n }\n}, deps);","//\n// memo.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 '../reconciler/hooks';\n\n/**\n * A hook that memoizes a callback function, ensuring that it only changes\n * if its dependencies change. This is useful for optimizing performance by preventing\n * unnecessary re-creations of functions.\n *\n * @template T - The type of the callback function.\n * @param callback - The callback function to be memoized.\n * @param deps - An optional dependencies. If provided, the callback\n * will only be updated when one of these dependencies changes.\n * If not provided, the callback will remain stable.\n * @returns - A stable version of the callback function that will not change unless\n * its dependencies change.\n *\n * @example\n * const memoizedCallback = useCallback(() => {\n * console.log('This function is memoized!');\n * }, [dependency]);\n */\n\nexport function useCallback<T extends (...args: any) => any>(\n callback: T,\n deps?: any\n): T;\n\nexport function useCallback<T extends ((...args: any) => any) | _.Falsey>(\n callback: T,\n deps?: any\n): T;\n\nexport function useCallback<T extends ((...args: any) => any) | _.Falsey>(\n callback: T,\n deps?: any\n): T {\n if (!_.isUndefined(deps)) return _useMemo('useCallback', () => callback, deps);\n const store = _useMemo('useCallback', () => {\n const store = {\n current: callback,\n stable: function (this: any, ...args: any) {\n if (_.isFunction(store.current))\n return store.current.call(this, ...args);\n },\n };\n return store;\n }, null);\n if (_.isFunction(callback)) store.current = callback;\n return callback && (store.stable as T);\n}\n","//\n// memo.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 '../reconciler/hooks';\n\n/**\n * A utility function that memoizes the result of a factory function.\n * \n * @template T The type of the value returned by the factory function.\n * @param factory A function that produces a value to be memoized.\n * @param deps An optional dependency array. The memoized value is recalculated \n * only when the dependencies change.\n * @returns The memoized value produced by the factory function.\n */\nexport const useMemo = <T>(\n factory: () => T,\n deps?: any,\n) => _useMemo('useMemo', () => factory(), deps);\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 { reconciler } from '../reconciler/state';\n\nconst storage = new WeakMap<any, Map<any, any>>();\n\n/**\n * Returns a persistent storage Map associated with the current renderer instance.\n * This hook allows components to store and retrieve values that persist across renders,\n * scoped to the renderer. Must be called within a render function.\n *\n * @throws Error if called outside of a render function.\n * @returns {Map<any, any>} The storage map for the current renderer.\n */\nexport const useRendererStorage = (\n persist = true\n) => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useRendererStorage must be used within a render function.');\n if (!persist) return state.renderer.renderStorage;\n const found = storage.get(state.renderer);\n const store = found ?? new Map<any, any>();\n if (!found) storage.set(state.renderer, store);\n return store;\n};\n","//\n// error.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 { Awaitable } from '@o2ter/utils-js';\nimport { ComponentType, PropsWithChildren, SetStateAction } from '../../../types/common';\nimport { createContext } from '../../context';\nimport { useContext } from '../../context';\nimport { useState } from '../../state';\nimport { useMemo } from '../../memo';\nimport { useRendererStorage } from '../../storage';\n\ntype Errors = {\n token: string;\n error: any;\n refresh: () => Awaitable<void>;\n refreshing: boolean;\n loading: boolean;\n}[];\n\ntype ContextValue = {\n errors: Errors;\n setErrors: (values: SetStateAction<Errors>) => void;\n};\n\nconst defaultStorageKey = Symbol();\nconst Context = createContext<ContextValue>();\n\n/**\n * A context provider component for managing asynchronous resource errors.\n * \n * This component provides a shared context for tracking errors encountered during\n * asynchronous operations. It allows child components to access and manage these errors\n * using the `useResourceErrors` hook.\n * \n * ### Usage:\n * Wrap your application or specific parts of it with this component to enable error tracking:\n * \n * ```tsx\n * <ResourceErrors>\n * <YourComponent />\n * </ResourceErrors>\n * ```\n * \n * @param children - The child components that will have access to the error context.\n * \n * @returns A context provider that wraps the provided children.\n */\nexport const ResourceErrors: ComponentType<PropsWithChildren<{}>> = ({\n children\n}) => {\n const [errors, setErrors] = useState<Errors>([]);\n const value = useMemo(() => ({ errors, setErrors }), [errors, setErrors]);\n return (\n <Context value={value}>{children}</Context>\n );\n}\n\nexport const useErrorContext = () => {\n const value = useContext(Context);\n if (value) return value;\n const storage = useRendererStorage();\n const found = storage.get(defaultStorageKey);\n if (found) return found as ContextValue;\n const store: ContextValue = {\n errors: [],\n setErrors: (values: SetStateAction<Errors>) => {\n store.errors = _.isFunction(values) ? values(store.errors) : values;\n },\n };\n storage.set(defaultStorageKey, store);\n return store;\n};\n\n/**\n * A hook to access the list of asynchronous resource errors.\n * \n * This hook allows components to retrieve the current list of errors being tracked\n * in the `ResourceErrors` context. It must be used within a component that is\n * a descendant of the `ResourceErrors` provider.\n * \n * ### Usage:\n * ```tsx\n * import { useEffect, useResourceErrors } from 'frosty';\n * \n * const errors = useResourceErrors();\n * \n * useEffect(() => {\n * errors.forEach(({ token, error, refresh }) => {\n * console.error(`Error [${token}]:`, error);\n * // Optionally call refresh() to retry the operation\n * });\n * }, [errors]);\n * ```\n * \n * @returns The list of errors currently being tracked in the context. Each error includes:\n * - `token`: A unique identifier for the error.\n * - `error`: The error object or message.\n * - `refresh`: A function to retry the operation that caused the error.\n */\nexport const useResourceErrors = () => useErrorContext().errors;\n","//\n// sync.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 { Awaitable } from '@o2ter/utils-js';\nimport { _useEffect } from '../reconciler/hooks';\nimport { reconciler } from '../reconciler/state';\n\n/**\n * A hook utility for synchronizing with an external store.\n *\n * @template Snapshot - The type of the snapshot returned by the store.\n * @param subscribe - A function that sets up a subscription to the external store.\n * - `onStoreChange`: A callback to invoke when the store changes.\n * - `signal`: An `AbortSignal` to handle cleanup when the subscription is no longer needed.\n * - Returns an optional cleanup function or a promise resolving to one.\n * @param getSnapshot - A function that retrieves the current snapshot of the store.\n * @param getServerSnapshot - (Optional) A function that retrieves the snapshot of the store\n * in a server environment.\n * @returns The current snapshot of the store.\n *\n * @throws Will throw an error if used outside of a valid render context.\n */\nexport const useSyncExternalStore = <Snapshot>(\n subscribe: (\n onStoreChange: () => void,\n signal: AbortSignal,\n ) => Awaitable<void | (() => Awaitable<void>)>,\n getSnapshot: () => Snapshot,\n getServerSnapshot?: () => Snapshot,\n) => {\n const state = reconciler.currentHookState;\n if (!state) throw Error('useSyncExternalStore must be used within a render function.');\n _useEffect('useSyncExternalStore', ({ node }) => {\n const abort = new AbortController();\n try {\n const destructor = subscribe(() => { node?._setDirty(); }, abort.signal);\n return () => {\n abort.abort();\n (async () => {\n try {\n const _destructor = await destructor;\n if (_.isFunction(_destructor)) _destructor();\n } catch (e) {\n console.error(e);\n }\n })();\n };\n } catch (e) {\n console.error(e);\n return () => abort.abort();\n }\n }, null);\n if (getServerSnapshot && state.renderer._server) {\n return getServerSnapshot();\n }\n return getSnapshot();\n};"],"names":["state","reconciler","equalDeps","createContext","_jsx","useContext"],"mappings":";;;;;;AAAA;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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;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as Ref } from './common-
|
|
1
|
+
import { b as Ref } from './common-BYsSVxNk.mjs';
|
|
2
2
|
|
|
3
3
|
declare const mergeRefs: <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => void;
|
|
4
4
|
declare const uniqueId: () => string;
|
|
5
5
|
|
|
6
6
|
export { mergeRefs as m, uniqueId as u };
|
|
7
|
-
//# sourceMappingURL=utils-
|
|
7
|
+
//# sourceMappingURL=utils-C_f_laIp.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-C_f_laIp.d.mts","sources":["../../src/core/utils.ts"],"sourcesContent":["//\n// utils.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 { Ref } from './types/common';\n\nexport const mergeRefs = <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => {\n for (const ref of refs) {\n if (_.isNil(ref)) continue;\n else if (typeof ref === 'function') ref(x);\n else if (typeof ref === 'object') ref.current = x;\n else {\n console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref ${ref}`);\n }\n }\n}\n\nlet counter = 0;\n\nexport const uniqueId = () => `${Date.now().toString(36)}${(counter++).toString(36)}${Math.random().toString(36).slice(2)}`;\n"],"names":[],"mappings":";;AACO,cAAA,SAAA,gBAAA,GAAA;AACA,cAAA,QAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as Ref } from './common-
|
|
1
|
+
import { b as Ref } from './common-BYsSVxNk.js';
|
|
2
2
|
|
|
3
3
|
declare const mergeRefs: <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => void;
|
|
4
4
|
declare const uniqueId: () => string;
|
|
5
5
|
|
|
6
6
|
export { mergeRefs as m, uniqueId as u };
|
|
7
|
-
//# sourceMappingURL=utils-
|
|
7
|
+
//# sourceMappingURL=utils-QOsIvm19.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-QOsIvm19.d.ts","sources":["../../src/core/utils.ts"],"sourcesContent":["//\n// utils.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 { Ref } from './types/common';\n\nexport const mergeRefs = <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => {\n for (const ref of refs) {\n if (_.isNil(ref)) continue;\n else if (typeof ref === 'function') ref(x);\n else if (typeof ref === 'object') ref.current = x;\n else {\n console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref ${ref}`);\n }\n }\n}\n\nlet counter = 0;\n\nexport const uniqueId = () => `${Date.now().toString(36)}${(counter++).toString(36)}${Math.random().toString(36).slice(2)}`;\n"],"names":[],"mappings":";;AACO,cAAA,SAAA,gBAAA,GAAA;AACA,cAAA,QAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _ElementType, c as PropsType, C as ComponentNode } from './internals/common-
|
|
1
|
+
import { _ as _ElementType, c as PropsType, C as ComponentNode } from './internals/common-BYsSVxNk.mjs';
|
|
2
2
|
export { JSX, jsx, jsxs } from './jsx-runtime.mjs';
|
|
3
|
-
export { F as Fragment } from './internals/fragment-
|
|
3
|
+
export { F as Fragment } from './internals/fragment-B-zrdJZ8.mjs';
|
|
4
4
|
import '@o2ter/utils-js';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'csstype';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _ElementType, c as PropsType, C as ComponentNode } from './internals/common-
|
|
1
|
+
import { _ as _ElementType, c as PropsType, C as ComponentNode } from './internals/common-BYsSVxNk.js';
|
|
2
2
|
export { JSX, jsx, jsxs } from './jsx-runtime.js';
|
|
3
|
-
export { F as Fragment } from './internals/fragment-
|
|
3
|
+
export { F as Fragment } from './internals/fragment-CRbC1VFN.js';
|
|
4
4
|
import '@o2ter/utils-js';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'csstype';
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as _IntrinsicElements, o as _IntrinsicAttributes, _ as _ElementType, C as ComponentNode, c as PropsType } from './internals/common-
|
|
2
|
-
export { F as Fragment } from './internals/fragment-
|
|
1
|
+
import { n as _IntrinsicElements, o as _IntrinsicAttributes, _ as _ElementType, C as ComponentNode, c as PropsType } from './internals/common-BYsSVxNk.mjs';
|
|
2
|
+
export { F as Fragment } from './internals/fragment-B-zrdJZ8.mjs';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'lodash';
|
|
5
5
|
import 'csstype';
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as _IntrinsicElements, o as _IntrinsicAttributes, _ as _ElementType, C as ComponentNode, c as PropsType } from './internals/common-
|
|
2
|
-
export { F as Fragment } from './internals/fragment-
|
|
1
|
+
import { n as _IntrinsicElements, o as _IntrinsicAttributes, _ as _ElementType, C as ComponentNode, c as PropsType } from './internals/common-BYsSVxNk.js';
|
|
2
|
+
export { F as Fragment } from './internals/fragment-CRbC1VFN.js';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'lodash';
|
|
5
5
|
import 'csstype';
|
package/dist/server-dom.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export * from 'jsdom';
|
|
3
|
-
import { _ as _DOMRenderer } from './internals/renderer-
|
|
4
|
-
import './internals/common-
|
|
3
|
+
import { _ as _DOMRenderer } from './internals/renderer-BtOijeDS.mjs';
|
|
4
|
+
import './internals/common-BYsSVxNk.mjs';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'lodash';
|
|
7
7
|
import 'csstype';
|
|
8
|
-
import './internals/renderer-
|
|
8
|
+
import './internals/renderer-eYwU4exf.mjs';
|
|
9
9
|
|
|
10
10
|
declare class ServerDOMRenderer extends _DOMRenderer {
|
|
11
11
|
constructor(dom?: JSDOM);
|
package/dist/server-dom.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export * from 'jsdom';
|
|
3
|
-
import { _ as _DOMRenderer } from './internals/renderer-
|
|
4
|
-
import './internals/common-
|
|
3
|
+
import { _ as _DOMRenderer } from './internals/renderer-DVEtzh7O.js';
|
|
4
|
+
import './internals/common-BYsSVxNk.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'lodash';
|
|
7
7
|
import 'csstype';
|
|
8
|
-
import './internals/renderer-
|
|
8
|
+
import './internals/renderer-DlRiag_W.js';
|
|
9
9
|
|
|
10
10
|
declare class ServerDOMRenderer extends _DOMRenderer {
|
|
11
11
|
constructor(dom?: JSDOM);
|
package/dist/server-dom.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsdom = require('jsdom');
|
|
4
|
-
var renderer = require('./internals/renderer-
|
|
4
|
+
var renderer = require('./internals/renderer-BJyESI8-.js');
|
|
5
5
|
require('lodash');
|
|
6
6
|
require('myers.js');
|
|
7
|
-
require('./internals/renderer-
|
|
8
|
-
require('./internals/state-
|
|
7
|
+
require('./internals/renderer-DK5OzE35.js');
|
|
8
|
+
require('./internals/state-BcId1rQb.js');
|
|
9
9
|
require('./internals/runtime-57ivQprw.js');
|
|
10
10
|
require('nextick');
|
|
11
11
|
require('postcss');
|
package/dist/server-dom.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSDOM } from 'jsdom';
|
|
2
2
|
export * from 'jsdom';
|
|
3
|
-
import { _ as _DOMRenderer } from './internals/renderer-
|
|
3
|
+
import { _ as _DOMRenderer } from './internals/renderer-CJA6vv86.mjs';
|
|
4
4
|
import 'lodash';
|
|
5
5
|
import 'myers.js';
|
|
6
|
-
import './internals/renderer-
|
|
7
|
-
import './internals/state-
|
|
6
|
+
import './internals/renderer-D7YbtgQX.mjs';
|
|
7
|
+
import './internals/state-DQ2OKak8.mjs';
|
|
8
8
|
import './internals/runtime-Dp4_akLf.mjs';
|
|
9
9
|
import 'nextick';
|
|
10
10
|
import 'postcss';
|
package/dist/web.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { S as SetStateAction, R as RefObject } from './internals/common-
|
|
1
|
+
import { S as SetStateAction, R as RefObject } from './internals/common-BYsSVxNk.mjs';
|
|
2
2
|
import * as jsdom from 'jsdom';
|
|
3
|
-
export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/renderer-
|
|
3
|
+
export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/renderer-BtOijeDS.mjs';
|
|
4
4
|
import '@o2ter/utils-js';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'csstype';
|
|
7
|
-
import './internals/renderer-
|
|
7
|
+
import './internals/renderer-eYwU4exf.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Hook to access the current document object in a web renderer.
|
package/dist/web.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { S as SetStateAction, R as RefObject } from './internals/common-
|
|
1
|
+
import { S as SetStateAction, R as RefObject } from './internals/common-BYsSVxNk.js';
|
|
2
2
|
import * as jsdom from 'jsdom';
|
|
3
|
-
export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/renderer-
|
|
3
|
+
export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/renderer-DVEtzh7O.js';
|
|
4
4
|
import '@o2ter/utils-js';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'csstype';
|
|
7
|
-
import './internals/renderer-
|
|
7
|
+
import './internals/renderer-DlRiag_W.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Hook to access the current document object in a web renderer.
|
package/dist/web.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var state = require('./internals/state-
|
|
4
|
-
var renderer = require('./internals/renderer-
|
|
3
|
+
var state = require('./internals/state-BcId1rQb.js');
|
|
4
|
+
var renderer = require('./internals/renderer-BJyESI8-.js');
|
|
5
5
|
var _ = require('lodash');
|
|
6
6
|
require('myers.js');
|
|
7
|
-
var sync = require('./internals/sync-
|
|
7
|
+
var sync = require('./internals/sync-bgrX6wfp.js');
|
|
8
8
|
require('nextick');
|
|
9
9
|
require('postcss');
|
|
10
10
|
require('postcss-js');
|
|
11
11
|
require('postcss-nested');
|
|
12
12
|
require('./internals/runtime-57ivQprw.js');
|
|
13
|
-
require('./internals/renderer-
|
|
13
|
+
require('./internals/renderer-DK5OzE35.js');
|
|
14
14
|
require('./jsx-runtime.js');
|
|
15
15
|
|
|
16
16
|
//
|
package/dist/web.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { r as reconciler, u as uniqueId, d as EventEmitter } from './internals/state-
|
|
2
|
-
import { _ as _DOMRenderer } from './internals/renderer-
|
|
3
|
-
export { D as DOMNativeNode } from './internals/renderer-
|
|
1
|
+
import { r as reconciler, u as uniqueId, d as EventEmitter } from './internals/state-DQ2OKak8.mjs';
|
|
2
|
+
import { _ as _DOMRenderer } from './internals/renderer-CJA6vv86.mjs';
|
|
3
|
+
export { D as DOMNativeNode } from './internals/renderer-CJA6vv86.mjs';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import 'myers.js';
|
|
6
|
-
import { g as useRendererStorage, d as useSyncExternalStore, f as useMemo, b as useCallback, a as useEffect } from './internals/sync-
|
|
6
|
+
import { g as useRendererStorage, d as useSyncExternalStore, f as useMemo, b as useCallback, a as useEffect } from './internals/sync-UIYH-wdf.mjs';
|
|
7
7
|
import 'nextick';
|
|
8
8
|
import 'postcss';
|
|
9
9
|
import 'postcss-js';
|
|
10
10
|
import 'postcss-nested';
|
|
11
11
|
import './internals/runtime-Dp4_akLf.mjs';
|
|
12
|
-
import './internals/renderer-
|
|
12
|
+
import './internals/renderer-D7YbtgQX.mjs';
|
|
13
13
|
import './jsx-runtime.mjs';
|
|
14
14
|
|
|
15
15
|
//
|
package/package.json
CHANGED
|
@@ -1762,20 +1762,20 @@ big.js@^5.2.2:
|
|
|
1762
1762
|
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
|
|
1763
1763
|
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==
|
|
1764
1764
|
|
|
1765
|
-
body-parser@^2.2.
|
|
1766
|
-
version "2.2.
|
|
1767
|
-
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-2.2.
|
|
1768
|
-
integrity sha512-
|
|
1765
|
+
body-parser@^2.2.1:
|
|
1766
|
+
version "2.2.1"
|
|
1767
|
+
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-2.2.1.tgz#6df606b0eb0a6e3f783dde91dde182c24c82438c"
|
|
1768
|
+
integrity sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==
|
|
1769
1769
|
dependencies:
|
|
1770
1770
|
bytes "^3.1.2"
|
|
1771
1771
|
content-type "^1.0.5"
|
|
1772
|
-
debug "^4.4.
|
|
1772
|
+
debug "^4.4.3"
|
|
1773
1773
|
http-errors "^2.0.0"
|
|
1774
|
-
iconv-lite "^0.
|
|
1774
|
+
iconv-lite "^0.7.0"
|
|
1775
1775
|
on-finished "^2.4.1"
|
|
1776
1776
|
qs "^6.14.0"
|
|
1777
|
-
raw-body "^3.0.
|
|
1778
|
-
type-is "^2.0.
|
|
1777
|
+
raw-body "^3.0.1"
|
|
1778
|
+
type-is "^2.0.1"
|
|
1779
1779
|
|
|
1780
1780
|
brace-expansion@^1.1.7:
|
|
1781
1781
|
version "1.1.12"
|
|
@@ -1822,7 +1822,7 @@ bufferutil@^4.0.9:
|
|
|
1822
1822
|
dependencies:
|
|
1823
1823
|
node-gyp-build "^4.3.0"
|
|
1824
1824
|
|
|
1825
|
-
bytes@3.1.2, bytes@^3.1.2:
|
|
1825
|
+
bytes@3.1.2, bytes@^3.1.2, bytes@~3.1.2:
|
|
1826
1826
|
version "3.1.2"
|
|
1827
1827
|
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5"
|
|
1828
1828
|
integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==
|
|
@@ -2058,7 +2058,7 @@ debug@2.6.9:
|
|
|
2058
2058
|
dependencies:
|
|
2059
2059
|
ms "2.0.0"
|
|
2060
2060
|
|
|
2061
|
-
debug@^4.1.0, debug@^4.3.1, debug@^4.3.5, debug@^4.4.0, debug@^4.4.1:
|
|
2061
|
+
debug@^4.1.0, debug@^4.3.1, debug@^4.3.5, debug@^4.4.0, debug@^4.4.1, debug@^4.4.3:
|
|
2062
2062
|
version "4.4.3"
|
|
2063
2063
|
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a"
|
|
2064
2064
|
integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==
|
|
@@ -2260,17 +2260,18 @@ express-rate-limit@^8.0.1:
|
|
|
2260
2260
|
ip-address "10.0.1"
|
|
2261
2261
|
|
|
2262
2262
|
express@^5.1.0:
|
|
2263
|
-
version "5.1
|
|
2264
|
-
resolved "https://registry.yarnpkg.com/express/-/express-5.1.
|
|
2265
|
-
integrity sha512-
|
|
2263
|
+
version "5.2.1"
|
|
2264
|
+
resolved "https://registry.yarnpkg.com/express/-/express-5.2.1.tgz#8f21d15b6d327f92b4794ecf8cb08a72f956ac04"
|
|
2265
|
+
integrity sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==
|
|
2266
2266
|
dependencies:
|
|
2267
2267
|
accepts "^2.0.0"
|
|
2268
|
-
body-parser "^2.2.
|
|
2268
|
+
body-parser "^2.2.1"
|
|
2269
2269
|
content-disposition "^1.0.0"
|
|
2270
2270
|
content-type "^1.0.5"
|
|
2271
2271
|
cookie "^0.7.1"
|
|
2272
2272
|
cookie-signature "^1.2.1"
|
|
2273
2273
|
debug "^4.4.0"
|
|
2274
|
+
depd "^2.0.0"
|
|
2274
2275
|
encodeurl "^2.0.0"
|
|
2275
2276
|
escape-html "^1.0.3"
|
|
2276
2277
|
etag "^1.8.1"
|
|
@@ -2470,7 +2471,7 @@ hasown@^2.0.2:
|
|
|
2470
2471
|
dependencies:
|
|
2471
2472
|
function-bind "^1.1.2"
|
|
2472
2473
|
|
|
2473
|
-
http-errors
|
|
2474
|
+
http-errors@^2.0.0:
|
|
2474
2475
|
version "2.0.0"
|
|
2475
2476
|
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3"
|
|
2476
2477
|
integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==
|
|
@@ -2481,20 +2482,24 @@ http-errors@2.0.0, http-errors@^2.0.0:
|
|
|
2481
2482
|
statuses "2.0.1"
|
|
2482
2483
|
toidentifier "1.0.1"
|
|
2483
2484
|
|
|
2484
|
-
|
|
2485
|
+
http-errors@~2.0.1:
|
|
2486
|
+
version "2.0.1"
|
|
2487
|
+
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.1.tgz#36d2f65bc909c8790018dd36fb4d93da6caae06b"
|
|
2488
|
+
integrity sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==
|
|
2489
|
+
dependencies:
|
|
2490
|
+
depd "~2.0.0"
|
|
2491
|
+
inherits "~2.0.4"
|
|
2492
|
+
setprototypeof "~1.2.0"
|
|
2493
|
+
statuses "~2.0.2"
|
|
2494
|
+
toidentifier "~1.0.1"
|
|
2495
|
+
|
|
2496
|
+
iconv-lite@^0.7.0, iconv-lite@~0.7.0:
|
|
2485
2497
|
version "0.7.0"
|
|
2486
2498
|
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.0.tgz#c50cd80e6746ca8115eb98743afa81aa0e147a3e"
|
|
2487
2499
|
integrity sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==
|
|
2488
2500
|
dependencies:
|
|
2489
2501
|
safer-buffer ">= 2.1.2 < 3.0.0"
|
|
2490
2502
|
|
|
2491
|
-
iconv-lite@^0.6.3:
|
|
2492
|
-
version "0.6.3"
|
|
2493
|
-
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
|
|
2494
|
-
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
|
|
2495
|
-
dependencies:
|
|
2496
|
-
safer-buffer ">= 2.1.2 < 3.0.0"
|
|
2497
|
-
|
|
2498
2503
|
icss-utils@^5.0.0, icss-utils@^5.1.0:
|
|
2499
2504
|
version "5.1.0"
|
|
2500
2505
|
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"
|
|
@@ -2534,7 +2539,7 @@ inflight@^1.0.4:
|
|
|
2534
2539
|
once "^1.3.0"
|
|
2535
2540
|
wrappy "1"
|
|
2536
2541
|
|
|
2537
|
-
inherits@2, inherits@2.0.4:
|
|
2542
|
+
inherits@2, inherits@2.0.4, inherits@~2.0.4:
|
|
2538
2543
|
version "2.0.4"
|
|
2539
2544
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
|
2540
2545
|
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
|
@@ -3177,15 +3182,15 @@ range-parser@^1.2.1:
|
|
|
3177
3182
|
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
|
|
3178
3183
|
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
|
|
3179
3184
|
|
|
3180
|
-
raw-body@^3.0.
|
|
3181
|
-
version "3.0.
|
|
3182
|
-
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-3.0.
|
|
3183
|
-
integrity sha512-
|
|
3185
|
+
raw-body@^3.0.1:
|
|
3186
|
+
version "3.0.2"
|
|
3187
|
+
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-3.0.2.tgz#3e3ada5ae5568f9095d84376fd3a49b8fb000a51"
|
|
3188
|
+
integrity sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==
|
|
3184
3189
|
dependencies:
|
|
3185
|
-
bytes "3.1.2"
|
|
3186
|
-
http-errors "2.0.
|
|
3187
|
-
iconv-lite "0.7.0"
|
|
3188
|
-
unpipe "1.0.0"
|
|
3190
|
+
bytes "~3.1.2"
|
|
3191
|
+
http-errors "~2.0.1"
|
|
3192
|
+
iconv-lite "~0.7.0"
|
|
3193
|
+
unpipe "~1.0.0"
|
|
3189
3194
|
|
|
3190
3195
|
readdirp@^4.0.1:
|
|
3191
3196
|
version "4.1.2"
|
|
@@ -3378,7 +3383,7 @@ serve-static@^2.2.0:
|
|
|
3378
3383
|
parseurl "^1.3.3"
|
|
3379
3384
|
send "^1.2.0"
|
|
3380
3385
|
|
|
3381
|
-
setprototypeof@1.2.0:
|
|
3386
|
+
setprototypeof@1.2.0, setprototypeof@~1.2.0:
|
|
3382
3387
|
version "1.2.0"
|
|
3383
3388
|
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
|
|
3384
3389
|
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
|
|
@@ -3509,7 +3514,7 @@ statuses@2.0.1:
|
|
|
3509
3514
|
resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
|
|
3510
3515
|
integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==
|
|
3511
3516
|
|
|
3512
|
-
statuses@^2.0.1:
|
|
3517
|
+
statuses@^2.0.1, statuses@~2.0.2:
|
|
3513
3518
|
version "2.0.2"
|
|
3514
3519
|
resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382"
|
|
3515
3520
|
integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==
|
|
@@ -3580,7 +3585,7 @@ to-regex-range@^5.0.1:
|
|
|
3580
3585
|
dependencies:
|
|
3581
3586
|
is-number "^7.0.0"
|
|
3582
3587
|
|
|
3583
|
-
toidentifier@1.0.1:
|
|
3588
|
+
toidentifier@1.0.1, toidentifier@~1.0.1:
|
|
3584
3589
|
version "1.0.1"
|
|
3585
3590
|
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
|
|
3586
3591
|
integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
|
|
@@ -3590,7 +3595,7 @@ tsscmp@1.0.6:
|
|
|
3590
3595
|
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
|
|
3591
3596
|
integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==
|
|
3592
3597
|
|
|
3593
|
-
type-is@^2.0.
|
|
3598
|
+
type-is@^2.0.1:
|
|
3594
3599
|
version "2.0.1"
|
|
3595
3600
|
resolved "https://registry.yarnpkg.com/type-is/-/type-is-2.0.1.tgz#64f6cf03f92fce4015c2b224793f6bdd4b068c97"
|
|
3596
3601
|
integrity sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==
|
|
@@ -3634,7 +3639,7 @@ unicode-property-aliases-ecmascript@^2.0.0:
|
|
|
3634
3639
|
resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz#301d4f8a43d2b75c97adfad87c9dd5350c9475d1"
|
|
3635
3640
|
integrity sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==
|
|
3636
3641
|
|
|
3637
|
-
unpipe
|
|
3642
|
+
unpipe@~1.0.0:
|
|
3638
3643
|
version "1.0.0"
|
|
3639
3644
|
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
|
|
3640
3645
|
integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==
|