preact-intlayer 9.7.0 → 9.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/IntlayerNode.cjs +1 -2
- package/dist/cjs/UI/ContentSelector.cjs +1 -2
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/analytics/AnalyticsProvider.cjs +2 -3
- package/dist/cjs/analytics/exposureSink.cjs +1 -2
- package/dist/cjs/analytics/index.cjs +4 -4
- package/dist/cjs/analytics/useAnalytics.cjs +4 -5
- package/dist/cjs/analytics/useConversion.cjs +2 -3
- package/dist/cjs/analytics/useExperiment.cjs +2 -3
- package/dist/cjs/client/IntlayerProvider.cjs +7 -8
- package/dist/cjs/client/index.cjs +11 -11
- package/dist/cjs/client/t.cjs +3 -4
- package/dist/cjs/client/useContent.cjs +3 -4
- package/dist/cjs/client/useDictionary.cjs +3 -4
- package/dist/cjs/client/useDictionary.cjs.map +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +4 -5
- package/dist/cjs/client/useDictionaryDynamic.cjs +5 -6
- package/dist/cjs/client/useIntlayer.cjs +3 -4
- package/dist/cjs/client/useLoadDynamic.cjs +1 -2
- package/dist/cjs/client/useLocale.cjs +4 -5
- package/dist/cjs/client/useLocaleBase.cjs +3 -4
- package/dist/cjs/client/useLocaleStorage.cjs +1 -2
- package/dist/cjs/client/usePathname.cjs +1 -2
- package/dist/cjs/client/useTraduction.cjs +3 -4
- package/dist/cjs/editor/ContentSelector.cjs +2 -3
- package/dist/cjs/editor/EditorProvider.cjs +2 -3
- package/dist/cjs/editor/useEditor.cjs +3 -4
- package/dist/cjs/format/index.cjs +9 -9
- package/dist/cjs/format/useCompact.cjs +2 -3
- package/dist/cjs/format/useCurrency.cjs +2 -3
- package/dist/cjs/format/useDate.cjs +2 -3
- package/dist/cjs/format/useIntl.cjs +2 -3
- package/dist/cjs/format/useList.cjs +2 -3
- package/dist/cjs/format/useNumber.cjs +2 -3
- package/dist/cjs/format/usePercentage.cjs +2 -3
- package/dist/cjs/format/useRelativeTime.cjs +2 -3
- package/dist/cjs/format/useUnit.cjs +2 -3
- package/dist/cjs/getDictionary.cjs +2 -3
- package/dist/cjs/getDictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayer.cjs +2 -3
- package/dist/cjs/html/HTMLProvider.cjs +2 -3
- package/dist/cjs/html/HTMLRenderer.cjs +3 -4
- package/dist/cjs/html/index.cjs +2 -2
- package/dist/cjs/index.cjs +17 -17
- package/dist/cjs/markdown/MarkdownProvider.cjs +3 -4
- package/dist/cjs/markdown/MarkdownRenderer.cjs +3 -4
- package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +4 -5
- package/dist/cjs/markdown/compiler.cjs +2 -3
- package/dist/cjs/markdown/index.cjs +3 -3
- package/dist/cjs/markdown/runtime.cjs +1 -2
- package/dist/cjs/plugins.cjs +10 -11
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/cjs/preactElement/renderPreactElement.cjs +1 -2
- package/dist/esm/IntlayerNode.mjs +1 -2
- package/dist/esm/UI/ContentSelector.mjs +1 -2
- package/dist/esm/analytics/AnalyticsProvider.mjs +1 -2
- package/dist/esm/analytics/exposureSink.mjs +1 -2
- package/dist/esm/analytics/index.mjs +1 -1
- package/dist/esm/analytics/useAnalytics.mjs +3 -4
- package/dist/esm/analytics/useConversion.mjs +2 -3
- package/dist/esm/analytics/useExperiment.mjs +2 -3
- package/dist/esm/client/IntlayerProvider.mjs +5 -6
- package/dist/esm/client/index.mjs +2 -2
- package/dist/esm/client/t.mjs +2 -3
- package/dist/esm/client/useContent.mjs +1 -2
- package/dist/esm/client/useDictionary.mjs +1 -2
- package/dist/esm/client/useDictionary.mjs.map +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +2 -3
- package/dist/esm/client/useDictionaryDynamic.mjs +2 -3
- package/dist/esm/client/useIntlayer.mjs +1 -2
- package/dist/esm/client/useLoadDynamic.mjs +1 -2
- package/dist/esm/client/useLocale.mjs +3 -4
- package/dist/esm/client/useLocaleBase.mjs +2 -3
- package/dist/esm/client/useLocaleStorage.mjs +1 -2
- package/dist/esm/client/usePathname.mjs +1 -2
- package/dist/esm/client/useTraduction.mjs +2 -3
- package/dist/esm/editor/ContentSelector.mjs +2 -3
- package/dist/esm/editor/EditorProvider.mjs +1 -2
- package/dist/esm/editor/useEditor.mjs +2 -3
- package/dist/esm/format/index.mjs +5 -5
- package/dist/esm/format/useCompact.mjs +1 -2
- package/dist/esm/format/useCurrency.mjs +1 -2
- package/dist/esm/format/useDate.mjs +1 -2
- package/dist/esm/format/useIntl.mjs +1 -2
- package/dist/esm/format/useList.mjs +1 -2
- package/dist/esm/format/useNumber.mjs +1 -2
- package/dist/esm/format/usePercentage.mjs +1 -2
- package/dist/esm/format/useRelativeTime.mjs +1 -2
- package/dist/esm/format/useUnit.mjs +1 -2
- package/dist/esm/getDictionary.mjs +1 -2
- package/dist/esm/getDictionary.mjs.map +1 -1
- package/dist/esm/getIntlayer.mjs +1 -2
- package/dist/esm/html/HTMLProvider.mjs +2 -3
- package/dist/esm/html/HTMLRenderer.mjs +2 -3
- package/dist/esm/index.mjs +6 -6
- package/dist/esm/markdown/MarkdownProvider.mjs +2 -3
- package/dist/esm/markdown/MarkdownRenderer.mjs +1 -2
- package/dist/esm/markdown/MarkdownRendererPlugin.mjs +2 -3
- package/dist/esm/markdown/compiler.mjs +1 -2
- package/dist/esm/markdown/runtime.mjs +1 -2
- package/dist/esm/plugins.mjs +5 -6
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/esm/preactElement/renderPreactElement.mjs +1 -2
- package/dist/types/IntlayerNode.d.ts +2 -3
- package/dist/types/IntlayerNode.d.ts.map +1 -1
- package/dist/types/UI/ContentSelector.d.ts +1 -2
- package/dist/types/UI/ContentSelector.d.ts.map +1 -1
- package/dist/types/analytics/AnalyticsProvider.d.ts +0 -2
- package/dist/types/analytics/AnalyticsProvider.d.ts.map +1 -1
- package/dist/types/analytics/exposureSink.d.ts +0 -2
- package/dist/types/analytics/exposureSink.d.ts.map +1 -1
- package/dist/types/analytics/useAnalytics.d.ts +0 -2
- package/dist/types/analytics/useAnalytics.d.ts.map +1 -1
- package/dist/types/analytics/useConversion.d.ts +0 -2
- package/dist/types/analytics/useConversion.d.ts.map +1 -1
- package/dist/types/analytics/useExperiment.d.ts +0 -2
- package/dist/types/analytics/useExperiment.d.ts.map +1 -1
- package/dist/types/client/IntlayerProvider.d.ts +1 -2
- package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
- package/dist/types/client/t.d.ts +0 -2
- package/dist/types/client/t.d.ts.map +1 -1
- package/dist/types/client/useContent.d.ts +0 -2
- package/dist/types/client/useContent.d.ts.map +1 -1
- package/dist/types/client/useDictionary.d.ts +0 -2
- package/dist/types/client/useDictionary.d.ts.map +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +0 -2
- package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +0 -2
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useIntlayer.d.ts +0 -2
- package/dist/types/client/useIntlayer.d.ts.map +1 -1
- package/dist/types/client/useLoadDynamic.d.ts +0 -2
- package/dist/types/client/useLoadDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +1 -2
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +0 -2
- package/dist/types/client/useLocaleBase.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +0 -2
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/client/usePathname.d.ts +0 -2
- package/dist/types/client/usePathname.d.ts.map +1 -1
- package/dist/types/client/useTraduction.d.ts +0 -2
- package/dist/types/client/useTraduction.d.ts.map +1 -1
- package/dist/types/editor/ContentSelector.d.ts +0 -2
- package/dist/types/editor/ContentSelector.d.ts.map +1 -1
- package/dist/types/editor/EditorProvider.d.ts +0 -2
- package/dist/types/editor/EditorProvider.d.ts.map +1 -1
- package/dist/types/editor/useEditor.d.ts +0 -2
- package/dist/types/editor/useEditor.d.ts.map +1 -1
- package/dist/types/format/useCompact.d.ts +0 -2
- package/dist/types/format/useCompact.d.ts.map +1 -1
- package/dist/types/format/useCurrency.d.ts +0 -2
- package/dist/types/format/useCurrency.d.ts.map +1 -1
- package/dist/types/format/useDate.d.ts +0 -2
- package/dist/types/format/useDate.d.ts.map +1 -1
- package/dist/types/format/useIntl.d.ts +0 -2
- package/dist/types/format/useIntl.d.ts.map +1 -1
- package/dist/types/format/useList.d.ts +0 -2
- package/dist/types/format/useList.d.ts.map +1 -1
- package/dist/types/format/useNumber.d.ts +0 -2
- package/dist/types/format/useNumber.d.ts.map +1 -1
- package/dist/types/format/usePercentage.d.ts +0 -2
- package/dist/types/format/usePercentage.d.ts.map +1 -1
- package/dist/types/format/useRelativeTime.d.ts +0 -2
- package/dist/types/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/format/useUnit.d.ts +0 -2
- package/dist/types/format/useUnit.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +0 -2
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getIntlayer.d.ts +0 -2
- package/dist/types/getIntlayer.d.ts.map +1 -1
- package/dist/types/html/HTMLProvider.d.ts +1 -2
- package/dist/types/html/HTMLProvider.d.ts.map +1 -1
- package/dist/types/html/HTMLRenderer.d.ts +0 -2
- package/dist/types/html/HTMLRenderer.d.ts.map +1 -1
- package/dist/types/html/index.d.ts +1 -1
- package/dist/types/html/types.d.ts +1 -2
- package/dist/types/html/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +1 -2
- package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +0 -2
- package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts +1 -2
- package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -1
- package/dist/types/markdown/compiler.d.ts +3 -2
- package/dist/types/markdown/compiler.d.ts.map +1 -1
- package/dist/types/markdown/runtime.d.ts +3 -2
- package/dist/types/markdown/runtime.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +3 -5
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/preactElement/renderPreactElement.d.ts +0 -2
- package/dist/types/preactElement/renderPreactElement.d.ts.map +1 -1
- package/package.json +50 -50
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
let preact = require("preact");
|
|
3
3
|
let _intlayer_core_utils = require("@intlayer/core/utils");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/IntlayerNode.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Renders content as a Preact vnode that also behaves like its value
|
|
8
8
|
* (`node.value`, `${node}`, `node.toUpperCase()`).
|
|
@@ -19,6 +19,5 @@ const renderIntlayerNode = ({ children, value, additionalProps }) => Object.setP
|
|
|
19
19
|
...additionalProps
|
|
20
20
|
}, (0, _intlayer_core_utils.getIntlayerNodePrototype)(value));
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.renderIntlayerNode = renderIntlayerNode;
|
|
24
23
|
//# sourceMappingURL=IntlayerNode.cjs.map
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
let preact_hooks = require("preact/hooks");
|
|
3
3
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/UI/ContentSelector.tsx
|
|
6
6
|
const DEFAULT_PRESS_DETECT_DURATION = 250;
|
|
7
7
|
const ContentSelector = ({ children, onPress: onSelect, onHover, onUnhover, onClickOutside: onUnselect, pressDuration = DEFAULT_PRESS_DETECT_DURATION, isSelecting: isSelectingProp, ...props }) => {
|
|
8
8
|
const divRef = (0, preact_hooks.useRef)(null);
|
|
@@ -91,6 +91,5 @@ const ContentSelector = ({ children, onPress: onSelect, onHover, onUnhover, onCl
|
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
//#endregion
|
|
95
94
|
exports.ContentSelector = ContentSelector;
|
|
96
95
|
//# sourceMappingURL=ContentSelector.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -24,5 +24,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.__toESM = __toESM;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_analytics_useAnalytics = require(
|
|
2
|
+
const require_analytics_useAnalytics = require("./useAnalytics.cjs");
|
|
3
3
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/analytics/AnalyticsProvider.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Runs {@link useAnalytics} and renders its children unchanged. Mounted inside
|
|
8
8
|
* {@link IntlayerProvider} alongside `EditorProvider`.
|
|
@@ -12,6 +12,5 @@ const AnalyticsProvider = ({ children }) => {
|
|
|
12
12
|
return /* @__PURE__ */ (0, preact_jsx_runtime.jsx)(preact_jsx_runtime.Fragment, { children });
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
exports.AnalyticsProvider = AnalyticsProvider;
|
|
17
16
|
//# sourceMappingURL=AnalyticsProvider.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/analytics/exposureSink.ts
|
|
3
3
|
let sink = null;
|
|
4
4
|
/**
|
|
5
5
|
* Installs (or clears) the exposure sink. `useAnalytics` sets this once the
|
|
@@ -20,7 +20,6 @@ const reportExposure = (input) => {
|
|
|
20
20
|
sink?.(input);
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
//#endregion
|
|
24
23
|
exports.reportExposure = reportExposure;
|
|
25
24
|
exports.setExposureSink = setExposureSink;
|
|
26
25
|
//# sourceMappingURL=exposureSink.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_analytics_useConversion = require(
|
|
5
|
-
const require_analytics_useExperiment = require(
|
|
2
|
+
const require_analytics_AnalyticsProvider = require("./AnalyticsProvider.cjs");
|
|
3
|
+
const require_analytics_useAnalytics = require("./useAnalytics.cjs");
|
|
4
|
+
const require_analytics_useConversion = require("./useConversion.cjs");
|
|
5
|
+
const require_analytics_useExperiment = require("./useExperiment.cjs");
|
|
6
6
|
|
|
7
7
|
exports.AnalyticsProvider = require_analytics_AnalyticsProvider.AnalyticsProvider;
|
|
8
8
|
exports.useAnalytics = require_analytics_useAnalytics.useAnalytics;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
let preact_hooks = require("preact/hooks");
|
|
2
|
+
const require_client_IntlayerProvider = require("../client/IntlayerProvider.cjs");
|
|
3
|
+
const require_analytics_exposureSink = require("./exposureSink.cjs");
|
|
5
4
|
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
5
|
+
let preact_hooks = require("preact/hooks");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/analytics/useAnalytics.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Initializes the Intlayer analytics client singleton when analytics is enabled
|
|
10
10
|
* and keeps it aware of the current locale.
|
|
@@ -47,6 +47,5 @@ const useAnalytics = () => {
|
|
|
47
47
|
}, [locale]);
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
exports.useAnalytics = useAnalytics;
|
|
52
51
|
//# sourceMappingURL=useAnalytics.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let preact_hooks = require("preact/hooks");
|
|
3
2
|
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
3
|
+
let preact_hooks = require("preact/hooks");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/analytics/useConversion.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns a stable `trackConversion` callback for content A/B testing. Safe to
|
|
8
8
|
* call from any component: it resolves to a no-op when analytics is disabled
|
|
@@ -25,6 +25,5 @@ const useConversion = () => {
|
|
|
25
25
|
}, []);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
//#endregion
|
|
29
28
|
exports.useConversion = useConversion;
|
|
30
29
|
//# sourceMappingURL=useConversion.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let preact_hooks = require("preact/hooks");
|
|
3
2
|
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
3
|
+
let preact_hooks = require("preact/hooks");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/analytics/useExperiment.ts
|
|
6
6
|
/**
|
|
7
7
|
* Assigns this session to a variant of an A/B experiment and records the
|
|
8
8
|
* exposure, scoped to `experimentKey`, so the backend can compute per-variant
|
|
@@ -58,6 +58,5 @@ const useExperiment = (experimentKey, variants, weights) => {
|
|
|
58
58
|
return state;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
//#endregion
|
|
62
61
|
exports.useExperiment = useExperiment;
|
|
63
62
|
//# sourceMappingURL=useExperiment.cjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
6
|
-
let preact = require("preact");
|
|
2
|
+
const require_analytics_AnalyticsProvider = require("../analytics/AnalyticsProvider.cjs");
|
|
3
|
+
const require_editor_EditorProvider = require("../editor/EditorProvider.cjs");
|
|
4
|
+
const require_client_useLocaleStorage = require("./useLocaleStorage.cjs");
|
|
7
5
|
let preact_hooks = require("preact/hooks");
|
|
8
|
-
let
|
|
6
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
9
7
|
let _intlayer_config_client = require("@intlayer/config/client");
|
|
10
8
|
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
9
|
+
let preact = require("preact");
|
|
10
|
+
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/client/IntlayerProvider.tsx
|
|
13
13
|
/**
|
|
14
14
|
* Context that store the current locale on the client side
|
|
15
15
|
*/
|
|
@@ -93,7 +93,6 @@ const IntlayerProvider = ({ children, ...props }) => /* @__PURE__ */ (0, preact_
|
|
|
93
93
|
]
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
//#endregion
|
|
97
96
|
exports.IntlayerClientContext = IntlayerClientContext;
|
|
98
97
|
exports.IntlayerProvider = IntlayerProvider;
|
|
99
98
|
exports.IntlayerProviderContent = IntlayerProviderContent;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const require_client_usePathname = require(
|
|
2
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
3
|
+
const require_client_t = require("./t.cjs");
|
|
4
|
+
const require_client_useDictionary = require("./useDictionary.cjs");
|
|
5
|
+
const require_client_useDictionaryAsync = require("./useDictionaryAsync.cjs");
|
|
6
|
+
const require_client_useDictionaryDynamic = require("./useDictionaryDynamic.cjs");
|
|
7
|
+
const require_client_useIntlayer = require("./useIntlayer.cjs");
|
|
8
|
+
const require_client_useLoadDynamic = require("./useLoadDynamic.cjs");
|
|
9
|
+
const require_client_useLocale = require("./useLocale.cjs");
|
|
10
|
+
const require_client_useLocaleBase = require("./useLocaleBase.cjs");
|
|
11
|
+
const require_client_useLocaleStorage = require("./useLocaleStorage.cjs");
|
|
12
|
+
const require_client_usePathname = require("./usePathname.cjs");
|
|
13
13
|
|
|
14
14
|
exports.IntlayerClientContext = require_client_IntlayerProvider.IntlayerClientContext;
|
|
15
15
|
exports.IntlayerProvider = require_client_IntlayerProvider.IntlayerProvider;
|
package/dist/cjs/client/t.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
3
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
2
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
3
|
let preact_hooks = require("preact/hooks");
|
|
4
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/client/t.ts
|
|
7
7
|
/**
|
|
8
8
|
* On the client side, this function returns the translation of the provided multilang content.
|
|
9
9
|
*
|
|
@@ -14,6 +14,5 @@ const t = (multilangContent, locale) => {
|
|
|
14
14
|
return (0, _intlayer_core_interpreter.getTranslation)(multilangContent, locale ?? currentLocale);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.t = t;
|
|
19
18
|
//# sourceMappingURL=t.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_useLocaleBase = require(
|
|
3
|
-
const require_client_useTraduction = require(
|
|
2
|
+
const require_client_useLocaleBase = require("./useLocaleBase.cjs");
|
|
3
|
+
const require_client_useTraduction = require("./useTraduction.cjs");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/client/useContent.ts
|
|
6
6
|
/**
|
|
7
7
|
* On the client side, hook to get the translation content based on the locale
|
|
8
8
|
*/
|
|
@@ -15,6 +15,5 @@ const useContent = (languageContent) => {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.useContent = useContent;
|
|
20
19
|
//# sourceMappingURL=useContent.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_getDictionary = require(
|
|
3
|
-
const require_client_IntlayerProvider = require(
|
|
2
|
+
const require_getDictionary = require("../getDictionary.cjs");
|
|
3
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
4
|
let preact_hooks = require("preact/hooks");
|
|
5
5
|
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/useDictionary.ts
|
|
8
8
|
/**
|
|
9
9
|
* Preact hook that transforms a dictionary (or qualified dictionary group) and
|
|
10
10
|
* returns the content.
|
|
@@ -24,6 +24,5 @@ const useDictionary = (dictionary, localeOrSelector) => {
|
|
|
24
24
|
return (0, preact_hooks.useMemo)(() => require_getDictionary.getDictionary(dictionary, argument), [dictionary.key, argumentIdentity]);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.useDictionary = useDictionary;
|
|
29
28
|
//# sourceMappingURL=useDictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.cjs","names":["useContext","IntlayerClientContext","resolveDictionaryArgument","getDictionarySelectorCacheKey","useMemo","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import {\n getDictionarySelectorCacheKey,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * Preact hook that transforms a dictionary (or qualified dictionary group) and\n * returns the content.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends
|
|
1
|
+
{"version":3,"file":"useDictionary.cjs","names":["useContext","IntlayerClientContext","resolveDictionaryArgument","getDictionarySelectorCacheKey","useMemo","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import {\n getDictionarySelectorCacheKey,\n resolveDictionaryArgument,\n} from '@intlayer/core/dictionaryManipulator';\nimport type {\n Dictionary,\n DictionarySelectorForGroup,\n QualifiedDictionaryGroup,\n} from '@intlayer/types/dictionary';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useContext, useMemo } from 'preact/hooks';\nimport { getDictionary } from '../getDictionary';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\n/**\n * Preact hook that transforms a dictionary (or qualified dictionary group) and\n * returns the content.\n *\n * If the locale is not provided (directly or through the selector), it will use\n * the locale from the client context.\n */\nexport const useDictionary = <\n const T extends Dictionary | QualifiedDictionaryGroup,\n const A extends LocalesValues | DictionarySelectorForGroup<T> =\n DeclaredLocales,\n>(\n dictionary: T,\n localeOrSelector?: A\n) => {\n const { locale: currentLocale, variant: contextVariant } =\n useContext(IntlayerClientContext) ?? {};\n\n // Layers the provider's locale and variant under the call-site argument.\n // This is the seam the build-time optimize transform lands on: it rewrites\n // `useIntlayer('key', selector)` into `useDictionary(dict, selector)`, so an\n // ambient variant has to be applied here to survive the rewrite.\n const argument =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false'\n ? resolveDictionaryArgument({\n localeOrSelector,\n contextLocale: currentLocale,\n contextVariant,\n dictionaryKey: dictionary.key,\n })\n : (localeOrSelector ?? currentLocale);\n\n // Stable identity of the resolved argument for memoization — a provider\n // variant is often a fresh object literal on every render, so the dependency\n // has to be its serialization, never its reference.\n const argumentIdentity =\n process.env.INTLAYER_DICTIONARY_SELECTOR !== 'false' &&\n typeof argument === 'object' &&\n argument !== null\n ? `${argument.locale ?? ''}|${getDictionarySelectorCacheKey(argument)}`\n : argument;\n\n return useMemo(\n () => getDictionary<T, A>(dictionary, argument as A),\n [dictionary.key, argumentIdentity]\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAa,iBAKX,YACA,qBACG;CACH,MAAM,EAAE,QAAQ,eAAe,SAAS,uBACtCA,yBAAWC,qDAAqB,KAAK,CAAC;CAMxC,MAAM,WACJ,QAAQ,IAAI,iCAAiC,cACzCC,gEAA0B;EACxB;EACA,eAAe;EACf;EACA,eAAe,WAAW;CAC5B,CAAC,IACA,oBAAoB;CAK3B,MAAM,mBACJ,QAAQ,IAAI,iCAAiC,WAC7C,OAAO,aAAa,YACpB,aAAa,OACT,GAAG,SAAS,UAAU,GAAG,OAAGC,oEAA8B,QAAQ,MAClE;CAEN,WAAOC,4BACCC,oCAAoB,YAAY,QAAa,GACnD,CAAC,WAAW,KAAK,gBAAgB,CACnC;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
3
|
-
const require_client_useDictionary = require(
|
|
4
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
2
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
3
|
+
const require_client_useDictionary = require("./useDictionary.cjs");
|
|
5
4
|
let preact_hooks = require("preact/hooks");
|
|
5
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/useDictionaryAsync.ts
|
|
8
8
|
/**
|
|
9
9
|
* On the server side, Hook that transform a dictionary and return the content
|
|
10
10
|
*
|
|
@@ -17,6 +17,5 @@ const useDictionaryAsync = async (dictionaryPromise, locale) => {
|
|
|
17
17
|
return require_client_useDictionary.useDictionary(dictionary, localeTarget);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
//#endregion
|
|
21
20
|
exports.useDictionaryAsync = useDictionaryAsync;
|
|
22
21
|
//# sourceMappingURL=useDictionaryAsync.cjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_getDictionary = require(
|
|
3
|
-
const require_client_IntlayerProvider = require(
|
|
4
|
-
const require_client_useLoadDynamic = require(
|
|
5
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
2
|
+
const require_getDictionary = require("../getDictionary.cjs");
|
|
3
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
|
+
const require_client_useLoadDynamic = require("./useLoadDynamic.cjs");
|
|
6
5
|
let preact_hooks = require("preact/hooks");
|
|
6
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
7
7
|
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/client/useDictionaryDynamic.ts
|
|
10
10
|
/**
|
|
11
11
|
* Preact hook that lazily loads a dictionary and returns its content.
|
|
12
12
|
*
|
|
@@ -45,6 +45,5 @@ const useDictionaryDynamic = (dictionaryPromise, key, localeOrSelector) => {
|
|
|
45
45
|
return require_getDictionary.getDictionary(dictionary, localeTarget);
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
//#endregion
|
|
49
48
|
exports.useDictionaryDynamic = useDictionaryDynamic;
|
|
50
49
|
//# sourceMappingURL=useDictionaryDynamic.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_getIntlayer = require(
|
|
3
|
-
const require_client_IntlayerProvider = require(
|
|
2
|
+
const require_getIntlayer = require("../getIntlayer.cjs");
|
|
3
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
4
|
let preact_hooks = require("preact/hooks");
|
|
5
5
|
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/useIntlayer.ts
|
|
8
8
|
/**
|
|
9
9
|
* Preact hook that picks one dictionary by its key and returns its content.
|
|
10
10
|
*
|
|
@@ -41,6 +41,5 @@ const useIntlayer = (key, localeOrSelector) => {
|
|
|
41
41
|
return (0, preact_hooks.useMemo)(() => require_getIntlayer.getIntlayer(key, argument), [key, argumentIdentity]);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
//#endregion
|
|
45
44
|
exports.useIntlayer = useIntlayer;
|
|
46
45
|
//# sourceMappingURL=useIntlayer.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/client/useLoadDynamic.ts
|
|
3
3
|
const createSuspender = (promise) => {
|
|
4
4
|
let status = "pending";
|
|
5
5
|
let result;
|
|
@@ -22,6 +22,5 @@ const useLoadDynamic = (key, promise) => {
|
|
|
22
22
|
return cache.get(key).read();
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
exports.useLoadDynamic = useLoadDynamic;
|
|
27
26
|
//# sourceMappingURL=useLoadDynamic.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
2
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
3
|
+
const require_client_useLocaleStorage = require("./useLocaleStorage.cjs");
|
|
5
4
|
let preact_hooks = require("preact/hooks");
|
|
5
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/client/useLocale.ts
|
|
8
8
|
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
9
9
|
/**
|
|
10
10
|
* Preact hook to get the current locale and related locale management functions.
|
|
@@ -48,6 +48,5 @@ const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
exports.useLocale = useLocale;
|
|
53
52
|
//# sourceMappingURL=useLocale.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
3
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
2
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
3
|
let preact_hooks = require("preact/hooks");
|
|
4
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/client/useLocaleBase.ts
|
|
7
7
|
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization;
|
|
8
8
|
/**
|
|
9
9
|
* On the client side, hook to get the current locale and all related fields
|
|
@@ -18,6 +18,5 @@ const useLocaleBase = () => {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.useLocaleBase = useLocaleBase;
|
|
23
22
|
//# sourceMappingURL=useLocaleBase.cjs.map
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
let preact_hooks = require("preact/hooks");
|
|
3
3
|
let _intlayer_core_utils = require("@intlayer/core/utils");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/client/useLocaleStorage.ts
|
|
6
6
|
/**
|
|
7
7
|
* Reads the locale persisted in the browser storage (cookie, localStorage…).
|
|
8
8
|
*
|
|
@@ -52,7 +52,6 @@ const useLocaleStorage = (isCookieEnabled) => (0, preact_hooks.useMemo)(() => (0
|
|
|
52
52
|
*/
|
|
53
53
|
const useLocaleCookie = useLocaleStorage;
|
|
54
54
|
|
|
55
|
-
//#endregion
|
|
56
55
|
exports.getLocaleInStorage = getLocaleInStorage;
|
|
57
56
|
exports.localeCookie = localeCookie;
|
|
58
57
|
exports.localeInStorage = localeInStorage;
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
let preact_hooks = require("preact/hooks");
|
|
3
3
|
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/client/usePathname.ts
|
|
6
6
|
/**
|
|
7
7
|
* Preact hook that returns the current pathname with the locale segment removed.
|
|
8
8
|
*
|
|
@@ -33,6 +33,5 @@ const usePathname = () => {
|
|
|
33
33
|
return (0, preact_hooks.useMemo)(() => (0, _intlayer_core_localization.getPathWithoutLocale)(rawPathname), [rawPathname]);
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
exports.usePathname = usePathname;
|
|
38
37
|
//# sourceMappingURL=usePathname.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
3
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
2
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
3
|
let preact_hooks = require("preact/hooks");
|
|
4
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/client/useTraduction.ts
|
|
7
7
|
/**
|
|
8
8
|
* On the client side, Hook that picking one dictionary by its id and return the content.
|
|
9
9
|
*
|
|
@@ -30,6 +30,5 @@ const useTranslation = (languageContent) => {
|
|
|
30
30
|
return (0, preact_hooks.useMemo)(() => (0, _intlayer_core_interpreter.getTranslation)(languageContent, locale), [languageContent, locale]);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
exports.useTranslation = useTranslation;
|
|
35
34
|
//# sourceMappingURL=useTraduction.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
|
|
3
2
|
let preact_hooks = require("preact/hooks");
|
|
3
|
+
let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
|
|
4
4
|
let preact_jsx_runtime = require("preact/jsx-runtime");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/editor/ContentSelector.tsx
|
|
7
7
|
const ContentSelector = ({ children, dictionaryKey, keyPath }) => {
|
|
8
8
|
(0, preact_hooks.useEffect)(() => {
|
|
9
9
|
if (process.env.INTLAYER_EDITOR_ENABLED === "false" || !_intlayer_editor_isEnabled.isEnabled || typeof window === "undefined") return;
|
|
@@ -19,6 +19,5 @@ const ContentSelector = ({ children, dictionaryKey, keyPath }) => {
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.ContentSelector = ContentSelector;
|
|
24
23
|
//# sourceMappingURL=ContentSelector.cjs.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_editor_useEditor = require(
|
|
2
|
+
const require_editor_useEditor = require("./useEditor.cjs");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/editor/EditorProvider.tsx
|
|
5
5
|
const EditorProvider = ({ children }) => {
|
|
6
6
|
require_editor_useEditor.useEditor();
|
|
7
7
|
return children;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
exports.EditorProvider = EditorProvider;
|
|
12
11
|
//# sourceMappingURL=EditorProvider.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
3
|
-
let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
|
|
2
|
+
const require_client_IntlayerProvider = require("../client/IntlayerProvider.cjs");
|
|
4
3
|
let preact_hooks = require("preact/hooks");
|
|
4
|
+
let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/editor/useEditor.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Initialises the Intlayer editor client singleton when the editor is enabled.
|
|
9
9
|
* Syncs the current locale from the Intlayer context into the editor manager so
|
|
@@ -40,6 +40,5 @@ const useEditor = () => {
|
|
|
40
40
|
}, [locale]);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
exports.useEditor = useEditor;
|
|
45
44
|
//# sourceMappingURL=useEditor.cjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
2
|
+
const require_format_useCompact = require("./useCompact.cjs");
|
|
3
|
+
const require_format_useCurrency = require("./useCurrency.cjs");
|
|
4
|
+
const require_format_useDate = require("./useDate.cjs");
|
|
5
|
+
const require_format_useIntl = require("./useIntl.cjs");
|
|
6
|
+
const require_format_useList = require("./useList.cjs");
|
|
7
|
+
const require_format_useNumber = require("./useNumber.cjs");
|
|
8
|
+
const require_format_usePercentage = require("./usePercentage.cjs");
|
|
9
|
+
const require_format_useRelativeTime = require("./useRelativeTime.cjs");
|
|
10
|
+
const require_format_useUnit = require("./useUnit.cjs");
|
|
11
11
|
|
|
12
12
|
exports.useCompact = require_format_useCompact.useCompact;
|
|
13
13
|
exports.useCurrency = require_format_useCurrency.useCurrency;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
2
|
+
const require_client_IntlayerProvider = require("../client/IntlayerProvider.cjs");
|
|
3
3
|
let preact_hooks = require("preact/hooks");
|
|
4
4
|
let _intlayer_core_formatters = require("@intlayer/core/formatters");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/format/useCompact.ts
|
|
7
7
|
/**
|
|
8
8
|
* React client hook that provides a compact number formatter
|
|
9
9
|
* bound to the current application locale.
|
|
@@ -22,6 +22,5 @@ const useCompact = () => {
|
|
|
22
22
|
}), [locale]);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
exports.useCompact = useCompact;
|
|
27
26
|
//# sourceMappingURL=useCompact.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
2
|
+
const require_client_IntlayerProvider = require("../client/IntlayerProvider.cjs");
|
|
3
3
|
let preact_hooks = require("preact/hooks");
|
|
4
4
|
let _intlayer_core_formatters = require("@intlayer/core/formatters");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/format/useCurrency.ts
|
|
7
7
|
/**
|
|
8
8
|
* React client hook that provides a currency formatter
|
|
9
9
|
* bound to the current application locale.
|
|
@@ -36,6 +36,5 @@ const useCurrency = () => {
|
|
|
36
36
|
}), [locale]);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
exports.useCurrency = useCurrency;
|
|
41
40
|
//# sourceMappingURL=useCurrency.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_IntlayerProvider = require(
|
|
2
|
+
const require_client_IntlayerProvider = require("../client/IntlayerProvider.cjs");
|
|
3
3
|
let preact_hooks = require("preact/hooks");
|
|
4
4
|
let _intlayer_core_formatters = require("@intlayer/core/formatters");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/format/useDate.ts
|
|
7
7
|
/**
|
|
8
8
|
* React client hook that provides a localized date/time formatter
|
|
9
9
|
* bound to the current application locale.
|
|
@@ -38,6 +38,5 @@ const useDate = () => {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
exports.useDate = useDate;
|
|
43
42
|
//# sourceMappingURL=useDate.cjs.map
|