@e1011/es-kit 1.1.48 → 1.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/esm/index.css +278 -278
- package/dist/hooks/index.css +278 -278
- package/dist/lib/cjs/src/core/ui/components/atoms/tag/tag.types.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/index.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.js +1 -1
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js +2 -0
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js.map +1 -0
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.templates.js.map +1 -1
- package/dist/lib/cjs/src/index.js +1 -1
- package/dist/lib/esm/src/core/ui/components/atoms/tag/tag.types.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/index.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js +1 -1
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js +2 -0
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js.map +1 -0
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.templates.js.map +1 -1
- package/dist/lib/esm/src/index.js +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/index.d.ts +0 -1
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/atoms/tag/tag.types.d.ts +1 -1
- package/dist/types/src/core/ui/components/atoms/tag/tag.types.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/atoms/text/text.types.d.ts +1 -1
- package/dist/types/src/core/ui/components/atoms/text/text.types.d.ts.map +1 -1
- package/dist/types/src/core/ui/components/atoms/toggle/Toggle.d.ts +12 -0
- package/dist/types/src/core/ui/components/atoms/toggle/Toggle.d.ts.map +1 -0
- package/dist/types/src/core/ui/components/atoms/toggle/toggle.stories.d.ts +13 -0
- package/dist/types/src/core/ui/components/atoms/toggle/toggle.stories.d.ts.map +1 -0
- package/dist/types/src/core/ui/components/atoms/toggle/toggle.test.d.ts +5 -0
- package/dist/types/src/core/ui/components/atoms/toggle/toggle.test.d.ts.map +1 -0
- package/dist/types/src/core/ui/components/field/Field.d.ts +1 -0
- package/dist/types/src/core/ui/components/field/Field.d.ts.map +1 -1
- package/dist/types/src/core/ui/index.d.ts +1 -0
- package/dist/types/src/core/ui/index.d.ts.map +1 -1
- package/dist/types/src/core/ui/types/CommonProps.d.ts +4 -0
- package/dist/types/src/core/ui/types/CommonProps.d.ts.map +1 -1
- package/dist/types/src/core/ui/types/index.d.ts +2 -0
- package/dist/types/src/core/ui/types/index.d.ts.map +1 -0
- package/dist/types/src/core/utils/appState/peregrineMQ/index.d.ts +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/index.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/peregrineMQ.d.ts +2 -2
- package/dist/types/src/core/utils/appState/peregrineMQ/peregrineMQ.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/peregrineMQ.types.d.ts +5 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/peregrineMQ.types.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.d.ts +2 -2
- package/dist/types/src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/store/store.vanillajs.d.ts.map +1 -1
- package/dist/types/src/ts-playground.d.ts +1 -0
- package/dist/types/src/ts-playground.d.ts.map +1 -0
- package/dist/ui/esm/src/core/ui/components/atoms/tag/tag.types.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/ui/src/core/ui/components/atoms/tag/tag.types.js.map +1 -1
- package/dist/ui/src/core/ui/components/field/Field.js.map +1 -1
- package/dist/utils/esm/index.css +278 -278
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/index.js.map +1 -1
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js +1 -1
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js +2 -0
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js.map +1 -0
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.js.map +1 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.templates.js.map +1 -1
- package/dist/utils/esm/src/core/utils/index.js +1 -1
- package/dist/utils/index.css +278 -278
- package/dist/utils/src/core/utils/appState/peregrineMQ/index.js.map +1 -1
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.js +1 -1
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js +2 -0
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js.map +1 -0
- package/dist/utils/src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.js.map +1 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.templates.js.map +1 -1
- package/dist/utils/src/core/utils/index.js +1 -1
- package/package.json +1 -1
- package/dist/types/src/core/types/CommonProps.d.ts +0 -11
- package/dist/types/src/core/types/CommonProps.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peregrineMQ.types.js","sources":["../../../../../../../../src/core/utils/appState/peregrineMQ/peregrineMQ.types.ts"],"sourcesContent":["export type CallbackPayload = string | number | Record<any, any>;\nexport type Callback = (message: string, data?: CallbackPayload) => void;\n\nexport type SubscribersSet = Set<Callback>;\n\nexport interface Config {\n /**\n * If true, enables automatic removal of channels without subscribers.\n */\n allowAutoPrune?: boolean\n\n /**\n * The interval, in milliseconds, for checking channels with no subscribers.\n */\n pruneInterval?: number\n\n /**\n * If true, allows the use of the clear method to remove all channels and listeners.\n */\n allowClear?: boolean\n}\n\nexport interface UnsubscribeOptions {\n /**\n * The channel to unsubscribe from.\n */\n channel?: string\n\n /**\n * If true, removes the channel from the collection when the last subscriber is removed.\n */\n prune?: boolean\n}\n\nexport interface PeregrineMQApi {\n /**\n * Sets the configuration options for a PeregrineMQ instance.\n *\n * @param {Config} config - An object containing configuration options for the instance.\n * @return {void}\n */\n configure: (config: Config) => void\n\n /**\n * Retrieves a list of all channels and their subscribers.\n *\n * @return { string[] }\n */\n getChannels: () => string[]\n\n /**\n * Removes all channels that have no subscribers.\n *\n * @return {void}\n */\n prune: () => void\n\n /**\n * Removes a specified channel from the collection.\n *\n * @param {string} channel - The name of the channel to remove.\n * @return {boolean} - Returns true if the channel was successfully removed, otherwise false.\n */\n removeChannel: (channel: string) => boolean\n\n /**\n * Publishes a message to a specified channel, passing the data to its subscribers.\n *\n * @param {string} channel - The channel to publish the message to.\n * @param {unknown} [data] - The data to pass to subscribers.\n * @return {boolean} - Returns true if the message was successfully published, otherwise false.\n */\n publish: (channel: string, data?: unknown) => PublishReturnType\n\n /**\n * Subscribes a function to a specified channel.\n * The returned unsubscribe function is unique and should be stored for later use.\n *\n * @param {string} channel - The channel name to subscribe to.\n * @param {Callback} callback - The function to call when a new message is published.\n * @return {() => boolean} - The unsubscribe function.\n */\n subscribe: (channel: string, callback: Callback) => () => boolean\n\n /**\n * Unsubscribes a callback from a channel.\n * Returns true if the callback was successfully unsubscribed, otherwise false.\n *\n * @param {Callback} callback - The callback to unsubscribe.\n * @param {UnsubscribeOptions} [options] - Options for unsubscribing, including the channel.\n * @return {boolean} - Returns true if the callback was successfully unsubscribed, otherwise false.\n */\n unsubscribe: (callback: Callback, options?: UnsubscribeOptions) => boolean\n\n /**\n * Checks if a specified callback is subscribed to a specified channel (or any channel if not specified).\n *\n * @param {Callback} callback - The callback to check for subscription.\n * @param {string} [channel] - The channel to check for subscription. If not specified, all channels will be checked.\n * @return {boolean} - Returns true if the callback is subscribed, otherwise false.\n */\n isSubscribed: (callback: Callback, channel?: string) => boolean\n\n /**\n * Removes all channels and subscribers from the collection.\n *\n * @function\n * @alias clear\n */\n clear: () => void\n\n /**\n * Retrieves the identifier for the specific instance of PeregrineMQ.\n *\n * @return {string} - A string identifier for the specific instance.\n */\n getId: () => string\n}\nexport const NON_EXISTENT_CHANNEL = 'NON_EXISTENT_CHANNEL'\n\nexport type NON_EXISTENT_CHANNEL_TYPE = typeof NON_EXISTENT_CHANNEL\n\nexport type PublishToChannelReturnType = NON_EXISTENT_CHANNEL_TYPE\n | undefined | boolean | unknown | Array<undefined | boolean | unknown>\n\nexport type PublishReturnType = PublishToChannelReturnType | PublishToChannelReturnType[]\n"],"names":["NON_EXISTENT_CHANNEL"],"mappings":"AAsHO,MAAMA,EAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePeregrineMQ.react.js","sources":["../../../../../../../../src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nimport { PeregrineMQ } from './peregrineMQ'\nimport { Callback } from './peregrineMQ.types'\n\nexport type usePeregrineMQReturnType = [\n (() => boolean) | undefined,\n <T>(channel: string, data?: T) =>
|
|
1
|
+
{"version":3,"file":"usePeregrineMQ.react.js","sources":["../../../../../../../../src/core/utils/appState/peregrineMQ/usePeregrineMQ.react.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nimport { PeregrineMQ } from './peregrineMQ'\nimport { Callback, PublishReturnType } from './peregrineMQ.types'\n\nexport type usePeregrineMQReturnType = [\n (() => boolean) | undefined,\n <T>(channel: string, data?: T) => PublishReturnType\n]\n\nexport const usePeregrineMQ = (\n peregrineInstance: PeregrineMQ, channel: string, callback: Callback,\n): usePeregrineMQReturnType => {\n const memCallback = useCallback(callback, [callback])\n\n const unsubscribeRef = useRef<ReturnType<typeof peregrineInstance.subscribe>>()\n\n useEffect(() => {\n unsubscribeRef.current = peregrineInstance.subscribe(channel, memCallback)\n\n return (): void => {\n unsubscribeRef?.current?.()\n }\n }, [memCallback, channel, peregrineInstance])\n\n return [unsubscribeRef.current, peregrineInstance.publish]\n}\n"],"names":["usePeregrineMQ","peregrineInstance","channel","callback","memCallback","useCallback","unsubscribeRef","useRef","useEffect","current","subscribe","publish"],"mappings":"+DAUO,MAAMA,EAAiBA,CAC5BC,EAAgCC,EAAiBC,KAEjD,MAAMC,EAAcC,EAAYF,EAAU,CAACA,IAErCG,EAAiBC,IAUvB,OARAC,GAAU,KACRF,EAAeG,QAAUR,EAAkBS,UAAUR,EAASE,GAEvD,KACLE,GAAgBG,WAAW,IAE5B,CAACL,EAAaF,EAASD,IAEnB,CAACK,EAAeG,QAASR,EAAkBU,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\n\nimport { isFunctionAsync } from '../../helpers'\n\n/**\n * Represents the callback function for a store listener.\n */\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\n/**\n * Represents a selector function that transforms the store state.\n */\n// export type Selector<T> = (state: Partial<T>) => Partial<T>;\nexport type SelectedValueType<T> = Partial<T> | Partial<keyof T>\n| string | number | boolean | undefined | string[] | number[] | boolean[] | undefined[];\nexport type Selector<T> = (state: Partial<T>) => SelectedValueType<T>;\n\n\n/**\n * Represents a listener for the store.\n */\nexport type Listener<T> = {\n selector?: Selector<T>\n previousValue?: SelectedValueType<T>\n} & ListenerCallBack<T>\n\n/**\n * Represents a store.\n */\nexport type Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState: () => Partial<T>\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState: (state: Partial<T>) => Promise<Partial<T>>\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @param selector - Optional selector function to transform the store state.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => () => void\n /**\n * Unubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => void\n}\n// & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n// TODO infer actionNames from createStore arguments\n/**\n * Represents a store with additional actions.\n */\nexport type StoreWithActions<T> = Store<T> & { actions: { [actionName: string]: ActionHandlerCaller<T> } }\n\n// export type PendingAction<A> = `${A}Pending`\n// export type ErrorAction<A> = `${A}Error`\n// export type ActionName<A> = `${A}`\n\n// export type ActionsReturnType<A, TActionHandler> = Record<ActionName<A>, TActionHandler>\n\n// export type ActionsStateReturnType<A>\n// = Partial<Record<PendingAction<A>, boolean>> & Partial<Record<ErrorAction<A>, boolean>>\n\n\n// function invert<T, ActionName extends string>(\n// arr: ActionName[], state: Partial<T>, actionHandler: ActionHandlerCaller<T>,\n// ): Partial<T> & ActionsStateReturnType<ActionName> {\n// arr.forEach((x) => {\n// state[`${x}Error`] = true\n// state[`${x}Pending`] = true\n// })\n\n// return state as (Partial<T> & ActionsStateReturnType<ActionName>)\n// }\n\n// function invert2<T, A extends string>(\n// arr: A[], actions: ActionsReturnType<A>, actionHandler: ActionHandlerCaller<T>,\n// ): ActionsReturnType<A, ActionHandlerCaller<T>> {\n// arr.forEach((x) => {\n// actions[`${x}`] = actionHandler\n// })\n\n// return actions as ActionsReturnType<A>\n// }\n\n// function invert3<T, A extends string>(\n// arr: A[], actions: ActionsReturnType<A>, state: Partial<T>, actionHandler: ActionHandlerCaller<T>,\n// ): [Partial<T> & ActionsStateReturnType<A>, ActionsReturnType<A, ActionHandlerCaller<T>>] {\n// arr.forEach((x) => {\n// state[`${x}Error`] = actionHandler\n// state[`${x}Pending`] = actionHandler\n// actions[`${x}`] = actionHandler\n// })\n\n// return [state, actions] as [Partial<T> & ActionsStateReturnType<A>, ActionsReturnType<A, ActionHandlerCaller<T>>]\n// }\n\n// const example = invert(['foo', 'bar', 'baz'], {}, () => {})\n// const example2 = invert2(['foo', 'bar', 'baz'], {}, () => {})\n// const example3 = invert3(['foo', 'bar', 'baz'], {}, () => {})\n\n\n\n/**\n * Represents an action handler function.\n */\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'], // Function to get the current state of the store\n setState: Store<T>['setState'], // Function to set the state of the store\n ...rest: unknown[]\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n/**\n * Represents an reducer function.\n */\nexport type Reducer<T> = (\n state: Partial<T>,\n action: string,\n ...rest: unknown[]\n) => Partial<T>\n\n\n/**\n * Represents a function that calls an action handler.\n */\nexport type ActionHandlerCaller<T> = (...args: unknown[]) => void | Partial<T> | Promise<void | Partial<T>>\n\n\ntype Actions<T> = { [key: string]: ActionHandler<T>}\n/**\n * Creates a new store.\n * @param initialState - The initial state of the store.\n * @param actions - Optional actions for the store.\n * @returns The created store.\n */\nexport const createStore = <T>(\n initialState: Partial<T>,\n actions?: Actions<T>,\n reducer?: Reducer<T>,\n): Store<T> | StoreWithActions<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n /**\n * Gets the current state of the store.\n * @returns The current state of the store.\n */\n const getState = (): Partial<T> => currentState\n\n // TODO debounce, batch? what is the meaningful time between setState ofr UI to be rendered and registerd by User?\n /**\n * Sets the state of the store.\n * @param newState - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n const setState = async (newState: Partial<T>): Promise<Partial<T>> => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n const newValue: SelectedValueType<T> = selector ? selector(currentState) : currentState\n\n // TODO plugin equality\n if (listener.previousValue === undefined || listener.previousValue !== newValue) {\n listener.previousValue = newValue\n // eslint-disable-next-line no-await-in-loop\n await listener(newValue as Partial<T>)\n }\n }\n return currentState\n }\n\n /**\n * Represents the basic API of the store.\n */\n const storeBaseicApi: Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState,\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState,\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => {\n if (selector && listener.selector && listener.selector !== selector) {\n throw new Error('Error, mismatch selector, listener.selector !== selector.')\n }\n if (selector && !listener.selector) {\n // eslint-disable-next-line no-param-reassign\n listener.selector = selector\n }\n\n if (listener.selector) {\n // setting the previousValue for the next cache/equality check\n // eslint-disable-next-line no-param-reassign\n listener.previousValue = listener.selector(getState())\n }\n\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n /**\n * Unsubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => {\n listeners.delete(listener)\n },\n }\n\n /**\n * Resolves the actions and creates action handlers.\n */\n const resolvedActions: Actions<T> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller<T>>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => {\n // eslint-disable-next-line no-param-reassign\n aggregator[actionName] = async(...rest: unknown[]): Promise<void | Partial<T>> => {\n // TODO try to not call subscriber too many times becuase of Error and Pending values\n const isAsync = isFunctionAsync(actionHandler as () => unknown)\n\n if (isAsync) {\n setState({\n ...getState(),\n [`${actionName}Error`]: null,\n [`${actionName}Pending`]: true,\n })\n }\n\n try {\n const resultOfAction = await actionHandler(getState, setState, ...rest)\n\n // TODO try to mutate state only once with the results, that means pass custom setState to action,\n // so that it would matk pending and error already inside action\n if (reducer) {\n setState(reducer(getState(), actionName, ...rest))\n }\n\n if (isAsync) {\n setState({ ...getState(), [`${actionName}Pending`]: false })\n }\n\n return resultOfAction\n } catch (error) {\n if (isAsync) {\n setState({\n ...getState(),\n [`${actionName}Pending`]: false,\n [`${actionName}Error`]: error,\n })\n }\n throw error\n }\n }\n\n return aggregator\n },\n {},\n ) : null\n\n /**\n * Represents the store combined with actions.\n */\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return resolvedActions\n ? storeCombinedWithActions as StoreWithActions<T>\n // ? storeCombinedWithActions as StoreWithActions<T> & ActionsStateReturnType<A>\n : storeCombinedWithActions as Store<T>\n}\n"],"names":["createStore","initialState","actions","reducer","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","newState","listener","selector","newValue","undefined","previousValue","_x","apply","this","arguments","storeBaseicApi","subscribe","Error","add","delete","unsubscribe","resolvedActions","Object","entries","reduce","aggregator","_ref2","actionName","actionHandler","isAsync","isFunctionAsync","_len","length","rest","Array","_key","resultOfAction","error","storeCombinedWithActions"],"mappings":"iJAgJO,MAAMA,EAAcA,CACzBC,EACAC,EACAC,KAEA,IAAIC,EAA2BH,EAC/B,MAAMI,EAAY,IAAIC,IAMhBC,EAAWA,IAAkBH,EAQ7BI,EAAQ,WAAA,IAAAC,EAAAC,GAAG,UAAOC,GACtBP,EAAeO,EAGf,IAAK,MAAMC,KAAYP,EAAW,CAEhC,MAAMQ,EAAoCD,GAAUC,SAM9CC,EAAiCD,EAAWA,EAAST,GAAgBA,OAG5CW,IAA3BH,EAASI,eAA+BJ,EAASI,gBAAkBF,IACrEF,EAASI,cAAgBF,QAEnBF,EAASE,GAEnB,CACA,OAAOV,KACR,OAtBKI,SAAQS,GAAA,OAAAR,EAAAS,MAAAC,KAAAC,UAAA,EAAA,GA2BRC,EAA2B,CAK/Bd,WAMAC,WAMAc,UAAWA,CAACV,EAAuBC,KACjC,GAAIA,GAAYD,EAASC,UAAYD,EAASC,WAAaA,EACzD,MAAM,IAAIU,MAAM,6DAclB,OAZIV,IAAaD,EAASC,WAExBD,EAASC,SAAWA,GAGlBD,EAASC,WAGXD,EAASI,cAAgBJ,EAASC,SAASN,MAG7CF,EAAUmB,IAAIZ,GACP,IAAMP,EAAUoB,OAAOb,EAAS,EAMzCc,YAAcd,IACZP,EAAUoB,OAAOb,EAAS,GAOxBe,EACFzB,EAAU0B,OAAOC,QAAQ3B,IAAU4B,QACnC,CACEC,EAAkDC,KAE/C,IADFC,EAAYC,GAA0CF,EAyCvD,OAtCAD,EAAWE,GAAWvB,GAAG,YAEvB,MAAMyB,EAAUC,EAAgBF,GAE5BC,GACF3B,EAAS,IACJD,IACH,CAAC,GAAG0B,UAAoB,KACxB,CAAC,GAAGA,aAAsB,IAI9B,IAAI,IAAA,IAAAI,EAAAjB,UAAAkB,OAZ4BC,EAAIC,IAAAA,MAAAH,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,GAAArB,UAAAqB,GAalC,MAAMC,QAAuBR,EAAc3B,EAAUC,KAAa+B,GAYlE,OARIpC,GACFK,EAASL,EAAQI,IAAY0B,KAAeM,IAG1CJ,GACF3B,EAAS,IAAKD,IAAY,CAAC,GAAG0B,aAAsB,IAG/CS,CACR,CAAC,MAAOC,GAQP,MAPIR,GACF3B,EAAS,IACJD,IACH,CAAC,GAAG0B,aAAsB,EAC1B,CAAC,GAAGA,UAAoBU,IAGtBA,CACR,KAGKZ,CAAU,GAEnB,CAAA,GACE,KAKAa,EAA2B,IAC5BvB,KACCM,EAAkB,CAAEzB,QAAS,IAAKyB,IAAsB,IAG9D,OACIiB,CAEoC"}
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\n\nimport { isFunctionAsync } from '../../helpers'\n\n/**\n * Represents the callback function for a store listener.\n */\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\n/**\n * Represents a selector function that transforms the store state.\n */\n// export type Selector<T> = (state: Partial<T>) => Partial<T>;\nexport type SelectedValueType<T> = Partial<T> | Partial<keyof T>\n| string | number | boolean | undefined | string[] | number[] | boolean[] | undefined[];\nexport type Selector<T> = (state: Partial<T>) => SelectedValueType<T>;\n\n\n/**\n * Represents a listener for the store.\n */\nexport type Listener<T> = {\n selector?: Selector<T>\n previousValue?: SelectedValueType<T>\n} & ListenerCallBack<T>\n\n/**\n * Represents a store.\n */\nexport type Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState: () => Partial<T>\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState: (state: Partial<T>) => Promise<Partial<T>>\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @param selector - Optional selector function to transform the store state.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => () => void\n /**\n * Unubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => void\n}\n// & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n// TODO infer actionNames from createStore arguments\n/**\n * Represents a store with additional actions.\n */\nexport type StoreWithActions<T> = Store<T> & { actions: { [actionName: string]: ActionHandlerCaller<T> } }\n\n\n\n\n/**\n * Represents an action handler function.\n */\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'], // Function to get the current state of the store\n setState: Store<T>['setState'], // Function to set the state of the store\n ...rest: unknown[]\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n/**\n * Represents an reducer function.\n */\nexport type Reducer<T> = (\n state: Partial<T>,\n action: string,\n ...rest: unknown[]\n) => Partial<T>\n\n\n/**\n * Represents a function that calls an action handler.\n */\nexport type ActionHandlerCaller<T> = (...args: unknown[]) => void | Partial<T> | Promise<void | Partial<T>>\n\n\ntype Actions<T> = { [key: string]: ActionHandler<T>}\n/**\n * Creates a new store.\n * @param initialState - The initial state of the store.\n * @param actions - Optional actions for the store.\n * @returns The created store.\n */\nexport const createStore = <T>(\n initialState: Partial<T>,\n actions?: Actions<T>,\n reducer?: Reducer<T>,\n): Store<T> | StoreWithActions<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n /**\n * Gets the current state of the store.\n * @returns The current state of the store.\n */\n const getState = (): Partial<T> => currentState\n\n // TODO debounce, batch? what is the meaningful time between setState ofr UI to be rendered and registerd by User?\n /**\n * Sets the state of the store.\n * @param newState - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n const setState = async (newState: Partial<T>): Promise<Partial<T>> => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n const newValue: SelectedValueType<T> = selector ? selector(currentState) : currentState\n\n // TODO plugin equality\n if (listener.previousValue === undefined || listener.previousValue !== newValue) {\n listener.previousValue = newValue\n // eslint-disable-next-line no-await-in-loop\n await listener(newValue as Partial<T>)\n }\n }\n return currentState\n }\n\n /**\n * Represents the basic API of the store.\n */\n const storeBaseicApi: Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState,\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState,\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => {\n if (selector && listener.selector && listener.selector !== selector) {\n throw new Error('Error, mismatch selector, listener.selector !== selector.')\n }\n if (selector && !listener.selector) {\n // eslint-disable-next-line no-param-reassign\n listener.selector = selector\n }\n\n if (listener.selector) {\n // setting the previousValue for the next cache/equality check\n // eslint-disable-next-line no-param-reassign\n listener.previousValue = listener.selector(getState())\n }\n\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n /**\n * Unsubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => {\n listeners.delete(listener)\n },\n }\n\n /**\n * Resolves the actions and creates action handlers.\n */\n const resolvedActions: Actions<T> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller<T>>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => {\n // eslint-disable-next-line no-param-reassign\n aggregator[actionName] = async(...rest: unknown[]): Promise<void | Partial<T>> => {\n // TODO try to not call subscriber too many times becuase of Error and Pending values\n const isAsync = isFunctionAsync(actionHandler as () => unknown)\n\n if (isAsync) {\n setState({\n ...getState(),\n [`${actionName}Error`]: null,\n [`${actionName}Pending`]: true,\n })\n }\n\n try {\n const resultOfAction = await actionHandler(getState, setState, ...rest)\n\n // TODO try to mutate state only once with the results, that means pass custom setState to action,\n // so that it would matk pending and error already inside action\n if (reducer) {\n setState(reducer(getState(), actionName, ...rest))\n }\n\n if (isAsync) {\n setState({ ...getState(), [`${actionName}Pending`]: false })\n }\n\n return resultOfAction\n } catch (error) {\n if (isAsync) {\n setState({\n ...getState(),\n [`${actionName}Pending`]: false,\n [`${actionName}Error`]: error,\n })\n }\n throw error\n }\n }\n\n return aggregator\n },\n {},\n ) : null\n\n /**\n * Represents the store combined with actions.\n */\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return resolvedActions\n ? storeCombinedWithActions as StoreWithActions<T>\n // ? storeCombinedWithActions as StoreWithActions<T> & ActionsStateReturnType<A>\n : storeCombinedWithActions as Store<T>\n}\n"],"names":["createStore","initialState","actions","reducer","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","newState","listener","selector","newValue","undefined","previousValue","_x","apply","this","arguments","storeBaseicApi","subscribe","Error","add","delete","unsubscribe","resolvedActions","Object","entries","reduce","aggregator","_ref2","actionName","actionHandler","isAsync","isFunctionAsync","_len","length","rest","Array","_key","resultOfAction","error","storeCombinedWithActions"],"mappings":"iJAkGO,MAAMA,EAAcA,CACzBC,EACAC,EACAC,KAEA,IAAIC,EAA2BH,EAC/B,MAAMI,EAAY,IAAIC,IAMhBC,EAAWA,IAAkBH,EAQ7BI,EAAQ,WAAA,IAAAC,EAAAC,GAAG,UAAOC,GACtBP,EAAeO,EAGf,IAAK,MAAMC,KAAYP,EAAW,CAEhC,MAAMQ,EAAoCD,GAAUC,SAM9CC,EAAiCD,EAAWA,EAAST,GAAgBA,OAG5CW,IAA3BH,EAASI,eAA+BJ,EAASI,gBAAkBF,IACrEF,EAASI,cAAgBF,QAEnBF,EAASE,GAEnB,CACA,OAAOV,KACR,OAtBKI,SAAQS,GAAA,OAAAR,EAAAS,MAAAC,KAAAC,UAAA,EAAA,GA2BRC,EAA2B,CAK/Bd,WAMAC,WAMAc,UAAWA,CAACV,EAAuBC,KACjC,GAAIA,GAAYD,EAASC,UAAYD,EAASC,WAAaA,EACzD,MAAM,IAAIU,MAAM,6DAclB,OAZIV,IAAaD,EAASC,WAExBD,EAASC,SAAWA,GAGlBD,EAASC,WAGXD,EAASI,cAAgBJ,EAASC,SAASN,MAG7CF,EAAUmB,IAAIZ,GACP,IAAMP,EAAUoB,OAAOb,EAAS,EAMzCc,YAAcd,IACZP,EAAUoB,OAAOb,EAAS,GAOxBe,EACFzB,EAAU0B,OAAOC,QAAQ3B,IAAU4B,QACnC,CACEC,EAAkDC,KAE/C,IADFC,EAAYC,GAA0CF,EAyCvD,OAtCAD,EAAWE,GAAWvB,GAAG,YAEvB,MAAMyB,EAAUC,EAAgBF,GAE5BC,GACF3B,EAAS,IACJD,IACH,CAAC,GAAG0B,UAAoB,KACxB,CAAC,GAAGA,aAAsB,IAI9B,IAAI,IAAA,IAAAI,EAAAjB,UAAAkB,OAZ4BC,EAAIC,IAAAA,MAAAH,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,GAAArB,UAAAqB,GAalC,MAAMC,QAAuBR,EAAc3B,EAAUC,KAAa+B,GAYlE,OARIpC,GACFK,EAASL,EAAQI,IAAY0B,KAAeM,IAG1CJ,GACF3B,EAAS,IAAKD,IAAY,CAAC,GAAG0B,aAAsB,IAG/CS,CACR,CAAC,MAAOC,GAQP,MAPIR,GACF3B,EAAS,IACJD,IACH,CAAC,GAAG0B,aAAsB,EAC1B,CAAC,GAAGA,UAAoBU,IAGtBA,CACR,KAGKZ,CAAU,GAEnB,CAAA,GACE,KAKAa,EAA2B,IAC5BvB,KACCM,EAAkB,CAAEzB,QAAS,IAAKyB,IAAsB,IAG9D,OACIiB,CAEoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.templates.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.templates.ts"],"sourcesContent":["import { ActionHandler, Reducer, Store, StoreWithActions, createStore } from './store.vanillajs'\n\n\ntype DefaultES = { [key: string]: any }\n\n\nexport type DataState<T, ES = DefaultES> = {\n dataId: string\n isLoading: boolean\n error?: unknown\n data?: T\n} & ES\n\n\ntype Load<T, ES = DefaultES> = (\n getState: Store<DataState<T, ES>>['getState'],\n setState: Store<DataState<T, ES>>['setState'],\n dataPromise: unknown | Promise<unknown>,\n) => Promise<Partial<DataState<T, ES>>>\n\n\ntype LoadHandler<T, ES = DefaultES> = (\n dataPromise: unknown | Promise<unknown>,\n) => Promise<Partial<DataState<T, ES>>>\n\n/**\n * Creates a data store with actions.\n * @param dataId - The ID of the data.\n * @param actions - Optional actions for the data store.\n * @returns The created data store with actions.\n */\nexport const createDataStore\n= <T, ES = DefaultES>(\n dataId: string,\n initialState?: Partial<ES>,\n actions?: Record<string, ActionHandler<DataState<T, ES>>>,\n reducer?: Reducer<DataState<T, ES>>,\n): StoreWithActions<DataState<T, ES>>\n& { actions: { load: LoadHandler<T, ES> } } => {\n const loadActions: { load: Load<T, ES> } = {\n ...actions,\n /**\n * Loads data into the data store.\n * @param getState - Function to get the current state of the data store.\n * @param setState - Function to set the state of the data store.\n * @param dataPromise - The data promise to be loaded.\n * @returns A promise that resolves to the updated state of the data store.\n */\n load: async (\n getState: Store<DataState<T, ES>>['getState'],\n setState: Store<DataState<T, ES>>['setState'],\n dataPromise: unknown | Promise<unknown>,\n ) => {\n const dataState: Partial<DataState<T, ES>> = getState()\n\n setState({ ...dataState, isLoading: true })\n\n try {\n const response: unknown = await dataPromise\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n dataState.data = response?.data || response\n } catch (error: unknown) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n dataState.error = error\n }\n return setState({ ...dataState, isLoading: false })\n },\n }\n\n return (createStore<DataState<T, ES>>({\n ...initialState,\n dataId,\n isLoading: false,\n } as Partial<DataState<T, ES>>, loadActions, reducer)) as StoreWithActions<DataState<T, ES>>\n & { actions: { load: LoadHandler<T, ES> } }\n}\n"],"names":["createDataStore","dataId","initialState","actions","reducer","loadActions","load","_ref","_asyncToGenerator","getState","setState","dataPromise","dataState","isLoading","response","data","error","_x","_x2","_x3","apply","this","arguments","createStore"],"mappings":"2IA+BO,MAAMA,EACXA,CACAC,EACAC,EACAC,EACAC,KAGA,MAAMC,EAAqC,IACtCF,EAQHG,MAAIC,EAAAC,GAAE,UACJC,EACAC,EACAC,GAEA,MAAMC,EAAuCH,IAE7CC,EAAS,IAAKE,EAAWC,WAAW,IAEpC,IACE,MAAMC,QAA0BH,EAIhCC,EAAUG,KAAOD,GAAUC,MAAQD,CACpC,CAAC,MAAOE,GAGPJ,EAAUI,MAAQA,CACpB,CACA,OAAON,EAAS,IAAKE,EAAWC,WAAW,OAC5C,
|
|
1
|
+
{"version":3,"file":"store.vanillajs.templates.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.templates.ts"],"sourcesContent":["import { ActionHandler, Reducer, Store, StoreWithActions, createStore } from './store.vanillajs'\n\n\ntype DefaultES = { [key: string]: any }\n\n\nexport type DataState<T, ES = DefaultES> = {\n dataId: string\n isLoading: boolean\n error?: unknown\n data?: T\n} & ES\n\n\ntype Load<T, ES = DefaultES> = (\n getState: Store<DataState<T, ES>>['getState'],\n setState: Store<DataState<T, ES>>['setState'],\n dataPromise: unknown | Promise<unknown>,\n) => Promise<Partial<DataState<T, ES>>>\n\n\ntype LoadHandler<T, ES = DefaultES> = (\n dataPromise: unknown | Promise<unknown>,\n) => Promise<Partial<DataState<T, ES>>>\n\n/**\n * Creates a data store with actions.\n * @param dataId - The ID of the data.\n * @param actions - Optional actions for the data store.\n * @returns The created data store with actions.\n */\nexport const createDataStore\n= <T, ES = DefaultES>(\n dataId: string,\n initialState?: Partial<ES>,\n actions?: Record<string, ActionHandler<DataState<T, ES>>>,\n reducer?: Reducer<DataState<T, ES>>,\n): StoreWithActions<DataState<T, ES>>\n& { actions: { load: LoadHandler<T, ES> } } => {\n const loadActions: { load: Load<T, ES> } = {\n ...actions,\n /**\n * Loads data into the data store.\n * @param getState - Function to get the current state of the data store.\n * @param setState - Function to set the state of the data store.\n * @param dataPromise - The data promise to be loaded.\n * @returns A promise that resolves to the updated state of the data store.\n */\n load: async (\n getState: Store<DataState<T, ES>>['getState'],\n setState: Store<DataState<T, ES>>['setState'],\n dataPromise: unknown | Promise<unknown>,\n ) => {\n const dataState: Partial<DataState<T, ES>> = getState()\n\n setState({ ...dataState, isLoading: true })\n\n try {\n const response: unknown = await dataPromise\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n dataState.data = response?.data || response\n } catch (error: unknown) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n dataState.error = error\n }\n return setState({ ...dataState, isLoading: false })\n },\n }\n\n return (createStore<DataState<T, ES>>({\n ...initialState,\n dataId,\n isLoading: false,\n } as Partial<DataState<T, ES>>, loadActions, reducer)) as StoreWithActions<DataState<T, ES>>\n & { actions: { load: LoadHandler<T, ES> } }\n}\n"],"names":["createDataStore","dataId","initialState","actions","reducer","loadActions","load","_ref","_asyncToGenerator","getState","setState","dataPromise","dataState","isLoading","response","data","error","_x","_x2","_x3","apply","this","arguments","createStore"],"mappings":"2IA+BO,MAAMA,EACXA,CACAC,EACAC,EACAC,EACAC,KAGA,MAAMC,EAAqC,IACtCF,EAQHG,MAAIC,EAAAC,GAAE,UACJC,EACAC,EACAC,GAEA,MAAMC,EAAuCH,IAE7CC,EAAS,IAAKE,EAAWC,WAAW,IAEpC,IACE,MAAMC,QAA0BH,EAIhCC,EAAUG,KAAOD,GAAUC,MAAQD,CACpC,CAAC,MAAOE,GAGPJ,EAAUI,MAAQA,CACpB,CACA,OAAON,EAAS,IAAKE,EAAWC,WAAW,OAC5C,SArBGI,EAAAC,EAAAC,GAAA,OAAAZ,EAAAa,MAAAC,KAAAC,UAAA,IAAA,IAAAf,EAwBN,OAAQgB,EAA8B,IACjCrB,EACHD,SACAY,WAAW,GACmBR,EAAaD,EAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{keyExtractor,keyExtractorFunction}from"./keyExtractor.js";export{dateRangeFormat,getDateTime,getTimeFromNow,getTimeFromNowOriginal,getTimeTo}from"./date.js";export{peregrineMQInstance}from"./appState/peregrineMQ/index.js";export{isBirthNumberValid}from"./helpers/birthnumber.validator.js";export{getMatch,isValidFormat,isValidModulo11,parse,regex}from"./helpers/birthnumberCZSKvalidator.js";export{parseCSVdata,validateCSVFile,validateCSVlines,validateJSONFile,validateLineCellTrimmed,validateLineNumColumns,validateSDFFile}from"./helpers/fileValidator.js";export{DATE_FORMAT,DATE_TIME_FORMAT,formatDate,formatDateTime,formatDateToTimestamp,getDate}from"./helpers/date.js";export{getDeviceId}from"./helpers/deviceInfo.js";export{emailMatch,emailMatcher,regexBuilder}from"./helpers/emailMatcher.js";export{cleanCsvLines,formatFilePath}from"./helpers/file.js";export{arrayToObjectTree,chunkArray,duplicatesInArray,formatJsonString,formatObj,formatObj2}from"./helpers/objectOperations.js";export{AsyncFunctionTemplate,debounce,delay,isFunctionAsync,memoize,memoizeComplex,memoizer,nestedTernary}from"./helpers/other.js";export{escapeRegExp,fileNameExt,findStringInText,normalizeString,removeWhitespaces,sanitizeId,sanitizePathId,toLowerCase,toUpperCase,truncateText}from"./helpers/textValueOperations.js";export{Operation,decrementValue,incerementValue,numberDefined,numberOperation,restrictNumberInLimits,setValue}from"./helpers/valueOperations.js";export{cancelableSetInterval,cancelableSetTimeout}from"./helpers/cancelableDelayedFunction.js";export{anchorClick,classNames,generateId,mapSerReplacer,noop,parseProps}from"./helpers/ui.js";export{composeId,defaultSanitizeConfig,sanitizeHtml}from"./helpers/text.js";export{ced,createResolveAttribute,customElementDefine,resolveAttributes}from"./webComponents/webComponent.utils.js";export{createStore}from"./appState/store/store.vanillajs.js";export{createDataStore}from"./appState/store/store.vanillajs.templates.js";export{useStore,useStoreApi}from"./appState/store/useStore.react.js";export{PeregrineMQ,PeregrineMQClearError}from"./appState/peregrineMQ/peregrineMQ.js";export{usePeregrineMQ}from"./appState/peregrineMQ/usePeregrineMQ.react.js";export{TinyStateMachine,TinyStateMachineEvent,TinyStateMachineEventType,TinyStateMachineState,createStates,stateIterator}from"./appState/stateMachine/tiny-state-machine.base.js";
|
|
1
|
+
export{keyExtractor,keyExtractorFunction}from"./keyExtractor.js";export{dateRangeFormat,getDateTime,getTimeFromNow,getTimeFromNowOriginal,getTimeTo}from"./date.js";export{peregrineMQInstance}from"./appState/peregrineMQ/index.js";export{isBirthNumberValid}from"./helpers/birthnumber.validator.js";export{getMatch,isValidFormat,isValidModulo11,parse,regex}from"./helpers/birthnumberCZSKvalidator.js";export{parseCSVdata,validateCSVFile,validateCSVlines,validateJSONFile,validateLineCellTrimmed,validateLineNumColumns,validateSDFFile}from"./helpers/fileValidator.js";export{DATE_FORMAT,DATE_TIME_FORMAT,formatDate,formatDateTime,formatDateToTimestamp,getDate}from"./helpers/date.js";export{getDeviceId}from"./helpers/deviceInfo.js";export{emailMatch,emailMatcher,regexBuilder}from"./helpers/emailMatcher.js";export{cleanCsvLines,formatFilePath}from"./helpers/file.js";export{arrayToObjectTree,chunkArray,duplicatesInArray,formatJsonString,formatObj,formatObj2}from"./helpers/objectOperations.js";export{AsyncFunctionTemplate,debounce,delay,isFunctionAsync,memoize,memoizeComplex,memoizer,nestedTernary}from"./helpers/other.js";export{escapeRegExp,fileNameExt,findStringInText,normalizeString,removeWhitespaces,sanitizeId,sanitizePathId,toLowerCase,toUpperCase,truncateText}from"./helpers/textValueOperations.js";export{Operation,decrementValue,incerementValue,numberDefined,numberOperation,restrictNumberInLimits,setValue}from"./helpers/valueOperations.js";export{cancelableSetInterval,cancelableSetTimeout}from"./helpers/cancelableDelayedFunction.js";export{anchorClick,classNames,generateId,mapSerReplacer,noop,parseProps}from"./helpers/ui.js";export{composeId,defaultSanitizeConfig,sanitizeHtml}from"./helpers/text.js";export{ced,createResolveAttribute,customElementDefine,resolveAttributes}from"./webComponents/webComponent.utils.js";export{createStore}from"./appState/store/store.vanillajs.js";export{createDataStore}from"./appState/store/store.vanillajs.templates.js";export{useStore,useStoreApi}from"./appState/store/useStore.react.js";export{PeregrineMQ,PeregrineMQClearError}from"./appState/peregrineMQ/peregrineMQ.js";export{NON_EXISTENT_CHANNEL}from"./appState/peregrineMQ/peregrineMQ.types.js";export{usePeregrineMQ}from"./appState/peregrineMQ/usePeregrineMQ.react.js";export{TinyStateMachine,TinyStateMachineEvent,TinyStateMachineEventType,TinyStateMachineState,createStates,stateIterator}from"./appState/stateMachine/tiny-state-machine.base.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|