solid-intlayer 9.9.3 → 9.9.4
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 +11 -1
- package/dist/cjs/LoadingBoundary.cjs +26 -1
- package/dist/cjs/analytics/AnalyticsProvider.cjs +12 -1
- package/dist/cjs/analytics/exposureSink.cjs +23 -1
- package/dist/cjs/analytics/index.cjs +9 -1
- package/dist/cjs/analytics/useAnalytics.cjs +59 -1
- package/dist/cjs/analytics/useConversion.cjs +25 -1
- package/dist/cjs/analytics/useExperiment.cjs +59 -1
- package/dist/cjs/client/IntlayerProvider.cjs +91 -1
- package/dist/cjs/client/contentProxy.cjs +32 -1
- package/dist/cjs/client/getBrowserLocale.cjs +115 -1
- package/dist/cjs/client/index.cjs +35 -1
- package/dist/cjs/client/t.cjs +16 -1
- package/dist/cjs/client/useContent.cjs +16 -1
- package/dist/cjs/client/useDictionary.cjs +51 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +19 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +82 -1
- package/dist/cjs/client/useIntlayer.cjs +50 -1
- package/dist/cjs/client/useLoadDynamic.cjs +140 -1
- package/dist/cjs/client/useLocale.cjs +52 -1
- package/dist/cjs/client/useLocaleBase.cjs +19 -1
- package/dist/cjs/client/useLocaleStorage.cjs +59 -1
- package/dist/cjs/client/usePathname.cjs +41 -1
- package/dist/cjs/client/useRewriteURL.cjs +21 -1
- package/dist/cjs/client/useTraduction.cjs +32 -1
- package/dist/cjs/editor/ContentSelector.cjs +20 -1
- package/dist/cjs/editor/EditorProvider.cjs +8 -1
- package/dist/cjs/editor/createEditedContentSource.cjs +32 -1
- package/dist/cjs/editor/useEditor.cjs +38 -1
- package/dist/cjs/format/index.cjs +19 -1
- package/dist/cjs/format/useCompact.cjs +15 -1
- package/dist/cjs/format/useCurrency.cjs +16 -1
- package/dist/cjs/format/useDate.cjs +25 -1
- package/dist/cjs/format/useIntl.cjs +31 -1
- package/dist/cjs/format/useList.cjs +15 -1
- package/dist/cjs/format/useNumber.cjs +19 -1
- package/dist/cjs/format/usePercentage.cjs +16 -1
- package/dist/cjs/format/useRelativeTime.cjs +16 -1
- package/dist/cjs/format/useUnit.cjs +15 -1
- package/dist/cjs/getDictionary.cjs +17 -1
- package/dist/cjs/getIntlayer.cjs +14 -1
- package/dist/cjs/html/HTMLProvider.cjs +24 -1
- package/dist/cjs/html/HTMLRenderer.cjs +49 -1
- package/dist/cjs/html/index.cjs +8 -1
- package/dist/cjs/html/types.cjs +1 -1
- package/dist/cjs/index.cjs +48 -1
- package/dist/cjs/markdown/MarkdownProvider.cjs +47 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +56 -1
- package/dist/cjs/markdown/compiler.cjs +64 -1
- package/dist/cjs/markdown/index.cjs +13 -1
- package/dist/cjs/markdown/runtime.cjs +48 -1
- package/dist/cjs/plugins.cjs +266 -1
- package/dist/cjs/proxyKeys.cjs +14 -1
- package/dist/cjs/server/index.cjs +3 -1
- package/dist/cjs/server/useDictionary.cjs +30 -1
- package/dist/cjs/solidCompat.cjs +167 -1
- package/dist/cjs/solidElement/renderSolidElement.cjs +34 -1
- package/dist/cjs/solidTypes.cjs +1 -1
- package/dist/esm/IntlayerNode.mjs +8 -6
- package/dist/esm/LoadingBoundary.mjs +19 -6
- package/dist/esm/analytics/AnalyticsProvider.mjs +10 -3
- package/dist/esm/analytics/exposureSink.mjs +19 -5
- package/dist/esm/analytics/index.mjs +5 -5
- package/dist/esm/analytics/useAnalytics.mjs +52 -25
- package/dist/esm/analytics/useConversion.mjs +22 -6
- package/dist/esm/analytics/useExperiment.mjs +50 -22
- package/dist/esm/client/IntlayerProvider.mjs +75 -28
- package/dist/esm/client/contentProxy.mjs +26 -12
- package/dist/esm/client/getBrowserLocale.mjs +106 -71
- package/dist/esm/client/index.mjs +14 -14
- package/dist/esm/client/t.mjs +13 -7
- package/dist/esm/client/useContent.mjs +11 -8
- package/dist/esm/client/useDictionary.mjs +47 -25
- package/dist/esm/client/useDictionaryAsync.mjs +16 -9
- package/dist/esm/client/useDictionaryDynamic.mjs +72 -43
- package/dist/esm/client/useIntlayer.mjs +45 -15
- package/dist/esm/client/useLoadDynamic.mjs +128 -49
- package/dist/esm/client/useLocale.mjs +47 -16
- package/dist/esm/client/useLocaleBase.mjs +14 -10
- package/dist/esm/client/useLocaleStorage.mjs +51 -10
- package/dist/esm/client/usePathname.mjs +37 -12
- package/dist/esm/client/useRewriteURL.mjs +17 -11
- package/dist/esm/client/useTraduction.mjs +29 -8
- package/dist/esm/editor/ContentSelector.mjs +18 -15
- package/dist/esm/editor/EditorProvider.mjs +6 -3
- package/dist/esm/editor/createEditedContentSource.mjs +28 -17
- package/dist/esm/editor/useEditor.mjs +32 -22
- package/dist/esm/format/index.mjs +10 -10
- package/dist/esm/format/useCompact.mjs +11 -8
- package/dist/esm/format/useCurrency.mjs +12 -9
- package/dist/esm/format/useDate.mjs +19 -13
- package/dist/esm/format/useIntl.mjs +27 -9
- package/dist/esm/format/useList.mjs +11 -8
- package/dist/esm/format/useNumber.mjs +15 -9
- package/dist/esm/format/usePercentage.mjs +12 -9
- package/dist/esm/format/useRelativeTime.mjs +12 -9
- package/dist/esm/format/useUnit.mjs +11 -8
- package/dist/esm/getDictionary.mjs +14 -6
- package/dist/esm/getIntlayer.mjs +11 -6
- package/dist/esm/html/HTMLProvider.mjs +21 -12
- package/dist/esm/html/HTMLRenderer.mjs +44 -17
- package/dist/esm/html/index.mjs +3 -3
- package/dist/esm/index.mjs +20 -20
- package/dist/esm/markdown/MarkdownProvider.mjs +31 -24
- package/dist/esm/markdown/MarkdownRenderer.mjs +48 -37
- package/dist/esm/markdown/compiler.mjs +59 -23
- package/dist/esm/markdown/index.mjs +4 -4
- package/dist/esm/markdown/runtime.mjs +40 -13
- package/dist/esm/plugins.mjs +205 -156
- package/dist/esm/proxyKeys.mjs +7 -2
- package/dist/esm/server/useDictionary.mjs +25 -7
- package/dist/esm/solidCompat.mjs +146 -39
- package/dist/esm/solidElement/renderSolidElement.mjs +22 -19
- package/dist/rolldown-runtime-CmQyd0Gu.js +27 -0
- package/dist/solid/analytics/useAnalytics.jsx +3 -3
- package/dist/solid/analytics/useConversion.js +2 -2
- package/dist/solid/analytics/useExperiment.js +3 -3
- package/package.json +7 -7
- package/dist/esm-YGODKOLP.js +0 -1
- package/dist/esm-bdKnuomJ.mjs +0 -256
- package/dist/isEnabled-CuTKz0YA.js +0 -1
- package/dist/isEnabled-DVKEZ2He.mjs +0 -18
- package/dist/rolldown-runtime-BocRIvOZ.js +0 -1
- package/dist/solid/esm-1cHk4dPd.js +0 -644
- package/dist/solid/isEnabled-C5NUhdhZ.js +0 -100
|
@@ -1 +1,11 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_core_utils = require("@intlayer/core/utils");
|
|
3
|
+
// src/IntlayerNode.tsx
|
|
4
|
+
var renderIntlayerNode = ({ children, value, additionalProps }) => {
|
|
5
|
+
const target = [children];
|
|
6
|
+
target.value = value;
|
|
7
|
+
if (additionalProps) for (const key in additionalProps) target[key] = additionalProps[key];
|
|
8
|
+
Object.setPrototypeOf(target, (0, _intlayer_core_utils.getIntlayerNodePrototype)(value, Array.prototype));
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
exports.renderIntlayerNode = renderIntlayerNode;
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let solid_js_web = require("solid-js/web");
|
|
3
|
+
const require_solidCompat = require("./solidCompat.cjs");
|
|
4
|
+
// src/LoadingBoundary.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Shows `fallback` while async reads below it are pending: `Suspense` in
|
|
7
|
+
* Solid 1, `Loading` in Solid 2. Both are compiler built-ins, auto-imported
|
|
8
|
+
* from the app's own web runtime; only the branch of the installed version is
|
|
9
|
+
* ever evaluated.
|
|
10
|
+
*/
|
|
11
|
+
var LoadingBoundary = (props) => require_solidCompat.isSolidTwo ? (0, solid_js_web.createComponent)(Loading, {
|
|
12
|
+
get fallback() {
|
|
13
|
+
return props.fallback;
|
|
14
|
+
},
|
|
15
|
+
get children() {
|
|
16
|
+
return props.children;
|
|
17
|
+
}
|
|
18
|
+
}) : (0, solid_js_web.createComponent)(solid_js_web.Suspense, {
|
|
19
|
+
get fallback() {
|
|
20
|
+
return props.fallback;
|
|
21
|
+
},
|
|
22
|
+
get children() {
|
|
23
|
+
return props.children;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
exports.LoadingBoundary = LoadingBoundary;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_analytics_useAnalytics = require("./useAnalytics.cjs");
|
|
3
|
+
// src/analytics/AnalyticsProvider.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Runs {@link useAnalytics} and renders its children unchanged. Mounted inside
|
|
6
|
+
* {@link IntlayerProvider} alongside `EditorProvider`.
|
|
7
|
+
*/
|
|
8
|
+
var AnalyticsProvider = ({ children }) => {
|
|
9
|
+
require_analytics_useAnalytics.useAnalytics();
|
|
10
|
+
return children;
|
|
11
|
+
};
|
|
12
|
+
exports.AnalyticsProvider = AnalyticsProvider;
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
// src/analytics/exposureSink.ts
|
|
3
|
+
var sink = null;
|
|
4
|
+
/**
|
|
5
|
+
* Installs (or clears) the exposure sink. `useAnalytics` sets this once the
|
|
6
|
+
* analytics client has loaded, and clears it on unmount.
|
|
7
|
+
*
|
|
8
|
+
* @param next - The sink to install, or `null` to clear.
|
|
9
|
+
*/
|
|
10
|
+
var setExposureSink = (next) => {
|
|
11
|
+
sink = next;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Forwards a content exposure to the installed sink. A cheap null-check when
|
|
15
|
+
* analytics is not running, so it is safe to call from every node resolution.
|
|
16
|
+
*
|
|
17
|
+
* @param input - The node metadata to report.
|
|
18
|
+
*/
|
|
19
|
+
var reportExposure = (input) => {
|
|
20
|
+
sink?.(input);
|
|
21
|
+
};
|
|
22
|
+
exports.reportExposure = reportExposure;
|
|
23
|
+
exports.setExposureSink = setExposureSink;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
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
|
+
exports.AnalyticsProvider = require_analytics_AnalyticsProvider.AnalyticsProvider;
|
|
7
|
+
exports.useAnalytics = require_analytics_useAnalytics.useAnalytics;
|
|
8
|
+
exports.useConversion = require_analytics_useConversion.useConversion;
|
|
9
|
+
exports.useExperiment = require_analytics_useExperiment.useExperiment;
|
|
@@ -1 +1,59 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
3
|
+
let solid_js = require("solid-js");
|
|
4
|
+
const require_client_IntlayerProvider = require("../client/IntlayerProvider.cjs");
|
|
5
|
+
const require_solidCompat = require("../solidCompat.cjs");
|
|
6
|
+
const require_analytics_exposureSink = require("./exposureSink.cjs");
|
|
7
|
+
// src/analytics/useAnalytics.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Initializes the Intlayer analytics client singleton when analytics is enabled
|
|
10
|
+
* and keeps it aware of the current locale.
|
|
11
|
+
*
|
|
12
|
+
* Mirrors {@link useEditor}: the module is loaded via a dynamic `import()` so it
|
|
13
|
+
* ships as its own async chunk, off the critical rendering path. Apps that
|
|
14
|
+
* don't opt in (`analytics.enabled !== true`) pay nothing — the whole body is
|
|
15
|
+
* guarded by `INTLAYER_ANALYTICS_ENABLED` and dead-code-eliminated at build
|
|
16
|
+
* time.
|
|
17
|
+
*/
|
|
18
|
+
var useAnalytics = () => {
|
|
19
|
+
if (process.env.INTLAYER_ANALYTICS_ENABLED === "false" || !_intlayer_analytics_isEnabled.isEnabled) return;
|
|
20
|
+
const { locale } = require_client_IntlayerProvider.useIntlayerContext();
|
|
21
|
+
const [client, setClient] = (0, solid_js.createSignal)(null);
|
|
22
|
+
let cancelled = false;
|
|
23
|
+
let initialized = false;
|
|
24
|
+
require_solidCompat.onMounted(() => {
|
|
25
|
+
import("@intlayer/analytics").then(({ initAnalyticsClient, buildContentExposure }) => {
|
|
26
|
+
if (cancelled) return;
|
|
27
|
+
const clientInstance = initAnalyticsClient();
|
|
28
|
+
initialized = true;
|
|
29
|
+
const currentLocale = locale?.();
|
|
30
|
+
if (currentLocale) clientInstance.setLocale(currentLocale);
|
|
31
|
+
clientInstance.trackPageView({ reason: "initial" });
|
|
32
|
+
require_analytics_exposureSink.setExposureSink((input) => clientInstance.trackContentExposure(buildContentExposure(input)));
|
|
33
|
+
setClient(clientInstance);
|
|
34
|
+
}).catch(() => {});
|
|
35
|
+
});
|
|
36
|
+
let previousLocale;
|
|
37
|
+
require_solidCompat.createWatchEffect(() => ({
|
|
38
|
+
clientInstance: client(),
|
|
39
|
+
currentLocale: locale?.()
|
|
40
|
+
}), ({ clientInstance, currentLocale }) => {
|
|
41
|
+
if (!clientInstance || !currentLocale) return;
|
|
42
|
+
if (previousLocale === void 0) {
|
|
43
|
+
previousLocale = currentLocale;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (previousLocale === currentLocale) return;
|
|
47
|
+
previousLocale = currentLocale;
|
|
48
|
+
clientInstance.setLocale(currentLocale);
|
|
49
|
+
clientInstance.trackPageView({ reason: "locale_change" });
|
|
50
|
+
});
|
|
51
|
+
(0, solid_js.onCleanup)(() => {
|
|
52
|
+
cancelled = true;
|
|
53
|
+
require_analytics_exposureSink.setExposureSink(null);
|
|
54
|
+
import("@intlayer/analytics").then(({ stopAnalyticsClient }) => {
|
|
55
|
+
if (initialized) stopAnalyticsClient();
|
|
56
|
+
}).catch(() => {});
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
exports.useAnalytics = useAnalytics;
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
3
|
+
// src/analytics/useConversion.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns a `trackConversion` callback for content A/B testing. Safe to call
|
|
6
|
+
* from any component: it resolves to a no-op when analytics is disabled or the
|
|
7
|
+
* client has not been initialized yet.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const trackConversion = useConversion();
|
|
12
|
+
* <button onClick={() => trackConversion({
|
|
13
|
+
* experimentKey: 'homepage-hero', variant: 'b', goal: 'cta_click',
|
|
14
|
+
* })}>Get started</button>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
var useConversion = () => {
|
|
18
|
+
return (params) => {
|
|
19
|
+
if (process.env.INTLAYER_ANALYTICS_ENABLED === "false" || !_intlayer_analytics_isEnabled.isEnabled) return;
|
|
20
|
+
import("@intlayer/analytics").then(({ getGlobalAnalyticsClient }) => {
|
|
21
|
+
getGlobalAnalyticsClient()?.trackConversion(params);
|
|
22
|
+
}).catch(() => {});
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.useConversion = useConversion;
|
|
@@ -1 +1,59 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
3
|
+
let solid_js = require("solid-js");
|
|
4
|
+
const require_solidCompat = require("../solidCompat.cjs");
|
|
5
|
+
// src/analytics/useExperiment.ts
|
|
6
|
+
/**
|
|
7
|
+
* Assigns this session to a variant of an A/B experiment and records the
|
|
8
|
+
* exposure, scoped to `experimentKey`, so the backend can compute per-variant
|
|
9
|
+
* conversion rates against `useConversion` events.
|
|
10
|
+
*
|
|
11
|
+
* Assignment is deterministic per session (no server round-trip, stable across
|
|
12
|
+
* re-mounts). The exposure is recorded once per mount.
|
|
13
|
+
*
|
|
14
|
+
* @param experimentKey - Unique key identifying the experiment.
|
|
15
|
+
* @param variants - The candidate variant names; the first one is the control.
|
|
16
|
+
* @param weights - Optional relative weights, one per variant (e.g. `[9, 1]`).
|
|
17
|
+
* @returns The {@link ExperimentState} for this session.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { variant } = useExperiment('homepage-hero', ['a', 'b']);
|
|
22
|
+
* const content = useIntlayer(variant() === 'b' ? 'hero-b' : 'hero');
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
var useExperiment = (experimentKey, variants, weights) => {
|
|
26
|
+
const [variant, setVariant] = (0, solid_js.createSignal)(variants[0] ?? "");
|
|
27
|
+
const [isAssigned, setIsAssigned] = (0, solid_js.createSignal)(false);
|
|
28
|
+
let cancelled = false;
|
|
29
|
+
let initialized = false;
|
|
30
|
+
require_solidCompat.onMounted(() => {
|
|
31
|
+
if (process.env.INTLAYER_ANALYTICS_ENABLED === "false" || !_intlayer_analytics_isEnabled.isEnabled) return;
|
|
32
|
+
import("@intlayer/analytics").then(({ initAnalyticsClient }) => {
|
|
33
|
+
if (cancelled) return;
|
|
34
|
+
const client = initAnalyticsClient();
|
|
35
|
+
initialized = true;
|
|
36
|
+
const assigned = client.getVariant(experimentKey, variants, weights);
|
|
37
|
+
setVariant(assigned);
|
|
38
|
+
setIsAssigned(true);
|
|
39
|
+
client.trackContentExposure({
|
|
40
|
+
dictionaryKey: experimentKey,
|
|
41
|
+
keyPath: "",
|
|
42
|
+
nodeType: "experiment",
|
|
43
|
+
experimentKey,
|
|
44
|
+
variant: assigned
|
|
45
|
+
});
|
|
46
|
+
}).catch(() => {});
|
|
47
|
+
});
|
|
48
|
+
(0, solid_js.onCleanup)(() => {
|
|
49
|
+
cancelled = true;
|
|
50
|
+
import("@intlayer/analytics").then(({ stopAnalyticsClient }) => {
|
|
51
|
+
if (initialized) stopAnalyticsClient();
|
|
52
|
+
}).catch(() => {});
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
variant,
|
|
56
|
+
isAssigned
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.useExperiment = useExperiment;
|
|
@@ -1 +1,91 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let solid_js_web = require("solid-js/web");
|
|
3
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
+
let _intlayer_config_client = require("@intlayer/config/client");
|
|
5
|
+
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
6
|
+
let solid_js = require("solid-js");
|
|
7
|
+
const require_LoadingBoundary = require("../LoadingBoundary.cjs");
|
|
8
|
+
const require_solidCompat = require("../solidCompat.cjs");
|
|
9
|
+
const require_client_useLocaleStorage = require("./useLocaleStorage.cjs");
|
|
10
|
+
// src/client/IntlayerProvider.tsx
|
|
11
|
+
var LazyEditorProvider = process.env.INTLAYER_EDITOR_ENABLED !== "false" ? require_solidCompat.lazyComponent(() => Promise.resolve().then(() => require("../editor/EditorProvider.cjs")).then((m) => ({ default: m.EditorProvider }))) : null;
|
|
12
|
+
var LazyAnalyticsProvider = process.env.INTLAYER_ANALYTICS_ENABLED !== "false" ? require_solidCompat.lazyComponent(() => Promise.resolve().then(() => require("../analytics/AnalyticsProvider.cjs")).then((m) => ({ default: m.AnalyticsProvider }))) : null;
|
|
13
|
+
/**
|
|
14
|
+
* Context that store the current locale on the client side
|
|
15
|
+
*/
|
|
16
|
+
var IntlayerClientContext = (0, solid_js.createContext)({
|
|
17
|
+
locale: () => require_client_useLocaleStorage.getLocaleInStorage() ?? _intlayer_config_built.internationalization?.defaultLocale,
|
|
18
|
+
setLocale: () => null
|
|
19
|
+
});
|
|
20
|
+
var IntlayerClientContextProvider = require_solidCompat.getContextProvider(IntlayerClientContext);
|
|
21
|
+
/**
|
|
22
|
+
* Hook that provides the current locale
|
|
23
|
+
*/
|
|
24
|
+
var useIntlayerContext = () => (0, solid_js.useContext)(IntlayerClientContext);
|
|
25
|
+
/**
|
|
26
|
+
* Provider that store the current locale on the client side
|
|
27
|
+
*/
|
|
28
|
+
var IntlayerProviderContent = (props) => {
|
|
29
|
+
const { defaultLocale: defaultLocaleConfig, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
30
|
+
const defaultLocale = (0, solid_js.untrack)(() => props.locale ?? require_client_useLocaleStorage.getLocaleInStorage() ?? props.defaultLocale ?? defaultLocaleConfig);
|
|
31
|
+
const [currentLocale, setCurrentLocale] = require_solidCompat.createWritableMemo((previousLocale) => props.locale || previousLocale || defaultLocale);
|
|
32
|
+
const setLocaleBase = (newLocale) => {
|
|
33
|
+
if (currentLocale().toString() === newLocale.toString()) return;
|
|
34
|
+
if (!availableLocales?.map(String).includes(newLocale)) {
|
|
35
|
+
console.error(`Locale ${newLocale} is not available`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
require_solidCompat.runInTransition(() => setCurrentLocale(newLocale));
|
|
39
|
+
require_client_useLocaleStorage.setLocaleInStorage(newLocale, props.isCookieEnabled);
|
|
40
|
+
};
|
|
41
|
+
const setLocale = props.setLocale ?? setLocaleBase;
|
|
42
|
+
const locale = (0, solid_js.createMemo)(() => (0, _intlayer_core_localization.localeResolver)(currentLocale()));
|
|
43
|
+
require_solidCompat.onMounted(() => {
|
|
44
|
+
(0, _intlayer_config_client.setIntlayerIdentifier)();
|
|
45
|
+
});
|
|
46
|
+
return (0, solid_js_web.createComponent)(IntlayerClientContextProvider, {
|
|
47
|
+
value: {
|
|
48
|
+
locale,
|
|
49
|
+
setLocale,
|
|
50
|
+
variant: () => props.variant
|
|
51
|
+
},
|
|
52
|
+
get children() {
|
|
53
|
+
return props.children;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Main provider for Intlayer in Solid applications.
|
|
59
|
+
*
|
|
60
|
+
* It provides the Intlayer context to your application, allowing the use
|
|
61
|
+
* of hooks like `useIntlayer` and `useLocale`.
|
|
62
|
+
*
|
|
63
|
+
* @param props - The provider props.
|
|
64
|
+
* @returns The provider component.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* import { IntlayerProvider } from 'solid-intlayer';
|
|
69
|
+
*
|
|
70
|
+
* const App = () => (
|
|
71
|
+
* <IntlayerProvider>
|
|
72
|
+
* <MyComponent />
|
|
73
|
+
* </IntlayerProvider>
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
var IntlayerProvider = (props) => (0, solid_js_web.createComponent)(IntlayerProviderContent, (0, solid_js_web.mergeProps)(props, { get children() {
|
|
78
|
+
return [
|
|
79
|
+
(0, solid_js_web.memo)(() => (0, solid_js_web.memo)(() => !!(process.env.INTLAYER_EDITOR_ENABLED !== "false" && LazyEditorProvider))() && (0, solid_js_web.createComponent)(require_LoadingBoundary.LoadingBoundary, { get children() {
|
|
80
|
+
return (0, solid_js_web.createComponent)(LazyEditorProvider, {});
|
|
81
|
+
} })),
|
|
82
|
+
(0, solid_js_web.memo)(() => (0, solid_js_web.memo)(() => !!(process.env.INTLAYER_ANALYTICS_ENABLED !== "false" && LazyAnalyticsProvider))() && (0, solid_js_web.createComponent)(require_LoadingBoundary.LoadingBoundary, { get children() {
|
|
83
|
+
return (0, solid_js_web.createComponent)(LazyAnalyticsProvider, {});
|
|
84
|
+
} })),
|
|
85
|
+
(0, solid_js_web.memo)(() => props.children)
|
|
86
|
+
];
|
|
87
|
+
} }));
|
|
88
|
+
exports.IntlayerClientContext = IntlayerClientContext;
|
|
89
|
+
exports.IntlayerProvider = IntlayerProvider;
|
|
90
|
+
exports.IntlayerProviderContent = IntlayerProviderContent;
|
|
91
|
+
exports.useIntlayerContext = useIntlayerContext;
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
// src/client/contentProxy.ts
|
|
3
|
+
/**
|
|
4
|
+
* Exposes reactive content through a proxy that reads `accessor` on every
|
|
5
|
+
* access, so each field read stays tracked — shared by `useDictionary`,
|
|
6
|
+
* `useIntlayer` and the dynamic collection read.
|
|
7
|
+
*
|
|
8
|
+
* Collections must behave like real arrays: Solid 2's `<For>` copies its list
|
|
9
|
+
* with `list.slice(0)`, which checks every index with `in`. Answering those
|
|
10
|
+
* checks for the function target would yield holes (`undefined` rows), so `in`
|
|
11
|
+
* is answered for the content, and inherited methods (`slice`, `map`…) run
|
|
12
|
+
* against it. Own fields are returned untouched: content nodes carry their
|
|
13
|
+
* own properties (`.value`, `.raw`) that a bound copy would lose.
|
|
14
|
+
*
|
|
15
|
+
* @param accessor - Returns the current content (a memo).
|
|
16
|
+
*/
|
|
17
|
+
var createContentProxy = (accessor) => new Proxy(accessor, {
|
|
18
|
+
get(target, property) {
|
|
19
|
+
const content = target();
|
|
20
|
+
if (content == null) return void 0;
|
|
21
|
+
const value = Reflect.get(Object(content), property);
|
|
22
|
+
return typeof value === "function" && !Object.hasOwn(content, property) ? value.bind(content) : value;
|
|
23
|
+
},
|
|
24
|
+
has(target, property) {
|
|
25
|
+
const content = target();
|
|
26
|
+
return content != null && typeof content === "object" && property in content;
|
|
27
|
+
},
|
|
28
|
+
apply(target) {
|
|
29
|
+
return target();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
exports.createContentProxy = createContentProxy;
|
|
@@ -1 +1,115 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
3
|
+
let _intlayer_config_defaultValues = require("@intlayer/config/defaultValues");
|
|
4
|
+
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
5
|
+
let _intlayer_core_utils = require("@intlayer/core/utils");
|
|
6
|
+
// src/client/getBrowserLocale.tsx
|
|
7
|
+
var LanguageDetector = /* @__PURE__ */ function(LanguageDetector) {
|
|
8
|
+
LanguageDetector["Querystring"] = "querystring";
|
|
9
|
+
LanguageDetector["Storage"] = "storage";
|
|
10
|
+
LanguageDetector["Navigator"] = "navigator";
|
|
11
|
+
LanguageDetector["HtmlTag"] = "htmlTag";
|
|
12
|
+
return LanguageDetector;
|
|
13
|
+
}({});
|
|
14
|
+
var getDefaultsOptions = () => {
|
|
15
|
+
return {
|
|
16
|
+
order: [
|
|
17
|
+
"querystring",
|
|
18
|
+
"storage",
|
|
19
|
+
"navigator",
|
|
20
|
+
"htmlTag"
|
|
21
|
+
],
|
|
22
|
+
lookupQuerystring: "locale",
|
|
23
|
+
htmlTag: typeof document !== "undefined" ? document.documentElement : null
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
var detectLanguage = (order, options) => {
|
|
27
|
+
const detected = {};
|
|
28
|
+
const queryStringDetector = () => {
|
|
29
|
+
if (typeof window === "undefined") return;
|
|
30
|
+
const search = window.location.search || "";
|
|
31
|
+
const value = new URLSearchParams(search).get(options.lookupQuerystring ?? "");
|
|
32
|
+
if (value) detected["querystring"] = value;
|
|
33
|
+
};
|
|
34
|
+
const storageDetector = () => {
|
|
35
|
+
if (typeof window === "undefined") return;
|
|
36
|
+
const locale = (0, _intlayer_core_utils.getLocaleFromStorageClient)({
|
|
37
|
+
getCookie: (name) => {
|
|
38
|
+
try {
|
|
39
|
+
const cookies = document.cookie.split(";");
|
|
40
|
+
const cookieName = `${name}=`;
|
|
41
|
+
const cookie = cookies.find((c) => c.trim().startsWith(cookieName));
|
|
42
|
+
if (cookie) return cookie.split("=")[1].trim();
|
|
43
|
+
} catch {}
|
|
44
|
+
},
|
|
45
|
+
getSessionStorage: (name) => {
|
|
46
|
+
try {
|
|
47
|
+
return window.sessionStorage.getItem(name) ?? void 0;
|
|
48
|
+
} catch {}
|
|
49
|
+
},
|
|
50
|
+
getLocaleStorage: (name) => {
|
|
51
|
+
try {
|
|
52
|
+
return window.localStorage.getItem(name) ?? void 0;
|
|
53
|
+
} catch {}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (locale) detected["storage"] = locale;
|
|
57
|
+
};
|
|
58
|
+
const navigatorDetector = () => {
|
|
59
|
+
if (typeof navigator === "undefined") return;
|
|
60
|
+
const languages = navigator.languages ?? [navigator.language];
|
|
61
|
+
const locale = (0, _intlayer_core_localization.localeDetector)({ "accept-language": languages.join(",") }, _intlayer_config_built.internationalization.locales, _intlayer_config_built.internationalization.defaultLocale);
|
|
62
|
+
if (locale) detected["navigator"] = locale;
|
|
63
|
+
};
|
|
64
|
+
const htmlTagDetector = () => {
|
|
65
|
+
const htmlTag = options.htmlTag;
|
|
66
|
+
if (htmlTag && typeof htmlTag.getAttribute === "function") {
|
|
67
|
+
const lang = htmlTag.getAttribute("lang");
|
|
68
|
+
if (lang) {
|
|
69
|
+
const locale = (0, _intlayer_core_localization.localeDetector)({ "accept-language": lang }, _intlayer_config_built.internationalization.locales, _intlayer_config_built.internationalization.defaultLocale);
|
|
70
|
+
detected["htmlTag"] = locale;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const detectors = {
|
|
75
|
+
["querystring"]: queryStringDetector,
|
|
76
|
+
["storage"]: storageDetector,
|
|
77
|
+
["navigator"]: navigatorDetector,
|
|
78
|
+
["htmlTag"]: htmlTagDetector
|
|
79
|
+
};
|
|
80
|
+
order.forEach((detectorName) => {
|
|
81
|
+
detectors[detectorName]?.();
|
|
82
|
+
});
|
|
83
|
+
return detected;
|
|
84
|
+
};
|
|
85
|
+
var getFirstAvailableLocale = (locales, order) => {
|
|
86
|
+
for (const detector of order) {
|
|
87
|
+
const locale = locales[detector];
|
|
88
|
+
if (locale && _intlayer_config_built.internationalization.locales.includes(locale)) return locale;
|
|
89
|
+
}
|
|
90
|
+
return _intlayer_config_built.internationalization?.defaultLocale ?? _intlayer_config_defaultValues.DEFAULT_LOCALE;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Core language detector function for browser environments.
|
|
94
|
+
*
|
|
95
|
+
* Detects the user's preferred locale by checking multiple sources in order:
|
|
96
|
+
* 1. Query string parameter
|
|
97
|
+
* 2. Storage (cookies, localStorage, sessionStorage) - uses getLocaleFromStorage
|
|
98
|
+
* 3. Navigator languages - uses localeDetector
|
|
99
|
+
* 4. HTML lang attribute - uses localeDetector
|
|
100
|
+
*
|
|
101
|
+
* @param userOptions - Optional configuration for detection order and lookup keys
|
|
102
|
+
* @returns The detected locale or the default locale
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* const locale = getBrowserLocale({ order: [LanguageDetector.Storage, LanguageDetector.Navigator] });
|
|
106
|
+
*/
|
|
107
|
+
var getBrowserLocale = (userOptions = {}) => {
|
|
108
|
+
const options = {
|
|
109
|
+
...getDefaultsOptions(),
|
|
110
|
+
...userOptions
|
|
111
|
+
};
|
|
112
|
+
return getFirstAvailableLocale(detectLanguage(options.order ?? [], options), options.order ?? []);
|
|
113
|
+
};
|
|
114
|
+
exports.LanguageDetector = LanguageDetector;
|
|
115
|
+
exports.getBrowserLocale = getBrowserLocale;
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_client_getBrowserLocale = require("./getBrowserLocale.cjs");
|
|
3
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
4
|
+
const require_client_t = require("./t.cjs");
|
|
5
|
+
const require_client_useDictionary = require("./useDictionary.cjs");
|
|
6
|
+
const require_client_useDictionaryAsync = require("./useDictionaryAsync.cjs");
|
|
7
|
+
const require_client_useDictionaryDynamic = require("./useDictionaryDynamic.cjs");
|
|
8
|
+
const require_client_useIntlayer = require("./useIntlayer.cjs");
|
|
9
|
+
const require_client_useLoadDynamic = require("./useLoadDynamic.cjs");
|
|
10
|
+
const require_client_useLocale = require("./useLocale.cjs");
|
|
11
|
+
const require_client_useLocaleBase = require("./useLocaleBase.cjs");
|
|
12
|
+
const require_client_useLocaleStorage = require("./useLocaleStorage.cjs");
|
|
13
|
+
const require_client_usePathname = require("./usePathname.cjs");
|
|
14
|
+
const require_client_useRewriteURL = require("./useRewriteURL.cjs");
|
|
15
|
+
exports.IntlayerClientContext = require_client_IntlayerProvider.IntlayerClientContext;
|
|
16
|
+
exports.IntlayerProvider = require_client_IntlayerProvider.IntlayerProvider;
|
|
17
|
+
exports.IntlayerProviderContent = require_client_IntlayerProvider.IntlayerProviderContent;
|
|
18
|
+
exports.getBrowserLocale = require_client_getBrowserLocale.getBrowserLocale;
|
|
19
|
+
exports.localeCookie = require_client_useLocaleStorage.localeCookie;
|
|
20
|
+
exports.localeInStorage = require_client_useLocaleStorage.localeInStorage;
|
|
21
|
+
exports.setLocaleCookie = require_client_useLocaleStorage.setLocaleCookie;
|
|
22
|
+
exports.setLocaleInStorage = require_client_useLocaleStorage.setLocaleInStorage;
|
|
23
|
+
exports.t = require_client_t.t;
|
|
24
|
+
exports.useDictionary = require_client_useDictionary.useDictionary;
|
|
25
|
+
exports.useDictionaryAsync = require_client_useDictionaryAsync.useDictionaryAsync;
|
|
26
|
+
exports.useDictionaryDynamic = require_client_useDictionaryDynamic.useDictionaryDynamic;
|
|
27
|
+
exports.useIntlayer = require_client_useIntlayer.useIntlayer;
|
|
28
|
+
exports.useIntlayerContext = require_client_IntlayerProvider.useIntlayerContext;
|
|
29
|
+
exports.useLoadDynamic = require_client_useLoadDynamic.useLoadDynamic;
|
|
30
|
+
exports.useLocale = require_client_useLocale.useLocale;
|
|
31
|
+
exports.useLocaleBase = require_client_useLocaleBase.useLocaleBase;
|
|
32
|
+
exports.useLocaleCookie = require_client_useLocaleStorage.useLocaleCookie;
|
|
33
|
+
exports.useLocaleStorage = require_client_useLocaleStorage.useLocaleStorage;
|
|
34
|
+
exports.usePathname = require_client_usePathname.usePathname;
|
|
35
|
+
exports.useRewriteURL = require_client_useRewriteURL.useRewriteURL;
|
package/dist/cjs/client/t.cjs
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
3
|
+
let solid_js = require("solid-js");
|
|
4
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
5
|
+
// src/client/t.ts
|
|
6
|
+
/**
|
|
7
|
+
* On the client side, this function returns the translation of the provided multilang content.
|
|
8
|
+
*
|
|
9
|
+
* If the locale is not provided, it will use the locale from the client context
|
|
10
|
+
*/
|
|
11
|
+
var t = (multilangContent, locale) => {
|
|
12
|
+
const { locale: currentLocale } = (0, solid_js.useContext)(require_client_IntlayerProvider.IntlayerClientContext) ?? {};
|
|
13
|
+
const localeTarget = locale ?? (typeof currentLocale === "function" ? currentLocale() : currentLocale);
|
|
14
|
+
return (0, _intlayer_core_interpreter.getTranslation)(multilangContent, localeTarget);
|
|
15
|
+
};
|
|
16
|
+
exports.t = t;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_client_useLocaleBase = require("./useLocaleBase.cjs");
|
|
3
|
+
const require_client_useTraduction = require("./useTraduction.cjs");
|
|
4
|
+
// src/client/useContent.ts
|
|
5
|
+
/**
|
|
6
|
+
* On the client side, hook to get the translation content based on the locale
|
|
7
|
+
*/
|
|
8
|
+
var useContent = (languageContent) => {
|
|
9
|
+
const { locale } = require_client_useLocaleBase.useLocaleBase();
|
|
10
|
+
return {
|
|
11
|
+
locale,
|
|
12
|
+
content: require_client_useTraduction.useTranslation(languageContent),
|
|
13
|
+
t: require_client_useTraduction.useTranslation
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
exports.useContent = useContent;
|
|
@@ -1 +1,51 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
3
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
4
|
+
let solid_js = require("solid-js");
|
|
5
|
+
const require_getDictionary = require("../getDictionary.cjs");
|
|
6
|
+
const require_plugins = require("../plugins.cjs");
|
|
7
|
+
const require_client_contentProxy = require("./contentProxy.cjs");
|
|
8
|
+
const require_client_IntlayerProvider = require("./IntlayerProvider.cjs");
|
|
9
|
+
const require_client_useLoadDynamic = require("./useLoadDynamic.cjs");
|
|
10
|
+
// src/client/useDictionary.ts
|
|
11
|
+
/**
|
|
12
|
+
* On the client side, Hook that transforms a dictionary (or qualified
|
|
13
|
+
* dictionary group) and returns its reactive content.
|
|
14
|
+
*
|
|
15
|
+
* The second argument is either a locale or a selector object
|
|
16
|
+
* (`{ item }`, `{ variant }`, optionally with `locale`).
|
|
17
|
+
*
|
|
18
|
+
* If the locale is not provided (directly or through the selector), it will
|
|
19
|
+
* use the locale from the client context.
|
|
20
|
+
*/
|
|
21
|
+
var useDictionary = (dictionary, localeOrSelector) => {
|
|
22
|
+
const context = (0, solid_js.useContext)(require_client_IntlayerProvider.IntlayerClientContext) ?? {};
|
|
23
|
+
const instancePlugins = /* @__PURE__ */ new Map();
|
|
24
|
+
const getInstancePlugins = (locale) => {
|
|
25
|
+
const sharedPlugins = require_plugins.getPlugins(locale);
|
|
26
|
+
let ownPlugins = instancePlugins.get(sharedPlugins);
|
|
27
|
+
if (!ownPlugins) {
|
|
28
|
+
ownPlugins = [...sharedPlugins];
|
|
29
|
+
instancePlugins.set(sharedPlugins, ownPlugins);
|
|
30
|
+
}
|
|
31
|
+
return ownPlugins;
|
|
32
|
+
};
|
|
33
|
+
const interpret = () => {
|
|
34
|
+
const currentLocale = context?.locale?.();
|
|
35
|
+
const source = require_client_useLoadDynamic.unwrapLoadable(dictionary) ?? dictionary;
|
|
36
|
+
if (process.env.INTLAYER_DICTIONARY_SELECTOR !== "false") return require_getDictionary.getDictionary(source, (0, _intlayer_core_dictionaryManipulator.resolveDictionaryArgument)({
|
|
37
|
+
localeOrSelector,
|
|
38
|
+
contextLocale: currentLocale,
|
|
39
|
+
contextVariant: context?.variant?.(),
|
|
40
|
+
dictionaryKey: dictionary.key
|
|
41
|
+
}), getInstancePlugins);
|
|
42
|
+
return require_getDictionary.getDictionary(source, localeOrSelector ?? currentLocale, getInstancePlugins);
|
|
43
|
+
};
|
|
44
|
+
const accessor = (0, solid_js.createMemo)(() => {
|
|
45
|
+
const { result, writes } = (0, _intlayer_core_interpreter.collectTransformCacheWrites)(interpret);
|
|
46
|
+
if (writes.length > 0) (0, solid_js.onCleanup)(() => (0, _intlayer_core_interpreter.deleteTransformCacheWrites)(writes));
|
|
47
|
+
return result;
|
|
48
|
+
});
|
|
49
|
+
return require_client_contentProxy.createContentProxy(accessor);
|
|
50
|
+
};
|
|
51
|
+
exports.useDictionary = useDictionary;
|