@bigbinary/neeto-commons-frontend 4.15.0-beta2 → 4.16.0-beta1
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/.ready +1 -1
- package/dist/cjs/initializers/constants.js +6 -0
- package/dist/cjs/initializers/constants.js.map +1 -1
- package/dist/cjs/initializers/dayjs.js +2 -1
- package/dist/cjs/initializers/dayjs.js.map +1 -1
- package/dist/cjs/initializers/i18n.js +10 -3
- package/dist/cjs/initializers/i18n.js.map +1 -1
- package/dist/cjs/initializers/index.js +6 -2
- package/dist/cjs/initializers/index.js.map +1 -1
- package/dist/cjs/initializers/utils/chineseLanguage.js +39 -0
- package/dist/cjs/initializers/utils/chineseLanguage.js.map +1 -0
- package/dist/cjs/initializers/utils/index.js +2 -1
- package/dist/cjs/initializers/utils/index.js.map +1 -1
- package/dist/cjs/iterableToArray-DleUNhX7.js +8 -0
- package/dist/cjs/iterableToArray-DleUNhX7.js.map +1 -0
- package/dist/cjs/nonIterableRest-BoRARYE5.js +13 -0
- package/dist/cjs/nonIterableRest-BoRARYE5.js.map +1 -0
- package/dist/cjs/react-utils/index.js +4 -2
- package/dist/cjs/react-utils/index.js.map +1 -1
- package/dist/cjs/react-utils/useDebounce/index.js +2 -1
- package/dist/cjs/react-utils/useDebounce/index.js.map +1 -1
- package/dist/cjs/react-utils/useDebounce/useDebounce.js +2 -1
- package/dist/cjs/react-utils/useDebounce/useDebounce.js.map +1 -1
- package/dist/cjs/react-utils/useFetchNeetoApps/index.js +2 -1
- package/dist/cjs/react-utils/useFetchNeetoApps/index.js.map +1 -1
- package/dist/cjs/react-utils/useFetchNeetoApps/useFetchNeetoApps.js +2 -1
- package/dist/cjs/react-utils/useFetchNeetoApps/useFetchNeetoApps.js.map +1 -1
- package/dist/cjs/react-utils/useIsElementVisibleInDom/index.js +2 -1
- package/dist/cjs/react-utils/useIsElementVisibleInDom/index.js.map +1 -1
- package/dist/cjs/react-utils/useIsElementVisibleInDom/useForceUpdate.js +2 -1
- package/dist/cjs/react-utils/useIsElementVisibleInDom/useForceUpdate.js.map +1 -1
- package/dist/cjs/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js +2 -1
- package/dist/cjs/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js.map +1 -1
- package/dist/cjs/react-utils/useLocalStorage/index.js +4 -2
- package/dist/cjs/react-utils/useLocalStorage/index.js.map +1 -1
- package/dist/cjs/react-utils/useLocalStorage/useLocalStorage.js +4 -2
- package/dist/cjs/react-utils/useLocalStorage/useLocalStorage.js.map +1 -1
- package/dist/cjs/react-utils/usePersistedQuery/index.js +2 -1
- package/dist/cjs/react-utils/usePersistedQuery/index.js.map +1 -1
- package/dist/cjs/react-utils/usePersistedQuery/usePersistedQuery.js +2 -1
- package/dist/cjs/react-utils/usePersistedQuery/usePersistedQuery.js.map +1 -1
- package/dist/cjs/react-utils/usePrefersReducedMotion/index.js +2 -1
- package/dist/cjs/react-utils/usePrefersReducedMotion/index.js.map +1 -1
- package/dist/cjs/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js +2 -1
- package/dist/cjs/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js.map +1 -1
- package/dist/cjs/react-utils/useQueryParams/index.js +2 -1
- package/dist/cjs/react-utils/useQueryParams/index.js.map +1 -1
- package/dist/cjs/react-utils/useQueryParams/useQueryParams.js +2 -1
- package/dist/cjs/react-utils/useQueryParams/useQueryParams.js.map +1 -1
- package/dist/cjs/react-utils/useRegisterNavigationCheckpoint/index.js +2 -1
- package/dist/cjs/react-utils/useRegisterNavigationCheckpoint/index.js.map +1 -1
- package/dist/cjs/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js +2 -1
- package/dist/cjs/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js.map +1 -1
- package/dist/cjs/react-utils/useStateWithDependency/index.js +2 -1
- package/dist/cjs/react-utils/useStateWithDependency/index.js.map +1 -1
- package/dist/cjs/react-utils/useStateWithDependency/useStateWithDependency.js +2 -1
- package/dist/cjs/react-utils/useStateWithDependency/useStateWithDependency.js.map +1 -1
- package/dist/cjs/{slicedToArray-BcL7fKuL.js → slicedToArray-C4VK6qBN.js} +3 -10
- package/dist/cjs/slicedToArray-C4VK6qBN.js.map +1 -0
- package/dist/cjs/toArray-C7Mv72M_.js +12 -0
- package/dist/cjs/toArray-C7Mv72M_.js.map +1 -0
- package/dist/cjs/{toConsumableArray-tBKHqzE3.js → toConsumableArray-CcFjhlHw.js} +3 -6
- package/dist/cjs/toConsumableArray-CcFjhlHw.js.map +1 -0
- package/dist/cjs/utils/buildNestedAttributesPayload.js +2 -1
- package/dist/cjs/utils/buildNestedAttributesPayload.js.map +1 -1
- package/dist/cjs/utils/createSubscription.js +2 -1
- package/dist/cjs/utils/createSubscription.js.map +1 -1
- package/dist/cjs/utils/customParseFormatPlugin.js +2 -1
- package/dist/cjs/utils/customParseFormatPlugin.js.map +1 -1
- package/dist/cjs/utils/datetime.js +2 -1
- package/dist/cjs/utils/datetime.js.map +1 -1
- package/dist/cjs/utils/dayjs.js +2 -1
- package/dist/cjs/utils/dayjs.js.map +1 -1
- package/dist/cjs/utils/deviceInformation.js +2 -1
- package/dist/cjs/utils/deviceInformation.js.map +1 -1
- package/dist/cjs/utils/general.js +2 -1
- package/dist/cjs/utils/general.js.map +1 -1
- package/dist/cjs/utils/index.js +4 -2
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/timezonePlugin.js +2 -1
- package/dist/cjs/utils/timezonePlugin.js.map +1 -1
- package/dist/cjs/v2/initializers/constants.js +6 -0
- package/dist/cjs/v2/initializers/constants.js.map +1 -1
- package/dist/cjs/v2/initializers/dayjs.js +2 -1
- package/dist/cjs/v2/initializers/dayjs.js.map +1 -1
- package/dist/cjs/v2/initializers/i18n.js +10 -3
- package/dist/cjs/v2/initializers/i18n.js.map +1 -1
- package/dist/cjs/v2/initializers/index.js +6 -2
- package/dist/cjs/v2/initializers/index.js.map +1 -1
- package/dist/cjs/v2/initializers/utils/chineseLanguage.js +39 -0
- package/dist/cjs/v2/initializers/utils/chineseLanguage.js.map +1 -0
- package/dist/cjs/v2/initializers/utils/index.js +2 -1
- package/dist/cjs/v2/initializers/utils/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/index.js +4 -2
- package/dist/cjs/v2/react-utils/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useDebounce/index.js +2 -1
- package/dist/cjs/v2/react-utils/useDebounce/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useDebounce/useDebounce.js +2 -1
- package/dist/cjs/v2/react-utils/useDebounce/useDebounce.js.map +1 -1
- package/dist/cjs/v2/react-utils/useFetchNeetoApps/index.js +2 -1
- package/dist/cjs/v2/react-utils/useFetchNeetoApps/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useFetchNeetoApps/useFetchNeetoApps.js +2 -1
- package/dist/cjs/v2/react-utils/useFetchNeetoApps/useFetchNeetoApps.js.map +1 -1
- package/dist/cjs/v2/react-utils/useGlobalSearch.js +2 -1
- package/dist/cjs/v2/react-utils/useGlobalSearch.js.map +1 -1
- package/dist/cjs/v2/react-utils/useIsElementVisibleInDom/index.js +2 -1
- package/dist/cjs/v2/react-utils/useIsElementVisibleInDom/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useIsElementVisibleInDom/useForceUpdate.js +2 -1
- package/dist/cjs/v2/react-utils/useIsElementVisibleInDom/useForceUpdate.js.map +1 -1
- package/dist/cjs/v2/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js +2 -1
- package/dist/cjs/v2/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js.map +1 -1
- package/dist/cjs/v2/react-utils/useLocalStorage/index.js +4 -2
- package/dist/cjs/v2/react-utils/useLocalStorage/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useLocalStorage/useLocalStorage.js +4 -2
- package/dist/cjs/v2/react-utils/useLocalStorage/useLocalStorage.js.map +1 -1
- package/dist/cjs/v2/react-utils/usePersistedQuery/index.js +2 -1
- package/dist/cjs/v2/react-utils/usePersistedQuery/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/usePersistedQuery/usePersistedQuery.js +2 -1
- package/dist/cjs/v2/react-utils/usePersistedQuery/usePersistedQuery.js.map +1 -1
- package/dist/cjs/v2/react-utils/usePrefersReducedMotion/index.js +2 -1
- package/dist/cjs/v2/react-utils/usePrefersReducedMotion/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js +2 -1
- package/dist/cjs/v2/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js.map +1 -1
- package/dist/cjs/v2/react-utils/useQueryParams/index.js +2 -1
- package/dist/cjs/v2/react-utils/useQueryParams/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useQueryParams/useQueryParams.js +2 -1
- package/dist/cjs/v2/react-utils/useQueryParams/useQueryParams.js.map +1 -1
- package/dist/cjs/v2/react-utils/useRegisterNavigationCheckpoint/index.js +2 -1
- package/dist/cjs/v2/react-utils/useRegisterNavigationCheckpoint/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js +2 -1
- package/dist/cjs/v2/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js.map +1 -1
- package/dist/cjs/v2/react-utils/useStateWithDependency/index.js +2 -1
- package/dist/cjs/v2/react-utils/useStateWithDependency/index.js.map +1 -1
- package/dist/cjs/v2/react-utils/useStateWithDependency/useStateWithDependency.js +2 -1
- package/dist/cjs/v2/react-utils/useStateWithDependency/useStateWithDependency.js.map +1 -1
- package/dist/cjs/v2/utils/buildNestedAttributesPayload.js +2 -1
- package/dist/cjs/v2/utils/buildNestedAttributesPayload.js.map +1 -1
- package/dist/cjs/v2/utils/createSubscription.js +2 -1
- package/dist/cjs/v2/utils/createSubscription.js.map +1 -1
- package/dist/cjs/v2/utils/customParseFormatPlugin.js +2 -1
- package/dist/cjs/v2/utils/customParseFormatPlugin.js.map +1 -1
- package/dist/cjs/v2/utils/datetime.js +2 -1
- package/dist/cjs/v2/utils/datetime.js.map +1 -1
- package/dist/cjs/v2/utils/dayjs.js +2 -1
- package/dist/cjs/v2/utils/dayjs.js.map +1 -1
- package/dist/cjs/v2/utils/deviceInformation.js +2 -1
- package/dist/cjs/v2/utils/deviceInformation.js.map +1 -1
- package/dist/cjs/v2/utils/general.js +2 -1
- package/dist/cjs/v2/utils/general.js.map +1 -1
- package/dist/cjs/v2/utils/index.js +4 -2
- package/dist/cjs/v2/utils/index.js.map +1 -1
- package/dist/cjs/v2/utils/timezonePlugin.js +2 -1
- package/dist/cjs/v2/utils/timezonePlugin.js.map +1 -1
- package/dist/initializers/constants.js +4 -1
- package/dist/initializers/constants.js.map +1 -1
- package/dist/initializers/dayjs.js +2 -1
- package/dist/initializers/dayjs.js.map +1 -1
- package/dist/initializers/i18n.js +10 -3
- package/dist/initializers/i18n.js.map +1 -1
- package/dist/initializers/index.js +6 -2
- package/dist/initializers/index.js.map +1 -1
- package/dist/initializers/utils/chineseLanguage.js +37 -0
- package/dist/initializers/utils/chineseLanguage.js.map +1 -0
- package/dist/initializers/utils/index.js +2 -1
- package/dist/initializers/utils/index.js.map +1 -1
- package/dist/iterableToArray-Db9fVUMi.js +6 -0
- package/dist/iterableToArray-Db9fVUMi.js.map +1 -0
- package/dist/nonIterableRest-BZgkRyt5.js +10 -0
- package/dist/nonIterableRest-BZgkRyt5.js.map +1 -0
- package/dist/react-utils/index.js +4 -2
- package/dist/react-utils/index.js.map +1 -1
- package/dist/react-utils/useDebounce/index.js +2 -1
- package/dist/react-utils/useDebounce/index.js.map +1 -1
- package/dist/react-utils/useDebounce/useDebounce.js +2 -1
- package/dist/react-utils/useDebounce/useDebounce.js.map +1 -1
- package/dist/react-utils/useFetchNeetoApps/index.js +2 -1
- package/dist/react-utils/useFetchNeetoApps/index.js.map +1 -1
- package/dist/react-utils/useFetchNeetoApps/useFetchNeetoApps.js +2 -1
- package/dist/react-utils/useFetchNeetoApps/useFetchNeetoApps.js.map +1 -1
- package/dist/react-utils/useIsElementVisibleInDom/index.js +2 -1
- package/dist/react-utils/useIsElementVisibleInDom/index.js.map +1 -1
- package/dist/react-utils/useIsElementVisibleInDom/useForceUpdate.js +2 -1
- package/dist/react-utils/useIsElementVisibleInDom/useForceUpdate.js.map +1 -1
- package/dist/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js +2 -1
- package/dist/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js.map +1 -1
- package/dist/react-utils/useLocalStorage/index.js +4 -2
- package/dist/react-utils/useLocalStorage/index.js.map +1 -1
- package/dist/react-utils/useLocalStorage/useLocalStorage.js +4 -2
- package/dist/react-utils/useLocalStorage/useLocalStorage.js.map +1 -1
- package/dist/react-utils/usePersistedQuery/index.js +2 -1
- package/dist/react-utils/usePersistedQuery/index.js.map +1 -1
- package/dist/react-utils/usePersistedQuery/usePersistedQuery.js +2 -1
- package/dist/react-utils/usePersistedQuery/usePersistedQuery.js.map +1 -1
- package/dist/react-utils/usePrefersReducedMotion/index.js +2 -1
- package/dist/react-utils/usePrefersReducedMotion/index.js.map +1 -1
- package/dist/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js +2 -1
- package/dist/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js.map +1 -1
- package/dist/react-utils/useQueryParams/index.js +2 -1
- package/dist/react-utils/useQueryParams/index.js.map +1 -1
- package/dist/react-utils/useQueryParams/useQueryParams.js +2 -1
- package/dist/react-utils/useQueryParams/useQueryParams.js.map +1 -1
- package/dist/react-utils/useRegisterNavigationCheckpoint/index.js +2 -1
- package/dist/react-utils/useRegisterNavigationCheckpoint/index.js.map +1 -1
- package/dist/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js +2 -1
- package/dist/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js.map +1 -1
- package/dist/react-utils/useStateWithDependency/index.js +2 -1
- package/dist/react-utils/useStateWithDependency/index.js.map +1 -1
- package/dist/react-utils/useStateWithDependency/useStateWithDependency.js +2 -1
- package/dist/react-utils/useStateWithDependency/useStateWithDependency.js.map +1 -1
- package/dist/{slicedToArray-DmsZvA_9.js → slicedToArray-BkMe3jhN.js} +2 -9
- package/dist/slicedToArray-BkMe3jhN.js.map +1 -0
- package/dist/toArray-CvRFt8yt.js +10 -0
- package/dist/toArray-CvRFt8yt.js.map +1 -0
- package/dist/{toConsumableArray-B7CFjjkW.js → toConsumableArray-xgAQXh23.js} +2 -5
- package/dist/toConsumableArray-xgAQXh23.js.map +1 -0
- package/dist/utils/buildNestedAttributesPayload.js +2 -1
- package/dist/utils/buildNestedAttributesPayload.js.map +1 -1
- package/dist/utils/createSubscription.js +2 -1
- package/dist/utils/createSubscription.js.map +1 -1
- package/dist/utils/customParseFormatPlugin.js +2 -1
- package/dist/utils/customParseFormatPlugin.js.map +1 -1
- package/dist/utils/datetime.js +2 -1
- package/dist/utils/datetime.js.map +1 -1
- package/dist/utils/dayjs.js +2 -1
- package/dist/utils/dayjs.js.map +1 -1
- package/dist/utils/deviceInformation.js +2 -1
- package/dist/utils/deviceInformation.js.map +1 -1
- package/dist/utils/general.js +2 -1
- package/dist/utils/general.js.map +1 -1
- package/dist/utils/index.js +4 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/timezonePlugin.js +2 -1
- package/dist/utils/timezonePlugin.js.map +1 -1
- package/dist/v2/initializers/constants.js +4 -1
- package/dist/v2/initializers/constants.js.map +1 -1
- package/dist/v2/initializers/dayjs.js +2 -1
- package/dist/v2/initializers/dayjs.js.map +1 -1
- package/dist/v2/initializers/i18n.js +10 -3
- package/dist/v2/initializers/i18n.js.map +1 -1
- package/dist/v2/initializers/index.js +6 -2
- package/dist/v2/initializers/index.js.map +1 -1
- package/dist/v2/initializers/utils/chineseLanguage.js +37 -0
- package/dist/v2/initializers/utils/chineseLanguage.js.map +1 -0
- package/dist/v2/initializers/utils/index.js +2 -1
- package/dist/v2/initializers/utils/index.js.map +1 -1
- package/dist/v2/react-utils/index.js +4 -2
- package/dist/v2/react-utils/index.js.map +1 -1
- package/dist/v2/react-utils/useDebounce/index.js +2 -1
- package/dist/v2/react-utils/useDebounce/index.js.map +1 -1
- package/dist/v2/react-utils/useDebounce/useDebounce.js +2 -1
- package/dist/v2/react-utils/useDebounce/useDebounce.js.map +1 -1
- package/dist/v2/react-utils/useFetchNeetoApps/index.js +2 -1
- package/dist/v2/react-utils/useFetchNeetoApps/index.js.map +1 -1
- package/dist/v2/react-utils/useFetchNeetoApps/useFetchNeetoApps.js +2 -1
- package/dist/v2/react-utils/useFetchNeetoApps/useFetchNeetoApps.js.map +1 -1
- package/dist/v2/react-utils/useGlobalSearch.js +2 -1
- package/dist/v2/react-utils/useGlobalSearch.js.map +1 -1
- package/dist/v2/react-utils/useIsElementVisibleInDom/index.js +2 -1
- package/dist/v2/react-utils/useIsElementVisibleInDom/index.js.map +1 -1
- package/dist/v2/react-utils/useIsElementVisibleInDom/useForceUpdate.js +2 -1
- package/dist/v2/react-utils/useIsElementVisibleInDom/useForceUpdate.js.map +1 -1
- package/dist/v2/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js +2 -1
- package/dist/v2/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js.map +1 -1
- package/dist/v2/react-utils/useLocalStorage/index.js +4 -2
- package/dist/v2/react-utils/useLocalStorage/index.js.map +1 -1
- package/dist/v2/react-utils/useLocalStorage/useLocalStorage.js +4 -2
- package/dist/v2/react-utils/useLocalStorage/useLocalStorage.js.map +1 -1
- package/dist/v2/react-utils/usePersistedQuery/index.js +2 -1
- package/dist/v2/react-utils/usePersistedQuery/index.js.map +1 -1
- package/dist/v2/react-utils/usePersistedQuery/usePersistedQuery.js +2 -1
- package/dist/v2/react-utils/usePersistedQuery/usePersistedQuery.js.map +1 -1
- package/dist/v2/react-utils/usePrefersReducedMotion/index.js +2 -1
- package/dist/v2/react-utils/usePrefersReducedMotion/index.js.map +1 -1
- package/dist/v2/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js +2 -1
- package/dist/v2/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js.map +1 -1
- package/dist/v2/react-utils/useQueryParams/index.js +2 -1
- package/dist/v2/react-utils/useQueryParams/index.js.map +1 -1
- package/dist/v2/react-utils/useQueryParams/useQueryParams.js +2 -1
- package/dist/v2/react-utils/useQueryParams/useQueryParams.js.map +1 -1
- package/dist/v2/react-utils/useRegisterNavigationCheckpoint/index.js +2 -1
- package/dist/v2/react-utils/useRegisterNavigationCheckpoint/index.js.map +1 -1
- package/dist/v2/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js +2 -1
- package/dist/v2/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js.map +1 -1
- package/dist/v2/react-utils/useStateWithDependency/index.js +2 -1
- package/dist/v2/react-utils/useStateWithDependency/index.js.map +1 -1
- package/dist/v2/react-utils/useStateWithDependency/useStateWithDependency.js +2 -1
- package/dist/v2/react-utils/useStateWithDependency/useStateWithDependency.js.map +1 -1
- package/dist/v2/utils/buildNestedAttributesPayload.js +2 -1
- package/dist/v2/utils/buildNestedAttributesPayload.js.map +1 -1
- package/dist/v2/utils/createSubscription.js +2 -1
- package/dist/v2/utils/createSubscription.js.map +1 -1
- package/dist/v2/utils/customParseFormatPlugin.js +2 -1
- package/dist/v2/utils/customParseFormatPlugin.js.map +1 -1
- package/dist/v2/utils/datetime.js +2 -1
- package/dist/v2/utils/datetime.js.map +1 -1
- package/dist/v2/utils/dayjs.js +2 -1
- package/dist/v2/utils/dayjs.js.map +1 -1
- package/dist/v2/utils/deviceInformation.js +2 -1
- package/dist/v2/utils/deviceInformation.js.map +1 -1
- package/dist/v2/utils/general.js +2 -1
- package/dist/v2/utils/general.js.map +1 -1
- package/dist/v2/utils/index.js +4 -2
- package/dist/v2/utils/index.js.map +1 -1
- package/dist/v2/utils/timezonePlugin.js +2 -1
- package/dist/v2/utils/timezonePlugin.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/slicedToArray-BcL7fKuL.js.map +0 -1
- package/dist/cjs/toConsumableArray-tBKHqzE3.js.map +0 -1
- package/dist/slicedToArray-DmsZvA_9.js.map +0 -1
- package/dist/toConsumableArray-B7CFjjkW.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { _ as _toArray } from '../../toArray-CvRFt8yt.js';
|
|
2
|
+
import { TRADITIONAL_CHINESE, SIMPLIFIED_CHINESE, TRADITIONAL_CHINESE_REGIONS } from '../constants.js';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
4
|
+
import '../../iterableToArray-Db9fVUMi.js';
|
|
5
|
+
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
+
var toTagKey = function toTagKey(tag) {
|
|
9
|
+
return tag.toLowerCase().replace(/_/g, "-");
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Products ship only zh-CN and zh-TW. Browsers often report other Chinese
|
|
13
|
+
// tags (zh-HK, zh-MO, zh-SG, zh-Hant, zh), which would otherwise fall back to
|
|
14
|
+
// English. Map them to the matching script so users get Chinese. A tag the
|
|
15
|
+
// product translates directly is left untouched.
|
|
16
|
+
var normalizeChineseLanguage = function normalizeChineseLanguage(language) {
|
|
17
|
+
var availableLanguages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
18
|
+
if (typeof language !== "string") return language;
|
|
19
|
+
var _language$toLowerCase = language.toLowerCase().split(/[-_]/),
|
|
20
|
+
_language$toLowerCase2 = _toArray(_language$toLowerCase),
|
|
21
|
+
base = _language$toLowerCase2[0],
|
|
22
|
+
subtags = _arrayLikeToArray(_language$toLowerCase2).slice(1);
|
|
23
|
+
if (base !== "zh") return language;
|
|
24
|
+
var shippedLanguage = Object.keys(availableLanguages).find(function (key) {
|
|
25
|
+
return toTagKey(key) === toTagKey(language);
|
|
26
|
+
});
|
|
27
|
+
if (shippedLanguage) return shippedLanguage;
|
|
28
|
+
if (subtags.includes("hant")) return TRADITIONAL_CHINESE;
|
|
29
|
+
if (subtags.includes("hans")) return SIMPLIFIED_CHINESE;
|
|
30
|
+
var isTraditionalRegion = subtags.some(function (subtag) {
|
|
31
|
+
return TRADITIONAL_CHINESE_REGIONS.includes(subtag);
|
|
32
|
+
});
|
|
33
|
+
return isTraditionalRegion ? TRADITIONAL_CHINESE : SIMPLIFIED_CHINESE;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { normalizeChineseLanguage };
|
|
37
|
+
//# sourceMappingURL=chineseLanguage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chineseLanguage.js","sources":["../../../src/initializers/utils/chineseLanguage.js"],"sourcesContent":["import {\n SIMPLIFIED_CHINESE,\n TRADITIONAL_CHINESE,\n TRADITIONAL_CHINESE_REGIONS,\n} from \"../constants\";\n\nconst toTagKey = tag => tag.toLowerCase().replace(/_/g, \"-\");\n\n// Products ship only zh-CN and zh-TW. Browsers often report other Chinese\n// tags (zh-HK, zh-MO, zh-SG, zh-Hant, zh), which would otherwise fall back to\n// English. Map them to the matching script so users get Chinese. A tag the\n// product translates directly is left untouched.\nexport const normalizeChineseLanguage = (language, availableLanguages = {}) => {\n if (typeof language !== \"string\") return language;\n\n const [base, ...subtags] = language.toLowerCase().split(/[-_]/);\n\n if (base !== \"zh\") return language;\n\n const shippedLanguage = Object.keys(availableLanguages).find(\n key => toTagKey(key) === toTagKey(language)\n );\n\n if (shippedLanguage) return shippedLanguage;\n\n if (subtags.includes(\"hant\")) return TRADITIONAL_CHINESE;\n\n if (subtags.includes(\"hans\")) return SIMPLIFIED_CHINESE;\n\n const isTraditionalRegion = subtags.some(subtag =>\n TRADITIONAL_CHINESE_REGIONS.includes(subtag)\n );\n\n return isTraditionalRegion ? TRADITIONAL_CHINESE : SIMPLIFIED_CHINESE;\n};\n"],"names":["toTagKey","tag","toLowerCase","replace","normalizeChineseLanguage","language","availableLanguages","arguments","length","undefined","_language$toLowerCase","split","_language$toLowerCase2","_toArray","base","subtags","_arrayLikeToArray","slice","shippedLanguage","Object","keys","find","key","includes","TRADITIONAL_CHINESE","SIMPLIFIED_CHINESE","isTraditionalRegion","some","subtag","TRADITIONAL_CHINESE_REGIONS"],"mappings":";;;;;;;AAMA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,GAAG,EAAA;EAAA,OAAIA,GAAG,CAACC,WAAW,EAAE,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAAA,CAAA;;AAE5D;AACA;AACA;AACA;IACaC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,QAAQ,EAA8B;AAAA,EAAA,IAA5BC,kBAAkB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;AACxE,EAAA,IAAI,OAAOF,QAAQ,KAAK,QAAQ,EAAE,OAAOA,QAAQ;EAEjD,IAAAK,qBAAA,GAA2BL,QAAQ,CAACH,WAAW,EAAE,CAACS,KAAK,CAAC,MAAM,CAAC;IAAAC,sBAAA,GAAAC,QAAA,CAAAH,qBAAA,CAAA;AAAxDI,IAAAA,IAAI,GAAAF,sBAAA,CAAA,CAAA,CAAA;AAAKG,IAAAA,OAAO,GAAAC,iBAAA,CAAAJ,sBAAA,EAAAK,KAAA,CAAA,CAAA,CAAA;AAEvB,EAAA,IAAIH,IAAI,KAAK,IAAI,EAAE,OAAOT,QAAQ;AAElC,EAAA,IAAMa,eAAe,GAAGC,MAAM,CAACC,IAAI,CAACd,kBAAkB,CAAC,CAACe,IAAI,CAC1D,UAAAC,GAAG,EAAA;IAAA,OAAItB,QAAQ,CAACsB,GAAG,CAAC,KAAKtB,QAAQ,CAACK,QAAQ,CAAC;AAAA,EAAA,CAC7C,CAAC;EAED,IAAIa,eAAe,EAAE,OAAOA,eAAe;EAE3C,IAAIH,OAAO,CAACQ,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAOC,mBAAmB;EAExD,IAAIT,OAAO,CAACQ,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAOE,kBAAkB;AAEvD,EAAA,IAAMC,mBAAmB,GAAGX,OAAO,CAACY,IAAI,CAAC,UAAAC,MAAM,EAAA;AAAA,IAAA,OAC7CC,2BAA2B,CAACN,QAAQ,CAACK,MAAM,CAAC;AAAA,EAAA,CAC9C,CAAC;AAED,EAAA,OAAOF,mBAAmB,GAAGF,mBAAmB,GAAGC,kBAAkB;AACvE;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _ as _typeof } from '../../typeof-D-UKOauR.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
2
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
3
3
|
import i18next from 'i18next';
|
|
4
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
4
5
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
5
6
|
|
|
6
7
|
var getter = function getter(key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/initializers/utils/index.js"],"sourcesContent":["import i18n from \"i18next\";\n\nconst getter = key => () => i18n.t(`taxonomyDefaultLabels.${key}`);\n\nexport const replaceNullValuesWithGetter = (inputObject, parentKey = \"\") => {\n const result = {};\n\n for (const [key, value] of Object.entries(inputObject)) {\n const transKey = parentKey ? `${parentKey}.${key}` : key;\n\n if (value === null) {\n Object.defineProperty(result, key, { get: getter(transKey) });\n } else if (typeof value === \"object\") {\n result[key] = replaceNullValuesWithGetter(value, transKey);\n } else {\n result[key] = value;\n }\n }\n\n return result;\n};\n"],"names":["getter","key","i18n","t","concat","replaceNullValuesWithGetter","inputObject","parentKey","arguments","length","undefined","result","_i","_Object$entries","Object","entries","_Object$entries$_i","_slicedToArray","value","transKey","defineProperty","get","_typeof"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/initializers/utils/index.js"],"sourcesContent":["import i18n from \"i18next\";\n\nconst getter = key => () => i18n.t(`taxonomyDefaultLabels.${key}`);\n\nexport const replaceNullValuesWithGetter = (inputObject, parentKey = \"\") => {\n const result = {};\n\n for (const [key, value] of Object.entries(inputObject)) {\n const transKey = parentKey ? `${parentKey}.${key}` : key;\n\n if (value === null) {\n Object.defineProperty(result, key, { get: getter(transKey) });\n } else if (typeof value === \"object\") {\n result[key] = replaceNullValuesWithGetter(value, transKey);\n } else {\n result[key] = value;\n }\n }\n\n return result;\n};\n"],"names":["getter","key","i18n","t","concat","replaceNullValuesWithGetter","inputObject","parentKey","arguments","length","undefined","result","_i","_Object$entries","Object","entries","_Object$entries$_i","_slicedToArray","value","transKey","defineProperty","get","_typeof"],"mappings":";;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,GAAG,EAAA;EAAA,OAAI,YAAA;IAAA,OAAMC,OAAI,CAACC,CAAC,CAAA,wBAAA,CAAAC,MAAA,CAA0BH,GAAG,CAAE,CAAC;AAAA,EAAA,CAAA;AAAA,CAAA;AAE3D,IAAMI,4BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,WAAW,EAAqB;AAAA,EAAA,IAAnBC,SAAS,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;EACrE,IAAMG,MAAM,GAAG,EAAE;AAEjB,EAAA,KAAA,IAAAC,EAAA,GAAA,CAAA,EAAAC,eAAA,GAA2BC,MAAM,CAACC,OAAO,CAACT,WAAW,CAAC,EAAAM,EAAA,GAAAC,eAAA,CAAAJ,MAAA,EAAAG,EAAA,EAAA,EAAE;AAAnD,IAAA,IAAAI,kBAAA,GAAAC,cAAA,CAAAJ,eAAA,CAAAD,EAAA,CAAA,EAAA,CAAA,CAAA;AAAOX,MAAAA,GAAG,GAAAe,kBAAA,CAAA,CAAA,CAAA;AAAEE,MAAAA,KAAK,GAAAF,kBAAA,CAAA,CAAA,CAAA;AACpB,IAAA,IAAMG,QAAQ,GAAGZ,SAAS,GAAA,EAAA,CAAAH,MAAA,CAAMG,SAAS,EAAA,GAAA,CAAA,CAAAH,MAAA,CAAIH,GAAG,CAAA,GAAKA,GAAG;IAExD,IAAIiB,KAAK,KAAK,IAAI,EAAE;AAClBJ,MAAAA,MAAM,CAACM,cAAc,CAACT,MAAM,EAAEV,GAAG,EAAE;QAAEoB,GAAG,EAAErB,MAAM,CAACmB,QAAQ;AAAE,OAAC,CAAC;AAC/D,IAAA,CAAC,MAAM,IAAIG,OAAA,CAAOJ,KAAK,CAAA,KAAK,QAAQ,EAAE;MACpCP,MAAM,CAACV,GAAG,CAAC,GAAGI,4BAA2B,CAACa,KAAK,EAAEC,QAAQ,CAAC;AAC5D,IAAA,CAAC,MAAM;AACLR,MAAAA,MAAM,CAACV,GAAG,CAAC,GAAGiB,KAAK;AACrB,IAAA;AACF,EAAA;AAEA,EAAA,OAAOP,MAAM;AACf;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterableToArray-Db9fVUMi.js","sources":["../node_modules/@babel/runtime/helpers/esm/iterableToArray.js"],"sourcesContent":["function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };"],"names":[],"mappings":"AAAA,SAAS,gBAAgB,CAAC,CAAC,EAAE;AAC7B,EAAE,IAAI,WAAW,IAAI,OAAO,MAAM,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACjH;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function _arrayWithHoles(r) {
|
|
2
|
+
if (Array.isArray(r)) return r;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() {
|
|
6
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { _arrayWithHoles as _, _nonIterableRest as a };
|
|
10
|
+
//# sourceMappingURL=nonIterableRest-BZgkRyt5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonIterableRest-BZgkRyt5.js","sources":["../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"],"sourcesContent":["function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };"],"names":[],"mappings":"AAAA,SAAS,eAAe,CAAC,CAAC,EAAE;AAC5B,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AAChC;;ACFA,SAAS,gBAAgB,GAAG;AAC5B,EAAE,MAAM,IAAI,SAAS,CAAC,2IAA2I,CAAC;AAClK;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -57,7 +57,8 @@ import './PrivateRoute/constants.js';
|
|
|
57
57
|
import 'react-helmet';
|
|
58
58
|
import './OnlyInDevelopment/constants.js';
|
|
59
59
|
import './OnlyInDevelopment/utils.js';
|
|
60
|
-
import '../slicedToArray-
|
|
60
|
+
import '../slicedToArray-BkMe3jhN.js';
|
|
61
|
+
import '../nonIterableRest-BZgkRyt5.js';
|
|
61
62
|
import '../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
62
63
|
import 'zustand';
|
|
63
64
|
import '@bigbinary/neeto-cist';
|
|
@@ -76,7 +77,8 @@ import 'qs';
|
|
|
76
77
|
import '../utils/datetime.js';
|
|
77
78
|
import '../utils/constants.js';
|
|
78
79
|
import '../utils/dayjs.js';
|
|
79
|
-
import '../toConsumableArray-
|
|
80
|
+
import '../toConsumableArray-xgAQXh23.js';
|
|
81
|
+
import '../iterableToArray-Db9fVUMi.js';
|
|
80
82
|
import '../createClass-CuM_Q_Jb.js';
|
|
81
83
|
import 'dayjs';
|
|
82
84
|
import '../utils/dayjsFormatOverrides/default.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default } from './useDebounce.js';
|
|
2
|
-
import '../../slicedToArray-
|
|
2
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
|
|
5
6
|
var useDebounce = function useDebounce(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebounce.js","sources":["../../../src/react-utils/useDebounce/useDebounce.js"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nconst useDebounce = (value, delay = 350) => {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value]);\n\n return debouncedValue;\n};\n\nexport default useDebounce;\n"],"names":["useDebounce","value","delay","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","debouncedValue","setDebouncedValue","useEffect","handler","setTimeout","clearTimeout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDebounce.js","sources":["../../../src/react-utils/useDebounce/useDebounce.js"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nconst useDebounce = (value, delay = 350) => {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value]);\n\n return debouncedValue;\n};\n\nexport default useDebounce;\n"],"names":["useDebounce","value","delay","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","debouncedValue","setDebouncedValue","useEffect","handler","setTimeout","clearTimeout"],"mappings":";;;;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAAK,EAAkB;AAAA,EAAA,IAAhBC,KAAK,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,GAAG;AACrC,EAAA,IAAAG,SAAA,GAA4CC,QAAQ,CAACN,KAAK,CAAC;IAAAO,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAApDI,IAAAA,cAAc,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,iBAAiB,GAAAH,UAAA,CAAA,CAAA,CAAA;AAExCI,EAAAA,SAAS,CAAC,YAAM;AACd,IAAA,IAAMC,OAAO,GAAGC,UAAU,CAAC,YAAM;MAC/BH,iBAAiB,CAACV,KAAK,CAAC;IAC1B,CAAC,EAAEC,KAAK,CAAC;AAET,IAAA,OAAO,YAAM;MACXa,YAAY,CAACF,OAAO,CAAC;IACvB,CAAC;AACH,EAAA,CAAC,EAAE,CAACZ,KAAK,CAAC,CAAC;AAEX,EAAA,OAAOS,cAAc;AACvB;;;;"}
|
|
@@ -10,7 +10,8 @@ import 'ramda';
|
|
|
10
10
|
import '../constants/constants.js';
|
|
11
11
|
import '../../utils/general.js';
|
|
12
12
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
13
|
-
import '../../slicedToArray-
|
|
13
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
14
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
14
15
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
15
16
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
16
17
|
import 'i18next';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -11,7 +11,8 @@ import '@tanstack/react-query';
|
|
|
11
11
|
import 'ramda';
|
|
12
12
|
import '../../utils/general.js';
|
|
13
13
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
14
|
-
import '../../slicedToArray-
|
|
14
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
15
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
15
16
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
16
17
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
17
18
|
import 'i18next';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchNeetoApps.js","sources":["../../../src/react-utils/useFetchNeetoApps/useFetchNeetoApps.js"],"sourcesContent":["import { isNotPresent } from \"neetocist\";\nimport usePersistedQuery from \"react-utils/usePersistedQuery\";\n\nimport neetoAppsApi from \"./apis/neeto_apps\";\n\nimport { NEETO_APPS_LIST_STALE_TIME } from \"../constants\";\nimport { QUERY_KEYS } from \"../constants/query\";\n\nconst useFetchNeetoApps = options => {\n const scopedQueryKey = [\n `${QUERY_KEYS.NEETO_APPS_LIST}-${globalProps.user?.id}`,\n ];\n\n const { data, modifiedAt } = usePersistedQuery.getCache(scopedQueryKey) || {};\n const expired = modifiedAt <= Date.now() - NEETO_APPS_LIST_STALE_TIME;\n\n return usePersistedQuery(scopedQueryKey, neetoAppsApi.fetch, {\n staleTime: NEETO_APPS_LIST_STALE_TIME,\n enabled: expired || isNotPresent(data),\n ...options,\n });\n};\n\nexport default useFetchNeetoApps;\n"],"names":["useFetchNeetoApps","options","_globalProps$user","scopedQueryKey","concat","QUERY_KEYS","NEETO_APPS_LIST","globalProps","user","id","_ref","usePersistedQuery","getCache","data","modifiedAt","expired","Date","now","NEETO_APPS_LIST_STALE_TIME","neetoAppsApi","fetch","_objectSpread","staleTime","enabled","isNotPresent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFetchNeetoApps.js","sources":["../../../src/react-utils/useFetchNeetoApps/useFetchNeetoApps.js"],"sourcesContent":["import { isNotPresent } from \"neetocist\";\nimport usePersistedQuery from \"react-utils/usePersistedQuery\";\n\nimport neetoAppsApi from \"./apis/neeto_apps\";\n\nimport { NEETO_APPS_LIST_STALE_TIME } from \"../constants\";\nimport { QUERY_KEYS } from \"../constants/query\";\n\nconst useFetchNeetoApps = options => {\n const scopedQueryKey = [\n `${QUERY_KEYS.NEETO_APPS_LIST}-${globalProps.user?.id}`,\n ];\n\n const { data, modifiedAt } = usePersistedQuery.getCache(scopedQueryKey) || {};\n const expired = modifiedAt <= Date.now() - NEETO_APPS_LIST_STALE_TIME;\n\n return usePersistedQuery(scopedQueryKey, neetoAppsApi.fetch, {\n staleTime: NEETO_APPS_LIST_STALE_TIME,\n enabled: expired || isNotPresent(data),\n ...options,\n });\n};\n\nexport default useFetchNeetoApps;\n"],"names":["useFetchNeetoApps","options","_globalProps$user","scopedQueryKey","concat","QUERY_KEYS","NEETO_APPS_LIST","globalProps","user","id","_ref","usePersistedQuery","getCache","data","modifiedAt","expired","Date","now","NEETO_APPS_LIST_STALE_TIME","neetoAppsApi","fetch","_objectSpread","staleTime","enabled","isNotPresent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAGC,OAAO,EAAI;AAAA,EAAA,IAAAC,iBAAA;EACnC,IAAMC,cAAc,GAAG,CAAA,EAAA,CAAAC,MAAA,CAClBC,UAAU,CAACC,eAAe,EAAA,GAAA,CAAA,CAAAF,MAAA,CAAA,CAAAF,iBAAA,GAAIK,WAAW,CAACC,IAAI,MAAA,IAAA,IAAAN,iBAAA,KAAA,MAAA,GAAA,MAAA,GAAhBA,iBAAA,CAAkBO,EAAE,CAAA,CACtD;EAED,IAAAC,IAAA,GAA6BC,iBAAiB,CAACC,QAAQ,CAACT,cAAc,CAAC,IAAI,EAAE;IAArEU,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAEC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;EACxB,IAAMC,OAAO,GAAGD,UAAU,IAAIE,IAAI,CAACC,GAAG,EAAE,GAAGC,0BAA0B;EAErE,OAAOP,iBAAiB,CAACR,cAAc,EAAEgB,YAAY,CAACC,KAAK,EAAAC,aAAA,CAAA;AACzDC,IAAAA,SAAS,EAAEJ,0BAA0B;AACrCK,IAAAA,OAAO,EAAER,OAAO,IAAIS,YAAY,CAACX,IAAI;GAAC,EACnCZ,OAAO,CACX,CAAC;AACJ;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default } from './useIsElementVisibleInDom.js';
|
|
2
|
-
import '../../slicedToArray-
|
|
2
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
import './useForceUpdate.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
|
|
5
6
|
var useForceUpdate = function useForceUpdate() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForceUpdate.js","sources":["../../../src/react-utils/useIsElementVisibleInDom/useForceUpdate.js"],"sourcesContent":["import { useState } from \"react\";\n\nconst useForceUpdate = () => {\n // eslint-disable-next-line react/hook-use-state\n const [, setValue] = useState(0);\n\n return () => setValue(value => value + 1);\n};\n\nexport default useForceUpdate;\n"],"names":["useForceUpdate","_useState","useState","_useState2","_slicedToArray","setValue","value"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useForceUpdate.js","sources":["../../../src/react-utils/useIsElementVisibleInDom/useForceUpdate.js"],"sourcesContent":["import { useState } from \"react\";\n\nconst useForceUpdate = () => {\n // eslint-disable-next-line react/hook-use-state\n const [, setValue] = useState(0);\n\n return () => setValue(value => value + 1);\n};\n\nexport default useForceUpdate;\n"],"names":["useForceUpdate","_useState","useState","_useState2","_slicedToArray","setValue","value"],"mappings":";;;;;AAEA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,GAAS;AAC3B;AACA,EAAA,IAAAC,SAAA,GAAqBC,QAAQ,CAAC,CAAC,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAvBI,IAAAA,QAAQ,GAAAF,UAAA,CAAA,CAAA,CAAA;EAEjB,OAAO,YAAA;IAAA,OAAME,QAAQ,CAAC,UAAAC,KAAK,EAAA;MAAA,OAAIA,KAAK,GAAG,CAAC;IAAA,CAAA,CAAC;AAAA,EAAA,CAAA;AAC3C;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
3
|
import useForceUpdate from './useForceUpdate.js';
|
|
4
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
4
5
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
5
6
|
|
|
6
7
|
var useIsElementVisibleInDom = function useIsElementVisibleInDom(target) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsElementVisibleInDom.js","sources":["../../../src/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport useForceUpdate from \"./useForceUpdate\";\n\nconst useIsElementVisibleInDom = (target, options = undefined) => {\n const [isIntersecting, setIsIntersecting] = useState(false);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!target) return forceUpdate();\n\n const observer = new IntersectionObserver(\n ([entry]) => setIsIntersecting(entry.isIntersecting),\n options\n );\n observer.observe(target);\n\n return () => observer.unobserve(target);\n }, [target, options]);\n\n return isIntersecting;\n};\n\nexport default useIsElementVisibleInDom;\n"],"names":["useIsElementVisibleInDom","target","options","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","isIntersecting","setIsIntersecting","forceUpdate","useForceUpdate","useEffect","observer","IntersectionObserver","_ref","_ref2","entry","observe","unobserve"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIsElementVisibleInDom.js","sources":["../../../src/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport useForceUpdate from \"./useForceUpdate\";\n\nconst useIsElementVisibleInDom = (target, options = undefined) => {\n const [isIntersecting, setIsIntersecting] = useState(false);\n const forceUpdate = useForceUpdate();\n\n useEffect(() => {\n if (!target) return forceUpdate();\n\n const observer = new IntersectionObserver(\n ([entry]) => setIsIntersecting(entry.isIntersecting),\n options\n );\n observer.observe(target);\n\n return () => observer.unobserve(target);\n }, [target, options]);\n\n return isIntersecting;\n};\n\nexport default useIsElementVisibleInDom;\n"],"names":["useIsElementVisibleInDom","target","options","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","isIntersecting","setIsIntersecting","forceUpdate","useForceUpdate","useEffect","observer","IntersectionObserver","_ref","_ref2","entry","observe","unobserve"],"mappings":";;;;;;AAIA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,MAAM,EAA0B;AAAA,EAAA,IAAxBC,OAAO,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAGE,SAAS;AAC3D,EAAA,IAAAC,SAAA,GAA4CC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAApDI,IAAAA,cAAc,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,iBAAiB,GAAAH,UAAA,CAAA,CAAA,CAAA;AACxC,EAAA,IAAMI,WAAW,GAAGC,cAAc,EAAE;AAEpCC,EAAAA,SAAS,CAAC,YAAM;AACd,IAAA,IAAI,CAACb,MAAM,EAAE,OAAOW,WAAW,EAAE;AAEjC,IAAA,IAAMG,QAAQ,GAAG,IAAIC,oBAAoB,CACvC,UAAAC,IAAA,EAAA;AAAA,MAAA,IAAAC,KAAA,GAAAT,cAAA,CAAAQ,IAAA,EAAA,CAAA,CAAA;AAAEE,QAAAA,KAAK,GAAAD,KAAA,CAAA,CAAA,CAAA;AAAA,MAAA,OAAMP,iBAAiB,CAACQ,KAAK,CAACT,cAAc,CAAC;AAAA,IAAA,CAAA,EACpDR,OACF,CAAC;AACDa,IAAAA,QAAQ,CAACK,OAAO,CAACnB,MAAM,CAAC;IAExB,OAAO,YAAA;AAAA,MAAA,OAAMc,QAAQ,CAACM,SAAS,CAACpB,MAAM,CAAC;AAAA,IAAA,CAAA;AACzC,EAAA,CAAC,EAAE,CAACA,MAAM,EAAEC,OAAO,CAAC,CAAC;AAErB,EAAA,OAAOQ,cAAc;AACvB;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default } from './useLocalStorage.js';
|
|
2
|
-
import '../../slicedToArray-
|
|
2
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
import 'ramda';
|
|
@@ -18,7 +19,8 @@ import 'qs';
|
|
|
18
19
|
import '../../utils/datetime.js';
|
|
19
20
|
import '../../utils/constants.js';
|
|
20
21
|
import '../../utils/dayjs.js';
|
|
21
|
-
import '../../toConsumableArray-
|
|
22
|
+
import '../../toConsumableArray-xgAQXh23.js';
|
|
23
|
+
import '../../iterableToArray-Db9fVUMi.js';
|
|
22
24
|
import '../../createClass-CuM_Q_Jb.js';
|
|
23
25
|
import 'dayjs';
|
|
24
26
|
import '../../utils/dayjsFormatOverrides/default.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { isNil } from 'ramda';
|
|
4
4
|
import 'axios';
|
|
@@ -14,6 +14,7 @@ import '@bigbinary/neeto-cist';
|
|
|
14
14
|
import '@bigbinary/neeto-time-zones';
|
|
15
15
|
import 'ua-parser-js';
|
|
16
16
|
import '../../utils/dayjs.js';
|
|
17
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
17
18
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
18
19
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
19
20
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
@@ -26,7 +27,8 @@ import '../../utils/constants.js';
|
|
|
26
27
|
import '../../utils/dayjsFormatOverrides/default.js';
|
|
27
28
|
import '../../utils/localePlugin.js';
|
|
28
29
|
import '@rails/actioncable';
|
|
29
|
-
import '../../toConsumableArray-
|
|
30
|
+
import '../../toConsumableArray-xgAQXh23.js';
|
|
31
|
+
import '../../iterableToArray-Db9fVUMi.js';
|
|
30
32
|
import '../../createClass-CuM_Q_Jb.js';
|
|
31
33
|
|
|
32
34
|
var getStorageValue = function getStorageValue(key, defaultValue) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.js","sources":["../../../src/react-utils/useLocalStorage/useLocalStorage.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/no-local-storage */\n\nimport { useState } from \"react\";\n\nimport { isNil } from \"ramda\";\nimport { removeFromLocalStorage, setToLocalStorage } from \"utils\";\n\nconst getStorageValue = (key, defaultValue) => {\n try {\n const storedValue = localStorage.getItem(key);\n\n return storedValue ? JSON.parse(storedValue) : defaultValue;\n } catch (error) {\n logger.error(error);\n\n return defaultValue;\n }\n};\n\nconst useLocalStorage = (key, defaultValue) => {\n const [storedValue, setStoredValue] = useState(() =>\n getStorageValue(key, defaultValue)\n );\n\n const setValue = value =>\n setStoredValue(prevStoredValue => {\n const newValue =\n typeof value === \"function\" ? value(prevStoredValue) : value;\n\n if (isNil(newValue)) {\n removeFromLocalStorage(key);\n } else {\n setToLocalStorage(key, newValue);\n }\n\n return newValue;\n });\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"],"names":["getStorageValue","key","defaultValue","storedValue","localStorage","getItem","JSON","parse","error","logger","useLocalStorage","_useState","useState","_useState2","_slicedToArray","setStoredValue","setValue","value","prevStoredValue","newValue","isNil","removeFromLocalStorage","setToLocalStorage"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocalStorage.js","sources":["../../../src/react-utils/useLocalStorage/useLocalStorage.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/no-local-storage */\n\nimport { useState } from \"react\";\n\nimport { isNil } from \"ramda\";\nimport { removeFromLocalStorage, setToLocalStorage } from \"utils\";\n\nconst getStorageValue = (key, defaultValue) => {\n try {\n const storedValue = localStorage.getItem(key);\n\n return storedValue ? JSON.parse(storedValue) : defaultValue;\n } catch (error) {\n logger.error(error);\n\n return defaultValue;\n }\n};\n\nconst useLocalStorage = (key, defaultValue) => {\n const [storedValue, setStoredValue] = useState(() =>\n getStorageValue(key, defaultValue)\n );\n\n const setValue = value =>\n setStoredValue(prevStoredValue => {\n const newValue =\n typeof value === \"function\" ? value(prevStoredValue) : value;\n\n if (isNil(newValue)) {\n removeFromLocalStorage(key);\n } else {\n setToLocalStorage(key, newValue);\n }\n\n return newValue;\n });\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"],"names":["getStorageValue","key","defaultValue","storedValue","localStorage","getItem","JSON","parse","error","logger","useLocalStorage","_useState","useState","_useState2","_slicedToArray","setStoredValue","setValue","value","prevStoredValue","newValue","isNil","removeFromLocalStorage","setToLocalStorage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAG,EAAEC,YAAY,EAAK;EAC7C,IAAI;AACF,IAAA,IAAMC,WAAW,GAAGC,YAAY,CAACC,OAAO,CAACJ,GAAG,CAAC;IAE7C,OAAOE,WAAW,GAAGG,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC,GAAGD,YAAY;EAC7D,CAAC,CAAC,OAAOM,KAAK,EAAE;AACdC,IAAAA,MAAM,CAACD,KAAK,CAACA,KAAK,CAAC;AAEnB,IAAA,OAAON,YAAY;AACrB,EAAA;AACF,CAAC;AAED,IAAMQ,eAAe,GAAG,SAAlBA,eAAeA,CAAIT,GAAG,EAAEC,YAAY,EAAK;EAC7C,IAAAS,SAAA,GAAsCC,QAAQ,CAAC,YAAA;AAAA,MAAA,OAC7CZ,eAAe,CAACC,GAAG,EAAEC,YAAY,CAAC;AAAA,IAAA,CACpC,CAAC;IAAAW,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAFMR,IAAAA,WAAW,GAAAU,UAAA,CAAA,CAAA,CAAA;AAAEE,IAAAA,cAAc,GAAAF,UAAA,CAAA,CAAA,CAAA;AAIlC,EAAA,IAAMG,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,KAAK,EAAA;AAAA,IAAA,OACpBF,cAAc,CAAC,UAAAG,eAAe,EAAI;AAChC,MAAA,IAAMC,QAAQ,GACZ,OAAOF,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACC,eAAe,CAAC,GAAGD,KAAK;AAE9D,MAAA,IAAIG,KAAK,CAACD,QAAQ,CAAC,EAAE;QACnBE,sBAAsB,CAACpB,GAAG,CAAC;AAC7B,MAAA,CAAC,MAAM;AACLqB,QAAAA,iBAAiB,CAACrB,GAAG,EAAEkB,QAAQ,CAAC;AAClC,MAAA;AAEA,MAAA,OAAOA,QAAQ;AACjB,IAAA,CAAC,CAAC;AAAA,EAAA,CAAA;AAEJ,EAAA,OAAO,CAAChB,WAAW,EAAEa,QAAQ,CAAC;AAChC;;;;"}
|
|
@@ -8,7 +8,8 @@ import 'ramda';
|
|
|
8
8
|
import '../constants/constants.js';
|
|
9
9
|
import '../../utils/general.js';
|
|
10
10
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
11
|
-
import '../../slicedToArray-
|
|
11
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
12
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
12
13
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
13
14
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
14
15
|
import 'i18next';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,8 @@ import { getFromLocalStorage, setToLocalStorage } from '../../utils/general.js';
|
|
|
7
7
|
import '../../toPropertyKey-BAXkSB3z.js';
|
|
8
8
|
import '../../typeof-D-UKOauR.js';
|
|
9
9
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
10
|
-
import '../../slicedToArray-
|
|
10
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
11
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
11
12
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
12
13
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
13
14
|
import 'i18next';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePersistedQuery.js","sources":["../../../src/react-utils/usePersistedQuery/usePersistedQuery.js"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { isNil } from \"ramda\";\nimport { QUERY_CACHE_NAME_SPACE } from \"react-utils/constants\";\nimport { getFromLocalStorage, setToLocalStorage } from \"utils/general\";\n\nconst localStorageQueryCache = {\n set: (key, data) => {\n const cache = localStorageQueryCache.getAll();\n const newCache = { ...cache, [key]: { data, modifiedAt: Date.now() } };\n setToLocalStorage(QUERY_CACHE_NAME_SPACE, newCache);\n },\n getAll: () => {\n const cache = getFromLocalStorage(QUERY_CACHE_NAME_SPACE);\n if (!cache) return {};\n\n return cache;\n },\n get: key => localStorageQueryCache.getAll()[key],\n};\n\nconst isOutdated = (localCache, staleTime) => {\n if (isNil(localCache)) return true;\n\n if (isNil(staleTime)) return false;\n\n return localCache.modifiedAt <= Date.now() - staleTime;\n};\n\nconst usePersistedQuery = (queryKey, fetch, options) => {\n const queryResult = useQuery({\n queryKey,\n queryFn: fetch,\n ...options,\n });\n const localCache = localStorageQueryCache.get(queryKey);\n\n useEffect(() => {\n if (!queryResult.isSuccess) return;\n localStorageQueryCache.set(queryKey, queryResult.data);\n }, [queryKey, queryResult.data, queryResult.isSuccess]);\n\n if (isOutdated(localCache, options?.staleTime)) {\n return { ...queryResult, isFreshLoading: queryResult.isLoading };\n }\n\n return {\n ...queryResult,\n data: queryResult.data || localCache.data,\n isFreshLoading: false,\n };\n};\n\nusePersistedQuery.getCache = localStorageQueryCache.get;\n\nexport default usePersistedQuery;\n"],"names":["localStorageQueryCache","set","key","data","cache","getAll","newCache","_objectSpread","_defineProperty","modifiedAt","Date","now","setToLocalStorage","QUERY_CACHE_NAME_SPACE","getFromLocalStorage","get","isOutdated","localCache","staleTime","isNil","usePersistedQuery","queryKey","fetch","options","queryResult","useQuery","queryFn","useEffect","isSuccess","isFreshLoading","isLoading","getCache"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePersistedQuery.js","sources":["../../../src/react-utils/usePersistedQuery/usePersistedQuery.js"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { isNil } from \"ramda\";\nimport { QUERY_CACHE_NAME_SPACE } from \"react-utils/constants\";\nimport { getFromLocalStorage, setToLocalStorage } from \"utils/general\";\n\nconst localStorageQueryCache = {\n set: (key, data) => {\n const cache = localStorageQueryCache.getAll();\n const newCache = { ...cache, [key]: { data, modifiedAt: Date.now() } };\n setToLocalStorage(QUERY_CACHE_NAME_SPACE, newCache);\n },\n getAll: () => {\n const cache = getFromLocalStorage(QUERY_CACHE_NAME_SPACE);\n if (!cache) return {};\n\n return cache;\n },\n get: key => localStorageQueryCache.getAll()[key],\n};\n\nconst isOutdated = (localCache, staleTime) => {\n if (isNil(localCache)) return true;\n\n if (isNil(staleTime)) return false;\n\n return localCache.modifiedAt <= Date.now() - staleTime;\n};\n\nconst usePersistedQuery = (queryKey, fetch, options) => {\n const queryResult = useQuery({\n queryKey,\n queryFn: fetch,\n ...options,\n });\n const localCache = localStorageQueryCache.get(queryKey);\n\n useEffect(() => {\n if (!queryResult.isSuccess) return;\n localStorageQueryCache.set(queryKey, queryResult.data);\n }, [queryKey, queryResult.data, queryResult.isSuccess]);\n\n if (isOutdated(localCache, options?.staleTime)) {\n return { ...queryResult, isFreshLoading: queryResult.isLoading };\n }\n\n return {\n ...queryResult,\n data: queryResult.data || localCache.data,\n isFreshLoading: false,\n };\n};\n\nusePersistedQuery.getCache = localStorageQueryCache.get;\n\nexport default usePersistedQuery;\n"],"names":["localStorageQueryCache","set","key","data","cache","getAll","newCache","_objectSpread","_defineProperty","modifiedAt","Date","now","setToLocalStorage","QUERY_CACHE_NAME_SPACE","getFromLocalStorage","get","isOutdated","localCache","staleTime","isNil","usePersistedQuery","queryKey","fetch","options","queryResult","useQuery","queryFn","useEffect","isSuccess","isFreshLoading","isLoading","getCache"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,sBAAsB,GAAG;AAC7BC,EAAAA,GAAG,EAAE,SAALA,GAAGA,CAAGC,GAAG,EAAEC,IAAI,EAAK;AAClB,IAAA,IAAMC,KAAK,GAAGJ,sBAAsB,CAACK,MAAM,EAAE;IAC7C,IAAMC,QAAQ,GAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAQH,KAAK,CAAA,EAAA,EAAA,EAAAI,eAAA,CAAA,EAAA,EAAGN,GAAG,EAAG;AAAEC,MAAAA,IAAI,EAAJA,IAAI;AAAEM,MAAAA,UAAU,EAAEC,IAAI,CAACC,GAAG;AAAG,KAAC,CAAA,CAAE;AACtEC,IAAAA,iBAAiB,CAACC,sBAAsB,EAAEP,QAAQ,CAAC;EACrD,CAAC;AACDD,EAAAA,MAAM,EAAE,SAARA,MAAMA,GAAQ;AACZ,IAAA,IAAMD,KAAK,GAAGU,mBAAmB,CAACD,sBAAsB,CAAC;AACzD,IAAA,IAAI,CAACT,KAAK,EAAE,OAAO,EAAE;AAErB,IAAA,OAAOA,KAAK;EACd,CAAC;AACDW,EAAAA,GAAG,EAAE,SAALA,GAAGA,CAAEb,GAAG,EAAA;AAAA,IAAA,OAAIF,sBAAsB,CAACK,MAAM,EAAE,CAACH,GAAG,CAAC;AAAA,EAAA;AAClD,CAAC;AAED,IAAMc,UAAU,GAAG,SAAbA,UAAUA,CAAIC,UAAU,EAAEC,SAAS,EAAK;AAC5C,EAAA,IAAIC,KAAK,CAACF,UAAU,CAAC,EAAE,OAAO,IAAI;AAElC,EAAA,IAAIE,KAAK,CAACD,SAAS,CAAC,EAAE,OAAO,KAAK;EAElC,OAAOD,UAAU,CAACR,UAAU,IAAIC,IAAI,CAACC,GAAG,EAAE,GAAGO,SAAS;AACxD,CAAC;AAED,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAK;AACtD,EAAA,IAAMC,WAAW,GAAGC,QAAQ,CAAAlB,aAAA,CAAA;AAC1Bc,IAAAA,QAAQ,EAARA,QAAQ;AACRK,IAAAA,OAAO,EAAEJ;GAAK,EACXC,OAAO,CACX,CAAC;AACF,EAAA,IAAMN,UAAU,GAAGjB,sBAAsB,CAACe,GAAG,CAACM,QAAQ,CAAC;AAEvDM,EAAAA,SAAS,CAAC,YAAM;AACd,IAAA,IAAI,CAACH,WAAW,CAACI,SAAS,EAAE;IAC5B5B,sBAAsB,CAACC,GAAG,CAACoB,QAAQ,EAAEG,WAAW,CAACrB,IAAI,CAAC;AACxD,EAAA,CAAC,EAAE,CAACkB,QAAQ,EAAEG,WAAW,CAACrB,IAAI,EAAEqB,WAAW,CAACI,SAAS,CAAC,CAAC;AAEvD,EAAA,IAAIZ,UAAU,CAACC,UAAU,EAAEM,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAA,MAAA,GAAA,MAAA,GAAPA,OAAO,CAAEL,SAAS,CAAC,EAAE;AAC9C,IAAA,OAAAX,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAYiB,WAAW,CAAA,EAAA,EAAA,EAAA;MAAEK,cAAc,EAAEL,WAAW,CAACM;AAAS,KAAA,CAAA;AAChE,EAAA;AAEA,EAAA,OAAAvB,aAAA,CAAAA,aAAA,CAAA,EAAA,EACKiB,WAAW,CAAA,EAAA,EAAA,EAAA;AACdrB,IAAAA,IAAI,EAAEqB,WAAW,CAACrB,IAAI,IAAIc,UAAU,CAACd,IAAI;AACzC0B,IAAAA,cAAc,EAAE;AAAK,GAAA,CAAA;AAEzB;AAEAT,iBAAiB,CAACW,QAAQ,GAAG/B,sBAAsB,CAACe,GAAG;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default } from './usePrefersReducedMotion.js';
|
|
2
|
-
import '../../slicedToArray-
|
|
2
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
import './constants.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
3
|
import { QUERY } from './constants.js';
|
|
4
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
4
5
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
5
6
|
|
|
6
7
|
var isRenderingOnServer = typeof window === "undefined";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrefersReducedMotion.js","sources":["../../../src/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nimport { QUERY } from \"./constants\";\n\nconst isRenderingOnServer = typeof window === \"undefined\";\n\nconst getInitialState = () =>\n // For our initial server render, we won't know if the user\n // prefers reduced motion, but it doesn't matter. This value\n // will be overwritten on the client, before any animations\n // occur.\n isRenderingOnServer ? true : !window.matchMedia(QUERY).matches;\n\nconst usePrefersReducedMotion = () => {\n const [prefersReducedMotion, setPrefersReducedMotion] =\n useState(getInitialState);\n\n useEffect(() => {\n if (isRenderingOnServer) return undefined;\n\n const mediaQueryList = window.matchMedia(QUERY);\n\n const listener = event => {\n setPrefersReducedMotion(!event.matches);\n };\n\n if (mediaQueryList.addEventListener) {\n mediaQueryList.addEventListener(\"change\", listener);\n } else {\n mediaQueryList.addListener(listener);\n }\n\n return () => {\n if (mediaQueryList.removeEventListener) {\n mediaQueryList.removeEventListener(\"change\", listener);\n } else {\n mediaQueryList.removeListener(listener);\n }\n };\n }, []);\n\n return prefersReducedMotion;\n};\n\nexport default usePrefersReducedMotion;\n"],"names":["isRenderingOnServer","window","getInitialState","matchMedia","QUERY","matches","usePrefersReducedMotion","_useState","useState","_useState2","_slicedToArray","prefersReducedMotion","setPrefersReducedMotion","useEffect","undefined","mediaQueryList","listener","event","addEventListener","addListener","removeEventListener","removeListener"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePrefersReducedMotion.js","sources":["../../../src/react-utils/usePrefersReducedMotion/usePrefersReducedMotion.js"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nimport { QUERY } from \"./constants\";\n\nconst isRenderingOnServer = typeof window === \"undefined\";\n\nconst getInitialState = () =>\n // For our initial server render, we won't know if the user\n // prefers reduced motion, but it doesn't matter. This value\n // will be overwritten on the client, before any animations\n // occur.\n isRenderingOnServer ? true : !window.matchMedia(QUERY).matches;\n\nconst usePrefersReducedMotion = () => {\n const [prefersReducedMotion, setPrefersReducedMotion] =\n useState(getInitialState);\n\n useEffect(() => {\n if (isRenderingOnServer) return undefined;\n\n const mediaQueryList = window.matchMedia(QUERY);\n\n const listener = event => {\n setPrefersReducedMotion(!event.matches);\n };\n\n if (mediaQueryList.addEventListener) {\n mediaQueryList.addEventListener(\"change\", listener);\n } else {\n mediaQueryList.addListener(listener);\n }\n\n return () => {\n if (mediaQueryList.removeEventListener) {\n mediaQueryList.removeEventListener(\"change\", listener);\n } else {\n mediaQueryList.removeListener(listener);\n }\n };\n }, []);\n\n return prefersReducedMotion;\n};\n\nexport default usePrefersReducedMotion;\n"],"names":["isRenderingOnServer","window","getInitialState","matchMedia","QUERY","matches","usePrefersReducedMotion","_useState","useState","_useState2","_slicedToArray","prefersReducedMotion","setPrefersReducedMotion","useEffect","undefined","mediaQueryList","listener","event","addEventListener","addListener","removeEventListener","removeListener"],"mappings":";;;;;;AAIA,IAAMA,mBAAmB,GAAG,OAAOC,MAAM,KAAK,WAAW;AAEzD,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,GAAA;AAAA,EAAA;AACnB;AACA;AACA;AACA;IACAF,mBAAmB,GAAG,IAAI,GAAG,CAACC,MAAM,CAACE,UAAU,CAACC,KAAK,CAAC,CAACC;AAAO;AAAA,CAAA;AAEhE,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,GAAS;AACpC,EAAA,IAAAC,SAAA,GACEC,QAAQ,CAACN,eAAe,CAAC;IAAAO,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AADpBI,IAAAA,oBAAoB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,uBAAuB,GAAAH,UAAA,CAAA,CAAA,CAAA;AAGpDI,EAAAA,SAAS,CAAC,YAAM;IACd,IAAIb,mBAAmB,EAAE,OAAOc,SAAS;AAEzC,IAAA,IAAMC,cAAc,GAAGd,MAAM,CAACE,UAAU,CAACC,KAAK,CAAC;AAE/C,IAAA,IAAMY,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,KAAK,EAAI;AACxBL,MAAAA,uBAAuB,CAAC,CAACK,KAAK,CAACZ,OAAO,CAAC;IACzC,CAAC;IAED,IAAIU,cAAc,CAACG,gBAAgB,EAAE;AACnCH,MAAAA,cAAc,CAACG,gBAAgB,CAAC,QAAQ,EAAEF,QAAQ,CAAC;AACrD,IAAA,CAAC,MAAM;AACLD,MAAAA,cAAc,CAACI,WAAW,CAACH,QAAQ,CAAC;AACtC,IAAA;AAEA,IAAA,OAAO,YAAM;MACX,IAAID,cAAc,CAACK,mBAAmB,EAAE;AACtCL,QAAAA,cAAc,CAACK,mBAAmB,CAAC,QAAQ,EAAEJ,QAAQ,CAAC;AACxD,MAAA,CAAC,MAAM;AACLD,QAAAA,cAAc,CAACM,cAAc,CAACL,QAAQ,CAAC;AACzC,MAAA;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AAEN,EAAA,OAAOL,oBAAoB;AAC7B;;;;"}
|
|
@@ -2,7 +2,8 @@ export { default } from './useQueryParams.js';
|
|
|
2
2
|
import 'react-router-dom';
|
|
3
3
|
import '../../utils/general.js';
|
|
4
4
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
5
|
-
import '../../slicedToArray-
|
|
5
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
6
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
6
7
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
7
8
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
8
9
|
import '../../defineProperty-Dcer7TUY.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useLocation } from 'react-router-dom';
|
|
2
2
|
import { parseQueryParams } from '../../utils/general.js';
|
|
3
3
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
4
|
-
import '../../slicedToArray-
|
|
4
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
5
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
5
6
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
6
7
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
7
8
|
import '../../defineProperty-Dcer7TUY.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryParams.js","sources":["../../../src/react-utils/useQueryParams/useQueryParams.js"],"sourcesContent":["import { useLocation } from \"react-router-dom\";\nimport { parseQueryParams } from \"utils/general\";\n\nconst useQueryParams = options => {\n const location = useLocation();\n\n return parseQueryParams(location?.search, options);\n};\n\nexport default useQueryParams;\n"],"names":["useQueryParams","options","location","useLocation","parseQueryParams","search"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useQueryParams.js","sources":["../../../src/react-utils/useQueryParams/useQueryParams.js"],"sourcesContent":["import { useLocation } from \"react-router-dom\";\nimport { parseQueryParams } from \"utils/general\";\n\nconst useQueryParams = options => {\n const location = useLocation();\n\n return parseQueryParams(location?.search, options);\n};\n\nexport default useQueryParams;\n"],"names":["useQueryParams","options","location","useLocation","parseQueryParams","search"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAGC,OAAO,EAAI;AAChC,EAAA,IAAMC,QAAQ,GAAGC,WAAW,EAAE;EAE9B,OAAOC,gBAAgB,CAACF,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAAA,MAAA,GAAA,MAAA,GAARA,QAAQ,CAAEG,MAAM,EAAEJ,OAAO,CAAC;AACpD;;;;"}
|
|
@@ -8,7 +8,8 @@ import '../constants/constants.js';
|
|
|
8
8
|
import '../withImmutableActions/withImmutableActions.js';
|
|
9
9
|
import '../../utils/general.js';
|
|
10
10
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
11
|
-
import '../../slicedToArray-
|
|
11
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
12
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
12
13
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
13
14
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
14
15
|
import 'i18next';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,7 +9,8 @@ import { useShallow } from 'zustand/shallow';
|
|
|
9
9
|
import '../../toPropertyKey-BAXkSB3z.js';
|
|
10
10
|
import '../../typeof-D-UKOauR.js';
|
|
11
11
|
import '../../objectWithoutProperties-DN7d1SzH.js';
|
|
12
|
-
import '../../slicedToArray-
|
|
12
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
13
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
13
14
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
14
15
|
import '../../asyncToGenerator-CPKhuIh2.js';
|
|
15
16
|
import 'i18next';
|
package/dist/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterNavigationCheckpoint.js","sources":["../../../src/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { mergeDeepLeft, pick, prop, dissoc } from \"ramda\";\nimport { STORAGE_KEY } from \"react-utils/constants\";\nimport withImmutableActions from \"react-utils/withImmutableActions\";\nimport { getFromLocalStorage, setToLocalStorage } from \"utils/general\";\nimport { create } from \"zustand\";\nimport { useShallow } from \"zustand/shallow\";\n\nconst getLocalStorageData = () => getFromLocalStorage(STORAGE_KEY) || {};\n\nconst setLocalStorageData = data => setToLocalStorage(STORAGE_KEY, data);\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useCheckpointStore = create(\n withImmutableActions(set => ({\n checkpoints: {},\n setCheckpoint: (key, path) =>\n set(mergeDeepLeft({ checkpoints: { [key]: path } })),\n removeCheckpoint: key =>\n set(state => ({ checkpoints: dissoc(key, state.checkpoints) })),\n }))\n);\n\nconst useRegisterNavigationCheckpoint = (\n key,\n path = window.location.pathname + window.location.search,\n persistInLocalStorage = false\n) => {\n const setCheckpoint = useCheckpointStore(prop(\"setCheckpoint\"));\n\n useEffect(() => {\n setCheckpoint(key, path);\n if (persistInLocalStorage) {\n const localStorageData = getLocalStorageData();\n setLocalStorageData({ ...localStorageData, [key]: path });\n }\n }, [key, path, persistInLocalStorage]);\n};\n\nexport const useNavigationCheckpoints = (...keys) => {\n const getCheckpoints = useCheckpointStore(\n useShallow(store => pick(keys, store.checkpoints))\n );\n\n const localStorageData = getLocalStorageData();\n const localStorageCheckpoints = pick(keys, localStorageData);\n\n return { ...getCheckpoints, ...localStorageCheckpoints };\n};\n\nexport const useRemoveNavigationCheckpoint = () => {\n const removeCheckpoint = useCheckpointStore(prop(\"removeCheckpoint\"));\n\n return key => {\n removeCheckpoint(key);\n const localStorageData = getLocalStorageData();\n setLocalStorageData(dissoc(key, localStorageData));\n };\n};\n\nexport default useRegisterNavigationCheckpoint;\n"],"names":["getLocalStorageData","getFromLocalStorage","STORAGE_KEY","setLocalStorageData","data","setToLocalStorage","useCheckpointStore","create","withImmutableActions","set","checkpoints","setCheckpoint","key","path","mergeDeepLeft","_defineProperty","removeCheckpoint","state","dissoc","useRegisterNavigationCheckpoint","arguments","length","undefined","window","location","pathname","search","persistInLocalStorage","prop","useEffect","localStorageData","_objectSpread","useNavigationCheckpoints","_len","keys","Array","_key","getCheckpoints","useShallow","store","pick","localStorageCheckpoints","useRemoveNavigationCheckpoint"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRegisterNavigationCheckpoint.js","sources":["../../../src/react-utils/useRegisterNavigationCheckpoint/useRegisterNavigationCheckpoint.js"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { mergeDeepLeft, pick, prop, dissoc } from \"ramda\";\nimport { STORAGE_KEY } from \"react-utils/constants\";\nimport withImmutableActions from \"react-utils/withImmutableActions\";\nimport { getFromLocalStorage, setToLocalStorage } from \"utils/general\";\nimport { create } from \"zustand\";\nimport { useShallow } from \"zustand/shallow\";\n\nconst getLocalStorageData = () => getFromLocalStorage(STORAGE_KEY) || {};\n\nconst setLocalStorageData = data => setToLocalStorage(STORAGE_KEY, data);\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useCheckpointStore = create(\n withImmutableActions(set => ({\n checkpoints: {},\n setCheckpoint: (key, path) =>\n set(mergeDeepLeft({ checkpoints: { [key]: path } })),\n removeCheckpoint: key =>\n set(state => ({ checkpoints: dissoc(key, state.checkpoints) })),\n }))\n);\n\nconst useRegisterNavigationCheckpoint = (\n key,\n path = window.location.pathname + window.location.search,\n persistInLocalStorage = false\n) => {\n const setCheckpoint = useCheckpointStore(prop(\"setCheckpoint\"));\n\n useEffect(() => {\n setCheckpoint(key, path);\n if (persistInLocalStorage) {\n const localStorageData = getLocalStorageData();\n setLocalStorageData({ ...localStorageData, [key]: path });\n }\n }, [key, path, persistInLocalStorage]);\n};\n\nexport const useNavigationCheckpoints = (...keys) => {\n const getCheckpoints = useCheckpointStore(\n useShallow(store => pick(keys, store.checkpoints))\n );\n\n const localStorageData = getLocalStorageData();\n const localStorageCheckpoints = pick(keys, localStorageData);\n\n return { ...getCheckpoints, ...localStorageCheckpoints };\n};\n\nexport const useRemoveNavigationCheckpoint = () => {\n const removeCheckpoint = useCheckpointStore(prop(\"removeCheckpoint\"));\n\n return key => {\n removeCheckpoint(key);\n const localStorageData = getLocalStorageData();\n setLocalStorageData(dissoc(key, localStorageData));\n };\n};\n\nexport default useRegisterNavigationCheckpoint;\n"],"names":["getLocalStorageData","getFromLocalStorage","STORAGE_KEY","setLocalStorageData","data","setToLocalStorage","useCheckpointStore","create","withImmutableActions","set","checkpoints","setCheckpoint","key","path","mergeDeepLeft","_defineProperty","removeCheckpoint","state","dissoc","useRegisterNavigationCheckpoint","arguments","length","undefined","window","location","pathname","search","persistInLocalStorage","prop","useEffect","localStorageData","_objectSpread","useNavigationCheckpoints","_len","keys","Array","_key","getCheckpoints","useShallow","store","pick","localStorageCheckpoints","useRemoveNavigationCheckpoint"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmBA,GAAA;AAAA,EAAA,OAASC,mBAAmB,CAACC,WAAW,CAAC,IAAI,EAAE;AAAA,CAAA;AAExE,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,IAAI,EAAA;AAAA,EAAA,OAAIC,iBAAiB,CAACH,WAAW,EAAEE,IAAI,CAAC;AAAA,CAAA;;AAExE;AACA,IAAME,kBAAkB,GAAGC,MAAM,CAC/BC,oBAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;IAC3BC,WAAW,EAAE,EAAE;AACfC,IAAAA,aAAa,EAAE,SAAfA,aAAaA,CAAGC,GAAG,EAAEC,IAAI,EAAA;MAAA,OACvBJ,GAAG,CAACK,aAAa,CAAC;AAAEJ,QAAAA,WAAW,EAAAK,eAAA,CAAA,EAAA,EAAKH,GAAG,EAAGC,IAAI;AAAG,OAAC,CAAC,CAAC;AAAA,IAAA,CAAA;AACtDG,IAAAA,gBAAgB,EAAE,SAAlBA,gBAAgBA,CAAEJ,GAAG,EAAA;MAAA,OACnBH,GAAG,CAAC,UAAAQ,KAAK,EAAA;QAAA,OAAK;AAAEP,UAAAA,WAAW,EAAEQ,MAAM,CAACN,GAAG,EAAEK,KAAK,CAACP,WAAW;SAAG;AAAA,MAAA,CAAC,CAAC;AAAA,IAAA;GAClE;AAAA,CAAC,CACJ,CAAC;AAED,IAAMS,+BAA+B,GAAG,SAAlCA,+BAA+BA,CACnCP,GAAG,EAGA;EAAA,IAFHC,IAAI,GAAAO,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,MAAGG,MAAM,CAACC,QAAQ,CAACC,QAAQ,GAAGF,MAAM,CAACC,QAAQ,CAACE,MAAM;AAAA,EAAA,IACxDC,qBAAqB,GAAAP,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,KAAK;EAE7B,IAAMT,aAAa,GAAGL,kBAAkB,CAACsB,IAAI,CAAC,eAAe,CAAC,CAAC;AAE/DC,EAAAA,SAAS,CAAC,YAAM;AACdlB,IAAAA,aAAa,CAACC,GAAG,EAAEC,IAAI,CAAC;AACxB,IAAA,IAAIc,qBAAqB,EAAE;AACzB,MAAA,IAAMG,gBAAgB,GAAG9B,mBAAmB,EAAE;AAC9CG,MAAAA,mBAAmB,CAAA4B,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAMD,gBAAgB,CAAA,EAAA,EAAA,EAAAf,eAAA,CAAA,EAAA,EAAGH,GAAG,EAAGC,IAAI,EAAE,CAAC;AAC3D,IAAA;EACF,CAAC,EAAE,CAACD,GAAG,EAAEC,IAAI,EAAEc,qBAAqB,CAAC,CAAC;AACxC;IAEaK,wBAAwB,GAAG,SAA3BA,wBAAwBA,GAAgB;AAAA,EAAA,KAAA,IAAAC,IAAA,GAAAb,SAAA,CAAAC,MAAA,EAATa,IAAI,GAAA,IAAAC,KAAA,CAAAF,IAAA,GAAAG,IAAA,GAAA,CAAA,EAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA,EAAA,EAAA;AAAJF,IAAAA,IAAI,CAAAE,IAAA,CAAA,GAAAhB,SAAA,CAAAgB,IAAA,CAAA;AAAA,EAAA;AAC9C,EAAA,IAAMC,cAAc,GAAG/B,kBAAkB,CACvCgC,UAAU,CAAC,UAAAC,KAAK,EAAA;AAAA,IAAA,OAAIC,IAAI,CAACN,IAAI,EAAEK,KAAK,CAAC7B,WAAW,CAAC;AAAA,EAAA,CAAA,CACnD,CAAC;AAED,EAAA,IAAMoB,gBAAgB,GAAG9B,mBAAmB,EAAE;AAC9C,EAAA,IAAMyC,uBAAuB,GAAGD,IAAI,CAACN,IAAI,EAAEJ,gBAAgB,CAAC;AAE5D,EAAA,OAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAYM,cAAc,GAAKI,uBAAuB,CAAA;AACxD;IAEaC,6BAA6B,GAAG,SAAhCA,6BAA6BA,GAAS;EACjD,IAAM1B,gBAAgB,GAAGV,kBAAkB,CAACsB,IAAI,CAAC,kBAAkB,CAAC,CAAC;EAErE,OAAO,UAAAhB,GAAG,EAAI;IACZI,gBAAgB,CAACJ,GAAG,CAAC;AACrB,IAAA,IAAMkB,gBAAgB,GAAG9B,mBAAmB,EAAE;AAC9CG,IAAAA,mBAAmB,CAACe,MAAM,CAACN,GAAG,EAAEkB,gBAAgB,CAAC,CAAC;EACpD,CAAC;AACH;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default } from './useStateWithDependency.js';
|
|
2
|
-
import '../../slicedToArray-
|
|
2
|
+
import '../../slicedToArray-BkMe3jhN.js';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
import 'react';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../../slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../../slicedToArray-BkMe3jhN.js';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
|
+
import '../../nonIterableRest-BZgkRyt5.js';
|
|
3
4
|
import '../../unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
4
5
|
|
|
5
6
|
var useStateWithDependency = function useStateWithDependency(defaultValue) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStateWithDependency.js","sources":["../../../src/react-utils/useStateWithDependency/useStateWithDependency.js"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nconst useStateWithDependency = (\n defaultValue,\n dependencies = [defaultValue]\n) => {\n const [value, setValue] = useState(defaultValue);\n\n useEffect(() => {\n setValue(defaultValue);\n }, dependencies);\n\n return [value, setValue];\n};\n\nexport default useStateWithDependency;\n"],"names":["useStateWithDependency","defaultValue","dependencies","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","value","setValue","useEffect"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStateWithDependency.js","sources":["../../../src/react-utils/useStateWithDependency/useStateWithDependency.js"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nconst useStateWithDependency = (\n defaultValue,\n dependencies = [defaultValue]\n) => {\n const [value, setValue] = useState(defaultValue);\n\n useEffect(() => {\n setValue(defaultValue);\n }, dependencies);\n\n return [value, setValue];\n};\n\nexport default useStateWithDependency;\n"],"names":["useStateWithDependency","defaultValue","dependencies","arguments","length","undefined","_useState","useState","_useState2","_slicedToArray","value","setValue","useEffect"],"mappings":";;;;;AAEA,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAC1BC,YAAY,EAET;AAAA,EAAA,IADHC,YAAY,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAACF,YAAY,CAAC;AAE7B,EAAA,IAAAK,SAAA,GAA0BC,QAAQ,CAACN,YAAY,CAAC;IAAAO,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAzCI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,UAAA,CAAA,CAAA,CAAA;AAEtBI,EAAAA,SAAS,CAAC,YAAM;IACdD,QAAQ,CAACV,YAAY,CAAC;EACxB,CAAC,EAAEC,YAAY,CAAC;AAEhB,EAAA,OAAO,CAACQ,KAAK,EAAEC,QAAQ,CAAC;AAC1B;;;;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { _ as _arrayWithHoles, a as _nonIterableRest } from './nonIterableRest-BZgkRyt5.js';
|
|
1
2
|
import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-Dqz8Y8_I.js';
|
|
2
3
|
|
|
3
|
-
function _arrayWithHoles(r) {
|
|
4
|
-
if (Array.isArray(r)) return r;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
4
|
function _iterableToArrayLimit(r, l) {
|
|
8
5
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
9
6
|
if (null != t) {
|
|
@@ -32,13 +29,9 @@ function _iterableToArrayLimit(r, l) {
|
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
function _nonIterableRest() {
|
|
36
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
32
|
function _slicedToArray(r, e) {
|
|
40
33
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
export { _slicedToArray as _ };
|
|
44
|
-
//# sourceMappingURL=slicedToArray-
|
|
37
|
+
//# sourceMappingURL=slicedToArray-BkMe3jhN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slicedToArray-BkMe3jhN.js","sources":["../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js"],"sourcesContent":["function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };"],"names":["arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest"],"mappings":";;;AAAA,SAAS,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE;AACrC,EAAE,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,IAAI,OAAO,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;AAClG,EAAE,IAAI,IAAI,IAAI,CAAC,EAAE;AACjB,IAAI,IAAI,CAAC;AACT,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC;AACP,MAAM,CAAC,GAAG,EAAE;AACZ,MAAM,CAAC,GAAG,IAAE;AACZ,MAAM,CAAC,GAAG,KAAE;AACZ,IAAI,IAAI;AACR,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;AAC7C,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;AAC7B,QAAQ,CAAC,GAAG,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7F,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,CAAC,GAAG,IAAE,EAAE,CAAC,GAAG,CAAC;AACnB,IAAI,CAAC,SAAS;AACd,MAAM,IAAI;AACV,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;AAC/E,MAAM,CAAC,SAAS;AAChB,QAAQ,IAAI,CAAC,EAAE,MAAM,CAAC;AACtB,MAAM;AACN,IAAI;AACJ,IAAI,OAAO,CAAC;AACZ,EAAE;AACF;;ACtBA,SAAS,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE;AAC9B,EAAE,OAAOA,eAAc,CAAC,CAAC,CAAC,IAAIC,qBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,IAAIC,2BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,IAAIC,gBAAe,EAAE;AACjH;;;;","x_google_ignoreList":[0,1]}
|