@cyclone-ui/state 0.0.12 → 0.0.14
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/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/dist/base/atoms/atom-with-broadcast.cjs +45 -1
- package/dist/base/atoms/atom-with-broadcast.mjs +45 -1
- package/dist/base/atoms/atom-with-broadcast.mjs.map +1 -1
- package/dist/base/atoms/atom-with-compare.cjs +12 -1
- package/dist/base/atoms/atom-with-compare.mjs +12 -1
- package/dist/base/atoms/atom-with-compare.mjs.map +1 -1
- package/dist/base/atoms/atom-with-debounce.cjs +52 -1
- package/dist/base/atoms/atom-with-debounce.mjs +52 -1
- package/dist/base/atoms/atom-with-debounce.mjs.map +1 -1
- package/dist/base/atoms/atom-with-effect.cjs +123 -1
- package/dist/base/atoms/atom-with-effect.mjs +120 -1
- package/dist/base/atoms/atom-with-effect.mjs.map +1 -1
- package/dist/base/atoms/atom-with-listeners.cjs +36 -1
- package/dist/base/atoms/atom-with-listeners.mjs +36 -1
- package/dist/base/atoms/atom-with-listeners.mjs.map +1 -1
- package/dist/base/atoms/atom-with-pending.cjs +14 -1
- package/dist/base/atoms/atom-with-pending.mjs +14 -1
- package/dist/base/atoms/atom-with-pending.mjs.map +1 -1
- package/dist/base/atoms/atom-with-refresh-and-default.cjs +19 -1
- package/dist/base/atoms/atom-with-refresh-and-default.mjs +19 -1
- package/dist/base/atoms/atom-with-refresh-and-default.mjs.map +1 -1
- package/dist/base/atoms/atom-with-refresh.cjs +13 -1
- package/dist/base/atoms/atom-with-refresh.mjs +13 -1
- package/dist/base/atoms/atom-with-refresh.mjs.map +1 -1
- package/dist/base/atoms/atom-with-toggle.cjs +13 -1
- package/dist/base/atoms/atom-with-toggle.mjs +13 -1
- package/dist/base/atoms/atom-with-toggle.mjs.map +1 -1
- package/dist/base/atoms/atom-with-web-storage.cjs +48 -1
- package/dist/base/atoms/atom-with-web-storage.mjs +47 -1
- package/dist/base/atoms/atom-with-web-storage.mjs.map +1 -1
- package/dist/base/atoms/atom-with-wrapper.cjs +25 -1
- package/dist/base/atoms/atom-with-wrapper.mjs +25 -1
- package/dist/base/atoms/atom-with-wrapper.mjs.map +1 -1
- package/dist/base/atoms/base-atom.cjs +25 -1
- package/dist/base/atoms/base-atom.mjs +25 -1
- package/dist/base/atoms/base-atom.mjs.map +1 -1
- package/dist/base/atoms/index.cjs +24 -1
- package/dist/base/atoms/index.mjs +13 -1
- package/dist/base/hooks/index.cjs +9 -1
- package/dist/base/hooks/index.mjs +6 -1
- package/dist/base/hooks/use-atom-effect.cjs +17 -1
- package/dist/base/hooks/use-atom-effect.mjs +17 -1
- package/dist/base/hooks/use-atom-effect.mjs.map +1 -1
- package/dist/base/hooks/use-hydrate-molecule.cjs +17 -1
- package/dist/base/hooks/use-hydrate-molecule.mjs +17 -1
- package/dist/base/hooks/use-hydrate-molecule.mjs.map +1 -1
- package/dist/base/hooks/use-prepare-atoms.cjs +20 -1
- package/dist/base/hooks/use-prepare-atoms.mjs +20 -1
- package/dist/base/hooks/use-prepare-atoms.mjs.map +1 -1
- package/dist/base/hooks/use-sync-molecule.cjs +37 -1
- package/dist/base/hooks/use-sync-molecule.mjs +37 -1
- package/dist/base/hooks/use-sync-molecule.mjs.map +1 -1
- package/dist/base/index.cjs +47 -1
- package/dist/base/index.mjs +24 -1
- package/dist/base/utilities/create-molecule.cjs +105 -4
- package/dist/base/utilities/create-molecule.d.cts.map +1 -1
- package/dist/base/utilities/create-molecule.mjs +102 -4
- package/dist/base/utilities/create-molecule.mjs.map +1 -1
- package/dist/base/utilities/create-web-storage.cjs +55 -1
- package/dist/base/utilities/create-web-storage.mjs +55 -1
- package/dist/base/utilities/create-web-storage.mjs.map +1 -1
- package/dist/base/utilities/debounce.cjs +52 -1
- package/dist/base/utilities/debounce.mjs +52 -1
- package/dist/base/utilities/debounce.mjs.map +1 -1
- package/dist/base/utilities/index.cjs +13 -1
- package/dist/base/utilities/index.mjs +6 -1
- package/dist/base/utilities/is-atom.cjs +48 -1
- package/dist/base/utilities/is-atom.mjs +46 -1
- package/dist/base/utilities/is-atom.mjs.map +1 -1
- package/dist/base/utilities/set-atom-debug.cjs +24 -1
- package/dist/base/utilities/set-atom-debug.mjs +23 -1
- package/dist/base/utilities/set-atom-debug.mjs.map +1 -1
- package/dist/client/index.cjs +16 -1
- package/dist/client/index.mjs +8 -1
- package/dist/form/atoms/atom-with-field.cjs +23 -1
- package/dist/form/atoms/atom-with-field.mjs +23 -1
- package/dist/form/atoms/atom-with-field.mjs.map +1 -1
- package/dist/form/atoms/atom-with-messages.cjs +85 -1
- package/dist/form/atoms/atom-with-messages.mjs +78 -1
- package/dist/form/atoms/atom-with-messages.mjs.map +1 -1
- package/dist/form/hooks/index.cjs +7 -1
- package/dist/form/hooks/index.mjs +5 -1
- package/dist/form/hooks/use-field-actions.cjs +92 -1
- package/dist/form/hooks/use-field-actions.mjs +92 -1
- package/dist/form/hooks/use-field-actions.mjs.map +1 -1
- package/dist/form/hooks/use-field-ref.cjs +16 -1
- package/dist/form/hooks/use-field-ref.mjs +16 -1
- package/dist/form/hooks/use-field-ref.mjs.map +1 -1
- package/dist/form/hooks/use-form-actions.cjs +69 -1
- package/dist/form/hooks/use-form-actions.mjs +69 -1
- package/dist/form/hooks/use-form-actions.mjs.map +1 -1
- package/dist/form/index.cjs +30 -1
- package/dist/form/index.mjs +17 -1
- package/dist/form/molecules/field-molecule.cjs +154 -1
- package/dist/form/molecules/field-molecule.mjs +153 -1
- package/dist/form/molecules/field-molecule.mjs.map +1 -1
- package/dist/form/molecules/form-molecule.cjs +180 -1
- package/dist/form/molecules/form-molecule.mjs +179 -1
- package/dist/form/molecules/form-molecule.mjs.map +1 -1
- package/dist/form/molecules/index.cjs +7 -1
- package/dist/form/molecules/index.mjs +4 -1
- package/dist/form/providers/FieldProvider.cjs +103 -4
- package/dist/form/providers/FieldProvider.mjs +103 -4
- package/dist/form/providers/FieldProvider.mjs.map +1 -1
- package/dist/form/providers/FormProvider.cjs +66 -4
- package/dist/form/providers/FormProvider.d.cts.map +1 -1
- package/dist/form/providers/FormProvider.mjs +66 -4
- package/dist/form/providers/FormProvider.mjs.map +1 -1
- package/dist/form/providers/index.cjs +5 -1
- package/dist/form/providers/index.mjs +4 -1
- package/dist/form/types.cjs +13 -1
- package/dist/form/types.mjs +13 -1
- package/dist/form/types.mjs.map +1 -1
- package/dist/form/utilities/abort-error.cjs +15 -1
- package/dist/form/utilities/abort-error.mjs +15 -1
- package/dist/form/utilities/abort-error.mjs.map +1 -1
- package/dist/form/utilities/index.cjs +7 -1
- package/dist/form/utilities/index.mjs +5 -1
- package/dist/form/utilities/is-validation-results.cjs +9 -1
- package/dist/form/utilities/is-validation-results.mjs +9 -1
- package/dist/form/utilities/is-validation-results.mjs.map +1 -1
- package/dist/form/utilities/validators.cjs +8 -1
- package/dist/form/utilities/validators.mjs +8 -1
- package/dist/form/utilities/validators.mjs.map +1 -1
- package/dist/index.cjs +71 -1
- package/dist/index.mjs +34 -1
- package/dist/message/components/MessageViewport.cjs +21 -6
- package/dist/message/components/MessageViewport.mjs +21 -6
- package/dist/message/components/MessageViewport.mjs.map +1 -1
- package/dist/message/components/index.cjs +3 -1
- package/dist/message/components/index.mjs +3 -1
- package/dist/message/hooks/index.cjs +3 -1
- package/dist/message/hooks/index.mjs +3 -1
- package/dist/message/hooks/use-message-actions.cjs +63 -1
- package/dist/message/hooks/use-message-actions.mjs +63 -1
- package/dist/message/hooks/use-message-actions.mjs.map +1 -1
- package/dist/message/index.cjs +23 -1
- package/dist/message/index.mjs +8 -1
- package/dist/message/providers/MessageProvider.cjs +16 -1
- package/dist/message/providers/MessageProvider.mjs +16 -1
- package/dist/message/providers/MessageProvider.mjs.map +1 -1
- package/dist/theme/hooks/index.cjs +7 -1
- package/dist/theme/hooks/index.mjs +4 -1
- package/dist/theme/hooks/use-theme-actions.cjs +21 -1
- package/dist/theme/hooks/use-theme-actions.mjs +21 -1
- package/dist/theme/hooks/use-theme-actions.mjs.map +1 -1
- package/dist/theme/hooks/use-theme-store.cjs +61 -1
- package/dist/theme/hooks/use-theme-store.d.cts +2 -2
- package/dist/theme/hooks/use-theme-store.d.mts +2 -2
- package/dist/theme/hooks/use-theme-store.mjs +59 -1
- package/dist/theme/hooks/use-theme-store.mjs.map +1 -1
- package/dist/theme/index.cjs +17 -1
- package/dist/theme/index.mjs +9 -1
- package/dist/theme/molecules/index.cjs +3 -1
- package/dist/theme/molecules/index.mjs +3 -1
- package/dist/theme/molecules/theme-molecule.cjs +14 -1
- package/dist/theme/molecules/theme-molecule.mjs +14 -1
- package/dist/theme/molecules/theme-molecule.mjs.map +1 -1
- package/dist/theme/providers/ThemeProvider.cjs +30 -5
- package/dist/theme/providers/ThemeProvider.mjs +30 -5
- package/dist/theme/providers/ThemeProvider.mjs.map +1 -1
- package/dist/theme/utilities/theme-helpers.cjs +71 -1
- package/dist/theme/utilities/theme-helpers.mjs +70 -1
- package/dist/theme/utilities/theme-helpers.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
import{isAtom
|
|
1
|
+
import { isAtom } from "../utilities/is-atom.mjs";
|
|
2
|
+
import { isEqual } from "@stryke/helpers/is-equal";
|
|
3
|
+
import { useAtomValue, useSetAtom } from "jotai";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/base/hooks/use-sync-molecule.ts
|
|
7
|
+
/**
|
|
8
|
+
* Keep the previous reference while `value` is deeply equal to it, so callers
|
|
9
|
+
* passing a fresh object literal each render do not re-trigger effects.
|
|
10
|
+
*/
|
|
11
|
+
const useDeepStable = (value) => {
|
|
12
|
+
const ref = useRef(value);
|
|
13
|
+
if (!isEqual(ref.current, value)) ref.current = value;
|
|
14
|
+
return ref.current;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Update atoms with new values on changes.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Values are compared deeply, so a provider that re-renders with equivalent
|
|
21
|
+
* `initialState` does not write to its atoms again. Without this, two
|
|
22
|
+
* providers sharing a molecule scope overwrite each other on every render.
|
|
23
|
+
*/
|
|
24
|
+
const useSyncMolecule = (atoms, values, store) => {
|
|
25
|
+
for (const key of Object.keys(atoms)) {
|
|
26
|
+
let value = values[key];
|
|
27
|
+
if (isAtom(value)) value = useAtomValue(value);
|
|
28
|
+
value = useDeepStable(value);
|
|
29
|
+
const setAtom = useSetAtom(atoms[key], { store });
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (value !== void 0) setAtom(value);
|
|
32
|
+
}, [setAtom, value]);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { useSyncMolecule };
|
|
2
38
|
//# sourceMappingURL=use-sync-molecule.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-molecule.mjs","names":[
|
|
1
|
+
{"version":3,"file":"use-sync-molecule.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/base/index.cjs
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_set_atom_debug = require("./utilities/set-atom-debug.cjs");
|
|
2
|
+
const require_atom_with_broadcast = require("./atoms/atom-with-broadcast.cjs");
|
|
3
|
+
const require_atom_with_compare = require("./atoms/atom-with-compare.cjs");
|
|
4
|
+
const require_atom_with_wrapper = require("./atoms/atom-with-wrapper.cjs");
|
|
5
|
+
const require_atom_with_debounce = require("./atoms/atom-with-debounce.cjs");
|
|
6
|
+
const require_atom_with_effect = require("./atoms/atom-with-effect.cjs");
|
|
7
|
+
const require_atom_with_listeners = require("./atoms/atom-with-listeners.cjs");
|
|
8
|
+
const require_atom_with_pending = require("./atoms/atom-with-pending.cjs");
|
|
9
|
+
const require_atom_with_refresh = require("./atoms/atom-with-refresh.cjs");
|
|
10
|
+
const require_atom_with_refresh_and_default = require("./atoms/atom-with-refresh-and-default.cjs");
|
|
11
|
+
const require_atom_with_toggle = require("./atoms/atom-with-toggle.cjs");
|
|
12
|
+
const require_create_web_storage = require("./utilities/create-web-storage.cjs");
|
|
13
|
+
const require_atom_with_web_storage = require("./atoms/atom-with-web-storage.cjs");
|
|
14
|
+
require("./atoms/index.cjs");
|
|
15
|
+
const require_use_atom_effect = require("./hooks/use-atom-effect.cjs");
|
|
16
|
+
const require_use_hydrate_molecule = require("./hooks/use-hydrate-molecule.cjs");
|
|
17
|
+
const require_use_prepare_atoms = require("./hooks/use-prepare-atoms.cjs");
|
|
18
|
+
const require_use_sync_molecule = require("./hooks/use-sync-molecule.cjs");
|
|
19
|
+
require("./hooks/index.cjs");
|
|
20
|
+
const require_create_molecule = require("./utilities/create-molecule.cjs");
|
|
21
|
+
const require_debounce = require("./utilities/debounce.cjs");
|
|
22
|
+
require("./utilities/index.cjs");
|
|
23
|
+
|
|
24
|
+
exports.DEFAULT_SCOPE = require_create_molecule.DEFAULT_SCOPE;
|
|
25
|
+
exports.atomWithBroadcast = require_atom_with_broadcast.atomWithBroadcast;
|
|
26
|
+
exports.atomWithCompare = require_atom_with_compare.atomWithCompare;
|
|
27
|
+
exports.atomWithDebounce = require_atom_with_debounce.atomWithDebounce;
|
|
28
|
+
exports.atomWithEffect = require_atom_with_effect.atomWithEffect;
|
|
29
|
+
exports.atomWithListeners = require_atom_with_listeners.atomWithListeners;
|
|
30
|
+
exports.atomWithPending = require_atom_with_pending.atomWithPending;
|
|
31
|
+
exports.atomWithRefresh = require_atom_with_refresh.atomWithRefresh;
|
|
32
|
+
exports.atomWithRefreshAndDefault = require_atom_with_refresh_and_default.atomWithRefreshAndDefault;
|
|
33
|
+
exports.atomWithToggle = require_atom_with_toggle.atomWithToggle;
|
|
34
|
+
exports.atomWithWebStorage = require_atom_with_web_storage.atomWithWebStorage;
|
|
35
|
+
exports.atomWithWrapper = require_atom_with_wrapper.atomWithWrapper;
|
|
36
|
+
exports.createMoleculeApi = require_create_molecule.createMoleculeApi;
|
|
37
|
+
exports.createScope = require_create_molecule.createScope;
|
|
38
|
+
exports.createWebStorage = require_create_web_storage.createWebStorage;
|
|
39
|
+
exports.debounce = require_debounce.debounce;
|
|
40
|
+
exports.getWebStorage = require_atom_with_web_storage.getWebStorage;
|
|
41
|
+
exports.setAtomDebugLabel = require_set_atom_debug.setAtomDebugLabel;
|
|
42
|
+
exports.setAtomDebugPrivate = require_set_atom_debug.setAtomDebugPrivate;
|
|
43
|
+
exports.use = require_create_molecule.use;
|
|
44
|
+
exports.useAtomEffect = require_use_atom_effect.useAtomEffect;
|
|
45
|
+
exports.useHydrateMolecule = require_use_hydrate_molecule.useHydrateMolecule;
|
|
46
|
+
exports.usePrepareAtoms = require_use_prepare_atoms.usePrepareAtoms;
|
|
47
|
+
exports.useSyncMolecule = require_use_sync_molecule.useSyncMolecule;
|
package/dist/base/index.mjs
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
import{setAtomDebugLabel
|
|
1
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./utilities/set-atom-debug.mjs";
|
|
2
|
+
import { atomWithBroadcast } from "./atoms/atom-with-broadcast.mjs";
|
|
3
|
+
import { atomWithCompare } from "./atoms/atom-with-compare.mjs";
|
|
4
|
+
import { atomWithWrapper } from "./atoms/atom-with-wrapper.mjs";
|
|
5
|
+
import { atomWithDebounce } from "./atoms/atom-with-debounce.mjs";
|
|
6
|
+
import { atomWithEffect } from "./atoms/atom-with-effect.mjs";
|
|
7
|
+
import { atomWithListeners } from "./atoms/atom-with-listeners.mjs";
|
|
8
|
+
import { atomWithPending } from "./atoms/atom-with-pending.mjs";
|
|
9
|
+
import { atomWithRefresh } from "./atoms/atom-with-refresh.mjs";
|
|
10
|
+
import { atomWithRefreshAndDefault } from "./atoms/atom-with-refresh-and-default.mjs";
|
|
11
|
+
import { atomWithToggle } from "./atoms/atom-with-toggle.mjs";
|
|
12
|
+
import { createWebStorage } from "./utilities/create-web-storage.mjs";
|
|
13
|
+
import { atomWithWebStorage, getWebStorage } from "./atoms/atom-with-web-storage.mjs";
|
|
14
|
+
import "./atoms/index.mjs";
|
|
15
|
+
import { useAtomEffect } from "./hooks/use-atom-effect.mjs";
|
|
16
|
+
import { useHydrateMolecule } from "./hooks/use-hydrate-molecule.mjs";
|
|
17
|
+
import { usePrepareAtoms } from "./hooks/use-prepare-atoms.mjs";
|
|
18
|
+
import { useSyncMolecule } from "./hooks/use-sync-molecule.mjs";
|
|
19
|
+
import "./hooks/index.mjs";
|
|
20
|
+
import { DEFAULT_SCOPE, createMoleculeApi, createScope, use } from "./utilities/create-molecule.mjs";
|
|
21
|
+
import { debounce } from "./utilities/debounce.mjs";
|
|
22
|
+
import "./utilities/index.mjs";
|
|
23
|
+
|
|
24
|
+
export { DEFAULT_SCOPE, atomWithBroadcast, atomWithCompare, atomWithDebounce, atomWithEffect, atomWithListeners, atomWithPending, atomWithRefresh, atomWithRefreshAndDefault, atomWithToggle, atomWithWebStorage, atomWithWrapper, createMoleculeApi, createScope, createWebStorage, debounce, getWebStorage, setAtomDebugLabel, setAtomDebugPrivate, use, useAtomEffect, useHydrateMolecule, usePrepareAtoms, useSyncMolecule };
|
|
@@ -1,4 +1,105 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const require_is_atom = require("./is-atom.cjs");
|
|
2
|
+
const require_set_atom_debug = require("./set-atom-debug.cjs");
|
|
3
|
+
const require_use_hydrate_molecule = require("../hooks/use-hydrate-molecule.cjs");
|
|
4
|
+
const require_use_sync_molecule = require("../hooks/use-sync-molecule.cjs");
|
|
5
|
+
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
6
|
+
let jotai_utils = require("jotai/utils");
|
|
7
|
+
let jotai = require("jotai");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
10
|
+
let bunshi = require("bunshi");
|
|
11
|
+
let Bunshi_react = require("bunshi/react");
|
|
12
|
+
|
|
13
|
+
//#region src/base/utilities/create-molecule.tsx
|
|
14
|
+
const DEFAULT_SCOPE = "__global__";
|
|
15
|
+
/**
|
|
16
|
+
* Create a new Scope with the given default value.
|
|
17
|
+
*
|
|
18
|
+
* @param defaultValue - The default value for the Scope.
|
|
19
|
+
* @param options - The options for the Scope.
|
|
20
|
+
* @returns The new Scope.
|
|
21
|
+
*/
|
|
22
|
+
function createScope(defaultValue = DEFAULT_SCOPE, options) {
|
|
23
|
+
return (0, bunshi.createScope)(defaultValue, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Use a Molecule or Scope in a molecule definition.
|
|
27
|
+
*
|
|
28
|
+
* @param dependency - The Molecule or Scope to use.
|
|
29
|
+
* @returns The value of the Molecule or Scope.
|
|
30
|
+
*/
|
|
31
|
+
function use(dependency) {
|
|
32
|
+
return (0, bunshi.use)(dependency);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a new Molecule with the given constructor function.
|
|
36
|
+
*
|
|
37
|
+
* @param constructFn - The constructor function for the Molecule.
|
|
38
|
+
* @param options - The options for the Molecule.
|
|
39
|
+
* @returns The new Molecule.
|
|
40
|
+
*/
|
|
41
|
+
function createMoleculeApi(constructFn, options) {
|
|
42
|
+
const Scope = !options.scope || (0, _stryke_type_checks_is_string.isString)(options.scope) ? createScope(options.scope ?? "__global__") : options.scope;
|
|
43
|
+
const Molecule = (0, bunshi.molecule)((mol, scope) => {
|
|
44
|
+
const currentScope = scope(Scope);
|
|
45
|
+
const result = constructFn(currentScope);
|
|
46
|
+
result.__scope = (0, jotai.atom)(() => currentScope);
|
|
47
|
+
result.__typename = (0, jotai.atom)(() => options.type);
|
|
48
|
+
for (const key of Object.keys(result)) if (require_is_atom.isAtom(result[key])) require_set_atom_debug.setAtomDebugLabel(result[key], `${options.type}/${currentScope}:${String(key)}`);
|
|
49
|
+
(0, bunshi.onMount)(() => {
|
|
50
|
+
if (options.onMount) {
|
|
51
|
+
const unmount = options.onMount(result);
|
|
52
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(unmount)) return unmount;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
(0, bunshi.onUnmount)(() => {
|
|
56
|
+
if (options.onUnmount) options.onUnmount();
|
|
57
|
+
});
|
|
58
|
+
return result;
|
|
59
|
+
});
|
|
60
|
+
const useMolecule = (opts) => (0, Bunshi_react.useMolecule)(Molecule, opts);
|
|
61
|
+
const use = (opts) => {
|
|
62
|
+
const atoms = useMolecule(opts);
|
|
63
|
+
const keys = Object.keys(atoms);
|
|
64
|
+
return new Proxy({}, { get(_, proxyKey) {
|
|
65
|
+
if (keys.filter((k) => k !== "__scope" && k !== "__typename").includes(proxyKey)) {
|
|
66
|
+
const key = proxyKey;
|
|
67
|
+
return {
|
|
68
|
+
get: () => (0, jotai.useAtomValue)(atoms[key]),
|
|
69
|
+
set: require_is_atom.isWritableAtom(atoms[key]) ? () => (0, jotai.useSetAtom)(atoms[key]) : void 0,
|
|
70
|
+
reset: require_is_atom.isResetAtom(atoms[key]) ? () => {
|
|
71
|
+
const setAtom = (0, jotai.useSetAtom)(atoms[key]);
|
|
72
|
+
return (0, react.useCallback)(() => {
|
|
73
|
+
setAtom(jotai_utils.RESET);
|
|
74
|
+
}, [setAtom]);
|
|
75
|
+
} : void 0
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
} });
|
|
79
|
+
};
|
|
80
|
+
function MoleculeStateManager({ initialState }) {
|
|
81
|
+
const atoms = useMolecule();
|
|
82
|
+
require_use_hydrate_molecule.useHydrateMolecule(atoms, Object.fromEntries(Object.entries(initialState).filter(([, value]) => !require_is_atom.isAtom(value))));
|
|
83
|
+
require_use_sync_molecule.useSyncMolecule(atoms, initialState);
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
function Provider({ children, scope, initialState, ...props }) {
|
|
87
|
+
return <Bunshi_react.ScopeProvider {...props} scope={Scope} value={scope}>
|
|
88
|
+
{initialState && <MoleculeStateManager initialState={initialState} />}
|
|
89
|
+
{children}
|
|
90
|
+
</Bunshi_react.ScopeProvider>;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
Scope,
|
|
94
|
+
Provider,
|
|
95
|
+
Molecule,
|
|
96
|
+
useMolecule,
|
|
97
|
+
use
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
exports.DEFAULT_SCOPE = DEFAULT_SCOPE;
|
|
103
|
+
exports.createMoleculeApi = createMoleculeApi;
|
|
104
|
+
exports.createScope = createScope;
|
|
105
|
+
exports.use = use;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-molecule.d.cts","names":["MoleculeScopeOptions","MoleculeScopeOptionsBase"],"sources":["../../../src/base/utilities/create-molecule.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"create-molecule.d.cts","names":["MoleculeScopeOptions","MoleculeScopeOptionsBase"],"sources":["../../../src/base/utilities/create-molecule.tsx"],"mappings":";;;;;KAqDY,SAAS;EACnB;IACE;KAEQ,oBAAoB;EAC9B;EACA;;KAGU,cACV,eAAe,qBAAqB,UAAU,wBAC5C,oBAAoB;cAEX;;;;;;;;iBASG,YACd,uBACA;EACE;IACD;;;;;;;iBAWa,IAAI,QAClB,YAAY,SAAS,UAAU,cAAc,UAC5C;KAIE,iBACH,eAAe,qBAAqB,UAAU,2BAE7C,cAAc;EACb,KAAK,OAAO,cAAc,WAAW,WAChC,OAAOA,2BAAyB;EAErC,KAAK,OAAO,cAAc,mBAClB,eACA,aACA,YAEH,OAAOA,+BAA6B,MAAM,UAAU;EAEzD,OAAO,YAAY,OAAO,uBACrB,OAAOA;;KAKJA,yBAAuBC;UAElB,YACf,eAAe,qBAAqB,UAAU;EAE9C,UAAU,SAAS,cAAc;EACjC,UAAU,MAAM,GAAG,sBAAsB;EACzC,OAAO;EACP,cAAc,OAAOD,2BAAyB,cAAc;EAC5D,MAAM,OAAOA,2BAAyB,iBAAiB;;KAG7C,iBAAiB,qBAAqB,oBAChD,WAAW;KAED,sBACV,eAAe,qBAAqB,UAAU,wBAC5C,KAAK;EACP;EACA,eAAe,QAAQ,wBAAwB;;KAGrC;KACA,cACV,eAAe,qBAAqB,UAAU,yBAC3C,OAAO,cAAc,YAAY;UAErB,gBACf,eAAe,qBAAqB,UAAU;EAE9C;EACA,QAAQ;EACR,UAAU,cAAc;EACxB,YAAY;;;;;;;;;iBAUE,kBACd,eAAe,qBAAqB,UAAU,sBAE9C,cAAc,kBAAkB,QAChC,SAAS,gBAAgB,UACxB,YAAY"}
|
|
@@ -1,5 +1,103 @@
|
|
|
1
|
-
import{isAtom
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { isAtom, isResetAtom, isWritableAtom } from "./is-atom.mjs";
|
|
2
|
+
import { setAtomDebugLabel } from "./set-atom-debug.mjs";
|
|
3
|
+
import { useHydrateMolecule } from "../hooks/use-hydrate-molecule.mjs";
|
|
4
|
+
import { useSyncMolecule } from "../hooks/use-sync-molecule.mjs";
|
|
5
|
+
import { isFunction } from "@stryke/type-checks/is-function";
|
|
6
|
+
import { RESET } from "jotai/utils";
|
|
7
|
+
import { atom, useAtomValue, useSetAtom } from "jotai";
|
|
8
|
+
import { useCallback } from "react";
|
|
9
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
10
|
+
import { createScope, molecule, onMount, onUnmount, use } from "bunshi";
|
|
11
|
+
import { ScopeProvider, useMolecule } from "bunshi/react";
|
|
12
|
+
|
|
13
|
+
//#region src/base/utilities/create-molecule.tsx
|
|
14
|
+
const DEFAULT_SCOPE = "__global__";
|
|
15
|
+
/**
|
|
16
|
+
* Create a new Scope with the given default value.
|
|
17
|
+
*
|
|
18
|
+
* @param defaultValue - The default value for the Scope.
|
|
19
|
+
* @param options - The options for the Scope.
|
|
20
|
+
* @returns The new Scope.
|
|
21
|
+
*/
|
|
22
|
+
function createScope$1(defaultValue = DEFAULT_SCOPE, options) {
|
|
23
|
+
return createScope(defaultValue, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Use a Molecule or Scope in a molecule definition.
|
|
27
|
+
*
|
|
28
|
+
* @param dependency - The Molecule or Scope to use.
|
|
29
|
+
* @returns The value of the Molecule or Scope.
|
|
30
|
+
*/
|
|
31
|
+
function use$1(dependency) {
|
|
32
|
+
return use(dependency);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a new Molecule with the given constructor function.
|
|
36
|
+
*
|
|
37
|
+
* @param constructFn - The constructor function for the Molecule.
|
|
38
|
+
* @param options - The options for the Molecule.
|
|
39
|
+
* @returns The new Molecule.
|
|
40
|
+
*/
|
|
41
|
+
function createMoleculeApi(constructFn, options) {
|
|
42
|
+
const Scope = !options.scope || isString(options.scope) ? createScope$1(options.scope ?? "__global__") : options.scope;
|
|
43
|
+
const Molecule = molecule((mol, scope) => {
|
|
44
|
+
const currentScope = scope(Scope);
|
|
45
|
+
const result = constructFn(currentScope);
|
|
46
|
+
result.__scope = atom(() => currentScope);
|
|
47
|
+
result.__typename = atom(() => options.type);
|
|
48
|
+
for (const key of Object.keys(result)) if (isAtom(result[key])) setAtomDebugLabel(result[key], `${options.type}/${currentScope}:${String(key)}`);
|
|
49
|
+
onMount(() => {
|
|
50
|
+
if (options.onMount) {
|
|
51
|
+
const unmount = options.onMount(result);
|
|
52
|
+
if (isFunction(unmount)) return unmount;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
onUnmount(() => {
|
|
56
|
+
if (options.onUnmount) options.onUnmount();
|
|
57
|
+
});
|
|
58
|
+
return result;
|
|
59
|
+
});
|
|
60
|
+
const useMolecule$1 = (opts) => useMolecule(Molecule, opts);
|
|
61
|
+
const use = (opts) => {
|
|
62
|
+
const atoms = useMolecule$1(opts);
|
|
63
|
+
const keys = Object.keys(atoms);
|
|
64
|
+
return new Proxy({}, { get(_, proxyKey) {
|
|
65
|
+
if (keys.filter((k) => k !== "__scope" && k !== "__typename").includes(proxyKey)) {
|
|
66
|
+
const key = proxyKey;
|
|
67
|
+
return {
|
|
68
|
+
get: () => useAtomValue(atoms[key]),
|
|
69
|
+
set: isWritableAtom(atoms[key]) ? () => useSetAtom(atoms[key]) : void 0,
|
|
70
|
+
reset: isResetAtom(atoms[key]) ? () => {
|
|
71
|
+
const setAtom = useSetAtom(atoms[key]);
|
|
72
|
+
return useCallback(() => {
|
|
73
|
+
setAtom(RESET);
|
|
74
|
+
}, [setAtom]);
|
|
75
|
+
} : void 0
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
} });
|
|
79
|
+
};
|
|
80
|
+
function MoleculeStateManager({ initialState }) {
|
|
81
|
+
const atoms = useMolecule$1();
|
|
82
|
+
useHydrateMolecule(atoms, Object.fromEntries(Object.entries(initialState).filter(([, value]) => !isAtom(value))));
|
|
83
|
+
useSyncMolecule(atoms, initialState);
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
function Provider({ children, scope, initialState, ...props }) {
|
|
87
|
+
return <ScopeProvider {...props} scope={Scope} value={scope}>
|
|
88
|
+
{initialState && <MoleculeStateManager initialState={initialState} />}
|
|
89
|
+
{children}
|
|
90
|
+
</ScopeProvider>;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
Scope,
|
|
94
|
+
Provider,
|
|
95
|
+
Molecule,
|
|
96
|
+
useMolecule: useMolecule$1,
|
|
97
|
+
use
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
export { DEFAULT_SCOPE, createMoleculeApi, createScope$1 as createScope, use$1 as use };
|
|
5
103
|
//# sourceMappingURL=create-molecule.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-molecule.mjs","names":["createScope","createScopeBase","use","useBase","useMolecule","useMoleculeBase"
|
|
1
|
+
{"version":3,"file":"create-molecule.mjs","names":["createScope","createScopeBase","use","useBase","useMolecule","useMoleculeBase"],"sources":[],"mappings":""}
|
|
@@ -1 +1,55 @@
|
|
|
1
|
-
let
|
|
1
|
+
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
2
|
+
let _stryke_type_checks_is_promise = require("@stryke/type-checks/is-promise");
|
|
3
|
+
|
|
4
|
+
//#region src/base/utilities/create-web-storage.ts
|
|
5
|
+
function createWebStorage(getStringStorage) {
|
|
6
|
+
let lastStrValue;
|
|
7
|
+
let lastValue;
|
|
8
|
+
const storage = {
|
|
9
|
+
getItem: (key, initialValue) => {
|
|
10
|
+
const parse = (strValue = "") => {
|
|
11
|
+
if (lastStrValue !== strValue) {
|
|
12
|
+
try {
|
|
13
|
+
const nextValue = parse(strValue);
|
|
14
|
+
if ((0, _stryke_type_checks_is_promise.isPromise)(nextValue)) return nextValue.then((result) => {
|
|
15
|
+
lastValue = result;
|
|
16
|
+
return result;
|
|
17
|
+
});
|
|
18
|
+
lastValue = nextValue;
|
|
19
|
+
} catch {
|
|
20
|
+
return initialValue;
|
|
21
|
+
}
|
|
22
|
+
lastStrValue = strValue;
|
|
23
|
+
}
|
|
24
|
+
return lastValue;
|
|
25
|
+
};
|
|
26
|
+
const strValue = getStringStorage()?.getItem(key) ?? void 0;
|
|
27
|
+
if (strValue && (0, _stryke_type_checks_is_promise.isPromiseLike)(strValue)) return strValue.then((value) => parse(value));
|
|
28
|
+
return parse(strValue);
|
|
29
|
+
},
|
|
30
|
+
removeItem: (key) => getStringStorage()?.removeItem(key),
|
|
31
|
+
setItem: (key, newValue) => getStringStorage()?.setItem(key, _stryke_json_storm_json.StormJSON.stringify(newValue))
|
|
32
|
+
};
|
|
33
|
+
if (typeof window !== "undefined" && typeof window.addEventListener === "function" && window.Storage) storage.subscribe = (key, callback, initialValue) => {
|
|
34
|
+
if (!(getStringStorage() instanceof window.Storage)) return () => {};
|
|
35
|
+
const storageEventCallback = (e) => {
|
|
36
|
+
if (e.storageArea === getStringStorage() && e.key === key) {
|
|
37
|
+
let newValue;
|
|
38
|
+
try {
|
|
39
|
+
newValue = JSON.parse(e.newValue || "");
|
|
40
|
+
} catch {
|
|
41
|
+
newValue = initialValue;
|
|
42
|
+
}
|
|
43
|
+
callback(newValue);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
window.addEventListener("storage", storageEventCallback);
|
|
47
|
+
return () => {
|
|
48
|
+
window.removeEventListener("storage", storageEventCallback);
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return storage;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.createWebStorage = createWebStorage;
|
|
@@ -1,2 +1,56 @@
|
|
|
1
|
-
import{StormJSON
|
|
1
|
+
import { StormJSON } from "@stryke/json/storm-json";
|
|
2
|
+
import { isPromise, isPromiseLike } from "@stryke/type-checks/is-promise";
|
|
3
|
+
|
|
4
|
+
//#region src/base/utilities/create-web-storage.ts
|
|
5
|
+
function createWebStorage(getStringStorage) {
|
|
6
|
+
let lastStrValue;
|
|
7
|
+
let lastValue;
|
|
8
|
+
const storage = {
|
|
9
|
+
getItem: (key, initialValue) => {
|
|
10
|
+
const parse = (strValue = "") => {
|
|
11
|
+
if (lastStrValue !== strValue) {
|
|
12
|
+
try {
|
|
13
|
+
const nextValue = parse(strValue);
|
|
14
|
+
if (isPromise(nextValue)) return nextValue.then((result) => {
|
|
15
|
+
lastValue = result;
|
|
16
|
+
return result;
|
|
17
|
+
});
|
|
18
|
+
lastValue = nextValue;
|
|
19
|
+
} catch {
|
|
20
|
+
return initialValue;
|
|
21
|
+
}
|
|
22
|
+
lastStrValue = strValue;
|
|
23
|
+
}
|
|
24
|
+
return lastValue;
|
|
25
|
+
};
|
|
26
|
+
const strValue = getStringStorage()?.getItem(key) ?? void 0;
|
|
27
|
+
if (strValue && isPromiseLike(strValue)) return strValue.then((value) => parse(value));
|
|
28
|
+
return parse(strValue);
|
|
29
|
+
},
|
|
30
|
+
removeItem: (key) => getStringStorage()?.removeItem(key),
|
|
31
|
+
setItem: (key, newValue) => getStringStorage()?.setItem(key, StormJSON.stringify(newValue))
|
|
32
|
+
};
|
|
33
|
+
if (typeof window !== "undefined" && typeof window.addEventListener === "function" && window.Storage) storage.subscribe = (key, callback, initialValue) => {
|
|
34
|
+
if (!(getStringStorage() instanceof window.Storage)) return () => {};
|
|
35
|
+
const storageEventCallback = (e) => {
|
|
36
|
+
if (e.storageArea === getStringStorage() && e.key === key) {
|
|
37
|
+
let newValue;
|
|
38
|
+
try {
|
|
39
|
+
newValue = JSON.parse(e.newValue || "");
|
|
40
|
+
} catch {
|
|
41
|
+
newValue = initialValue;
|
|
42
|
+
}
|
|
43
|
+
callback(newValue);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
window.addEventListener("storage", storageEventCallback);
|
|
47
|
+
return () => {
|
|
48
|
+
window.removeEventListener("storage", storageEventCallback);
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return storage;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { createWebStorage };
|
|
2
56
|
//# sourceMappingURL=create-web-storage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-web-storage.mjs","names":["StormParser"
|
|
1
|
+
{"version":3,"file":"create-web-storage.mjs","names":["StormParser"],"sources":[],"mappings":""}
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/base/utilities/debounce.ts
|
|
2
|
+
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
3
|
+
function debounce(fn, wait = 25, options = {}) {
|
|
4
|
+
options = {
|
|
5
|
+
...DEBOUNCE_DEFAULTS,
|
|
6
|
+
...options
|
|
7
|
+
};
|
|
8
|
+
if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
|
|
9
|
+
let leadingValue;
|
|
10
|
+
let timeout;
|
|
11
|
+
let resolveList = [];
|
|
12
|
+
let currentPromise;
|
|
13
|
+
let trailingArgs;
|
|
14
|
+
const applyFn = async (_this, args) => {
|
|
15
|
+
currentPromise = _applyPromised(fn, _this, args);
|
|
16
|
+
currentPromise.finally(async () => {
|
|
17
|
+
currentPromise = void 0;
|
|
18
|
+
if (options.trailing && trailingArgs && !timeout) {
|
|
19
|
+
const promise = applyFn(_this, trailingArgs);
|
|
20
|
+
trailingArgs = void 0;
|
|
21
|
+
return promise;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return currentPromise;
|
|
25
|
+
};
|
|
26
|
+
return async (...args) => {
|
|
27
|
+
if (currentPromise) {
|
|
28
|
+
if (options.trailing) trailingArgs = args;
|
|
29
|
+
return currentPromise;
|
|
30
|
+
}
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
const shouldCallNow = !timeout && options.leading;
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
timeout = setTimeout(() => {
|
|
35
|
+
timeout = void 0;
|
|
36
|
+
const promise = options.leading ? leadingValue : applyFn(this, args);
|
|
37
|
+
for (const _resolve of resolveList) _resolve(promise);
|
|
38
|
+
resolveList = [];
|
|
39
|
+
}, wait);
|
|
40
|
+
if (shouldCallNow) {
|
|
41
|
+
leadingValue = applyFn(this, args);
|
|
42
|
+
resolve(leadingValue);
|
|
43
|
+
} else resolveList.push(resolve);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function _applyPromised(fn, _this, args) {
|
|
48
|
+
return await fn.apply(_this, args);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
exports.debounce = debounce;
|
|
@@ -1,2 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/base/utilities/debounce.ts
|
|
2
|
+
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
3
|
+
function debounce(fn, wait = 25, options = {}) {
|
|
4
|
+
options = {
|
|
5
|
+
...DEBOUNCE_DEFAULTS,
|
|
6
|
+
...options
|
|
7
|
+
};
|
|
8
|
+
if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
|
|
9
|
+
let leadingValue;
|
|
10
|
+
let timeout;
|
|
11
|
+
let resolveList = [];
|
|
12
|
+
let currentPromise;
|
|
13
|
+
let trailingArgs;
|
|
14
|
+
const applyFn = async (_this, args) => {
|
|
15
|
+
currentPromise = _applyPromised(fn, _this, args);
|
|
16
|
+
currentPromise.finally(async () => {
|
|
17
|
+
currentPromise = void 0;
|
|
18
|
+
if (options.trailing && trailingArgs && !timeout) {
|
|
19
|
+
const promise = applyFn(_this, trailingArgs);
|
|
20
|
+
trailingArgs = void 0;
|
|
21
|
+
return promise;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return currentPromise;
|
|
25
|
+
};
|
|
26
|
+
return async (...args) => {
|
|
27
|
+
if (currentPromise) {
|
|
28
|
+
if (options.trailing) trailingArgs = args;
|
|
29
|
+
return currentPromise;
|
|
30
|
+
}
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
const shouldCallNow = !timeout && options.leading;
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
timeout = setTimeout(() => {
|
|
35
|
+
timeout = void 0;
|
|
36
|
+
const promise = options.leading ? leadingValue : applyFn(this, args);
|
|
37
|
+
for (const _resolve of resolveList) _resolve(promise);
|
|
38
|
+
resolveList = [];
|
|
39
|
+
}, wait);
|
|
40
|
+
if (shouldCallNow) {
|
|
41
|
+
leadingValue = applyFn(this, args);
|
|
42
|
+
resolve(leadingValue);
|
|
43
|
+
} else resolveList.push(resolve);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function _applyPromised(fn, _this, args) {
|
|
48
|
+
return await fn.apply(_this, args);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { debounce };
|
|
2
53
|
//# sourceMappingURL=debounce.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.mjs","names":[
|
|
1
|
+
{"version":3,"file":"debounce.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_set_atom_debug = require("./set-atom-debug.cjs");
|
|
2
|
+
const require_create_web_storage = require("./create-web-storage.cjs");
|
|
3
|
+
const require_create_molecule = require("./create-molecule.cjs");
|
|
4
|
+
const require_debounce = require("./debounce.cjs");
|
|
5
|
+
|
|
6
|
+
exports.DEFAULT_SCOPE = require_create_molecule.DEFAULT_SCOPE;
|
|
7
|
+
exports.createMoleculeApi = require_create_molecule.createMoleculeApi;
|
|
8
|
+
exports.createScope = require_create_molecule.createScope;
|
|
9
|
+
exports.createWebStorage = require_create_web_storage.createWebStorage;
|
|
10
|
+
exports.debounce = require_debounce.debounce;
|
|
11
|
+
exports.setAtomDebugLabel = require_set_atom_debug.setAtomDebugLabel;
|
|
12
|
+
exports.setAtomDebugPrivate = require_set_atom_debug.setAtomDebugPrivate;
|
|
13
|
+
exports.use = require_create_molecule.use;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{setAtomDebugLabel
|
|
1
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./set-atom-debug.mjs";
|
|
2
|
+
import { createWebStorage } from "./create-web-storage.mjs";
|
|
3
|
+
import { DEFAULT_SCOPE, createMoleculeApi, createScope, use } from "./create-molecule.mjs";
|
|
4
|
+
import { debounce } from "./debounce.mjs";
|
|
5
|
+
|
|
6
|
+
export { DEFAULT_SCOPE, createMoleculeApi, createScope, createWebStorage, debounce, setAtomDebugLabel, setAtomDebugPrivate, use };
|