@cyclone-ui/state 0.0.2
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/LICENSE +187 -0
- package/README.md +302 -0
- package/dist/base/atoms/atom-with-broadcast.cjs +1 -0
- package/dist/base/atoms/atom-with-broadcast.d.cts +13 -0
- package/dist/base/atoms/atom-with-broadcast.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-broadcast.d.mts +13 -0
- package/dist/base/atoms/atom-with-broadcast.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-broadcast.mjs +2 -0
- package/dist/base/atoms/atom-with-broadcast.mjs.map +1 -0
- package/dist/base/atoms/atom-with-compare.cjs +1 -0
- package/dist/base/atoms/atom-with-compare.d.cts +5 -0
- package/dist/base/atoms/atom-with-compare.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-compare.d.mts +5 -0
- package/dist/base/atoms/atom-with-compare.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-compare.mjs +2 -0
- package/dist/base/atoms/atom-with-compare.mjs.map +1 -0
- package/dist/base/atoms/atom-with-debounce.cjs +1 -0
- package/dist/base/atoms/atom-with-debounce.d.cts +12 -0
- package/dist/base/atoms/atom-with-debounce.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-debounce.d.mts +12 -0
- package/dist/base/atoms/atom-with-debounce.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-debounce.mjs +2 -0
- package/dist/base/atoms/atom-with-debounce.mjs.map +1 -0
- package/dist/base/atoms/atom-with-effect.cjs +1 -0
- package/dist/base/atoms/atom-with-effect.d.cts +14 -0
- package/dist/base/atoms/atom-with-effect.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-effect.d.mts +14 -0
- package/dist/base/atoms/atom-with-effect.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-effect.mjs +2 -0
- package/dist/base/atoms/atom-with-effect.mjs.map +1 -0
- package/dist/base/atoms/atom-with-listeners.cjs +1 -0
- package/dist/base/atoms/atom-with-listeners.d.cts +13 -0
- package/dist/base/atoms/atom-with-listeners.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-listeners.d.mts +13 -0
- package/dist/base/atoms/atom-with-listeners.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-listeners.mjs +2 -0
- package/dist/base/atoms/atom-with-listeners.mjs.map +1 -0
- package/dist/base/atoms/atom-with-pending.cjs +1 -0
- package/dist/base/atoms/atom-with-pending.d.cts +12 -0
- package/dist/base/atoms/atom-with-pending.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-pending.d.mts +12 -0
- package/dist/base/atoms/atom-with-pending.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-pending.mjs +2 -0
- package/dist/base/atoms/atom-with-pending.mjs.map +1 -0
- package/dist/base/atoms/atom-with-refresh-and-default.cjs +1 -0
- package/dist/base/atoms/atom-with-refresh-and-default.d.cts +6 -0
- package/dist/base/atoms/atom-with-refresh-and-default.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-refresh-and-default.d.mts +6 -0
- package/dist/base/atoms/atom-with-refresh-and-default.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-refresh-and-default.mjs +2 -0
- package/dist/base/atoms/atom-with-refresh-and-default.mjs.map +1 -0
- package/dist/base/atoms/atom-with-refresh.cjs +1 -0
- package/dist/base/atoms/atom-with-refresh.d.cts +6 -0
- package/dist/base/atoms/atom-with-refresh.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-refresh.d.mts +6 -0
- package/dist/base/atoms/atom-with-refresh.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-refresh.mjs +2 -0
- package/dist/base/atoms/atom-with-refresh.mjs.map +1 -0
- package/dist/base/atoms/atom-with-toggle.cjs +1 -0
- package/dist/base/atoms/atom-with-toggle.d.cts +6 -0
- package/dist/base/atoms/atom-with-toggle.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-toggle.d.mts +6 -0
- package/dist/base/atoms/atom-with-toggle.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-toggle.mjs +2 -0
- package/dist/base/atoms/atom-with-toggle.mjs.map +1 -0
- package/dist/base/atoms/atom-with-web-storage.cjs +1 -0
- package/dist/base/atoms/atom-with-web-storage.d.cts +20 -0
- package/dist/base/atoms/atom-with-web-storage.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-web-storage.d.mts +20 -0
- package/dist/base/atoms/atom-with-web-storage.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-web-storage.mjs +2 -0
- package/dist/base/atoms/atom-with-web-storage.mjs.map +1 -0
- package/dist/base/atoms/atom-with-wrapper.cjs +1 -0
- package/dist/base/atoms/atom-with-wrapper.d.cts +18 -0
- package/dist/base/atoms/atom-with-wrapper.d.cts.map +1 -0
- package/dist/base/atoms/atom-with-wrapper.d.mts +18 -0
- package/dist/base/atoms/atom-with-wrapper.d.mts.map +1 -0
- package/dist/base/atoms/atom-with-wrapper.mjs +2 -0
- package/dist/base/atoms/atom-with-wrapper.mjs.map +1 -0
- package/dist/base/atoms/base-atom.cjs +1 -0
- package/dist/base/atoms/base-atom.mjs +2 -0
- package/dist/base/atoms/base-atom.mjs.map +1 -0
- package/dist/base/atoms/index.cjs +1 -0
- package/dist/base/atoms/index.d.cts +12 -0
- package/dist/base/atoms/index.d.mts +12 -0
- package/dist/base/atoms/index.mjs +1 -0
- package/dist/base/hooks/index.cjs +1 -0
- package/dist/base/hooks/index.d.cts +5 -0
- package/dist/base/hooks/index.d.mts +5 -0
- package/dist/base/hooks/index.mjs +1 -0
- package/dist/base/hooks/use-atom-effect.cjs +1 -0
- package/dist/base/hooks/use-atom-effect.d.cts +11 -0
- package/dist/base/hooks/use-atom-effect.d.cts.map +1 -0
- package/dist/base/hooks/use-atom-effect.d.mts +11 -0
- package/dist/base/hooks/use-atom-effect.d.mts.map +1 -0
- package/dist/base/hooks/use-atom-effect.mjs +2 -0
- package/dist/base/hooks/use-atom-effect.mjs.map +1 -0
- package/dist/base/hooks/use-hydrate-molecule.cjs +1 -0
- package/dist/base/hooks/use-hydrate-molecule.d.cts +11 -0
- package/dist/base/hooks/use-hydrate-molecule.d.cts.map +1 -0
- package/dist/base/hooks/use-hydrate-molecule.d.mts +11 -0
- package/dist/base/hooks/use-hydrate-molecule.d.mts.map +1 -0
- package/dist/base/hooks/use-hydrate-molecule.mjs +2 -0
- package/dist/base/hooks/use-hydrate-molecule.mjs.map +1 -0
- package/dist/base/hooks/use-prepare-atoms.cjs +1 -0
- package/dist/base/hooks/use-prepare-atoms.d.cts +8 -0
- package/dist/base/hooks/use-prepare-atoms.d.cts.map +1 -0
- package/dist/base/hooks/use-prepare-atoms.d.mts +8 -0
- package/dist/base/hooks/use-prepare-atoms.d.mts.map +1 -0
- package/dist/base/hooks/use-prepare-atoms.mjs +2 -0
- package/dist/base/hooks/use-prepare-atoms.mjs.map +1 -0
- package/dist/base/hooks/use-sync-molecule.cjs +1 -0
- package/dist/base/hooks/use-sync-molecule.d.cts +10 -0
- package/dist/base/hooks/use-sync-molecule.d.cts.map +1 -0
- package/dist/base/hooks/use-sync-molecule.d.mts +10 -0
- package/dist/base/hooks/use-sync-molecule.d.mts.map +1 -0
- package/dist/base/hooks/use-sync-molecule.mjs +2 -0
- package/dist/base/hooks/use-sync-molecule.mjs.map +1 -0
- package/dist/base/index.cjs +1 -0
- package/dist/base/index.d.cts +23 -0
- package/dist/base/index.d.mts +23 -0
- package/dist/base/index.mjs +1 -0
- package/dist/base/utilities/create-molecule.cjs +4 -0
- package/dist/base/utilities/create-molecule.d.cts +68 -0
- package/dist/base/utilities/create-molecule.d.cts.map +1 -0
- package/dist/base/utilities/create-molecule.d.mts +68 -0
- package/dist/base/utilities/create-molecule.d.mts.map +1 -0
- package/dist/base/utilities/create-molecule.mjs +5 -0
- package/dist/base/utilities/create-molecule.mjs.map +1 -0
- package/dist/base/utilities/create-web-storage.cjs +1 -0
- package/dist/base/utilities/create-web-storage.d.cts +6 -0
- package/dist/base/utilities/create-web-storage.d.cts.map +1 -0
- package/dist/base/utilities/create-web-storage.d.mts +6 -0
- package/dist/base/utilities/create-web-storage.d.mts.map +1 -0
- package/dist/base/utilities/create-web-storage.mjs +2 -0
- package/dist/base/utilities/create-web-storage.mjs.map +1 -0
- package/dist/base/utilities/debounce.cjs +1 -0
- package/dist/base/utilities/debounce.d.cts +19 -0
- package/dist/base/utilities/debounce.d.cts.map +1 -0
- package/dist/base/utilities/debounce.d.mts +19 -0
- package/dist/base/utilities/debounce.d.mts.map +1 -0
- package/dist/base/utilities/debounce.mjs +2 -0
- package/dist/base/utilities/debounce.mjs.map +1 -0
- package/dist/base/utilities/index.cjs +1 -0
- package/dist/base/utilities/index.d.cts +5 -0
- package/dist/base/utilities/index.d.mts +5 -0
- package/dist/base/utilities/index.mjs +1 -0
- package/dist/base/utilities/is-atom.cjs +1 -0
- package/dist/base/utilities/is-atom.mjs +2 -0
- package/dist/base/utilities/is-atom.mjs.map +1 -0
- package/dist/base/utilities/set-atom-debug.cjs +1 -0
- package/dist/base/utilities/set-atom-debug.d.cts +18 -0
- package/dist/base/utilities/set-atom-debug.d.cts.map +1 -0
- package/dist/base/utilities/set-atom-debug.d.mts +18 -0
- package/dist/base/utilities/set-atom-debug.d.mts.map +1 -0
- package/dist/base/utilities/set-atom-debug.mjs +2 -0
- package/dist/base/utilities/set-atom-debug.mjs.map +1 -0
- package/dist/client/index.cjs +1 -0
- package/dist/client/index.d.cts +8 -0
- package/dist/client/index.d.mts +8 -0
- package/dist/client/index.mjs +1 -0
- package/dist/form/atoms/atom-with-field.cjs +1 -0
- package/dist/form/atoms/atom-with-field.mjs +2 -0
- package/dist/form/atoms/atom-with-field.mjs.map +1 -0
- package/dist/form/atoms/atom-with-messages.cjs +1 -0
- package/dist/form/atoms/atom-with-messages.mjs +2 -0
- package/dist/form/atoms/atom-with-messages.mjs.map +1 -0
- package/dist/form/hooks/index.cjs +1 -0
- package/dist/form/hooks/index.d.cts +4 -0
- package/dist/form/hooks/index.d.mts +4 -0
- package/dist/form/hooks/index.mjs +1 -0
- package/dist/form/hooks/use-field-actions.cjs +1 -0
- package/dist/form/hooks/use-field-actions.d.cts +17 -0
- package/dist/form/hooks/use-field-actions.d.cts.map +1 -0
- package/dist/form/hooks/use-field-actions.d.mts +17 -0
- package/dist/form/hooks/use-field-actions.d.mts.map +1 -0
- package/dist/form/hooks/use-field-actions.mjs +2 -0
- package/dist/form/hooks/use-field-actions.mjs.map +1 -0
- package/dist/form/hooks/use-field-ref.cjs +1 -0
- package/dist/form/hooks/use-field-ref.d.cts +6 -0
- package/dist/form/hooks/use-field-ref.d.cts.map +1 -0
- package/dist/form/hooks/use-field-ref.d.mts +6 -0
- package/dist/form/hooks/use-field-ref.d.mts.map +1 -0
- package/dist/form/hooks/use-field-ref.mjs +2 -0
- package/dist/form/hooks/use-field-ref.mjs.map +1 -0
- package/dist/form/hooks/use-form-actions.cjs +1 -0
- package/dist/form/hooks/use-form-actions.d.cts +13 -0
- package/dist/form/hooks/use-form-actions.d.cts.map +1 -0
- package/dist/form/hooks/use-form-actions.d.mts +13 -0
- package/dist/form/hooks/use-form-actions.d.mts.map +1 -0
- package/dist/form/hooks/use-form-actions.mjs +2 -0
- package/dist/form/hooks/use-form-actions.mjs.map +1 -0
- package/dist/form/index.cjs +1 -0
- package/dist/form/index.d.cts +16 -0
- package/dist/form/index.d.mts +16 -0
- package/dist/form/index.mjs +1 -0
- package/dist/form/molecules/field-molecule.cjs +1 -0
- package/dist/form/molecules/field-molecule.d.cts +9 -0
- package/dist/form/molecules/field-molecule.d.cts.map +1 -0
- package/dist/form/molecules/field-molecule.d.mts +9 -0
- package/dist/form/molecules/field-molecule.d.mts.map +1 -0
- package/dist/form/molecules/field-molecule.mjs +2 -0
- package/dist/form/molecules/field-molecule.mjs.map +1 -0
- package/dist/form/molecules/form-molecule.cjs +1 -0
- package/dist/form/molecules/form-molecule.d.cts +9 -0
- package/dist/form/molecules/form-molecule.d.cts.map +1 -0
- package/dist/form/molecules/form-molecule.d.mts +9 -0
- package/dist/form/molecules/form-molecule.d.mts.map +1 -0
- package/dist/form/molecules/form-molecule.mjs +2 -0
- package/dist/form/molecules/form-molecule.mjs.map +1 -0
- package/dist/form/molecules/index.cjs +1 -0
- package/dist/form/molecules/index.d.cts +3 -0
- package/dist/form/molecules/index.d.mts +3 -0
- package/dist/form/molecules/index.mjs +1 -0
- package/dist/form/providers/FieldProvider.cjs +4 -0
- package/dist/form/providers/FieldProvider.d.cts +10 -0
- package/dist/form/providers/FieldProvider.d.cts.map +1 -0
- package/dist/form/providers/FieldProvider.d.mts +10 -0
- package/dist/form/providers/FieldProvider.d.mts.map +1 -0
- package/dist/form/providers/FieldProvider.mjs +5 -0
- package/dist/form/providers/FieldProvider.mjs.map +1 -0
- package/dist/form/providers/FormProvider.cjs +4 -0
- package/dist/form/providers/FormProvider.d.cts +10 -0
- package/dist/form/providers/FormProvider.d.cts.map +1 -0
- package/dist/form/providers/FormProvider.d.mts +10 -0
- package/dist/form/providers/FormProvider.d.mts.map +1 -0
- package/dist/form/providers/FormProvider.mjs +5 -0
- package/dist/form/providers/FormProvider.mjs.map +1 -0
- package/dist/form/providers/index.cjs +1 -0
- package/dist/form/providers/index.d.cts +3 -0
- package/dist/form/providers/index.d.mts +3 -0
- package/dist/form/providers/index.mjs +1 -0
- package/dist/form/types.cjs +1 -0
- package/dist/form/types.d.cts +288 -0
- package/dist/form/types.d.cts.map +1 -0
- package/dist/form/types.d.mts +288 -0
- package/dist/form/types.d.mts.map +1 -0
- package/dist/form/types.mjs +2 -0
- package/dist/form/types.mjs.map +1 -0
- package/dist/form/utilities/abort-error.cjs +1 -0
- package/dist/form/utilities/abort-error.d.cts +13 -0
- package/dist/form/utilities/abort-error.d.cts.map +1 -0
- package/dist/form/utilities/abort-error.d.mts +13 -0
- package/dist/form/utilities/abort-error.d.mts.map +1 -0
- package/dist/form/utilities/abort-error.mjs +2 -0
- package/dist/form/utilities/abort-error.mjs.map +1 -0
- package/dist/form/utilities/index.cjs +1 -0
- package/dist/form/utilities/index.d.cts +4 -0
- package/dist/form/utilities/index.d.mts +4 -0
- package/dist/form/utilities/index.mjs +1 -0
- package/dist/form/utilities/is-validation-results.cjs +1 -0
- package/dist/form/utilities/is-validation-results.d.cts +6 -0
- package/dist/form/utilities/is-validation-results.d.cts.map +1 -0
- package/dist/form/utilities/is-validation-results.d.mts +6 -0
- package/dist/form/utilities/is-validation-results.d.mts.map +1 -0
- package/dist/form/utilities/is-validation-results.mjs +2 -0
- package/dist/form/utilities/is-validation-results.mjs.map +1 -0
- package/dist/form/utilities/validators.cjs +1 -0
- package/dist/form/utilities/validators.d.cts +6 -0
- package/dist/form/utilities/validators.d.cts.map +1 -0
- package/dist/form/utilities/validators.d.mts +6 -0
- package/dist/form/utilities/validators.d.mts.map +1 -0
- package/dist/form/utilities/validators.mjs +2 -0
- package/dist/form/utilities/validators.mjs.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +34 -0
- package/dist/index.d.mts +34 -0
- package/dist/index.mjs +1 -0
- package/dist/message/components/MessageViewport.cjs +1 -0
- package/dist/message/components/MessageViewport.d.cts +19 -0
- package/dist/message/components/MessageViewport.d.cts.map +1 -0
- package/dist/message/components/MessageViewport.d.mts +19 -0
- package/dist/message/components/MessageViewport.d.mts.map +1 -0
- package/dist/message/components/MessageViewport.mjs +2 -0
- package/dist/message/components/MessageViewport.mjs.map +1 -0
- package/dist/message/components/index.cjs +1 -0
- package/dist/message/components/index.d.cts +2 -0
- package/dist/message/components/index.d.mts +2 -0
- package/dist/message/components/index.mjs +1 -0
- package/dist/message/hooks/index.cjs +1 -0
- package/dist/message/hooks/index.d.cts +2 -0
- package/dist/message/hooks/index.d.mts +2 -0
- package/dist/message/hooks/index.mjs +1 -0
- package/dist/message/hooks/use-message-actions.cjs +1 -0
- package/dist/message/hooks/use-message-actions.d.cts +21 -0
- package/dist/message/hooks/use-message-actions.d.cts.map +1 -0
- package/dist/message/hooks/use-message-actions.d.mts +21 -0
- package/dist/message/hooks/use-message-actions.d.mts.map +1 -0
- package/dist/message/hooks/use-message-actions.mjs +2 -0
- package/dist/message/hooks/use-message-actions.mjs.map +1 -0
- package/dist/message/index.cjs +1 -0
- package/dist/message/index.d.cts +9 -0
- package/dist/message/index.d.mts +9 -0
- package/dist/message/index.mjs +1 -0
- package/dist/message/providers/MessageProvider.cjs +1 -0
- package/dist/message/providers/MessageProvider.d.cts +21 -0
- package/dist/message/providers/MessageProvider.d.cts.map +1 -0
- package/dist/message/providers/MessageProvider.d.mts +21 -0
- package/dist/message/providers/MessageProvider.d.mts.map +1 -0
- package/dist/message/providers/MessageProvider.mjs +2 -0
- package/dist/message/providers/MessageProvider.mjs.map +1 -0
- package/dist/message/providers/index.d.cts +2 -0
- package/dist/message/providers/index.d.mts +2 -0
- package/dist/message/types.d.cts +6 -0
- package/dist/message/types.d.cts.map +1 -0
- package/dist/message/types.d.mts +6 -0
- package/dist/message/types.d.mts.map +1 -0
- package/dist/theme/hooks/index.cjs +1 -0
- package/dist/theme/hooks/index.d.cts +3 -0
- package/dist/theme/hooks/index.d.mts +3 -0
- package/dist/theme/hooks/index.mjs +1 -0
- package/dist/theme/hooks/use-theme-actions.cjs +1 -0
- package/dist/theme/hooks/use-theme-actions.d.cts +11 -0
- package/dist/theme/hooks/use-theme-actions.d.cts.map +1 -0
- package/dist/theme/hooks/use-theme-actions.d.mts +11 -0
- package/dist/theme/hooks/use-theme-actions.d.mts.map +1 -0
- package/dist/theme/hooks/use-theme-actions.mjs +2 -0
- package/dist/theme/hooks/use-theme-actions.mjs.map +1 -0
- package/dist/theme/hooks/use-theme-store.cjs +1 -0
- package/dist/theme/hooks/use-theme-store.d.cts +49 -0
- package/dist/theme/hooks/use-theme-store.d.cts.map +1 -0
- package/dist/theme/hooks/use-theme-store.d.mts +49 -0
- package/dist/theme/hooks/use-theme-store.d.mts.map +1 -0
- package/dist/theme/hooks/use-theme-store.mjs +2 -0
- package/dist/theme/hooks/use-theme-store.mjs.map +1 -0
- package/dist/theme/index.cjs +1 -0
- package/dist/theme/index.d.cts +9 -0
- package/dist/theme/index.d.mts +9 -0
- package/dist/theme/index.mjs +1 -0
- package/dist/theme/molecules/index.cjs +1 -0
- package/dist/theme/molecules/index.d.cts +2 -0
- package/dist/theme/molecules/index.d.mts +2 -0
- package/dist/theme/molecules/index.mjs +1 -0
- package/dist/theme/molecules/theme-molecule.cjs +1 -0
- package/dist/theme/molecules/theme-molecule.d.cts +14 -0
- package/dist/theme/molecules/theme-molecule.d.cts.map +1 -0
- package/dist/theme/molecules/theme-molecule.d.mts +14 -0
- package/dist/theme/molecules/theme-molecule.d.mts.map +1 -0
- package/dist/theme/molecules/theme-molecule.mjs +2 -0
- package/dist/theme/molecules/theme-molecule.mjs.map +1 -0
- package/dist/theme/providers/ThemeProvider.cjs +5 -0
- package/dist/theme/providers/ThemeProvider.d.cts +13 -0
- package/dist/theme/providers/ThemeProvider.d.cts.map +1 -0
- package/dist/theme/providers/ThemeProvider.d.mts +13 -0
- package/dist/theme/providers/ThemeProvider.d.mts.map +1 -0
- package/dist/theme/providers/ThemeProvider.mjs +6 -0
- package/dist/theme/providers/ThemeProvider.mjs.map +1 -0
- package/dist/theme/types.cjs +1 -0
- package/dist/theme/types.d.cts +41 -0
- package/dist/theme/types.d.cts.map +1 -0
- package/dist/theme/types.d.mts +41 -0
- package/dist/theme/types.d.mts.map +1 -0
- package/dist/theme/types.mjs +2 -0
- package/dist/theme/types.mjs.map +1 -0
- package/dist/theme/utilities/theme-helpers.cjs +1 -0
- package/dist/theme/utilities/theme-helpers.d.cts +55 -0
- package/dist/theme/utilities/theme-helpers.d.cts.map +1 -0
- package/dist/theme/utilities/theme-helpers.d.mts +55 -0
- package/dist/theme/utilities/theme-helpers.d.mts.map +1 -0
- package/dist/theme/utilities/theme-helpers.mjs +2 -0
- package/dist/theme/utilities/theme-helpers.mjs.map +1 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +55 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +55 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +0 -0
- package/package.json +146 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sync-molecule.d.mts","names":[],"sources":["../../../src/base/hooks/use-sync-molecule.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isAtom as e}from"../utilities/is-atom.mjs";import{useAtomValue as t,useSetAtom as n}from"jotai";import{useEffect as r}from"react";const i=(i,a,o)=>{for(let s of Object.keys(i)){let c=a[s];e(c)&&(c=t(c));let l=n(i[s],{store:o});r(()=>{c!==void 0&&l(c)},[l,c])}};export{i as useSyncMolecule};
|
|
2
|
+
//# sourceMappingURL=use-sync-molecule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sync-molecule.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./utilities/set-atom-debug.cjs"),t=require("./atoms/atom-with-broadcast.cjs"),n=require("./atoms/atom-with-compare.cjs"),r=require("./atoms/atom-with-wrapper.cjs"),i=require("./atoms/atom-with-debounce.cjs"),a=require("./atoms/atom-with-effect.cjs"),o=require("./atoms/atom-with-listeners.cjs"),s=require("./atoms/atom-with-pending.cjs"),c=require("./atoms/atom-with-refresh.cjs"),l=require("./atoms/atom-with-refresh-and-default.cjs"),u=require("./atoms/atom-with-toggle.cjs"),d=require("./utilities/create-web-storage.cjs"),f=require("./atoms/atom-with-web-storage.cjs");require("./atoms/index.cjs");const p=require("./hooks/use-atom-effect.cjs"),m=require("./hooks/use-hydrate-molecule.cjs"),h=require("./hooks/use-prepare-atoms.cjs"),g=require("./hooks/use-sync-molecule.cjs");require("./hooks/index.cjs");const _=require("./utilities/create-molecule.cjs"),v=require("./utilities/debounce.cjs");require("./utilities/index.cjs"),exports.DEFAULT_SCOPE=_.DEFAULT_SCOPE,exports.atomWithBroadcast=t.atomWithBroadcast,exports.atomWithCompare=n.atomWithCompare,exports.atomWithDebounce=i.atomWithDebounce,exports.atomWithEffect=a.atomWithEffect,exports.atomWithListeners=o.atomWithListeners,exports.atomWithPending=s.atomWithPending,exports.atomWithRefresh=c.atomWithRefresh,exports.atomWithRefreshAndDefault=l.atomWithRefreshAndDefault,exports.atomWithToggle=u.atomWithToggle,exports.atomWithWebStorage=f.atomWithWebStorage,exports.atomWithWrapper=r.atomWithWrapper,exports.createMoleculeApi=_.createMoleculeApi,exports.createScope=_.createScope,exports.createWebStorage=d.createWebStorage,exports.debounce=v.debounce,exports.getWebStorage=f.getWebStorage,exports.setAtomDebugLabel=e.setAtomDebugLabel,exports.setAtomDebugPrivate=e.setAtomDebugPrivate,exports.use=_.use,exports.useAtomEffect=p.useAtomEffect,exports.useHydrateMolecule=m.useHydrateMolecule,exports.usePrepareAtoms=h.usePrepareAtoms,exports.useSyncMolecule=g.useSyncMolecule;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, use } from "./utilities/create-molecule.cjs";
|
|
2
|
+
import { atomWithBroadcast } from "./atoms/atom-with-broadcast.cjs";
|
|
3
|
+
import { atomWithCompare } from "./atoms/atom-with-compare.cjs";
|
|
4
|
+
import { atomWithDebounce } from "./atoms/atom-with-debounce.cjs";
|
|
5
|
+
import { EffectCallback, atomWithEffect } from "./atoms/atom-with-effect.cjs";
|
|
6
|
+
import { Callback, atomWithListeners } from "./atoms/atom-with-listeners.cjs";
|
|
7
|
+
import { atomWithPending } from "./atoms/atom-with-pending.cjs";
|
|
8
|
+
import { atomWithRefresh } from "./atoms/atom-with-refresh.cjs";
|
|
9
|
+
import { atomWithRefreshAndDefault } from "./atoms/atom-with-refresh-and-default.cjs";
|
|
10
|
+
import { atomWithToggle } from "./atoms/atom-with-toggle.cjs";
|
|
11
|
+
import { atomWithWebStorage, getWebStorage } from "./atoms/atom-with-web-storage.cjs";
|
|
12
|
+
import { atomWithWrapper } from "./atoms/atom-with-wrapper.cjs";
|
|
13
|
+
import "./atoms/index.cjs";
|
|
14
|
+
import { useAtomEffect } from "./hooks/use-atom-effect.cjs";
|
|
15
|
+
import { UseHydrateAtoms, useHydrateMolecule } from "./hooks/use-hydrate-molecule.cjs";
|
|
16
|
+
import { usePrepareAtoms } from "./hooks/use-prepare-atoms.cjs";
|
|
17
|
+
import { UseSyncAtoms, useSyncMolecule } from "./hooks/use-sync-molecule.cjs";
|
|
18
|
+
import "./hooks/index.cjs";
|
|
19
|
+
import { createWebStorage } from "./utilities/create-web-storage.cjs";
|
|
20
|
+
import { DebounceOptions, debounce } from "./utilities/debounce.cjs";
|
|
21
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./utilities/set-atom-debug.cjs";
|
|
22
|
+
import "./utilities/index.cjs";
|
|
23
|
+
export { BaseMoleculeState, Callback, CleanupCallback, DEFAULT_SCOPE, DebounceOptions, EffectCallback, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, UseHydrateAtoms, UseSyncAtoms, atomWithBroadcast, atomWithCompare, atomWithDebounce, atomWithEffect, atomWithListeners, atomWithPending, atomWithRefresh, atomWithRefreshAndDefault, atomWithToggle, atomWithWebStorage, atomWithWrapper, createMoleculeApi, createScope, createWebStorage, debounce, getWebStorage, setAtomDebugLabel, setAtomDebugPrivate, use, useAtomEffect, useHydrateMolecule, usePrepareAtoms, useSyncMolecule };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, use } from "./utilities/create-molecule.mjs";
|
|
2
|
+
import { atomWithBroadcast } from "./atoms/atom-with-broadcast.mjs";
|
|
3
|
+
import { atomWithCompare } from "./atoms/atom-with-compare.mjs";
|
|
4
|
+
import { atomWithDebounce } from "./atoms/atom-with-debounce.mjs";
|
|
5
|
+
import { EffectCallback, atomWithEffect } from "./atoms/atom-with-effect.mjs";
|
|
6
|
+
import { Callback, atomWithListeners } from "./atoms/atom-with-listeners.mjs";
|
|
7
|
+
import { atomWithPending } from "./atoms/atom-with-pending.mjs";
|
|
8
|
+
import { atomWithRefresh } from "./atoms/atom-with-refresh.mjs";
|
|
9
|
+
import { atomWithRefreshAndDefault } from "./atoms/atom-with-refresh-and-default.mjs";
|
|
10
|
+
import { atomWithToggle } from "./atoms/atom-with-toggle.mjs";
|
|
11
|
+
import { atomWithWebStorage, getWebStorage } from "./atoms/atom-with-web-storage.mjs";
|
|
12
|
+
import { atomWithWrapper } from "./atoms/atom-with-wrapper.mjs";
|
|
13
|
+
import "./atoms/index.mjs";
|
|
14
|
+
import { useAtomEffect } from "./hooks/use-atom-effect.mjs";
|
|
15
|
+
import { UseHydrateAtoms, useHydrateMolecule } from "./hooks/use-hydrate-molecule.mjs";
|
|
16
|
+
import { usePrepareAtoms } from "./hooks/use-prepare-atoms.mjs";
|
|
17
|
+
import { UseSyncAtoms, useSyncMolecule } from "./hooks/use-sync-molecule.mjs";
|
|
18
|
+
import "./hooks/index.mjs";
|
|
19
|
+
import { createWebStorage } from "./utilities/create-web-storage.mjs";
|
|
20
|
+
import { DebounceOptions, debounce } from "./utilities/debounce.mjs";
|
|
21
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./utilities/set-atom-debug.mjs";
|
|
22
|
+
import "./utilities/index.mjs";
|
|
23
|
+
export { BaseMoleculeState, Callback, CleanupCallback, DEFAULT_SCOPE, DebounceOptions, EffectCallback, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, UseHydrateAtoms, UseSyncAtoms, atomWithBroadcast, atomWithCompare, atomWithDebounce, atomWithEffect, atomWithListeners, atomWithPending, atomWithRefresh, atomWithRefreshAndDefault, atomWithToggle, atomWithWebStorage, atomWithWrapper, createMoleculeApi, createScope, createWebStorage, debounce, getWebStorage, setAtomDebugLabel, setAtomDebugPrivate, use, useAtomEffect, useHydrateMolecule, usePrepareAtoms, useSyncMolecule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{setAtomDebugLabel as e,setAtomDebugPrivate as t}from"./utilities/set-atom-debug.mjs";import{atomWithBroadcast as n}from"./atoms/atom-with-broadcast.mjs";import{atomWithCompare as r}from"./atoms/atom-with-compare.mjs";import{atomWithWrapper as i}from"./atoms/atom-with-wrapper.mjs";import{atomWithDebounce as a}from"./atoms/atom-with-debounce.mjs";import{atomWithEffect as o}from"./atoms/atom-with-effect.mjs";import{atomWithListeners as s}from"./atoms/atom-with-listeners.mjs";import{atomWithPending as c}from"./atoms/atom-with-pending.mjs";import{atomWithRefresh as l}from"./atoms/atom-with-refresh.mjs";import{atomWithRefreshAndDefault as u}from"./atoms/atom-with-refresh-and-default.mjs";import{atomWithToggle as d}from"./atoms/atom-with-toggle.mjs";import{createWebStorage as f}from"./utilities/create-web-storage.mjs";import{atomWithWebStorage as p,getWebStorage as m}from"./atoms/atom-with-web-storage.mjs";import"./atoms/index.mjs";import{useAtomEffect as h}from"./hooks/use-atom-effect.mjs";import{useHydrateMolecule as g}from"./hooks/use-hydrate-molecule.mjs";import{usePrepareAtoms as _}from"./hooks/use-prepare-atoms.mjs";import{useSyncMolecule as v}from"./hooks/use-sync-molecule.mjs";import"./hooks/index.mjs";import{DEFAULT_SCOPE as y,createMoleculeApi as b,createScope as x,use as S}from"./utilities/create-molecule.mjs";import{debounce as C}from"./utilities/debounce.mjs";import"./utilities/index.mjs";export{y as DEFAULT_SCOPE,n as atomWithBroadcast,r as atomWithCompare,a as atomWithDebounce,o as atomWithEffect,s as atomWithListeners,c as atomWithPending,l as atomWithRefresh,u as atomWithRefreshAndDefault,d as atomWithToggle,p as atomWithWebStorage,i as atomWithWrapper,b as createMoleculeApi,x as createScope,f as createWebStorage,C as debounce,m as getWebStorage,e as setAtomDebugLabel,t as setAtomDebugPrivate,S as use,h as useAtomEffect,g as useHydrateMolecule,_ as usePrepareAtoms,v as useSyncMolecule};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e=require("./is-atom.cjs"),t=require("./set-atom-debug.cjs"),n=require("../hooks/use-sync-molecule.cjs");let r=require("@stryke/type-checks/is-function"),i=require("jotai/utils"),a=require("jotai"),o=require("react"),s=require("@stryke/type-checks/is-string"),c=require("bunshi"),l=require("bunshi/react");const u=`__global__`;function d(e=u,t){return(0,c.createScope)(e,t)}function f(e){return(0,c.use)(e)}function p(u,f){let p=!f.scope||(0,s.isString)(f.scope)?d(f.scope??`__global__`):f.scope,m=(0,c.molecule)((n,i)=>{let o=i(p),s=u(o);s.__scope=(0,a.atom)(()=>o),s.__typename=(0,a.atom)(()=>f.type);for(let n of Object.keys(s))e.isAtom(s[n])&&t.setAtomDebugLabel(s[n],`${f.type}/${o}:${String(n)}`);return(0,c.onMount)(()=>{if(f.onMount){let e=f.onMount(s);if((0,r.isFunction)(e))return e}}),(0,c.onUnmount)(()=>{f.onUnmount&&f.onUnmount()}),s}),h=e=>(0,l.useMolecule)(m,e),g=t=>{let n=h(t),r=Object.keys(n);return new Proxy({},{get(t,s){if(r.filter(e=>e!==`__scope`&&e!==`__typename`).includes(s)){let t=s;return{get:()=>(0,a.useAtomValue)(n[t]),set:e.isWritableAtom(n[t])?()=>(0,a.useSetAtom)(n[t]):void 0,reset:e.isResetAtom(n[t])?()=>{let e=(0,a.useSetAtom)(n[t]);return(0,o.useCallback)(()=>{e(i.RESET)},[e])}:void 0}}}})};function _({initialState:e}){let t=h();return n.useSyncMolecule(t,e),null}function v({children:e,scope:t,initialState:n,...r}){return<l.ScopeProvider{...r} scope={p} value={t}>
|
|
2
|
+
{n&&<_ initialState={n}/>}
|
|
3
|
+
{e}
|
|
4
|
+
</l.ScopeProvider>}return{Scope:p,Provider:v,Molecule:m,useMolecule:h,use:g}}exports.DEFAULT_SCOPE=u,exports.createMoleculeApi=p,exports.createScope=d,exports.use=f;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AtomRecord, AtomRecordConstraint, ExtractAtomRecordValues, IsResetAtom } from "../../types.cjs";
|
|
2
|
+
import { MoleculeScope } from "bunshi";
|
|
3
|
+
import { MoleculeScopeOptions, ProviderProps } from "bunshi/react";
|
|
4
|
+
import { Atom, WritableAtom } from "jotai";
|
|
5
|
+
//#region src/base/utilities/create-molecule.d.ts
|
|
6
|
+
type Molecule<TValue> = {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
} & Record<symbol, unknown>;
|
|
9
|
+
type BaseMoleculeState = AtomRecord<{
|
|
10
|
+
__scope: string;
|
|
11
|
+
__typename: string;
|
|
12
|
+
}>;
|
|
13
|
+
type MoleculeState<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = BaseMoleculeState & TState;
|
|
14
|
+
declare 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
|
+
declare function createScope(defaultValue?: string, options?: {
|
|
23
|
+
debugLabel?: string;
|
|
24
|
+
}): MoleculeScope<string>;
|
|
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
|
+
declare function use<TValue>(dependency: Molecule<TValue> | MoleculeScope<TValue>): TValue;
|
|
32
|
+
type UseMoleculeState<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = { [TKey in keyof TState]: {
|
|
33
|
+
get: TState[TKey] extends Atom<infer TValue> ? (opts?: MoleculeScopeOptions$1) => TValue : never;
|
|
34
|
+
set: TState[TKey] extends WritableAtom<infer _TValue, infer TArgs, infer TReturn> ? (opts?: MoleculeScopeOptions$1) => (...args: TArgs) => TReturn : never;
|
|
35
|
+
reset: IsResetAtom<TState[TKey]> extends true ? (opts?: MoleculeScopeOptions$1) => () => void : never;
|
|
36
|
+
}; };
|
|
37
|
+
type MoleculeScopeOptions$1 = MoleculeScopeOptions;
|
|
38
|
+
interface MoleculeApi<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> {
|
|
39
|
+
Molecule: Molecule<MoleculeState<TState>>;
|
|
40
|
+
Provider: React.FC<MoleculeProviderProps<TState>>;
|
|
41
|
+
Scope: MoleculeScope<string>;
|
|
42
|
+
useMolecule: (opts?: MoleculeScopeOptions$1) => MoleculeState<TState>;
|
|
43
|
+
use: (opts?: MoleculeScopeOptions$1) => UseMoleculeState<TState>;
|
|
44
|
+
}
|
|
45
|
+
type GetMoleculeState<TMoleculeApi extends MoleculeApi<any>> = ReturnType<TMoleculeApi["useMolecule"]>;
|
|
46
|
+
type MoleculeProviderProps<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = Omit<ProviderProps<string>, "scope" | "value"> & {
|
|
47
|
+
scope: string;
|
|
48
|
+
initialState?: Partial<ExtractAtomRecordValues<TState>>;
|
|
49
|
+
};
|
|
50
|
+
type CleanupCallback = () => unknown;
|
|
51
|
+
type MountCallback<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = (state: MoleculeState<TState>) => CleanupCallback | void;
|
|
52
|
+
interface MoleculeOptions<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> {
|
|
53
|
+
type: string;
|
|
54
|
+
scope?: MoleculeScope<string> | string;
|
|
55
|
+
onMount?: MountCallback<TState>;
|
|
56
|
+
onUnmount?: CleanupCallback;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a new Molecule with the given constructor function.
|
|
60
|
+
*
|
|
61
|
+
* @param constructFn - The constructor function for the Molecule.
|
|
62
|
+
* @param options - The options for the Molecule.
|
|
63
|
+
* @returns The new Molecule.
|
|
64
|
+
*/
|
|
65
|
+
declare function createMoleculeApi<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint>(constructFn: (scope: string) => TState, options: MoleculeOptions<TState>): MoleculeApi<TState>;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions$1 as MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, use };
|
|
68
|
+
//# sourceMappingURL=create-molecule.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-molecule.d.cts","names":[],"sources":["../../../src/base/utilities/create-molecule.tsx"],"mappings":";;;;;KAoDY,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,OAAO,2BAAyB;EAErC,KAAK,OAAO,cAAc,mBAClB,eACA,aACA,YAEH,OAAO,+BAA6B,MAAM,UAAU;EAEzD,OAAO,YAAY,OAAO,uBACrB,OAAO;;KAKJ,yBAAuB;UAElB,YACf,eAAe,qBAAqB,UAAU;EAE9C,UAAU,SAAS,cAAc;EACjC,UAAU,MAAM,GAAG,sBAAsB;EACzC,OAAO;EACP,cAAc,OAAO,2BAAyB,cAAc;EAC5D,MAAM,OAAO,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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AtomRecord, AtomRecordConstraint, ExtractAtomRecordValues, IsResetAtom } from "../../types.mjs";
|
|
2
|
+
import { Atom, WritableAtom } from "jotai";
|
|
3
|
+
import { MoleculeScope } from "bunshi";
|
|
4
|
+
import { MoleculeScopeOptions, ProviderProps } from "bunshi/react";
|
|
5
|
+
//#region src/base/utilities/create-molecule.d.ts
|
|
6
|
+
type Molecule<TValue> = {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
} & Record<symbol, unknown>;
|
|
9
|
+
type BaseMoleculeState = AtomRecord<{
|
|
10
|
+
__scope: string;
|
|
11
|
+
__typename: string;
|
|
12
|
+
}>;
|
|
13
|
+
type MoleculeState<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = BaseMoleculeState & TState;
|
|
14
|
+
declare 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
|
+
declare function createScope$1(defaultValue?: string, options?: {
|
|
23
|
+
debugLabel?: string;
|
|
24
|
+
}): MoleculeScope<string>;
|
|
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
|
+
declare function use$1<TValue>(dependency: Molecule<TValue> | MoleculeScope<TValue>): TValue;
|
|
32
|
+
type UseMoleculeState<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = { [TKey in keyof TState]: {
|
|
33
|
+
get: TState[TKey] extends Atom<infer TValue> ? (opts?: MoleculeScopeOptions$1) => TValue : never;
|
|
34
|
+
set: TState[TKey] extends WritableAtom<infer _TValue, infer TArgs, infer TReturn> ? (opts?: MoleculeScopeOptions$1) => (...args: TArgs) => TReturn : never;
|
|
35
|
+
reset: IsResetAtom<TState[TKey]> extends true ? (opts?: MoleculeScopeOptions$1) => () => void : never;
|
|
36
|
+
}; };
|
|
37
|
+
type MoleculeScopeOptions$1 = MoleculeScopeOptions;
|
|
38
|
+
interface MoleculeApi<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> {
|
|
39
|
+
Molecule: Molecule<MoleculeState<TState>>;
|
|
40
|
+
Provider: React.FC<MoleculeProviderProps<TState>>;
|
|
41
|
+
Scope: MoleculeScope<string>;
|
|
42
|
+
useMolecule: (opts?: MoleculeScopeOptions$1) => MoleculeState<TState>;
|
|
43
|
+
use: (opts?: MoleculeScopeOptions$1) => UseMoleculeState<TState>;
|
|
44
|
+
}
|
|
45
|
+
type GetMoleculeState<TMoleculeApi extends MoleculeApi<any>> = ReturnType<TMoleculeApi["useMolecule"]>;
|
|
46
|
+
type MoleculeProviderProps<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = Omit<ProviderProps<string>, "scope" | "value"> & {
|
|
47
|
+
scope: string;
|
|
48
|
+
initialState?: Partial<ExtractAtomRecordValues<TState>>;
|
|
49
|
+
};
|
|
50
|
+
type CleanupCallback = () => unknown;
|
|
51
|
+
type MountCallback<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> = (state: MoleculeState<TState>) => CleanupCallback | void;
|
|
52
|
+
interface MoleculeOptions<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint> {
|
|
53
|
+
type: string;
|
|
54
|
+
scope?: MoleculeScope<string> | string;
|
|
55
|
+
onMount?: MountCallback<TState>;
|
|
56
|
+
onUnmount?: CleanupCallback;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a new Molecule with the given constructor function.
|
|
60
|
+
*
|
|
61
|
+
* @param constructFn - The constructor function for the Molecule.
|
|
62
|
+
* @param options - The options for the Molecule.
|
|
63
|
+
* @returns The new Molecule.
|
|
64
|
+
*/
|
|
65
|
+
declare function createMoleculeApi<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint>(constructFn: (scope: string) => TState, options: MoleculeOptions<TState>): MoleculeApi<TState>;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions$1 as MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope$1 as createScope, use$1 as use };
|
|
68
|
+
//# sourceMappingURL=create-molecule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-molecule.d.mts","names":[],"sources":["../../../src/base/utilities/create-molecule.tsx"],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{isAtom as e,isResetAtom as t,isWritableAtom as n}from"./is-atom.mjs";import{setAtomDebugLabel as r}from"./set-atom-debug.mjs";import{useSyncMolecule as i}from"../hooks/use-sync-molecule.mjs";import{isFunction as a}from"@stryke/type-checks/is-function";import{RESET as o}from"jotai/utils";import{atom as s,useAtomValue as c,useSetAtom as l}from"jotai";import{useCallback as u}from"react";import{isString as d}from"@stryke/type-checks/is-string";import{createScope as f,molecule as p,onMount as m,onUnmount as h,use as g}from"bunshi";import{ScopeProvider as _,useMolecule as v}from"bunshi/react";const y=`__global__`;function b(e=y,t){return f(e,t)}function x(e){return g(e)}function S(f,g){let y=!g.scope||d(g.scope)?b(g.scope??`__global__`):g.scope,x=p((t,n)=>{let i=n(y),o=f(i);o.__scope=s(()=>i),o.__typename=s(()=>g.type);for(let t of Object.keys(o))e(o[t])&&r(o[t],`${g.type}/${i}:${String(t)}`);return m(()=>{if(g.onMount){let e=g.onMount(o);if(a(e))return e}}),h(()=>{g.onUnmount&&g.onUnmount()}),o}),S=e=>v(x,e),C=e=>{let r=S(e),i=Object.keys(r);return new Proxy({},{get(e,a){if(i.filter(e=>e!==`__scope`&&e!==`__typename`).includes(a)){let e=a;return{get:()=>c(r[e]),set:n(r[e])?()=>l(r[e]):void 0,reset:t(r[e])?()=>{let t=l(r[e]);return u(()=>{t(o)},[t])}:void 0}}}})};function w({initialState:e}){let t=S();return i(t,e),null}function T({children:e,scope:t,initialState:n,...r}){return<_{...r} scope={y} value={t}>
|
|
2
|
+
{n&&<w initialState={n}/>}
|
|
3
|
+
{e}
|
|
4
|
+
</_>}return{Scope:y,Provider:T,Molecule:x,useMolecule:S,use:C}}export{y as DEFAULT_SCOPE,S as createMoleculeApi,b as createScope,x as use};
|
|
5
|
+
//# sourceMappingURL=create-molecule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-molecule.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("@stryke/json/storm-json"),t=require("@stryke/type-checks/is-promise");function n(n){let r,i,a={getItem:(e,a)=>{let o=(e=``)=>{if(r!==e){try{let n=o(e);if((0,t.isPromise)(n))return n.then(e=>(i=e,e));i=n}catch{return a}r=e}return i},s=n()?.getItem(e)??void 0;return s&&(0,t.isPromiseLike)(s)?s.then(e=>o(e)):o(s)},removeItem:e=>n()?.removeItem(e),setItem:(t,r)=>n()?.setItem(t,e.StormJSON.stringify(r))};return typeof window<`u`&&typeof window.addEventListener==`function`&&window.Storage&&(a.subscribe=(e,t,r)=>{if(!(n()instanceof window.Storage))return()=>{};let i=i=>{if(i.storageArea===n()&&i.key===e){let e;try{e=JSON.parse(i.newValue||``)}catch{e=r}t(e)}};return window.addEventListener(`storage`,i),()=>{window.removeEventListener(`storage`,i)}}),a}exports.createWebStorage=n;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AsyncStorage, AsyncStringStorage, SyncStorage, SyncStringStorage } from "jotai/vanilla/utils/atomWithStorage";
|
|
2
|
+
//#region src/base/utilities/create-web-storage.d.ts
|
|
3
|
+
declare function createWebStorage<TValue>(getStringStorage: () => AsyncStringStorage | SyncStringStorage | undefined): AsyncStorage<TValue> | SyncStorage<TValue>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { createWebStorage };
|
|
6
|
+
//# sourceMappingURL=create-web-storage.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-web-storage.d.cts","names":[],"sources":["../../../src/base/utilities/create-web-storage.ts"],"mappings":";;iBA2BgB,iBAAiB,QAC/B,wBAAwB,qBAAqB,gCAC5C,aAAa,UAAU,YAAY"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AsyncStorage, AsyncStringStorage, SyncStorage, SyncStringStorage } from "jotai/vanilla/utils/atomWithStorage";
|
|
2
|
+
//#region src/base/utilities/create-web-storage.d.ts
|
|
3
|
+
declare function createWebStorage<TValue>(getStringStorage: () => AsyncStringStorage | SyncStringStorage | undefined): AsyncStorage<TValue> | SyncStorage<TValue>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { createWebStorage };
|
|
6
|
+
//# sourceMappingURL=create-web-storage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-web-storage.d.mts","names":[],"sources":["../../../src/base/utilities/create-web-storage.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{StormJSON as e}from"@stryke/json/storm-json";import{isPromise as t,isPromiseLike as n}from"@stryke/type-checks/is-promise";function r(r){let i,a,o={getItem:(e,o)=>{let s=(e=``)=>{if(i!==e){try{let n=s(e);if(t(n))return n.then(e=>(a=e,e));a=n}catch{return o}i=e}return a},c=r()?.getItem(e)??void 0;return c&&n(c)?c.then(e=>s(e)):s(c)},removeItem:e=>r()?.removeItem(e),setItem:(t,n)=>r()?.setItem(t,e.stringify(n))};return typeof window<`u`&&typeof window.addEventListener==`function`&&window.Storage&&(o.subscribe=(e,t,n)=>{if(!(r()instanceof window.Storage))return()=>{};let i=i=>{if(i.storageArea===r()&&i.key===e){let e;try{e=JSON.parse(i.newValue||``)}catch{e=n}t(e)}};return window.addEventListener(`storage`,i),()=>{window.removeEventListener(`storage`,i)}}),o}export{r as createWebStorage};
|
|
2
|
+
//# sourceMappingURL=create-web-storage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-web-storage.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={trailing:!0};function t(t,r=25,i={}){if(i={...e,...i},!Number.isFinite(r))throw TypeError("Expected `wait` to be a finite number");let a,o,s=[],c,l,u=async(e,r)=>(c=n(t,e,r),c.finally(async()=>{if(c=void 0,i.trailing&&l&&!o){let t=u(e,l);return l=void 0,t}}),c);return async(...e)=>c?(i.trailing&&(l=e),c):new Promise(t=>{let n=!o&&i.leading;clearTimeout(o),o=setTimeout(()=>{o=void 0;let t=i.leading?a:u(this,e);for(let e of s)e(t);s=[]},r),n?(a=u(this,e),t(a)):s.push(t)})}async function n(e,t,n){return await e.apply(t,n)}exports.debounce=t;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/base/utilities/debounce.d.ts
|
|
2
|
+
interface DebounceOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Call the `fn` on the [leading edge of the timeout](https://css-tricks.com/debouncing-throttling-explained-examples/#article-header-id-1).
|
|
5
|
+
* Meaning immediately, instead of waiting for `wait` milliseconds.
|
|
6
|
+
*
|
|
7
|
+
* @defaultValue false
|
|
8
|
+
*/
|
|
9
|
+
readonly leading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
Call the `fn` on trailing edge with last used arguments. Result of call is from previous call.
|
|
12
|
+
@defaultValue true
|
|
13
|
+
*/
|
|
14
|
+
readonly trailing?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function debounce<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => PromiseLike<TReturn> | TReturn, wait?: number, options?: DebounceOptions): (...args: TArgs) => Promise<TReturn>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DebounceOptions, debounce };
|
|
19
|
+
//# sourceMappingURL=debounce.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.cts","names":[],"sources":["../../../src/base/utilities/debounce.ts"],"mappings":";UAkBiB;;;;;;;WAON;;;;;WAMA;;iBAOK,SAAS,yBAAyB,SAChD,QAAQ,MAAM,UAAU,YAAY,WAAW,SAC/C,eACA,UAAS,sBAwCQ,MAAM,UAAK,QAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/base/utilities/debounce.d.ts
|
|
2
|
+
interface DebounceOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Call the `fn` on the [leading edge of the timeout](https://css-tricks.com/debouncing-throttling-explained-examples/#article-header-id-1).
|
|
5
|
+
* Meaning immediately, instead of waiting for `wait` milliseconds.
|
|
6
|
+
*
|
|
7
|
+
* @defaultValue false
|
|
8
|
+
*/
|
|
9
|
+
readonly leading?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
Call the `fn` on trailing edge with last used arguments. Result of call is from previous call.
|
|
12
|
+
@defaultValue true
|
|
13
|
+
*/
|
|
14
|
+
readonly trailing?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function debounce<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => PromiseLike<TReturn> | TReturn, wait?: number, options?: DebounceOptions): (...args: TArgs) => Promise<TReturn>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DebounceOptions, debounce };
|
|
19
|
+
//# sourceMappingURL=debounce.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.d.mts","names":[],"sources":["../../../src/base/utilities/debounce.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={trailing:!0};function t(t,r=25,i={}){if(i={...e,...i},!Number.isFinite(r))throw TypeError("Expected `wait` to be a finite number");let a,o,s=[],c,l,u=async(e,r)=>(c=n(t,e,r),c.finally(async()=>{if(c=void 0,i.trailing&&l&&!o){let t=u(e,l);return l=void 0,t}}),c);return async(...e)=>c?(i.trailing&&(l=e),c):new Promise(t=>{let n=!o&&i.leading;clearTimeout(o),o=setTimeout(()=>{o=void 0;let t=i.leading?a:u(this,e);for(let e of s)e(t);s=[]},r),n?(a=u(this,e),t(a)):s.push(t)})}async function n(e,t,n){return await e.apply(t,n)}export{t as debounce};
|
|
2
|
+
//# sourceMappingURL=debounce.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./set-atom-debug.cjs"),t=require("./create-web-storage.cjs"),n=require("./create-molecule.cjs"),r=require("./debounce.cjs");exports.DEFAULT_SCOPE=n.DEFAULT_SCOPE,exports.createMoleculeApi=n.createMoleculeApi,exports.createScope=n.createScope,exports.createWebStorage=t.createWebStorage,exports.debounce=r.debounce,exports.setAtomDebugLabel=e.setAtomDebugLabel,exports.setAtomDebugPrivate=e.setAtomDebugPrivate,exports.use=n.use;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, use } from "./create-molecule.cjs";
|
|
2
|
+
import { createWebStorage } from "./create-web-storage.cjs";
|
|
3
|
+
import { DebounceOptions, debounce } from "./debounce.cjs";
|
|
4
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./set-atom-debug.cjs";
|
|
5
|
+
export { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, DebounceOptions, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, createWebStorage, debounce, setAtomDebugLabel, setAtomDebugPrivate, use };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, use } from "./create-molecule.mjs";
|
|
2
|
+
import { createWebStorage } from "./create-web-storage.mjs";
|
|
3
|
+
import { DebounceOptions, debounce } from "./debounce.mjs";
|
|
4
|
+
import { setAtomDebugLabel, setAtomDebugPrivate } from "./set-atom-debug.mjs";
|
|
5
|
+
export { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, DebounceOptions, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, createWebStorage, debounce, setAtomDebugLabel, setAtomDebugPrivate, use };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{setAtomDebugLabel as e,setAtomDebugPrivate as t}from"./set-atom-debug.mjs";import{createWebStorage as n}from"./create-web-storage.mjs";import{DEFAULT_SCOPE as r,createMoleculeApi as i,createScope as a,use as o}from"./create-molecule.mjs";import{debounce as s}from"./debounce.mjs";export{r as DEFAULT_SCOPE,i as createMoleculeApi,a as createScope,n as createWebStorage,s as debounce,e as setAtomDebugLabel,t as setAtomDebugPrivate,o as use};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("@stryke/type-checks/is-function"),t=require("@stryke/type-checks/is-plain-object");const n=n=>{try{return(0,t.isPlainObject)(n)&&`read`in n&&(0,e.isFunction)(n.read)}catch{return!1}},r=t=>{try{return n(t)&&`write`in t&&(0,e.isFunction)(t.write)}catch{return!1}},i=e=>{try{return r(e)&&`init`in e}catch{return!1}};exports.isAtom=n,exports.isResetAtom=i,exports.isWritableAtom=r;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isFunction as e}from"@stryke/type-checks/is-function";import{isPlainObject as t}from"@stryke/type-checks/is-plain-object";const n=n=>{try{return t(n)&&`read`in n&&e(n.read)}catch{return!1}},r=t=>{try{return n(t)&&`write`in t&&e(t.write)}catch{return!1}},i=e=>{try{return r(e)&&`init`in e}catch{return!1}};export{n as isAtom,i as isResetAtom,r as isWritableAtom};
|
|
2
|
+
//# sourceMappingURL=is-atom.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-atom.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("@stryke/env/environment-checks");const t=(t,n)=>{e.isDevelopment&&(t.debugLabel=n)},n=t=>{e.isDevelopment&&(t.debugPrivate=!0)};exports.setAtomDebugLabel=t,exports.setAtomDebugPrivate=n;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Atom } from "jotai/vanilla";
|
|
2
|
+
//#region src/base/utilities/set-atom-debug.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Add a debug label to the Jotai Atom
|
|
5
|
+
*
|
|
6
|
+
* @param atom - The atom to apply the debug label to
|
|
7
|
+
* @param label - The label to apply to the atom
|
|
8
|
+
*/
|
|
9
|
+
declare const setAtomDebugLabel: (atom: Atom<unknown>, label: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Mark the atom as a *private* or internal
|
|
12
|
+
*
|
|
13
|
+
* @param atom - The atom to mark as private
|
|
14
|
+
*/
|
|
15
|
+
declare const setAtomDebugPrivate: (atom: Atom<unknown>) => void;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { setAtomDebugLabel, setAtomDebugPrivate };
|
|
18
|
+
//# sourceMappingURL=set-atom-debug.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-atom-debug.d.cts","names":[],"sources":["../../../src/base/utilities/set-atom-debug.ts"],"mappings":";;;;;;;;cA2Ba,oBAAqB,MAAM,eAAe;;;;;;cAW1C,sBAAuB,MAAM"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Atom } from "jotai/vanilla";
|
|
2
|
+
//#region src/base/utilities/set-atom-debug.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Add a debug label to the Jotai Atom
|
|
5
|
+
*
|
|
6
|
+
* @param atom - The atom to apply the debug label to
|
|
7
|
+
* @param label - The label to apply to the atom
|
|
8
|
+
*/
|
|
9
|
+
declare const setAtomDebugLabel: (atom: Atom<unknown>, label: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Mark the atom as a *private* or internal
|
|
12
|
+
*
|
|
13
|
+
* @param atom - The atom to mark as private
|
|
14
|
+
*/
|
|
15
|
+
declare const setAtomDebugPrivate: (atom: Atom<unknown>) => void;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { setAtomDebugLabel, setAtomDebugPrivate };
|
|
18
|
+
//# sourceMappingURL=set-atom-debug.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-atom-debug.d.mts","names":[],"sources":["../../../src/base/utilities/set-atom-debug.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-atom-debug.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../theme/molecules/theme-molecule.cjs"),t=require("../theme/hooks/use-theme-actions.cjs"),n=require("../theme/utilities/theme-helpers.cjs"),r=require("../theme/hooks/use-theme-store.cjs"),i=require("../theme/providers/ThemeProvider.cjs"),a=require("../theme/types.cjs");require("../theme/index.cjs"),exports.ColorThemeName=a.ColorThemeName,exports.ThemeApi=e.ThemeApi,exports.ThemeProvider=i.ThemeProvider,exports.getThemeColorThemeName=n.getThemeColorThemeName,exports.themeColorThemeNameExists=n.themeColorThemeNameExists,exports.useColorThemeName=r.useColorThemeName,exports.useColorThemeNameExists=r.useColorThemeNameExists,exports.useThemeActions=t.useThemeActions,exports.useThemeMode=r.useThemeMode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColorThemeMode, ColorThemeName, ThemeBaseState, ThemeOptions } from "../theme/types.cjs";
|
|
2
|
+
import { useThemeActions } from "../theme/hooks/use-theme-actions.cjs";
|
|
3
|
+
import { useColorThemeName, useColorThemeNameExists, useThemeMode } from "../theme/hooks/use-theme-store.cjs";
|
|
4
|
+
import { ThemeApi } from "../theme/molecules/theme-molecule.cjs";
|
|
5
|
+
import { ThemeProvider, ThemeProviderProps } from "../theme/providers/ThemeProvider.cjs";
|
|
6
|
+
import { getThemeColorThemeName, themeColorThemeNameExists } from "../theme/utilities/theme-helpers.cjs";
|
|
7
|
+
import "../theme/index.cjs";
|
|
8
|
+
export { ColorThemeMode, ColorThemeName, ThemeApi, ThemeBaseState, ThemeOptions, ThemeProvider, ThemeProviderProps, getThemeColorThemeName, themeColorThemeNameExists, useColorThemeName, useColorThemeNameExists, useThemeActions, useThemeMode };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColorThemeMode, ColorThemeName, ThemeBaseState, ThemeOptions } from "../theme/types.mjs";
|
|
2
|
+
import { useThemeActions } from "../theme/hooks/use-theme-actions.mjs";
|
|
3
|
+
import { useColorThemeName, useColorThemeNameExists, useThemeMode } from "../theme/hooks/use-theme-store.mjs";
|
|
4
|
+
import { ThemeApi } from "../theme/molecules/theme-molecule.mjs";
|
|
5
|
+
import { ThemeProvider, ThemeProviderProps } from "../theme/providers/ThemeProvider.mjs";
|
|
6
|
+
import { getThemeColorThemeName, themeColorThemeNameExists } from "../theme/utilities/theme-helpers.mjs";
|
|
7
|
+
import "../theme/index.mjs";
|
|
8
|
+
export { ColorThemeMode, ColorThemeName, ThemeApi, ThemeBaseState, ThemeOptions, ThemeProvider, ThemeProviderProps, getThemeColorThemeName, themeColorThemeNameExists, useColorThemeName, useColorThemeNameExists, useThemeActions, useThemeMode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ThemeApi as e}from"../theme/molecules/theme-molecule.mjs";import{useThemeActions as t}from"../theme/hooks/use-theme-actions.mjs";import{getThemeColorThemeName as n,themeColorThemeNameExists as r}from"../theme/utilities/theme-helpers.mjs";import{useColorThemeName as i,useColorThemeNameExists as a,useThemeMode as o}from"../theme/hooks/use-theme-store.mjs";import{ThemeProvider as s}from"../theme/providers/ThemeProvider.mjs";import{ColorThemeName as c}from"../theme/types.mjs";import"../theme/index.mjs";export{c as ColorThemeName,e as ThemeApi,s as ThemeProvider,n as getThemeColorThemeName,r as themeColorThemeNameExists,i as useColorThemeName,a as useColorThemeNameExists,t as useThemeActions,o as useThemeMode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("jotai/utils");require("jotai");const t=(t,n,r)=>(0,e.atomWithDefault)(e=>{let i=e(t),a=e(n),o=e(r);return(i.items??[]).reduce((e,t,n)=>(e.some(e=>e.value===t.value)||e.push({index:n,...t,selected:t.value===a,disabled:!!t.disabled||!!o}),e),[])});exports.atomWithFieldItems=t;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{atomWithDefault as e}from"jotai/utils";import"jotai";const t=(t,n,r)=>e(e=>{let i=e(t),a=e(n),o=e(r);return(i.items??[]).reduce((e,t,n)=>(e.some(e=>e.value===t.value)||e.push({index:n,...t,selected:t.value===a,disabled:!!t.disabled||!!o}),e),[])});export{t as atomWithFieldItems};
|
|
2
|
+
//# sourceMappingURL=atom-with-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atom-with-field.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../utilities/is-validation-results.cjs");let t=require("jotai"),n=require("@stryke/type-checks/is-set-object");const r=(e,t)=>{let n=[];return e.initialize&&n.push(...e.initialize.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.change&&n.push(...e.change.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.blur&&n.push(...e.blur.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.server&&n.push(...e.server.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.submit&&n.push(...e.submit.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),n},i=(t,n)=>e.isValidationResults(t)?r(t,n):Object.entries(t).reduce((t,[a,o])=>(t[a]=e.isValidationResults(o)?r(o,n):i(o,n),t),{}),a=(e,n)=>(0,t.atom)(t=>i(t(e),n)),o=(t,i)=>e.isValidationResults(t)?r(t,i):Object.entries(t??{}).reduce((t,[a,s])=>((0,n.isSetObject)(s)&&(e.isValidationResults(s)?t.push(...r(s,i)):t.push(...o(s,i))),t),[]),s=(e,n)=>(0,t.atom)(t=>o(t(e),n)),c=(e,n)=>(0,t.atom)(t=>r(t(e),n)),l=(e,n,r,i,a,o,s)=>(0,t.atom)(t=>{let c=t(e);if(c.length>0)return c;let l=t(n);if(l.length>0)return l;let u=t(r);if(u.length>0)return u;let d=t(i);if(d.length>0)return d;let f=t(a);if(f.length>0)return f;let p=t(o);if(p.length>0)return p;let m=t(s);return m.length>0?m:[]}),u=(e,n,r,i,a,o,s,c)=>(0,t.atom)(t=>{let l=t(e);return t(n).length>0||l.theme?.includes(`danger`)?`danger`:t(r).length>0||l.theme?.includes(`warning`)?`warning`:t(o).length>0||l.theme?.includes(`success`)?`success`:t(i).length>0||l.theme?.includes(`info`)?`info`:t(a).length>0||l.theme?.includes(`discovery`)?`discovery`:t(s).length>0||l.theme?.includes(`positive`)?`positive`:t(c).length>0||l.theme?.includes(`negative`)?`negative`:`primary`});exports.atomWithFieldsMessageList=s,exports.atomWithFieldsMessageTypes=a,exports.atomWithMessageTypes=c,exports.atomWithMessages=l,exports.atomWithTheme=u,exports.getFieldsMessageList=o,exports.getFieldsMessageTypes=i,exports.getMessageType=r;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isValidationResults as e}from"../utilities/is-validation-results.mjs";import{atom as t}from"jotai";import{isSetObject as n}from"@stryke/type-checks/is-set-object";const r=(e,t)=>{let n=[];return e.initialize&&n.push(...e.initialize.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.change&&n.push(...e.change.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.blur&&n.push(...e.blur.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.server&&n.push(...e.server.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),e.submit&&n.push(...e.submit.filter(e=>t===e.type&&(e.message||e.code)&&!n.some(t=>t.message===e.message||t.code===e.code))),n},i=(t,n)=>e(t)?r(t,n):Object.entries(t).reduce((t,[a,o])=>(t[a]=e(o)?r(o,n):i(o,n),t),{}),a=(e,n)=>t(t=>i(t(e),n)),o=(t,i)=>e(t)?r(t,i):Object.entries(t??{}).reduce((t,[a,s])=>(n(s)&&(e(s)?t.push(...r(s,i)):t.push(...o(s,i))),t),[]),s=(e,n)=>t(t=>o(t(e),n)),c=(e,n)=>t(t=>r(t(e),n)),l=(e,n,r,i,a,o,s)=>t(t=>{let c=t(e);if(c.length>0)return c;let l=t(n);if(l.length>0)return l;let u=t(r);if(u.length>0)return u;let d=t(i);if(d.length>0)return d;let f=t(a);if(f.length>0)return f;let p=t(o);if(p.length>0)return p;let m=t(s);return m.length>0?m:[]}),u=(e,n,r,i,a,o,s,c)=>t(t=>{let l=t(e);return t(n).length>0||l.theme?.includes(`danger`)?`danger`:t(r).length>0||l.theme?.includes(`warning`)?`warning`:t(o).length>0||l.theme?.includes(`success`)?`success`:t(i).length>0||l.theme?.includes(`info`)?`info`:t(a).length>0||l.theme?.includes(`discovery`)?`discovery`:t(s).length>0||l.theme?.includes(`positive`)?`positive`:t(c).length>0||l.theme?.includes(`negative`)?`negative`:`primary`});export{s as atomWithFieldsMessageList,a as atomWithFieldsMessageTypes,c as atomWithMessageTypes,l as atomWithMessages,u as atomWithTheme,o as getFieldsMessageList,i as getFieldsMessageTypes,r as getMessageType};
|
|
2
|
+
//# sourceMappingURL=atom-with-messages.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atom-with-messages.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./use-field-actions.cjs"),t=require("./use-field-ref.cjs"),n=require("./use-form-actions.cjs");exports.useFieldActions=e.useFieldActions,exports.useFieldRef=t.useFieldRef,exports.useFormActions=n.useFormActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFieldActions as e}from"./use-field-actions.mjs";import{useFieldRef as t}from"./use-field-ref.mjs";import{useFormActions as n}from"./use-form-actions.mjs";export{e as useFieldActions,t as useFieldRef,n as useFormActions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../molecules/field-molecule.cjs"),t=require("../types.cjs");let n=require("jotai/utils"),r=require("react"),i=require("@stryke/type-checks/is-promise"),a=require("@stryke/string-format/upper-case-first");const o=()=>{let o=e.FieldApi.useMolecule(),s=(0,n.useAtomCallback)((0,r.useCallback)(async(e,n,r,s)=>{let c=e(o.options);if(c.validate?.[`on${(0,a.upperCaseFirst)(s)}`]&&c.validate[`on${(0,a.upperCaseFirst)(s)}`].length>0||c.validate?.[`on${(0,a.upperCaseFirst)(t.ValidationCause.INITIALIZE)}`]&&c.validate[`on${(0,a.upperCaseFirst)(t.ValidationCause.INITIALIZE)}`].length>0){let l=e(o.previousValue),u=[];c.validate?.[`on${(0,a.upperCaseFirst)(s)}`]&&c.validate[`on${(0,a.upperCaseFirst)(s)}`].length>0&&u.push(...c.validate[`on${(0,a.upperCaseFirst)(s)}`].map(t=>t(r,l,s,e,n))),s!==t.ValidationCause.INITIALIZE&&c.validate?.[`on${(0,a.upperCaseFirst)(t.ValidationCause.INITIALIZE)}`]&&c.validate[`on${(0,a.upperCaseFirst)(t.ValidationCause.INITIALIZE)}`].length>0&&u.push(...c.validate[`on${(0,a.upperCaseFirst)(t.ValidationCause.INITIALIZE)}`].map(t=>t(r,l,s,e,n)));let d=[],f=[];for(let e of u)e&&((0,i.isPromise)(e)?f.push(e):d.push(...e));if(f.length>0){n(o.validating,!0);for(let e of await Promise.all(f))e&&e.length>0&&d.push(...e);n(o.validating,!1)}n(o.validationResults,e=>({...e,[s]:d}))}},[])),c=(0,n.useAtomCallback)((0,r.useCallback)(async(e,t)=>{t(o.value,e(o.initialValue)),t(o.options,n.RESET)},[])),l=(0,n.useAtomCallback)((0,r.useCallback)(async(e,t,n,r=!0)=>{r&&e(o.dirty)||n!==e(o.initialValue)&&t(o.initialValue,n)},[])),u=(0,n.useAtomCallback)((0,r.useCallback)(async(e,t,n,r=!1)=>{if(!e(o.disabled)){!e(o.touched)&&r&&t(o.touched,r);let i=e(o.options),a=e(o.value),s=n;i.parse&&(s=i.parse(n)),i.isEqual(s,a)||t(o.value,s)}},[])),d=(0,n.useAtomCallback)((0,r.useCallback)(async(e,t)=>{e(o.disabled)||(e(o.touched)||t(o.touched,!0),t(o.focused,!0))},[])),f=(0,n.useAtomCallback)((0,r.useCallback)(async(e,t)=>{e(o.disabled)||(e(o.touched)||t(o.touched,!0),t(o.focused,!1),t(o.blurred,!0))},[])),p=(0,r.useCallback)(async e=>e?d():f(),[d,f]),m=(0,n.useAtomCallback)((0,r.useCallback)(async e=>p(!e(o.focused)),[p]));return{mount:(0,n.useAtomCallback)((0,r.useCallback)(async(e,t,n,r)=>{if(t(o.ref,n),t(o.tabIndex,r??0),!e(o.initialValue)){let n=e(o.options);t(o.initialValue,n.defaultValue??null)}},[])),initialize:l,change:u,focus:d,blur:f,setFocused:p,toggleFocused:m,validate:s,reset:c}};exports.useFieldActions=o;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ValidationCause } from "../types.cjs";
|
|
2
|
+
import { Ref } from "react";
|
|
3
|
+
//#region src/form/hooks/use-field-actions.d.ts
|
|
4
|
+
declare const useFieldActions: <TFieldValue = any>() => {
|
|
5
|
+
mount: (ref: Ref<HTMLInputElement>, tabIndex?: number | undefined) => Promise<void>;
|
|
6
|
+
initialize: (initialValue: TFieldValue, skipIfDirty?: boolean | undefined) => Promise<void>;
|
|
7
|
+
change: (nextValue: TFieldValue, touch?: boolean | undefined) => Promise<void>;
|
|
8
|
+
focus: () => Promise<void>;
|
|
9
|
+
blur: () => Promise<void>;
|
|
10
|
+
setFocused: (focused: boolean) => Promise<void>;
|
|
11
|
+
toggleFocused: () => Promise<void>;
|
|
12
|
+
validate: (nextValue: TFieldValue, cause: ValidationCause) => Promise<void>;
|
|
13
|
+
reset: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useFieldActions };
|
|
17
|
+
//# sourceMappingURL=use-field-actions.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-field-actions.d.cts","names":[],"sources":["../../../src/form/hooks/use-field-actions.ts"],"mappings":";;;cA8Ba,kBAAmB;;;;;;EA2KZ,aAAA,qBAAO"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ValidationCause } from "../types.mjs";
|
|
2
|
+
import { Ref } from "react";
|
|
3
|
+
//#region src/form/hooks/use-field-actions.d.ts
|
|
4
|
+
declare const useFieldActions: <TFieldValue = any>() => {
|
|
5
|
+
mount: (ref: Ref<HTMLInputElement>, tabIndex?: number | undefined) => Promise<void>;
|
|
6
|
+
initialize: (initialValue: TFieldValue, skipIfDirty?: boolean | undefined) => Promise<void>;
|
|
7
|
+
change: (nextValue: TFieldValue, touch?: boolean | undefined) => Promise<void>;
|
|
8
|
+
focus: () => Promise<void>;
|
|
9
|
+
blur: () => Promise<void>;
|
|
10
|
+
setFocused: (focused: boolean) => Promise<void>;
|
|
11
|
+
toggleFocused: () => Promise<void>;
|
|
12
|
+
validate: (nextValue: TFieldValue, cause: ValidationCause) => Promise<void>;
|
|
13
|
+
reset: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useFieldActions };
|
|
17
|
+
//# sourceMappingURL=use-field-actions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-field-actions.d.mts","names":[],"sources":["../../../src/form/hooks/use-field-actions.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{FieldApi as e}from"../molecules/field-molecule.mjs";import{ValidationCause as t}from"../types.mjs";import{RESET as n,useAtomCallback as r}from"jotai/utils";import{useCallback as i}from"react";import{isPromise as a}from"@stryke/type-checks/is-promise";import{upperCaseFirst as o}from"@stryke/string-format/upper-case-first";const s=()=>{let s=e.useMolecule(),c=r(i(async(e,n,r,i)=>{let c=e(s.options);if(c.validate?.[`on${o(i)}`]&&c.validate[`on${o(i)}`].length>0||c.validate?.[`on${o(t.INITIALIZE)}`]&&c.validate[`on${o(t.INITIALIZE)}`].length>0){let l=e(s.previousValue),u=[];c.validate?.[`on${o(i)}`]&&c.validate[`on${o(i)}`].length>0&&u.push(...c.validate[`on${o(i)}`].map(t=>t(r,l,i,e,n))),i!==t.INITIALIZE&&c.validate?.[`on${o(t.INITIALIZE)}`]&&c.validate[`on${o(t.INITIALIZE)}`].length>0&&u.push(...c.validate[`on${o(t.INITIALIZE)}`].map(t=>t(r,l,i,e,n)));let d=[],f=[];for(let e of u)e&&(a(e)?f.push(e):d.push(...e));if(f.length>0){n(s.validating,!0);for(let e of await Promise.all(f))e&&e.length>0&&d.push(...e);n(s.validating,!1)}n(s.validationResults,e=>({...e,[i]:d}))}},[])),l=r(i(async(e,t)=>{t(s.value,e(s.initialValue)),t(s.options,n)},[])),u=r(i(async(e,t,n,r=!0)=>{r&&e(s.dirty)||n!==e(s.initialValue)&&t(s.initialValue,n)},[])),d=r(i(async(e,t,n,r=!1)=>{if(!e(s.disabled)){!e(s.touched)&&r&&t(s.touched,r);let i=e(s.options),a=e(s.value),o=n;i.parse&&(o=i.parse(n)),i.isEqual(o,a)||t(s.value,o)}},[])),f=r(i(async(e,t)=>{e(s.disabled)||(e(s.touched)||t(s.touched,!0),t(s.focused,!0))},[])),p=r(i(async(e,t)=>{e(s.disabled)||(e(s.touched)||t(s.touched,!0),t(s.focused,!1),t(s.blurred,!0))},[])),m=i(async e=>e?f():p(),[f,p]),h=r(i(async e=>m(!e(s.focused)),[m]));return{mount:r(i(async(e,t,n,r)=>{if(t(s.ref,n),t(s.tabIndex,r??0),!e(s.initialValue)){let n=e(s.options);t(s.initialValue,n.defaultValue??null)}},[])),initialize:u,change:d,focus:f,blur:p,setFocused:m,toggleFocused:h,validate:c,reset:l}};export{s as useFieldActions};
|
|
2
|
+
//# sourceMappingURL=use-field-actions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-field-actions.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../molecules/field-molecule.cjs");let t=require("react"),n=require("@maskito/react"),r=require("@tamagui/core");const i=i=>{let a=(0,t.useRef)(null),o=e.FieldApi.use().options.get(),s=[a,(0,n.useMaskito)({options:o.mask})];return i&&s.push(i),(0,r.useComposedRefs)(...s)};exports.useFieldRef=i;
|