angular-intlayer 9.6.0 → 9.7.1
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/UI/IntlayerNode.component.cjs +4 -5
- package/dist/cjs/UI/index.cjs +2 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/decorate.cjs +1 -2
- package/dist/cjs/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/decorateMetadata.cjs +1 -2
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/analytics/exposureSink.cjs +1 -2
- package/dist/cjs/analytics/index.cjs +3 -3
- package/dist/cjs/analytics/useAnalytics.cjs +3 -4
- package/dist/cjs/analytics/useConversion.cjs +1 -2
- package/dist/cjs/analytics/useExperiment.cjs +1 -2
- package/dist/cjs/client/index.cjs +9 -9
- package/dist/cjs/client/installIntlayer.cjs +4 -5
- package/dist/cjs/client/intlayerToken.cjs +2 -3
- package/dist/cjs/client/useDictionary.cjs +3 -4
- package/dist/cjs/client/useDictionaryAsync.cjs +4 -5
- package/dist/cjs/client/useDictionaryDynamic.cjs +6 -7
- package/dist/cjs/client/useIntlayer.cjs +3 -4
- package/dist/cjs/client/useLoadDynamic.cjs +1 -2
- package/dist/cjs/client/useLocale.cjs +3 -4
- package/dist/cjs/client/useLocaleStorage.cjs +1 -2
- package/dist/cjs/client/usePathname.cjs +1 -2
- package/dist/cjs/editor/ContentSelector.component.cjs +4 -5
- package/dist/cjs/editor/EditorProvider.component.cjs +5 -6
- package/dist/cjs/editor/index.cjs +5 -5
- package/dist/cjs/editor/useEditor.cjs +12 -3
- package/dist/cjs/editor/useEditor.cjs.map +1 -1
- package/dist/cjs/esbuild/hiddenDirectory.cjs +1 -2
- package/dist/cjs/esbuild/index.cjs +1 -1
- package/dist/cjs/esbuild/plugin.cjs +3 -4
- package/dist/cjs/esbuild/resolvePackageExport.cjs +1 -2
- 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/getIntlayer.cjs +2 -3
- package/dist/cjs/html/index.cjs +2 -2
- package/dist/cjs/html/installIntlayerHTML.cjs +3 -4
- package/dist/cjs/index.cjs +17 -17
- package/dist/cjs/markdown/index.cjs +2 -2
- package/dist/cjs/markdown/installIntlayerMarkdown.cjs +3 -4
- package/dist/cjs/plugins.cjs +6 -7
- package/dist/cjs/renderIntlayerNode.cjs +1 -2
- package/dist/cjs/webpack/index.cjs +1 -1
- package/dist/cjs/webpack/mergeConfig.cjs +1 -2
- package/dist/esm/UI/IntlayerNode.component.mjs +3 -4
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/decorate.mjs +1 -2
- package/dist/esm/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/decorateMetadata.mjs +1 -2
- package/dist/esm/analytics/exposureSink.mjs +1 -2
- package/dist/esm/analytics/useAnalytics.mjs +2 -3
- package/dist/esm/analytics/useConversion.mjs +1 -2
- package/dist/esm/analytics/useExperiment.mjs +1 -2
- package/dist/esm/client/index.mjs +2 -2
- package/dist/esm/client/installIntlayer.mjs +2 -3
- package/dist/esm/client/intlayerToken.mjs +1 -2
- package/dist/esm/client/useDictionary.mjs +1 -2
- 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 +2 -3
- package/dist/esm/client/useLocaleStorage.mjs +1 -2
- package/dist/esm/client/usePathname.mjs +1 -2
- package/dist/esm/editor/ContentSelector.component.mjs +3 -4
- package/dist/esm/editor/EditorProvider.component.mjs +3 -4
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs +11 -2
- package/dist/esm/editor/useEditor.mjs.map +1 -1
- package/dist/esm/esbuild/hiddenDirectory.mjs +1 -2
- package/dist/esm/esbuild/plugin.mjs +4 -5
- package/dist/esm/esbuild/resolvePackageExport.mjs +1 -2
- 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/getIntlayer.mjs +1 -2
- package/dist/esm/html/installIntlayerHTML.mjs +2 -3
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/markdown/installIntlayerMarkdown.mjs +2 -3
- package/dist/esm/plugins.mjs +2 -3
- package/dist/esm/renderIntlayerNode.mjs +1 -2
- package/dist/esm/webpack/mergeConfig.mjs +1 -2
- package/dist/types/UI/IntlayerNode.component.d.ts +0 -2
- package/dist/types/UI/IntlayerNode.component.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/index.d.ts +1 -1
- package/dist/types/client/installIntlayer.d.ts +0 -2
- package/dist/types/client/installIntlayer.d.ts.map +1 -1
- package/dist/types/client/intlayerToken.d.ts +0 -2
- package/dist/types/client/intlayerToken.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 +0 -2
- package/dist/types/client/useLocale.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/editor/ContentSelector.component.d.ts +0 -2
- package/dist/types/editor/ContentSelector.component.d.ts.map +1 -1
- package/dist/types/editor/EditorProvider.component.d.ts +0 -2
- package/dist/types/editor/EditorProvider.component.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/esbuild/hiddenDirectory.d.ts +0 -2
- package/dist/types/esbuild/hiddenDirectory.d.ts.map +1 -1
- package/dist/types/esbuild/plugin.d.ts +0 -2
- package/dist/types/esbuild/plugin.d.ts.map +1 -1
- package/dist/types/esbuild/resolvePackageExport.d.ts +0 -2
- package/dist/types/esbuild/resolvePackageExport.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/installIntlayerHTML.d.ts +1 -2
- package/dist/types/html/installIntlayerHTML.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/markdown/installIntlayerMarkdown.d.ts +0 -2
- package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +0 -2
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/renderIntlayerNode.d.ts +1 -2
- package/dist/types/renderIntlayerNode.d.ts.map +1 -1
- package/dist/types/webpack/mergeConfig.d.ts +0 -2
- package/dist/types/webpack/mergeConfig.d.ts.map +1 -1
- package/package.json +15 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { signal } from "@angular/core";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/client/useLoadDynamic.ts
|
|
4
4
|
/**
|
|
5
5
|
* A "synchronous" loader for a dynamically‐imported JSON (or anything).
|
|
6
6
|
*
|
|
@@ -22,6 +22,5 @@ const useLoadDynamic = (key, promise) => {
|
|
|
22
22
|
return container();
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { useLoadDynamic };
|
|
27
26
|
//# sourceMappingURL=useLoadDynamic.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { setLocaleInStorage } from "./useLocaleStorage.mjs";
|
|
2
1
|
import { INTLAYER_TOKEN } from "./intlayerToken.mjs";
|
|
2
|
+
import { setLocaleInStorage } from "./useLocaleStorage.mjs";
|
|
3
3
|
import { computed, inject } from "@angular/core";
|
|
4
4
|
import { internationalization } from "@intlayer/config/built";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/client/useLocale.ts
|
|
7
7
|
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
8
8
|
/**
|
|
9
9
|
* Angular hook to manage the current locale and related functions.
|
|
@@ -53,6 +53,5 @@ const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
//#endregion
|
|
57
56
|
export { useLocale };
|
|
58
57
|
//# sourceMappingURL=useLocale.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocaleStorageClient, getCachedLocaleFromStorageClient, getLocaleFromStorageClient, localeStorageOptions, setLocaleInStorageClient } from "@intlayer/core/utils";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/client/useLocaleStorage.ts
|
|
4
4
|
/**
|
|
5
5
|
* Reads the locale persisted in the browser storage (cookie, localStorage…).
|
|
6
6
|
*
|
|
@@ -56,6 +56,5 @@ const useLocaleCookie = (isCookieEnabled) => {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
//#endregion
|
|
60
59
|
export { getLocaleInStorage, localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage };
|
|
61
60
|
//# sourceMappingURL=useLocaleStorage.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DestroyRef, computed, inject, signal } from "@angular/core";
|
|
2
2
|
import { getPathWithoutLocale } from "@intlayer/core/localization";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/client/usePathname.ts
|
|
5
5
|
/**
|
|
6
6
|
* Angular hook that returns a signal containing the current pathname with
|
|
7
7
|
* the locale segment removed.
|
|
@@ -46,6 +46,5 @@ const usePathname = () => {
|
|
|
46
46
|
return computed(() => getPathWithoutLocale(rawPathname()));
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
//#endregion
|
|
50
49
|
export { usePathname };
|
|
51
50
|
//# sourceMappingURL=usePathname.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
|
|
3
3
|
import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from "@angular/core";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/editor/ContentSelector.component.ts
|
|
6
6
|
let ContentSelectorWrapperComponent = class ContentSelectorWrapperComponent {
|
|
7
7
|
dictionaryKey;
|
|
8
8
|
keyPath;
|
|
@@ -26,6 +26,5 @@ ContentSelectorWrapperComponent = __decorate([Component({
|
|
|
26
26
|
`
|
|
27
27
|
})], ContentSelectorWrapperComponent);
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { ContentSelectorWrapperComponent };
|
|
31
30
|
//# sourceMappingURL=ContentSelector.component.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorate.mjs";
|
|
3
1
|
import { useEditor } from "./useEditor.mjs";
|
|
2
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorateMetadata.mjs";
|
|
3
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { Component } from "@angular/core";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/editor/EditorProvider.component.ts
|
|
7
7
|
let EditorProviderComponent = class EditorProviderComponent {
|
|
8
8
|
constructor() {
|
|
9
9
|
useEditor();
|
|
@@ -15,6 +15,5 @@ EditorProviderComponent = __decorate([Component({
|
|
|
15
15
|
template: `<ng-content />`
|
|
16
16
|
}), __decorateMetadata("design:paramtypes", [])], EditorProviderComponent);
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { EditorProviderComponent };
|
|
20
19
|
//# sourceMappingURL=EditorProvider.component.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContentSelectorWrapperComponent } from "./ContentSelector.component.mjs";
|
|
2
|
-
import { provideIntlayerEditor, useEditor } from "./useEditor.mjs";
|
|
3
2
|
import { EditorProviderComponent } from "./EditorProvider.component.mjs";
|
|
3
|
+
import { provideIntlayerEditor, useEditor } from "./useEditor.mjs";
|
|
4
4
|
|
|
5
5
|
export { ContentSelectorWrapperComponent, EditorProviderComponent, provideIntlayerEditor, useEditor };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
2
|
+
import { setLocaleInStorage } from "../client/useLocaleStorage.mjs";
|
|
2
3
|
import { DestroyRef, Injector, effect, inject, provideAppInitializer, runInInjectionContext, signal } from "@angular/core";
|
|
3
4
|
import { isEnabled } from "@intlayer/editor/isEnabled";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
// src/editor/useEditor.ts
|
|
6
7
|
/**
|
|
7
8
|
* Initialises the Intlayer editor client singleton when the editor is enabled.
|
|
8
9
|
* Syncs the current locale from the provided Intlayer client into the editor
|
|
@@ -31,9 +32,18 @@ const useEditor = (client) => {
|
|
|
31
32
|
const locale = resolvedClient?.locale();
|
|
32
33
|
if (m && locale) m.currentLocale.set(locale);
|
|
33
34
|
}));
|
|
35
|
+
const localeRequestEffectRef = runInInjectionContext(injector, () => effect((onCleanup) => {
|
|
36
|
+
const m = manager();
|
|
37
|
+
if (!m || !resolvedClient) return;
|
|
38
|
+
onCleanup(m.onLocaleChangeRequested((requestedLocale) => {
|
|
39
|
+
resolvedClient.setLocale(requestedLocale);
|
|
40
|
+
setLocaleInStorage(requestedLocale, true);
|
|
41
|
+
}));
|
|
42
|
+
}));
|
|
34
43
|
destroyRef?.onDestroy(() => {
|
|
35
44
|
stopped = true;
|
|
36
45
|
effectRef.destroy();
|
|
46
|
+
localeRequestEffectRef.destroy();
|
|
37
47
|
manager.set(null);
|
|
38
48
|
import("@intlayer/editor").then(({ stopEditorClient }) => {
|
|
39
49
|
stopEditorClient();
|
|
@@ -59,6 +69,5 @@ const useEditor = (client) => {
|
|
|
59
69
|
*/
|
|
60
70
|
const provideIntlayerEditor = (client) => provideAppInitializer(() => useEditor(client));
|
|
61
71
|
|
|
62
|
-
//#endregion
|
|
63
72
|
export { provideIntlayerEditor, useEditor };
|
|
64
73
|
//# sourceMappingURL=useEditor.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import {\n DestroyRef,\n effect,\n Injector,\n inject,\n provideAppInitializer,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\n// Import from the standalone token file to avoid a circular dependency:\n// installIntlayer.ts → useEditor.ts → ../client → installIntlayer.ts\nimport { INTLAYER_TOKEN, type IntlayerProvider } from '../client/intlayerToken';\n\n/**\n * Initialises the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the provided Intlayer client into the editor\n * manager so the editor always knows which locale the app is displaying.\n *\n * Must be called inside an Angular injection context (e.g. a component\n * constructor, `provideAppInitializer`, or `runInInjectionContext`).\n *\n * @param client - The IntlayerProvider instance to sync locale from.\n * When omitted the function injects `INTLAYER_TOKEN` from the DI tree,\n * so it still works when called directly from a component.\n */\nexport const useEditor = (client?: IntlayerProvider | null): void => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled) return;\n\n const destroyRef = inject(DestroyRef, { optional: true });\n const injector = inject(Injector);\n\n // Resolve the client: use the passed-in reference or fall back to injection.\n const resolvedClient =\n client ??\n inject<IntlayerProvider>(INTLAYER_TOKEN, { optional: true } as any);\n\n // `manager` signal is set once the async import resolves.\n // Using a signal lets an `effect()` react to it becoming available.\n const manager = signal<EditorStateManager | null>(null);\n\n // Guard: prevents the async callback from acting after the view is destroyed.\n let stopped = false;\n\n // Initialise the editor client\n import('@intlayer/editor')\n .then(({ initEditorClient }) => {\n if (stopped) return;\n manager.set(initEditorClient());\n })\n .catch(() => {});\n\n // Keep the editor locale in sync with the Angular locale signal\n const effectRef = runInInjectionContext(injector, () =>\n effect(() => {\n const m = manager();\n const locale = resolvedClient?.locale();\n if (m && locale) m.currentLocale.set(locale as Locale);\n })\n );\n\n // Tear down on destroy\n destroyRef?.onDestroy(() => {\n stopped = true;\n effectRef.destroy();\n manager.set(null);\n import('@intlayer/editor')\n .then(({ stopEditorClient }) => {\n stopEditorClient();\n })\n .catch(() => {});\n });\n};\n\n/**\n * Angular provider that wires `useEditor` into the application initialisation\n * phase via `provideAppInitializer`.\n *\n * `provideIntlayer()` already calls this internally, so you only need this\n * function when you want to manage providers individually.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { provideIntlayer, provideIntlayerEditor } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [provideIntlayer(), provideIntlayerEditor()],\n * };\n * ```\n */\nexport const provideIntlayerEditor = (client?: IntlayerProvider | null) =>\n provideAppInitializer(() => useEditor(client));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import {\n DestroyRef,\n effect,\n Injector,\n inject,\n provideAppInitializer,\n runInInjectionContext,\n signal,\n} from '@angular/core';\nimport type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\n// Import from the standalone token file to avoid a circular dependency:\n// installIntlayer.ts → useEditor.ts → ../client → installIntlayer.ts\nimport { INTLAYER_TOKEN, type IntlayerProvider } from '../client/intlayerToken';\nimport { setLocaleInStorage } from '../client/useLocaleStorage';\n\n/**\n * Initialises the Intlayer editor client singleton when the editor is enabled.\n * Syncs the current locale from the provided Intlayer client into the editor\n * manager so the editor always knows which locale the app is displaying.\n *\n * Must be called inside an Angular injection context (e.g. a component\n * constructor, `provideAppInitializer`, or `runInInjectionContext`).\n *\n * @param client - The IntlayerProvider instance to sync locale from.\n * When omitted the function injects `INTLAYER_TOKEN` from the DI tree,\n * so it still works when called directly from a component.\n */\nexport const useEditor = (client?: IntlayerProvider | null): void => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled) return;\n\n const destroyRef = inject(DestroyRef, { optional: true });\n const injector = inject(Injector);\n\n // Resolve the client: use the passed-in reference or fall back to injection.\n const resolvedClient =\n client ??\n inject<IntlayerProvider>(INTLAYER_TOKEN, { optional: true } as any);\n\n // `manager` signal is set once the async import resolves.\n // Using a signal lets an `effect()` react to it becoming available.\n const manager = signal<EditorStateManager | null>(null);\n\n // Guard: prevents the async callback from acting after the view is destroyed.\n let stopped = false;\n\n // Initialise the editor client\n import('@intlayer/editor')\n .then(({ initEditorClient }) => {\n if (stopped) return;\n manager.set(initEditorClient());\n })\n .catch(() => {});\n\n // Keep the editor locale in sync with the Angular locale signal\n const effectRef = runInInjectionContext(injector, () =>\n effect(() => {\n const m = manager();\n const locale = resolvedClient?.locale();\n if (m && locale) m.currentLocale.set(locale as Locale);\n })\n );\n\n // Apply the locales requested by the editor\n const localeRequestEffectRef = runInInjectionContext(injector, () =>\n effect((onCleanup) => {\n const m = manager();\n\n if (!m || !resolvedClient) return;\n\n onCleanup(\n m.onLocaleChangeRequested((requestedLocale) => {\n resolvedClient.setLocale(requestedLocale);\n setLocaleInStorage(requestedLocale, true);\n })\n );\n })\n );\n\n // Tear down on destroy\n destroyRef?.onDestroy(() => {\n stopped = true;\n effectRef.destroy();\n localeRequestEffectRef.destroy();\n manager.set(null);\n import('@intlayer/editor')\n .then(({ stopEditorClient }) => {\n stopEditorClient();\n })\n .catch(() => {});\n });\n};\n\n/**\n * Angular provider that wires `useEditor` into the application initialisation\n * phase via `provideAppInitializer`.\n *\n * `provideIntlayer()` already calls this internally, so you only need this\n * function when you want to manage providers individually.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { provideIntlayer, provideIntlayerEditor } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [provideIntlayer(), provideIntlayerEditor()],\n * };\n * ```\n */\nexport const provideIntlayerEditor = (client?: IntlayerProvider | null) =>\n provideAppInitializer(() => useEditor(client));\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAa,aAAa,WAA2C;CACnE,IAAI,QAAQ,IAAI,4BAA4B,WAAW,CAAC,WAAW;CAEnE,MAAM,aAAa,OAAO,YAAY,EAAE,UAAU,KAAK,CAAC;CACxD,MAAM,WAAW,OAAO,QAAQ;CAGhC,MAAM,iBACJ,UACA,OAAyB,gBAAgB,EAAE,UAAU,KAAK,CAAQ;CAIpE,MAAM,UAAU,OAAkC,IAAI;CAGtD,IAAI,UAAU;CAGd,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;EAC9B,IAAI,SAAS;EACb,QAAQ,IAAI,iBAAiB,CAAC;CAChC,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;CAGjB,MAAM,YAAY,sBAAsB,gBACtC,aAAa;EACX,MAAM,IAAI,QAAQ;EAClB,MAAM,SAAS,gBAAgB,OAAO;EACtC,IAAI,KAAK,QAAQ,EAAE,cAAc,IAAI,MAAgB;CACvD,CAAC,CACH;CAGA,MAAM,yBAAyB,sBAAsB,gBACnD,QAAQ,cAAc;EACpB,MAAM,IAAI,QAAQ;EAElB,IAAI,CAAC,KAAK,CAAC,gBAAgB;EAE3B,UACE,EAAE,yBAAyB,oBAAoB;GAC7C,eAAe,UAAU,eAAe;GACxC,mBAAmB,iBAAiB,IAAI;EAC1C,CAAC,CACH;CACF,CAAC,CACH;CAGA,YAAY,gBAAgB;EAC1B,UAAU;EACV,UAAU,QAAQ;EAClB,uBAAuB,QAAQ;EAC/B,QAAQ,IAAI,IAAI;EAChB,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;GAC9B,iBAAiB;EACnB,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;CACnB,CAAC;AACH;;;;;;;;;;;;;;;;;;AAmBA,MAAa,yBAAyB,WACpC,4BAA4B,UAAU,MAAM,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { relative, sep } from "node:path";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/esbuild/hiddenDirectory.ts
|
|
4
4
|
/**
|
|
5
5
|
* Whether `directory` sits under a dot-directory (`.intlayer/…`) of `baseDir`.
|
|
6
6
|
*
|
|
@@ -14,6 +14,5 @@ import { relative, sep } from "node:path";
|
|
|
14
14
|
*/
|
|
15
15
|
const isInHiddenDirectory = (baseDir, directory) => relative(baseDir, directory).split(sep).some((segment) => segment.startsWith(".") && segment !== "..");
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { isInHiddenDirectory };
|
|
19
18
|
//# sourceMappingURL=hiddenDirectory.mjs.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { isInHiddenDirectory } from "./hiddenDirectory.mjs";
|
|
2
2
|
import { resolvePackageExport } from "./resolvePackageExport.mjs";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
5
|
import { basename, dirname, join, relative } from "node:path";
|
|
5
|
-
import { getConfiguration } from "@intlayer/config/node";
|
|
6
|
-
import { getAlias, getHasDictionarySelector, getUnusedNodeTypesAsync, normalizePath } from "@intlayer/config/utils";
|
|
7
|
-
import { readFile } from "node:fs/promises";
|
|
8
6
|
import { addDynamicEntryPreload, createDynamicEntryFilter, resolvePreloadModuleId } from "@intlayer/config/dictionaryPreload";
|
|
9
7
|
import { formatDictionarySelectorEnvVar, formatNodeTypeToEnvVar, getConfigEnvVars } from "@intlayer/config/envVars";
|
|
10
8
|
import { getAppLogger } from "@intlayer/config/logger";
|
|
9
|
+
import { getConfiguration } from "@intlayer/config/node";
|
|
10
|
+
import { getAlias, getHasDictionarySelector, getUnusedNodeTypesAsync, normalizePath } from "@intlayer/config/utils";
|
|
11
11
|
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
12
12
|
import { prepareIntlayer } from "@intlayer/engine/build";
|
|
13
13
|
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
14
14
|
import { startContentWatcher } from "@intlayer/engine/utils";
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// src/esbuild/plugin.ts
|
|
17
17
|
/**
|
|
18
18
|
* Absolute id of the locale resolver the injected preamble imports.
|
|
19
19
|
*
|
|
@@ -189,6 +189,5 @@ const intlayerEsbuildPlugin = (options) => {
|
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
//#endregion
|
|
193
192
|
export { intlayerEsbuildPlugin };
|
|
194
193
|
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname, join, resolve } from "node:path";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/esbuild/resolvePackageExport.ts
|
|
5
5
|
/** Splits a bare specifier into its package name and `./`-prefixed subpath. */
|
|
6
6
|
const parsePackageSpecifier = (specifier) => {
|
|
7
7
|
const segments = specifier.split("/");
|
|
@@ -110,6 +110,5 @@ const resolvePackageExport = (specifier, resolveDir, conditions) => {
|
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
//#endregion
|
|
114
113
|
export { findPackageManifest, parsePackageSpecifier, resolvePackageExport };
|
|
115
114
|
//# sourceMappingURL=resolvePackageExport.mjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { usePercentage } from "./usePercentage.mjs";
|
|
2
|
-
import { useUnit } from "./useUnit.mjs";
|
|
3
1
|
import { useCompact } from "./useCompact.mjs";
|
|
4
|
-
import { useNumber } from "./useNumber.mjs";
|
|
5
|
-
import { useIntl } from "./useIntl.mjs";
|
|
6
|
-
import { useList } from "./useList.mjs";
|
|
7
2
|
import { useCurrency } from "./useCurrency.mjs";
|
|
8
3
|
import { useDate } from "./useDate.mjs";
|
|
4
|
+
import { useIntl } from "./useIntl.mjs";
|
|
5
|
+
import { useList } from "./useList.mjs";
|
|
6
|
+
import { useNumber } from "./useNumber.mjs";
|
|
7
|
+
import { usePercentage } from "./usePercentage.mjs";
|
|
9
8
|
import { useRelativeTime } from "./useRelativeTime.mjs";
|
|
9
|
+
import { useUnit } from "./useUnit.mjs";
|
|
10
10
|
|
|
11
11
|
export { useCompact, useCurrency, useDate, useIntl, useList, useNumber, usePercentage, useRelativeTime, useUnit };
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { compact } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useCompact.ts
|
|
6
6
|
const useCompact = () => {
|
|
7
7
|
const intlayer = inject(INTLAYER_TOKEN);
|
|
8
8
|
return computed(() => (...args) => compact(args[0], {
|
|
@@ -11,6 +11,5 @@ const useCompact = () => {
|
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { useCompact };
|
|
16
15
|
//# sourceMappingURL=useCompact.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { currency } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useCurrency.ts
|
|
6
6
|
const useCurrency = () => {
|
|
7
7
|
const intlayer = inject(INTLAYER_TOKEN);
|
|
8
8
|
return computed(() => (...args) => currency(args[0], {
|
|
@@ -11,6 +11,5 @@ const useCurrency = () => {
|
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { useCurrency };
|
|
16
15
|
//# sourceMappingURL=useCurrency.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { date, presets } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useDate.ts
|
|
6
6
|
/**
|
|
7
7
|
* Angular client hook that provides a localized date/time formatter.
|
|
8
8
|
*/
|
|
@@ -21,6 +21,5 @@ const useDate = () => {
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { useDate };
|
|
26
25
|
//# sourceMappingURL=useDate.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { bindIntl } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useIntl.ts
|
|
6
6
|
/**
|
|
7
7
|
* Angular composable that provides a locale-bound `Intl` object as a Signal.
|
|
8
8
|
*/
|
|
@@ -14,6 +14,5 @@ const useIntl = (locale) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { useIntl };
|
|
19
18
|
//# sourceMappingURL=useIntl.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { list } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useList.ts
|
|
6
6
|
const useList = () => {
|
|
7
7
|
const intlayer = inject(INTLAYER_TOKEN);
|
|
8
8
|
return computed(() => (...args) => list(args[0], {
|
|
@@ -11,6 +11,5 @@ const useList = () => {
|
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { useList };
|
|
16
15
|
//# sourceMappingURL=useList.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { number } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useNumber.ts
|
|
6
6
|
/**
|
|
7
7
|
* Angular client hook that provides a localized number formatter.
|
|
8
8
|
*/
|
|
@@ -14,6 +14,5 @@ const useNumber = () => {
|
|
|
14
14
|
}));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { useNumber };
|
|
19
18
|
//# sourceMappingURL=useNumber.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { percentage } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/usePercentage.ts
|
|
6
6
|
const usePercentage = () => {
|
|
7
7
|
const intlayer = inject(INTLAYER_TOKEN);
|
|
8
8
|
return computed(() => (...args) => percentage(args[0], {
|
|
@@ -11,6 +11,5 @@ const usePercentage = () => {
|
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { usePercentage };
|
|
16
15
|
//# sourceMappingURL=usePercentage.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { relativeTime } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useRelativeTime.ts
|
|
6
6
|
const useRelativeTime = () => {
|
|
7
7
|
const intlayer = inject(INTLAYER_TOKEN);
|
|
8
8
|
return computed(() => (...args) => relativeTime(args[0], args[1], {
|
|
@@ -11,6 +11,5 @@ const useRelativeTime = () => {
|
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { useRelativeTime };
|
|
16
15
|
//# sourceMappingURL=useRelativeTime.mjs.map
|
|
@@ -2,7 +2,7 @@ import { INTLAYER_TOKEN } from "../client/intlayerToken.mjs";
|
|
|
2
2
|
import { computed, inject } from "@angular/core";
|
|
3
3
|
import { units } from "@intlayer/core/formatters";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/format/useUnit.ts
|
|
6
6
|
const useUnit = () => {
|
|
7
7
|
const intlayer = inject(INTLAYER_TOKEN);
|
|
8
8
|
return computed(() => (...args) => units(args[0], {
|
|
@@ -11,6 +11,5 @@ const useUnit = () => {
|
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { useUnit };
|
|
16
15
|
//# sourceMappingURL=useUnit.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPlugins } from "./plugins.mjs";
|
|
2
2
|
import { getDictionary as getDictionary$1 } from "@intlayer/core/interpreter";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/getDictionary.ts
|
|
5
5
|
/**
|
|
6
6
|
* Transforms a dictionary (or qualified dictionary group) and returns its
|
|
7
7
|
* content for the given locale or selector (`{ item }`, `{ variant }`,
|
|
@@ -12,6 +12,5 @@ const getDictionary = (dictionary, localeOrSelector) => {
|
|
|
12
12
|
return getDictionary$1(dictionary, localeOrSelector, getPlugins(locale));
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { getDictionary };
|
|
17
16
|
//# sourceMappingURL=getDictionary.mjs.map
|
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPlugins } from "./plugins.mjs";
|
|
2
2
|
import { getIntlayer as getIntlayer$1 } from "@intlayer/core/interpreter";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/getIntlayer.ts
|
|
5
5
|
/**
|
|
6
6
|
* Picks one dictionary by its key and returns its content for the given
|
|
7
7
|
* locale or selector (`{ item }`, `{ variant }`,
|
|
@@ -12,6 +12,5 @@ const getIntlayer = (key, localeOrSelector) => {
|
|
|
12
12
|
return getIntlayer$1(key, localeOrSelector, getPlugins(locale));
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { getIntlayer };
|
|
17
16
|
//# sourceMappingURL=getIntlayer.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
|
|
2
2
|
import { Injectable, InjectionToken, inject } from "@angular/core";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/html/installIntlayerHTML.ts
|
|
5
5
|
const INTLAYER_HTML_TOKEN = new InjectionToken("intlayerHTML");
|
|
6
6
|
/**
|
|
7
7
|
* Default HTML renderer. In Angular, we often just use [innerHTML],
|
|
@@ -32,6 +32,5 @@ const useHTML = () => {
|
|
|
32
32
|
return htmlProvider;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
//#endregion
|
|
36
35
|
export { INTLAYER_HTML_TOKEN, IntlayerHTMLService, createIntlayerHTMLProvider, useHTML };
|
|
37
36
|
//# sourceMappingURL=installIntlayerHTML.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { getPlugins, htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, markdownStringPlugin } from "./plugins.mjs";
|
|
2
1
|
import { getDictionary } from "./getDictionary.mjs";
|
|
3
|
-
import { getIntlayer } from "./getIntlayer.mjs";
|
|
4
2
|
import { INTLAYER_TOKEN, IntlayerProvider, createIntlayerClient } from "./client/intlayerToken.mjs";
|
|
5
3
|
import { provideIntlayerAnalytics, useAnalytics } from "./analytics/useAnalytics.mjs";
|
|
6
4
|
import { useConversion } from "./analytics/useConversion.mjs";
|
|
7
5
|
import { useExperiment } from "./analytics/useExperiment.mjs";
|
|
8
6
|
import { installIntlayer, provideIntlayer } from "./client/installIntlayer.mjs";
|
|
7
|
+
import { getIntlayer } from "./getIntlayer.mjs";
|
|
9
8
|
import { useDictionary } from "./client/useDictionary.mjs";
|
|
10
9
|
import { useDictionaryAsync } from "./client/useDictionaryAsync.mjs";
|
|
11
10
|
import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
|
|
12
11
|
import { useDictionaryDynamic } from "./client/useDictionaryDynamic.mjs";
|
|
12
|
+
import { getPlugins, htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, markdownStringPlugin } from "./plugins.mjs";
|
|
13
13
|
import { isUpdatableNode, useIntlayer } from "./client/useIntlayer.mjs";
|
|
14
14
|
import { useLocale } from "./client/useLocale.mjs";
|
|
15
15
|
import { usePathname } from "./client/usePathname.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import __decorate from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.mjs";
|
|
2
2
|
import { Injectable, InjectionToken, inject } from "@angular/core";
|
|
3
3
|
import { compile, parseMarkdown as parseMarkdown$1, renderMarkdownAst } from "@intlayer/core/markdown";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/markdown/installIntlayerMarkdown.ts
|
|
6
6
|
/**
|
|
7
7
|
* Angular `InjectionToken` used to provide a custom markdown renderer via the
|
|
8
8
|
* DI system. Use `createIntlayerMarkdownProvider` to create the provider value
|
|
@@ -156,6 +156,5 @@ const useMarkdown = () => {
|
|
|
156
156
|
return markdownProvider;
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
//#endregion
|
|
160
159
|
export { INTLAYER_MARKDOWN_TOKEN, IntlayerMarkdownService, compileMarkdown, createIntlayerMarkdownProvider, htmlRuntime, parseMarkdown, useMarkdown };
|
|
161
160
|
//# sourceMappingURL=installIntlayerMarkdown.mjs.map
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { reportExposure } from "./analytics/exposureSink.mjs";
|
|
2
2
|
import { ContentSelectorWrapperComponent } from "./editor/ContentSelector.component.mjs";
|
|
3
3
|
import { renderIntlayerNode } from "./renderIntlayerNode.mjs";
|
|
4
|
-
import { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, getInsertion, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, resolveInterpreterLocale, selectPlugin, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
|
|
5
4
|
import { signal, untracked } from "@angular/core";
|
|
6
5
|
import { editor, internationalization } from "@intlayer/config/built";
|
|
6
|
+
import { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, getInsertion, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, resolveInterpreterLocale, selectPlugin, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
|
|
7
7
|
import { compile, getMarkdownMetadata } from "@intlayer/core/markdown";
|
|
8
8
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/plugins.ts
|
|
11
11
|
/**
|
|
12
12
|
* Code-split markdown renderer, held in a signal.
|
|
13
13
|
*
|
|
@@ -251,6 +251,5 @@ const getPlugins = (locale, fallback = true) => {
|
|
|
251
251
|
return enabledPlugins;
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
-
//#endregion
|
|
255
254
|
export { getPlugins, htmlPlugin, insertionPlugin, intlayerNodePlugins, markdownPlugin, markdownStringPlugin };
|
|
256
255
|
//# sourceMappingURL=plugins.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getIntlayerNodePrototype } from "@intlayer/core/utils";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/renderIntlayerNode.ts
|
|
4
4
|
/**
|
|
5
5
|
* Builds a node that renders its content and also behaves like its value
|
|
6
6
|
* (`node.value`, `${node}`, `node.toUpperCase()`), through a shared prototype
|
|
@@ -19,6 +19,5 @@ const renderIntlayerNode = ({ children, value, additionalProps = {} }) => {
|
|
|
19
19
|
return Object.setPrototypeOf(children, getIntlayerNodePrototype(value, Function.prototype));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { renderIntlayerNode };
|
|
24
23
|
//# sourceMappingURL=renderIntlayerNode.mjs.map
|
|
@@ -5,7 +5,7 @@ import { getAlias } from "@intlayer/config/utils";
|
|
|
5
5
|
import { IntlayerPlugin } from "@intlayer/webpack";
|
|
6
6
|
import { defu } from "defu";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/webpack/mergeConfig.ts
|
|
9
9
|
const _require = createRequire(import.meta.url);
|
|
10
10
|
const mergeConfig = (baseConfig) => {
|
|
11
11
|
const intlayerConfig = getConfiguration();
|
|
@@ -42,6 +42,5 @@ const mergeConfig = (baseConfig) => {
|
|
|
42
42
|
return defu(config, baseConfig);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
export { mergeConfig };
|
|
47
46
|
//# sourceMappingURL=mergeConfig.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OnChanges, SimpleChanges } from "@angular/core";
|
|
2
|
-
//#region src/UI/IntlayerNode.component.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A transparent host element that renders Intlayer content nodes.
|
|
5
4
|
*
|
|
@@ -21,5 +20,4 @@ export declare class IntlayerNodeComponent implements OnChanges {
|
|
|
21
20
|
ngOnChanges(changes: SimpleChanges): void;
|
|
22
21
|
private render;
|
|
23
22
|
}
|
|
24
|
-
//#endregion
|
|
25
23
|
//# sourceMappingURL=IntlayerNode.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerNode.component.d.ts","names":[],"sources":["../../../src/UI/IntlayerNode.component.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntlayerNode.component.d.ts","names":[],"sources":["../../../src/UI/IntlayerNode.component.ts"],"mappings":";;;;;;;;;;;;;;qBAkCa,iCAAiC;EACnC;UAED;UACA;UACA;EAER,YAAY,SAAS;UAMb"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { KeyPath } from "@intlayer/types/keyPath";
|
|
2
|
-
//#region src/analytics/exposureSink.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Node metadata reported for a content exposure. Kept dependency-free (types
|
|
5
4
|
* only) so the interpreter hot path in `plugins.ts` never statically imports
|
|
@@ -27,5 +26,4 @@ export declare const setExposureSink: (next: ExposureSink | null) => void;
|
|
|
27
26
|
* @param input - The node metadata to report.
|
|
28
27
|
*/
|
|
29
28
|
export declare const reportExposure: (input: ExposureInput) => void;
|
|
30
|
-
//#endregion
|
|
31
29
|
//# sourceMappingURL=exposureSink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposureSink.d.ts","names":[],"sources":["../../../src/analytics/exposureSink.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"exposureSink.d.ts","names":[],"sources":["../../../src/analytics/exposureSink.ts"],"mappings":";;;;;;YAOY;EACV;EACA,SAAS;EACT;EACA;;;YAIU,gBAAgB,OAAO;;;;;;;qBAUtB,kBAAe,MAAU;;;;;;;qBAUzB,iBAAc,OAAW"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IntlayerProvider } from "../client/intlayerToken.js";
|
|
2
|
-
//#region src/analytics/useAnalytics.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Initializes the Intlayer analytics client singleton when analytics is
|
|
5
4
|
* enabled (mirrors {@link useEditor}). Records an initial page view, keeps the
|
|
@@ -31,5 +30,4 @@ export declare const useAnalytics: (client?: IntlayerProvider | null) => void;
|
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
32
|
export declare const provideIntlayerAnalytics: (client?: IntlayerProvider | null) => import("@angular/core").EnvironmentProviders;
|
|
34
|
-
//#endregion
|
|
35
33
|
//# sourceMappingURL=useAnalytics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnalytics.d.ts","names":[],"sources":["../../../src/analytics/useAnalytics.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAnalytics.d.ts","names":[],"sources":["../../../src/analytics/useAnalytics.ts"],"mappings":";;;;;;;;;;;;;qBA4Ba,eAAY,SAAa;;;;;;;;;;;;;;;;;;qBAkGzB,2BAAwB,SAAa,oDAAuB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/analytics/useConversion.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Parameters describing a conversion to record.
|
|
4
3
|
*/
|
|
@@ -33,5 +32,4 @@ export type ConversionParams = {
|
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
34
|
export declare const useConversion: () => (params: ConversionParams) => void;
|
|
36
|
-
//#endregion
|
|
37
35
|
//# sourceMappingURL=useConversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversion.d.ts","names":[],"sources":["../../../src/analytics/useConversion.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useConversion.d.ts","names":[],"sources":["../../../src/analytics/useConversion.ts"],"mappings":";;;YAKY;;EAEV;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;;;;qBAuBW,sBAAa,QACR"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Signal } from "@angular/core";
|
|
2
|
-
//#region src/analytics/useExperiment.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The state of an A/B experiment for the current session.
|
|
5
4
|
*/
|
|
@@ -42,5 +41,4 @@ export type ExperimentState = {
|
|
|
42
41
|
* ```
|
|
43
42
|
*/
|
|
44
43
|
export declare const useExperiment: (experimentKey: string, variants: string[], weights?: number[]) => ExperimentState;
|
|
45
|
-
//#endregion
|
|
46
44
|
//# sourceMappingURL=useExperiment.d.ts.map
|