preact-intlayer 9.5.7 → 9.5.9-canary.0

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.
Files changed (46) hide show
  1. package/dist/cjs/analytics/useAnalytics.cjs +2 -2
  2. package/dist/cjs/analytics/useConversion.cjs +1 -1
  3. package/dist/cjs/analytics/useExperiment.cjs +1 -1
  4. package/dist/cjs/client/IntlayerProvider.cjs +3 -3
  5. package/dist/cjs/client/t.cjs +1 -1
  6. package/dist/cjs/client/useDictionary.cjs +1 -1
  7. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  8. package/dist/cjs/client/useDictionaryDynamic.cjs +2 -2
  9. package/dist/cjs/client/useIntlayer.cjs +1 -1
  10. package/dist/cjs/client/useLocale.cjs +1 -1
  11. package/dist/cjs/client/useLocaleBase.cjs +1 -1
  12. package/dist/cjs/client/useTraduction.cjs +1 -1
  13. package/dist/cjs/editor/ContentSelector.cjs +1 -1
  14. package/dist/cjs/editor/useEditor.cjs +1 -1
  15. package/dist/cjs/format/index.cjs +4 -4
  16. package/dist/cjs/html/HTMLProvider.cjs +1 -1
  17. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  18. package/dist/cjs/index.cjs +2 -2
  19. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
  20. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +1 -1
  21. package/dist/cjs/plugins.cjs +4 -9
  22. package/dist/cjs/plugins.cjs.map +1 -1
  23. package/dist/esm/analytics/useAnalytics.mjs +2 -2
  24. package/dist/esm/analytics/useConversion.mjs +1 -1
  25. package/dist/esm/analytics/useExperiment.mjs +1 -1
  26. package/dist/esm/client/IntlayerProvider.mjs +3 -3
  27. package/dist/esm/client/t.mjs +1 -1
  28. package/dist/esm/client/useDictionary.mjs +1 -1
  29. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  30. package/dist/esm/client/useDictionaryDynamic.mjs +2 -2
  31. package/dist/esm/client/useIntlayer.mjs +1 -1
  32. package/dist/esm/client/useLocale.mjs +1 -1
  33. package/dist/esm/client/useLocaleBase.mjs +1 -1
  34. package/dist/esm/client/useTraduction.mjs +1 -1
  35. package/dist/esm/editor/ContentSelector.mjs +1 -1
  36. package/dist/esm/editor/useEditor.mjs +1 -1
  37. package/dist/esm/format/index.mjs +4 -4
  38. package/dist/esm/html/HTMLProvider.mjs +1 -1
  39. package/dist/esm/html/HTMLRenderer.mjs +1 -1
  40. package/dist/esm/index.mjs +2 -2
  41. package/dist/esm/markdown/MarkdownProvider.mjs +1 -1
  42. package/dist/esm/markdown/MarkdownRendererPlugin.mjs +1 -1
  43. package/dist/esm/plugins.mjs +4 -9
  44. package/dist/esm/plugins.mjs.map +1 -1
  45. package/dist/types/plugins.d.ts.map +1 -1
  46. package/package.json +8 -8
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_analytics_exposureSink = require('./exposureSink.cjs');
3
2
  const require_client_IntlayerProvider = require('../client/IntlayerProvider.cjs');
4
- let preact_hooks = require("preact/hooks");
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
  //#region src/analytics/useAnalytics.tsx
8
8
  /**
@@ -1,6 +1,6 @@
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
  //#region src/analytics/useConversion.ts
6
6
  /**
@@ -1,6 +1,6 @@
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
  //#region src/analytics/useExperiment.ts
6
6
  /**
@@ -2,12 +2,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_editor_EditorProvider = require('../editor/EditorProvider.cjs');
3
3
  const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
4
4
  const require_analytics_AnalyticsProvider = require('../analytics/AnalyticsProvider.cjs');
5
- let _intlayer_config_built = require("@intlayer/config/built");
6
- let preact = require("preact");
7
5
  let preact_hooks = require("preact/hooks");
8
- let preact_jsx_runtime = require("preact/jsx-runtime");
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
  //#region src/client/IntlayerProvider.tsx
13
13
  /**
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
- let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
4
3
  let preact_hooks = require("preact/hooks");
4
+ let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
5
5
 
6
6
  //#region src/client/t.ts
7
7
  /**
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_getDictionary = require('../getDictionary.cjs');
3
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
+ const require_getDictionary = require('../getDictionary.cjs');
4
4
  let preact_hooks = require("preact/hooks");
5
5
  let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
6
6
 
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
3
  const require_client_useDictionary = require('./useDictionary.cjs');
4
- let _intlayer_config_built = require("@intlayer/config/built");
5
4
  let preact_hooks = require("preact/hooks");
5
+ let _intlayer_config_built = require("@intlayer/config/built");
6
6
 
7
7
  //#region src/client/useDictionaryAsync.ts
8
8
  /**
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_getDictionary = require('../getDictionary.cjs');
3
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
+ const require_getDictionary = require('../getDictionary.cjs');
4
4
  const require_client_useLoadDynamic = require('./useLoadDynamic.cjs');
5
- let _intlayer_config_built = require("@intlayer/config/built");
6
5
  let preact_hooks = require("preact/hooks");
6
+ let _intlayer_config_built = require("@intlayer/config/built");
7
7
  let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
8
8
 
9
9
  //#region src/client/useDictionaryDynamic.ts
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_getIntlayer = require('../getIntlayer.cjs');
3
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
+ const require_getIntlayer = require('../getIntlayer.cjs');
4
4
  let preact_hooks = require("preact/hooks");
5
5
  let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
6
6
 
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
3
3
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
4
- let _intlayer_config_built = require("@intlayer/config/built");
5
4
  let preact_hooks = require("preact/hooks");
5
+ let _intlayer_config_built = require("@intlayer/config/built");
6
6
 
7
7
  //#region src/client/useLocale.ts
8
8
  const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
- let _intlayer_config_built = require("@intlayer/config/built");
4
3
  let preact_hooks = require("preact/hooks");
4
+ let _intlayer_config_built = require("@intlayer/config/built");
5
5
 
6
6
  //#region src/client/useLocaleBase.ts
7
7
  const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
3
- let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
4
3
  let preact_hooks = require("preact/hooks");
4
+ let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
5
5
 
6
6
  //#region src/client/useTraduction.ts
7
7
  /**
@@ -1,6 +1,6 @@
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
  //#region src/editor/ContentSelector.tsx
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_client_IntlayerProvider = require('../client/IntlayerProvider.cjs');
3
- let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
4
3
  let preact_hooks = require("preact/hooks");
4
+ let _intlayer_editor_isEnabled = require("@intlayer/editor/isEnabled");
5
5
 
6
6
  //#region src/editor/useEditor.tsx
7
7
  /**
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_format_usePercentage = require('./usePercentage.cjs');
2
+ const require_format_useCurrency = require('./useCurrency.cjs');
3
3
  const require_format_useUnit = require('./useUnit.cjs');
4
+ const require_format_useDate = require('./useDate.cjs');
4
5
  const require_format_useCompact = require('./useCompact.cjs');
5
- const require_format_useNumber = require('./useNumber.cjs');
6
6
  const require_format_useIntl = require('./useIntl.cjs');
7
7
  const require_format_useList = require('./useList.cjs');
8
- const require_format_useCurrency = require('./useCurrency.cjs');
9
- const require_format_useDate = require('./useDate.cjs');
8
+ const require_format_useNumber = require('./useNumber.cjs');
9
+ const require_format_usePercentage = require('./usePercentage.cjs');
10
10
  const require_format_useRelativeTime = require('./useRelativeTime.cjs');
11
11
 
12
12
  exports.useCompact = require_format_useCompact.useCompact;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let preact = require("preact");
3
2
  let preact_hooks = require("preact/hooks");
3
+ let preact = require("preact");
4
4
  let preact_jsx_runtime = require("preact/jsx-runtime");
5
5
 
6
6
  //#region src/html/HTMLProvider.tsx
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_html_HTMLProvider = require('./HTMLProvider.cjs');
3
- let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
4
3
  let preact = require("preact");
4
+ let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
5
5
  let _intlayer_core_transpiler = require("@intlayer/core/transpiler");
6
6
 
7
7
  //#region src/html/HTMLRenderer.tsx
@@ -1,6 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_getDictionary = require('./getDictionary.cjs');
3
- const require_getIntlayer = require('./getIntlayer.cjs');
4
2
  const require_client_useLocaleStorage = require('./client/useLocaleStorage.cjs');
5
3
  const require_client_IntlayerProvider = require('./client/IntlayerProvider.cjs');
6
4
  const require_analytics_useAnalytics = require('./analytics/useAnalytics.cjs');
@@ -8,10 +6,12 @@ const require_analytics_AnalyticsProvider = require('./analytics/AnalyticsProvid
8
6
  const require_analytics_useConversion = require('./analytics/useConversion.cjs');
9
7
  const require_analytics_useExperiment = require('./analytics/useExperiment.cjs');
10
8
  const require_client_t = require('./client/t.cjs');
9
+ const require_getDictionary = require('./getDictionary.cjs');
11
10
  const require_client_useDictionary = require('./client/useDictionary.cjs');
12
11
  const require_client_useDictionaryAsync = require('./client/useDictionaryAsync.cjs');
13
12
  const require_client_useLoadDynamic = require('./client/useLoadDynamic.cjs');
14
13
  const require_client_useDictionaryDynamic = require('./client/useDictionaryDynamic.cjs');
14
+ const require_getIntlayer = require('./getIntlayer.cjs');
15
15
  const require_client_useIntlayer = require('./client/useIntlayer.cjs');
16
16
  const require_client_useLocale = require('./client/useLocale.cjs');
17
17
  const require_client_useLocaleBase = require('./client/useLocaleBase.cjs');
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_markdown_compiler = require('./compiler.cjs');
3
- let preact = require("preact");
4
3
  let preact_hooks = require("preact/hooks");
4
+ let preact = require("preact");
5
5
  let preact_jsx_runtime = require("preact/jsx-runtime");
6
6
 
7
7
  //#region src/markdown/MarkdownProvider.tsx
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_client_useLocale = require('../client/useLocale.cjs');
5
5
  const require_markdown_MarkdownProvider = require('./MarkdownProvider.cjs');
6
- let _intlayer_core_markdown = require("@intlayer/core/markdown");
7
6
  let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
7
+ let _intlayer_core_markdown = require("@intlayer/core/markdown");
8
8
 
9
9
  //#region src/markdown/MarkdownRendererPlugin.tsx
10
10
  const MarkdownRendererPlugin = (props) => {
@@ -4,14 +4,14 @@ const require_analytics_exposureSink = require('./analytics/exposureSink.cjs');
4
4
  const require_editor_ContentSelector = require('./editor/ContentSelector.cjs');
5
5
  const require_IntlayerNode = require('./IntlayerNode.cjs');
6
6
  const require_preactElement_renderPreactElement = require('./preactElement/renderPreactElement.cjs');
7
- let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
8
7
  let _intlayer_config_built = require("@intlayer/config/built");
8
+ let preact = require("preact");
9
+ let preact_jsx_runtime = require("preact/jsx-runtime");
10
+ let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
9
11
  let _intlayer_core_markdown = require("@intlayer/core/markdown");
10
12
  let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
11
13
  _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
12
- let preact = require("preact");
13
14
  let preact_compat = require("preact/compat");
14
- let preact_jsx_runtime = require("preact/jsx-runtime");
15
15
 
16
16
  //#region src/plugins.tsx
17
17
  const markdownRendererModulePromise = process.env.INTLAYER_NODE_TYPE_MARKDOWN !== "false" ? Promise.resolve().then(() => require("./markdown/MarkdownRendererPlugin.cjs")).then((m) => ({
@@ -124,12 +124,7 @@ const insertionPlugin = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? _
124
124
  keyPath: newKeyPath,
125
125
  plugins: [insertionStringPlugin, ...props.plugins ?? []]
126
126
  });
127
- if (typeof children === "object" && children !== null && "nodeType" in children && [_intlayer_types_nodeType.ENUMERATION, _intlayer_types_nodeType.CONDITION].includes(children.nodeType)) return (values) => (arg) => {
128
- const inner = result(arg);
129
- if (typeof inner === "function") return inner(values);
130
- return inner;
131
- };
132
- return result;
127
+ return (0, _intlayer_core_interpreter.resolveInsertedSelector)(children, result);
133
128
  }
134
129
  };
135
130
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.cjs","names":["renderIntlayerNode","editor","ContentSelector","fallbackPlugin","renderPreactElement","h","Fragment","NodeTypes","isInterpolableWrapperNode","transformInterpolableNode","func","lazy","getMarkdownMetadata","internationalization","translationPlugin","enumerationPlugin","pluralPlugin","conditionPlugin","nestedPlugin","filePlugin","genderPlugin","selectPlugin"],"sources":["../../src/plugins.tsx"],"sourcesContent":["import { editor, internationalization } from '@intlayer/config/built';\nimport {\n conditionPlugin,\n type DeepTransformContent as DeepTransformContentCore,\n enumerationPlugin,\n fallbackPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n isInterpolableWrapperNode,\n nestedPlugin,\n type Plugins,\n pluralPlugin,\n selectPlugin,\n transformInterpolableNode,\n translationPlugin,\n} from '@intlayer/core/interpreter';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport type {\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n} from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Fragment, type FunctionComponent, h, type VNode } from 'preact';\nimport { lazy } from 'preact/compat';\nimport { reportExposure } from './analytics/exposureSink';\nimport { ContentSelector } from './editor/ContentSelector';\nimport type { HTMLComponents } from './html/types';\nimport { type IntlayerNode, renderIntlayerNode } from './IntlayerNode';\nimport { renderPreactElement } from './preactElement/renderPreactElement';\n\nconst markdownRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN !== 'false'\n ? import('./markdown/MarkdownRendererPlugin').then((m) => ({\n MarkdownRendererPlugin: m.MarkdownRendererPlugin,\n MarkdownMetadataRenderer: m.MarkdownMetadataRenderer,\n }))\n : null;\n\nconst htmlRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_HTML !== 'false'\n ? import('./html/HTMLRenderer').then((m) => m.HTMLRenderer)\n : null;\n\n// These preloads are read later by `useLoadDynamic`, so the rejection must stay\n// on the promise: a `.catch()` chained into it would resolve with `undefined`\n// and be mistaken for a loaded module. Handle it on the side instead, so an\n// aborted chunk load never escapes as an unhandled rejection.\nmarkdownRendererModulePromise?.catch(() => {});\nhtmlRendererModulePromise?.catch(() => {});\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n // Node-level analytics: record which content is resolved for display.\n // No-op (and dead-code-eliminated) when analytics is disabled.\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'text',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: rest.children,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' && editor.enabled ? (\n <ContentSelector {...rest} key={rest.children}>\n {rest.children}\n </ContentSelector>\n ) : (\n rest.children\n ),\n });\n },\n};\n\n/** ---------------------------------------------\n * PREACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type PreactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? VNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const preactNodePlugins: Plugins =\n process.env.INTLAYER_NODE_TYPE_PREACT_NODE === 'false'\n ? fallbackPlugin\n : {\n id: 'preact-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'preact-node',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: '[[preact-element]]',\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n {renderPreactElement(node)}\n </ContentSelector>\n ) : (\n renderPreactElement(node)\n ),\n });\n },\n };\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, _S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.INSERTION]: infer I; // Accept strings OR nested nodes like enumerations\n fields: readonly (infer F)[]; // Infer the exact string literals in the array\n}\n ? <V extends { [K in Extract<F, string>]: string | number | VNode }>(\n values: V\n ) => I extends string\n ? V[keyof V] extends string | number\n ? IntlayerNode<string>\n : IntlayerNode<VNode>\n : DeepTransformContent<I, L> // Delegate nested nodes (like enumerations) back to the core\n : never;\n\n/**\n * Check if a value is a Preact VNode\n */\nconst isVNode = (value: any): value is VNode => {\n return (\n value !== null &&\n value !== undefined &&\n typeof value !== 'string' &&\n typeof value !== 'number' &&\n typeof value !== 'boolean'\n );\n};\n\n/**\n * Split insertion string and join with Preact VNodes\n */\nconst splitAndJoinInsertion = (\n template: string,\n values: Record<string, string | number | VNode>\n): VNode => {\n // Check if any value is a VNode\n const hasVNode = Object.values(values).some(isVNode);\n\n if (!hasVNode) {\n // Simple string replacement\n return template.replace(/\\{\\{\\s*(.*?)\\s*\\}\\}/g, (_, key) => {\n const trimmedKey = key.trim();\n return (values[trimmedKey] ?? '').toString();\n }) as any;\n }\n\n // Split the template by placeholders while keeping the structure\n const parts: (string | VNode)[] = [];\n let lastIndex = 0;\n const regex = /\\{\\{\\s*(.*?)\\s*\\}\\}/g;\n let match: RegExpExecArray | null = regex.exec(template);\n\n while (match !== null) {\n // Add text before the placeholder\n if (match.index > lastIndex) {\n parts.push(template.substring(lastIndex, match.index));\n }\n\n // Add the replaced value\n const key = match[1].trim();\n const value = values[key];\n if (value !== undefined && value !== null) {\n parts.push(typeof value === 'number' ? String(value) : value);\n }\n\n lastIndex = match.index + match[0].length;\n match = regex.exec(template);\n }\n\n // Add remaining text\n if (lastIndex < template.length) {\n parts.push(template.substring(lastIndex));\n }\n\n // Return as Fragment\n return h(\n Fragment,\n null,\n ...parts.map((part, index) => h(Fragment, { key: index }, part))\n );\n};\n\n/** Insertion plugin for Preact. Handles component/node insertion. */\nexport const insertionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_INSERTION === 'false'\n ? fallbackPlugin\n : {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.INSERTION,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.INSERTION,\n },\n ];\n\n const children = node[NodeTypes.INSERTION];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) =>\n typeof node === 'string' || isInterpolableWrapperNode(node),\n transform: (node, subProps, deepTransformNode) => {\n // `html()`/`markdown()` nodes carry their `{{ … }}` placeholders\n // inside a raw string. Interpolate into that string, then re-run\n // the transform so the html/markdown renderer applies afterwards.\n // VNodes cannot be injected into a raw markup string, so string\n // interpolation (not `splitAndJoinInsertion`) is used here.\n if (isInterpolableWrapperNode(node)) {\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) =>\n transformInterpolableNode(\n node,\n values,\n subProps,\n props.plugins,\n deepTransformNode\n );\n }\n\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]:\n | string\n | number\n | VNode;\n }\n ) => {\n const result = splitAndJoinInsertion(transformedResult, values);\n\n return deepTransformNode(result, {\n ...subProps,\n plugins: props.plugins,\n children: result as any,\n });\n };\n },\n };\n\n const result = deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n\n if (\n typeof children === 'object' &&\n children !== null &&\n 'nodeType' in children &&\n [NodeTypes.ENUMERATION, NodeTypes.CONDITION].includes(\n children.nodeType as\n | typeof NodeTypes.ENUMERATION\n | typeof NodeTypes.CONDITION\n )\n ) {\n return (values: any) => (arg: any) => {\n const func = result as Function;\n const inner = func(arg);\n\n if (typeof inner === 'function') {\n return inner(values);\n }\n return inner;\n };\n }\n\n return result;\n },\n };\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<\n string,\n {\n metadata: DeepTransformContent<string>;\n use: (components?: HTMLComponents<'permissive', {}>) => VNode;\n }\n >\n : never;\n\n/**\n * Code-split renderers are loaded with `lazy` rather than a hand-rolled\n * suspender. A node that suspended on the hand-rolled one never recovered once\n * the chunk landed, so every markdown node present on the first paint stayed\n * blank forever; `lazy` implements the suspend/retry handshake correctly.\n */\nconst MarkdownSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownRendererPlugin as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\nconst MarkdownMetadataSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownMetadataRenderer as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node) ?? {};\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n const render = (components?: any) =>\n renderIntlayerNode({\n ...props,\n value: node,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n\n const element = render() as any;\n\n return new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return node;\n if (prop === Symbol.toPrimitive) return () => node;\n if (prop === 'toString') return () => node;\n if (prop === 'valueOf') return () => node;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(node);\n }\n if (prop === 'metadata') return metadataNodes;\n if (prop === 'use')\n return (components?: any) => render(components);\n return Reflect.get(target, prop);\n },\n }) as any;\n },\n };\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.MARKDOWN]: infer _M;\n metadata?: infer U;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => VNode;\n metadata: DeepTransformContent<U>;\n }\n : never;\n\nexport const markdownPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.MARKDOWN,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.MARKDOWN,\n },\n ];\n\n const children = node[NodeTypes.MARKDOWN];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n };\n\n/** ---------------------------------------------\n * HTML PLUGIN\n * --------------------------------------------- */\n\nexport type HTMLPluginCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.HTML]: infer I;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => IntlayerNode<I>;\n }\n : never;\n\nconst HTMLSuspenseRenderer = lazy(() =>\n htmlRendererModulePromise!.then((HTMLRenderer) => ({\n default: HTMLRenderer as FunctionComponent<Record<string, any>>,\n }))\n);\n\n/** HTML plugin. Replaces node with a function that takes components => VNode. */\nexport const htmlPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_HTML === 'false'\n ? fallbackPlugin\n : {\n id: 'html-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.HTML,\n transform: (node: HTMLContent<string>, props) => {\n const html = node[NodeTypes.HTML];\n const _tags = node.tags ?? [];\n // `children` is dropped deliberately: `HTMLRenderer` resolves its\n // content as `children || html`, so forwarding the raw node here would\n // shadow the HTML string and render nothing.\n const { plugins, children: _nodeChildren, ...rest } = props;\n\n // Type-safe render function that accepts properly typed components\n const render = (userComponents?: HTMLComponents): VNode =>\n renderIntlayerNode({\n ...rest,\n value: html,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled\n ? h(\n ContentSelector,\n { ...rest },\n h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n })\n )\n : h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n }),\n }) as any;\n\n const element = render() as any;\n\n const proxy = new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return html;\n if (prop === Symbol.toPrimitive) return () => html;\n if (prop === 'toString') return () => html;\n if (prop === 'valueOf') return () => html;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(html);\n }\n if (prop === 'use')\n return (userComponents?: HTMLComponents) =>\n render(userComponents);\n return Reflect.get(target, prop);\n },\n });\n\n return proxy;\n },\n };\n\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginPreact<T, S, L extends LocalesValues> {\n preactNode: PreactNodeCond<T>;\n preactIntlayerNode: IntlayerNodeCond<T>;\n preactInsertion: InsertionCond<T, S, L>;\n preactMarkdown: MarkdownCond<T>;\n preactHtml: HTMLPluginCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `preact-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = Omit<\n IInterpreterPluginStateCore,\n 'insertion' // Remove insertion type from core package\n> & {\n preactNode: true;\n preactIntlayerNode: true;\n preactInsertion: true;\n preactMarkdown: true;\n preactHtml: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\nconst pluginsCache = new Map<string, Plugins[]>();\n\n/**\n * Get the plugins array for Preact content transformation.\n * This function is used by both getIntlayer and getDictionary to ensure consistent plugin configuration.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => {\n const currentLocale = locale ?? internationalization.defaultLocale;\n const cacheKey = `${currentLocale}_${fallback}`;\n\n if (pluginsCache.has(cacheKey)) {\n return pluginsCache.get(cacheKey)!;\n }\n\n const plugins = [\n translationPlugin(\n locale ?? internationalization.defaultLocale,\n fallback ? internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n pluralPlugin(locale ?? internationalization.defaultLocale),\n conditionPlugin,\n nestedPlugin(locale ?? internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n selectPlugin,\n // Always include: handle plain strings/numbers and React elements\n intlayerNodePlugins,\n preactNodePlugins,\n insertionPlugin,\n markdownPlugin,\n htmlPlugin,\n ] as Plugins[];\n\n pluginsCache.set(cacheKey, plugins);\n\n return plugins;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,MAAM,gCACJ,QAAQ,IAAI,gCAAgC,+CACxC,0CAA4C,MAAM,OAAO;CACvD,wBAAwB,EAAE;CAC1B,0BAA0B,EAAE;AAC9B,EAAE,IACF;AAEN,MAAM,4BACJ,QAAQ,IAAI,4BAA4B,+CACpC,4BAA8B,MAAM,MAAM,EAAE,YAAY,IACxD;AAMN,+BAA+B,YAAY,CAAC,CAAC;AAC7C,2BAA2B,YAAY,CAAC,CAAC;;AAWzC,MAAa,sBAA+B;CAC1C,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;CAClB,YACE,OACA,EACE,SACA,GAAG,WAEF;EAGH,IAAI,QAAQ,IAAI,+BAA+B,SAC7C,8CAAe;GACb,eAAe,KAAK;GACpB,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,UAAU;EACZ,CAAC;EAGH,OAAOA,wCAAmB;GACxB,GAAG;GACH,OAAO,KAAK;GACZ,UACE,QAAQ,IAAI,4BAA4B,WAAWC,8BAAO,UACxD,0CAACC,gDAAD;IAAiB,GAAI;IAAM,KAAK,KAAK;GAEpB,GADd,KAAK,QACS,IAEjB,KAAK;EAEX,CAAC;CACH;AACF;;AAcA,MAAa,oBACX,QAAQ,IAAI,mCAAmC,UAC3CC,4CACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAChB,OAAO,KAAK,UAAU,eACtB,OAAO,KAAK,QAAQ;CAEtB,YACE,MACA,EACE,SACA,GAAG,WAEF;EACH,IAAI,QAAQ,IAAI,+BAA+B,S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;IACtB,GAAG;IACH;IACA,YAAY;GACd,CAAC,CACH,QACAA,UAAE,sBAAsB;IACtB,GAAG;IACH;IACA,YAAY;GACd,CAAC;EACT,CAAC;EAEH,MAAM,UAAU,OAAO;EAmBvB,OAAO,IAjBW,MAAM,SAAS,EAC/B,IAAI,QAAQ,MAAM;GAChB,IAAI,SAAS,SAAS,OAAO;GAC7B,IAAI,SAAS,OAAO,aAAa,aAAa;GAC9C,IAAI,SAAS,YAAY,aAAa;GACtC,IAAI,SAAS,WAAW,aAAa;GACrC,IAAI,OAAO,SAAS,YAAY,SAAS,eAAe;IACtD,MAAM,SAAU,OAAO,UAAkB;IACzC,IAAI,OAAO,WAAW,YAAY,OAAO,OAAO,KAAK,IAAI;GAC3D;GACA,IAAI,SAAS,OACX,QAAQ,mBACN,OAAO,cAAc;GACzB,OAAO,QAAQ,IAAI,QAAQ,IAAI;EACjC,EACF,CAEW;CACb;AACF;AAmCN,MAAM,+BAAe,IAAI,IAAuB;;;;;AAMhD,MAAa,cACX,QACA,WAAoB,SACN;CAEd,MAAM,WAAW,GADK,UAAUQ,4CAAqB,cACnB,GAAG;CAErC,IAAI,aAAa,IAAI,QAAQ,GAC3B,OAAO,aAAa,IAAI,QAAQ;CAGlC,MAAM,UAAU;MACdC,8CACE,UAAUD,4CAAqB,eAC/B,WAAWA,4CAAqB,gBAAgB,MAClD;EACAE;MACAC,yCAAa,UAAUH,4CAAqB,aAAa;EACzDI;MACAC,yCAAa,UAAUL,4CAAqB,aAAa;EACzDM;EACAC;EACAC;EAEA;EACA;EACA;EACA;EACA;CACF;CAEA,aAAa,IAAI,UAAU,OAAO;CAElC,OAAO;AACT"}
1
+ {"version":3,"file":"plugins.cjs","names":["renderIntlayerNode","editor","ContentSelector","fallbackPlugin","renderPreactElement","h","Fragment","NodeTypes","isInterpolableWrapperNode","transformInterpolableNode","resolveInsertedSelector","lazy","getMarkdownMetadata","internationalization","translationPlugin","enumerationPlugin","pluralPlugin","conditionPlugin","nestedPlugin","filePlugin","genderPlugin","selectPlugin"],"sources":["../../src/plugins.tsx"],"sourcesContent":["import { editor, internationalization } from '@intlayer/config/built';\nimport {\n conditionPlugin,\n type DeepTransformContent as DeepTransformContentCore,\n enumerationPlugin,\n fallbackPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n isInterpolableWrapperNode,\n nestedPlugin,\n type Plugins,\n pluralPlugin,\n resolveInsertedSelector,\n selectPlugin,\n transformInterpolableNode,\n translationPlugin,\n} from '@intlayer/core/interpreter';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport type {\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n} from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Fragment, type FunctionComponent, h, type VNode } from 'preact';\nimport { lazy } from 'preact/compat';\nimport { reportExposure } from './analytics/exposureSink';\nimport { ContentSelector } from './editor/ContentSelector';\nimport type { HTMLComponents } from './html/types';\nimport { type IntlayerNode, renderIntlayerNode } from './IntlayerNode';\nimport { renderPreactElement } from './preactElement/renderPreactElement';\n\nconst markdownRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN !== 'false'\n ? import('./markdown/MarkdownRendererPlugin').then((m) => ({\n MarkdownRendererPlugin: m.MarkdownRendererPlugin,\n MarkdownMetadataRenderer: m.MarkdownMetadataRenderer,\n }))\n : null;\n\nconst htmlRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_HTML !== 'false'\n ? import('./html/HTMLRenderer').then((m) => m.HTMLRenderer)\n : null;\n\n// These preloads are read later by `useLoadDynamic`, so the rejection must stay\n// on the promise: a `.catch()` chained into it would resolve with `undefined`\n// and be mistaken for a loaded module. Handle it on the side instead, so an\n// aborted chunk load never escapes as an unhandled rejection.\nmarkdownRendererModulePromise?.catch(() => {});\nhtmlRendererModulePromise?.catch(() => {});\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n // Node-level analytics: record which content is resolved for display.\n // No-op (and dead-code-eliminated) when analytics is disabled.\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'text',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: rest.children,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' && editor.enabled ? (\n <ContentSelector {...rest} key={rest.children}>\n {rest.children}\n </ContentSelector>\n ) : (\n rest.children\n ),\n });\n },\n};\n\n/** ---------------------------------------------\n * PREACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type PreactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? VNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const preactNodePlugins: Plugins =\n process.env.INTLAYER_NODE_TYPE_PREACT_NODE === 'false'\n ? fallbackPlugin\n : {\n id: 'preact-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'preact-node',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: '[[preact-element]]',\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n {renderPreactElement(node)}\n </ContentSelector>\n ) : (\n renderPreactElement(node)\n ),\n });\n },\n };\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, _S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.INSERTION]: infer I; // Accept strings OR nested nodes like enumerations\n fields: readonly (infer F)[]; // Infer the exact string literals in the array\n}\n ? <V extends { [K in Extract<F, string>]: string | number | VNode }>(\n values: V\n ) => I extends string\n ? V[keyof V] extends string | number\n ? IntlayerNode<string>\n : IntlayerNode<VNode>\n : DeepTransformContent<I, L> // Delegate nested nodes (like enumerations) back to the core\n : never;\n\n/**\n * Check if a value is a Preact VNode\n */\nconst isVNode = (value: any): value is VNode => {\n return (\n value !== null &&\n value !== undefined &&\n typeof value !== 'string' &&\n typeof value !== 'number' &&\n typeof value !== 'boolean'\n );\n};\n\n/**\n * Split insertion string and join with Preact VNodes\n */\nconst splitAndJoinInsertion = (\n template: string,\n values: Record<string, string | number | VNode>\n): VNode => {\n // Check if any value is a VNode\n const hasVNode = Object.values(values).some(isVNode);\n\n if (!hasVNode) {\n // Simple string replacement\n return template.replace(/\\{\\{\\s*(.*?)\\s*\\}\\}/g, (_, key) => {\n const trimmedKey = key.trim();\n return (values[trimmedKey] ?? '').toString();\n }) as any;\n }\n\n // Split the template by placeholders while keeping the structure\n const parts: (string | VNode)[] = [];\n let lastIndex = 0;\n const regex = /\\{\\{\\s*(.*?)\\s*\\}\\}/g;\n let match: RegExpExecArray | null = regex.exec(template);\n\n while (match !== null) {\n // Add text before the placeholder\n if (match.index > lastIndex) {\n parts.push(template.substring(lastIndex, match.index));\n }\n\n // Add the replaced value\n const key = match[1].trim();\n const value = values[key];\n if (value !== undefined && value !== null) {\n parts.push(typeof value === 'number' ? String(value) : value);\n }\n\n lastIndex = match.index + match[0].length;\n match = regex.exec(template);\n }\n\n // Add remaining text\n if (lastIndex < template.length) {\n parts.push(template.substring(lastIndex));\n }\n\n // Return as Fragment\n return h(\n Fragment,\n null,\n ...parts.map((part, index) => h(Fragment, { key: index }, part))\n );\n};\n\n/** Insertion plugin for Preact. Handles component/node insertion. */\nexport const insertionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_INSERTION === 'false'\n ? fallbackPlugin\n : {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.INSERTION,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.INSERTION,\n },\n ];\n\n const children = node[NodeTypes.INSERTION];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) =>\n typeof node === 'string' || isInterpolableWrapperNode(node),\n transform: (node, subProps, deepTransformNode) => {\n // `html()`/`markdown()` nodes carry their `{{ … }}` placeholders\n // inside a raw string. Interpolate into that string, then re-run\n // the transform so the html/markdown renderer applies afterwards.\n // VNodes cannot be injected into a raw markup string, so string\n // interpolation (not `splitAndJoinInsertion`) is used here.\n if (isInterpolableWrapperNode(node)) {\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) =>\n transformInterpolableNode(\n node,\n values,\n subProps,\n props.plugins,\n deepTransformNode\n );\n }\n\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]:\n | string\n | number\n | VNode;\n }\n ) => {\n const result = splitAndJoinInsertion(transformedResult, values);\n\n return deepTransformNode(result, {\n ...subProps,\n plugins: props.plugins,\n children: result as any,\n });\n };\n },\n };\n\n const result = deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n\n return resolveInsertedSelector(children, result);\n },\n };\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<\n string,\n {\n metadata: DeepTransformContent<string>;\n use: (components?: HTMLComponents<'permissive', {}>) => VNode;\n }\n >\n : never;\n\n/**\n * Code-split renderers are loaded with `lazy` rather than a hand-rolled\n * suspender. A node that suspended on the hand-rolled one never recovered once\n * the chunk landed, so every markdown node present on the first paint stayed\n * blank forever; `lazy` implements the suspend/retry handshake correctly.\n */\nconst MarkdownSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownRendererPlugin as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\nconst MarkdownMetadataSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownMetadataRenderer as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node) ?? {};\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n const render = (components?: any) =>\n renderIntlayerNode({\n ...props,\n value: node,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n\n const element = render() as any;\n\n return new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return node;\n if (prop === Symbol.toPrimitive) return () => node;\n if (prop === 'toString') return () => node;\n if (prop === 'valueOf') return () => node;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(node);\n }\n if (prop === 'metadata') return metadataNodes;\n if (prop === 'use')\n return (components?: any) => render(components);\n return Reflect.get(target, prop);\n },\n }) as any;\n },\n };\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.MARKDOWN]: infer _M;\n metadata?: infer U;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => VNode;\n metadata: DeepTransformContent<U>;\n }\n : never;\n\nexport const markdownPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.MARKDOWN,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.MARKDOWN,\n },\n ];\n\n const children = node[NodeTypes.MARKDOWN];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n };\n\n/** ---------------------------------------------\n * HTML PLUGIN\n * --------------------------------------------- */\n\nexport type HTMLPluginCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.HTML]: infer I;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => IntlayerNode<I>;\n }\n : never;\n\nconst HTMLSuspenseRenderer = lazy(() =>\n htmlRendererModulePromise!.then((HTMLRenderer) => ({\n default: HTMLRenderer as FunctionComponent<Record<string, any>>,\n }))\n);\n\n/** HTML plugin. Replaces node with a function that takes components => VNode. */\nexport const htmlPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_HTML === 'false'\n ? fallbackPlugin\n : {\n id: 'html-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.HTML,\n transform: (node: HTMLContent<string>, props) => {\n const html = node[NodeTypes.HTML];\n const _tags = node.tags ?? [];\n // `children` is dropped deliberately: `HTMLRenderer` resolves its\n // content as `children || html`, so forwarding the raw node here would\n // shadow the HTML string and render nothing.\n const { plugins, children: _nodeChildren, ...rest } = props;\n\n // Type-safe render function that accepts properly typed components\n const render = (userComponents?: HTMLComponents): VNode =>\n renderIntlayerNode({\n ...rest,\n value: html,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled\n ? h(\n ContentSelector,\n { ...rest },\n h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n })\n )\n : h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n }),\n }) as any;\n\n const element = render() as any;\n\n const proxy = new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return html;\n if (prop === Symbol.toPrimitive) return () => html;\n if (prop === 'toString') return () => html;\n if (prop === 'valueOf') return () => html;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(html);\n }\n if (prop === 'use')\n return (userComponents?: HTMLComponents) =>\n render(userComponents);\n return Reflect.get(target, prop);\n },\n });\n\n return proxy;\n },\n };\n\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginPreact<T, S, L extends LocalesValues> {\n preactNode: PreactNodeCond<T>;\n preactIntlayerNode: IntlayerNodeCond<T>;\n preactInsertion: InsertionCond<T, S, L>;\n preactMarkdown: MarkdownCond<T>;\n preactHtml: HTMLPluginCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `preact-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = Omit<\n IInterpreterPluginStateCore,\n 'insertion' // Remove insertion type from core package\n> & {\n preactNode: true;\n preactIntlayerNode: true;\n preactInsertion: true;\n preactMarkdown: true;\n preactHtml: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\nconst pluginsCache = new Map<string, Plugins[]>();\n\n/**\n * Get the plugins array for Preact content transformation.\n * This function is used by both getIntlayer and getDictionary to ensure consistent plugin configuration.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => {\n const currentLocale = locale ?? internationalization.defaultLocale;\n const cacheKey = `${currentLocale}_${fallback}`;\n\n if (pluginsCache.has(cacheKey)) {\n return pluginsCache.get(cacheKey)!;\n }\n\n const plugins = [\n translationPlugin(\n locale ?? internationalization.defaultLocale,\n fallback ? internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n pluralPlugin(locale ?? internationalization.defaultLocale),\n conditionPlugin,\n nestedPlugin(locale ?? internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n selectPlugin,\n // Always include: handle plain strings/numbers and React elements\n intlayerNodePlugins,\n preactNodePlugins,\n insertionPlugin,\n markdownPlugin,\n htmlPlugin,\n ] as Plugins[];\n\n pluginsCache.set(cacheKey, plugins);\n\n return plugins;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,MAAM,gCACJ,QAAQ,IAAI,gCAAgC,+CACxC,0CAA4C,MAAM,OAAO;CACvD,wBAAwB,EAAE;CAC1B,0BAA0B,EAAE;AAC9B,EAAE,IACF;AAEN,MAAM,4BACJ,QAAQ,IAAI,4BAA4B,+CACpC,4BAA8B,MAAM,MAAM,EAAE,YAAY,IACxD;AAMN,+BAA+B,YAAY,CAAC,CAAC;AAC7C,2BAA2B,YAAY,CAAC,CAAC;;AAWzC,MAAa,sBAA+B;CAC1C,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;CAClB,YACE,OACA,EACE,SACA,GAAG,WAEF;EAGH,IAAI,QAAQ,IAAI,+BAA+B,SAC7C,8CAAe;GACb,eAAe,KAAK;GACpB,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,UAAU;EACZ,CAAC;EAGH,OAAOA,wCAAmB;GACxB,GAAG;GACH,OAAO,KAAK;GACZ,UACE,QAAQ,IAAI,4BAA4B,WAAWC,8BAAO,UACxD,0CAACC,gDAAD;IAAiB,GAAI;IAAM,KAAK,KAAK;GAEpB,GADd,KAAK,QACS,IAEjB,KAAK;EAEX,CAAC;CACH;AACF;;AAcA,MAAa,oBACX,QAAQ,IAAI,mCAAmC,UAC3CC,4CACA;CACE,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAChB,OAAO,KAAK,UAAU,eACtB,OAAO,KAAK,QAAQ;CAEtB,YACE,MACA,EACE,SACA,GA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C/B,IAAI,QAAQ,MAAM;GAChB,IAAI,SAAS,SAAS,OAAO;GAC7B,IAAI,SAAS,OAAO,aAAa,aAAa;GAC9C,IAAI,SAAS,YAAY,aAAa;GACtC,IAAI,SAAS,WAAW,aAAa;GACrC,IAAI,OAAO,SAAS,YAAY,SAAS,eAAe;IACtD,MAAM,SAAU,OAAO,UAAkB;IACzC,IAAI,OAAO,WAAW,YAAY,OAAO,OAAO,KAAK,IAAI;GAC3D;GACA,IAAI,SAAS,OACX,QAAQ,mBACN,OAAO,cAAc;GACzB,OAAO,QAAQ,IAAI,QAAQ,IAAI;EACjC,EACF,CAEW;CACb;AACF;AAmCN,MAAM,+BAAe,IAAI,IAAuB;;;;;AAMhD,MAAa,cACX,QACA,WAAoB,SACN;CAEd,MAAM,WAAW,GADK,UAAUQ,4CAAqB,cACnB,GAAG;CAErC,IAAI,aAAa,IAAI,QAAQ,GAC3B,OAAO,aAAa,IAAI,QAAQ;CAGlC,MAAM,UAAU;MACdC,8CACE,UAAUD,4CAAqB,eAC/B,WAAWA,4CAAqB,gBAAgB,MAClD;EACAE;MACAC,yCAAa,UAAUH,4CAAqB,aAAa;EACzDI;MACAC,yCAAa,UAAUL,4CAAqB,aAAa;EACzDM;EACAC;EACAC;EAEA;EACA;EACA;EACA;EACA;CACF;CAEA,aAAa,IAAI,UAAU,OAAO;CAElC,OAAO;AACT"}
@@ -1,7 +1,7 @@
1
- import { setExposureSink } from "./exposureSink.mjs";
2
1
  import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
3
- import { useContext, useEffect, useRef } from "preact/hooks";
2
+ import { setExposureSink } from "./exposureSink.mjs";
4
3
  import { isEnabled } from "@intlayer/analytics/isEnabled";
4
+ import { useContext, useEffect, useRef } from "preact/hooks";
5
5
 
6
6
  //#region src/analytics/useAnalytics.tsx
7
7
  /**
@@ -1,5 +1,5 @@
1
- import { useCallback } from "preact/hooks";
2
1
  import { isEnabled } from "@intlayer/analytics/isEnabled";
2
+ import { useCallback } from "preact/hooks";
3
3
 
4
4
  //#region src/analytics/useConversion.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { useEffect, useState } from "preact/hooks";
2
1
  import { isEnabled } from "@intlayer/analytics/isEnabled";
2
+ import { useEffect, useState } from "preact/hooks";
3
3
 
4
4
  //#region src/analytics/useExperiment.ts
5
5
  /**
@@ -1,12 +1,12 @@
1
1
  import { EditorProvider } from "../editor/EditorProvider.mjs";
2
2
  import { localeInStorage, setLocaleInStorage } from "./useLocaleStorage.mjs";
3
3
  import { AnalyticsProvider } from "../analytics/AnalyticsProvider.mjs";
4
- import { internationalization } from "@intlayer/config/built";
5
- import { createContext } from "preact";
6
4
  import { useContext, useEffect, useState } from "preact/hooks";
7
- import { jsx, jsxs } from "preact/jsx-runtime";
5
+ import { internationalization } from "@intlayer/config/built";
8
6
  import { setIntlayerIdentifier } from "@intlayer/config/client";
9
7
  import { localeResolver } from "@intlayer/core/localization";
8
+ import { createContext } from "preact";
9
+ import { jsx, jsxs } from "preact/jsx-runtime";
10
10
 
11
11
  //#region src/client/IntlayerProvider.tsx
12
12
  /**
@@ -1,6 +1,6 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
- import { getTranslation } from "@intlayer/core/interpreter";
3
2
  import { useContext } from "preact/hooks";
3
+ import { getTranslation } from "@intlayer/core/interpreter";
4
4
 
5
5
  //#region src/client/t.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { getDictionary } from "../getDictionary.mjs";
2
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
+ import { getDictionary } from "../getDictionary.mjs";
3
3
  import { useContext, useMemo } from "preact/hooks";
4
4
  import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
2
  import { useDictionary } from "./useDictionary.mjs";
3
- import { internationalization } from "@intlayer/config/built";
4
3
  import { useContext, useMemo } from "preact/hooks";
4
+ import { internationalization } from "@intlayer/config/built";
5
5
 
6
6
  //#region src/client/useDictionaryAsync.ts
7
7
  /**
@@ -1,8 +1,8 @@
1
- import { getDictionary } from "../getDictionary.mjs";
2
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
+ import { getDictionary } from "../getDictionary.mjs";
3
3
  import { useLoadDynamic } from "./useLoadDynamic.mjs";
4
- import { internationalization } from "@intlayer/config/built";
5
4
  import { useContext } from "preact/hooks";
5
+ import { internationalization } from "@intlayer/config/built";
6
6
  import { getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryArgument, resolveQualifiedDynamicContent } from "@intlayer/core/dictionaryManipulator";
7
7
 
8
8
  //#region src/client/useDictionaryDynamic.ts
@@ -1,5 +1,5 @@
1
- import { getIntlayer } from "../getIntlayer.mjs";
2
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
+ import { getIntlayer } from "../getIntlayer.mjs";
3
3
  import { useContext, useMemo } from "preact/hooks";
4
4
  import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { setLocaleInStorage } from "./useLocaleStorage.mjs";
2
2
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
3
- import { internationalization } from "@intlayer/config/built";
4
3
  import { useContext } from "preact/hooks";
4
+ import { internationalization } from "@intlayer/config/built";
5
5
 
6
6
  //#region src/client/useLocale.ts
7
7
  const { defaultLocale, locales: availableLocales } = internationalization ?? {};
@@ -1,6 +1,6 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
- import { internationalization } from "@intlayer/config/built";
3
2
  import { useContext } from "preact/hooks";
3
+ import { internationalization } from "@intlayer/config/built";
4
4
 
5
5
  //#region src/client/useLocaleBase.ts
6
6
  const { defaultLocale, locales: availableLocales } = internationalization;
@@ -1,6 +1,6 @@
1
1
  import { IntlayerClientContext } from "./IntlayerProvider.mjs";
2
- import { getTranslation } from "@intlayer/core/interpreter";
3
2
  import { useContext, useMemo } from "preact/hooks";
3
+ import { getTranslation } from "@intlayer/core/interpreter";
4
4
 
5
5
  //#region src/client/useTraduction.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { isEnabled } from "@intlayer/editor/isEnabled";
2
1
  import { useEffect } from "preact/hooks";
2
+ import { isEnabled } from "@intlayer/editor/isEnabled";
3
3
  import { jsx } from "preact/jsx-runtime";
4
4
 
5
5
  //#region src/editor/ContentSelector.tsx
@@ -1,6 +1,6 @@
1
1
  import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
2
- import { isEnabled } from "@intlayer/editor/isEnabled";
3
2
  import { useContext, useEffect, useRef } from "preact/hooks";
3
+ import { isEnabled } from "@intlayer/editor/isEnabled";
4
4
 
5
5
  //#region src/editor/useEditor.tsx
6
6
  /**
@@ -1,11 +1,11 @@
1
- import { usePercentage } from "./usePercentage.mjs";
1
+ import { useCurrency } from "./useCurrency.mjs";
2
2
  import { useUnit } from "./useUnit.mjs";
3
+ import { useDate } from "./useDate.mjs";
3
4
  import { useCompact } from "./useCompact.mjs";
4
- import { useNumber } from "./useNumber.mjs";
5
5
  import { useIntl } from "./useIntl.mjs";
6
6
  import { useList } from "./useList.mjs";
7
- import { useCurrency } from "./useCurrency.mjs";
8
- import { useDate } from "./useDate.mjs";
7
+ import { useNumber } from "./useNumber.mjs";
8
+ import { usePercentage } from "./usePercentage.mjs";
9
9
  import { useRelativeTime } from "./useRelativeTime.mjs";
10
10
 
11
11
  export { useCompact, useCurrency, useDate, useIntl, useList, useNumber, usePercentage, useRelativeTime, useUnit };
@@ -1,5 +1,5 @@
1
- import { createContext } from "preact";
2
1
  import { useContext } from "preact/hooks";
2
+ import { createContext } from "preact";
3
3
  import { jsx } from "preact/jsx-runtime";
4
4
 
5
5
  //#region src/html/HTMLProvider.tsx
@@ -1,6 +1,6 @@
1
1
  import { useHTMLContext } from "./HTMLProvider.mjs";
2
- import { getHTML } from "@intlayer/core/interpreter";
3
2
  import { Fragment, h } from "preact";
3
+ import { getHTML } from "@intlayer/core/interpreter";
4
4
  import { VOID_HTML_ELEMENTS } from "@intlayer/core/transpiler";
5
5
 
6
6
  //#region src/html/HTMLRenderer.tsx
@@ -1,5 +1,3 @@
1
- import { getDictionary } from "./getDictionary.mjs";
2
- import { getIntlayer } from "./getIntlayer.mjs";
3
1
  import { localeCookie, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./client/useLocaleStorage.mjs";
4
2
  import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./client/IntlayerProvider.mjs";
5
3
  import { useAnalytics } from "./analytics/useAnalytics.mjs";
@@ -7,10 +5,12 @@ import { AnalyticsProvider } from "./analytics/AnalyticsProvider.mjs";
7
5
  import { useConversion } from "./analytics/useConversion.mjs";
8
6
  import { useExperiment } from "./analytics/useExperiment.mjs";
9
7
  import { t } from "./client/t.mjs";
8
+ import { getDictionary } from "./getDictionary.mjs";
10
9
  import { useDictionary } from "./client/useDictionary.mjs";
11
10
  import { useDictionaryAsync } from "./client/useDictionaryAsync.mjs";
12
11
  import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
13
12
  import { useDictionaryDynamic } from "./client/useDictionaryDynamic.mjs";
13
+ import { getIntlayer } from "./getIntlayer.mjs";
14
14
  import { useIntlayer } from "./client/useIntlayer.mjs";
15
15
  import { useLocale } from "./client/useLocale.mjs";
16
16
  import { useLocaleBase } from "./client/useLocaleBase.mjs";
@@ -1,6 +1,6 @@
1
1
  import { compileMarkdown } from "./compiler.mjs";
2
- import { createContext } from "preact";
3
2
  import { useContext } from "preact/hooks";
3
+ import { createContext } from "preact";
4
4
  import { jsx } from "preact/jsx-runtime";
5
5
 
6
6
  //#region src/markdown/MarkdownProvider.tsx
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { useLocale } from "../client/useLocale.mjs";
4
4
  import { useMarkdownContext } from "./MarkdownProvider.mjs";
5
- import { getMarkdownMetadata } from "@intlayer/core/markdown";
6
5
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
6
+ import { getMarkdownMetadata } from "@intlayer/core/markdown";
7
7
 
8
8
  //#region src/markdown/MarkdownRendererPlugin.tsx
9
9
  const MarkdownRendererPlugin = (props) => {
@@ -2,13 +2,13 @@ import { reportExposure } from "./analytics/exposureSink.mjs";
2
2
  import { ContentSelector } from "./editor/ContentSelector.mjs";
3
3
  import { renderIntlayerNode } from "./IntlayerNode.mjs";
4
4
  import { renderPreactElement } from "./preactElement/renderPreactElement.mjs";
5
- import { conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, selectPlugin, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
6
5
  import { editor, internationalization } from "@intlayer/config/built";
6
+ import { Fragment, createElement, h } from "preact";
7
+ import { jsx } from "preact/jsx-runtime";
8
+ import { conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, resolveInsertedSelector, selectPlugin, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
7
9
  import { getMarkdownMetadata } from "@intlayer/core/markdown";
8
10
  import * as NodeTypes from "@intlayer/types/nodeType";
9
- import { Fragment, createElement, h } from "preact";
10
11
  import { lazy } from "preact/compat";
11
- import { jsx } from "preact/jsx-runtime";
12
12
 
13
13
  //#region src/plugins.tsx
14
14
  const markdownRendererModulePromise = process.env.INTLAYER_NODE_TYPE_MARKDOWN !== "false" ? import("./markdown/MarkdownRendererPlugin.mjs").then((m) => ({
@@ -121,12 +121,7 @@ const insertionPlugin = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? f
121
121
  keyPath: newKeyPath,
122
122
  plugins: [insertionStringPlugin, ...props.plugins ?? []]
123
123
  });
124
- if (typeof children === "object" && children !== null && "nodeType" in children && [NodeTypes.ENUMERATION, NodeTypes.CONDITION].includes(children.nodeType)) return (values) => (arg) => {
125
- const inner = result(arg);
126
- if (typeof inner === "function") return inner(values);
127
- return inner;
128
- };
129
- return result;
124
+ return resolveInsertedSelector(children, result);
130
125
  }
131
126
  };
132
127
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.mjs","names":["func"],"sources":["../../src/plugins.tsx"],"sourcesContent":["import { editor, internationalization } from '@intlayer/config/built';\nimport {\n conditionPlugin,\n type DeepTransformContent as DeepTransformContentCore,\n enumerationPlugin,\n fallbackPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n isInterpolableWrapperNode,\n nestedPlugin,\n type Plugins,\n pluralPlugin,\n selectPlugin,\n transformInterpolableNode,\n translationPlugin,\n} from '@intlayer/core/interpreter';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport type {\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n} from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Fragment, type FunctionComponent, h, type VNode } from 'preact';\nimport { lazy } from 'preact/compat';\nimport { reportExposure } from './analytics/exposureSink';\nimport { ContentSelector } from './editor/ContentSelector';\nimport type { HTMLComponents } from './html/types';\nimport { type IntlayerNode, renderIntlayerNode } from './IntlayerNode';\nimport { renderPreactElement } from './preactElement/renderPreactElement';\n\nconst markdownRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN !== 'false'\n ? import('./markdown/MarkdownRendererPlugin').then((m) => ({\n MarkdownRendererPlugin: m.MarkdownRendererPlugin,\n MarkdownMetadataRenderer: m.MarkdownMetadataRenderer,\n }))\n : null;\n\nconst htmlRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_HTML !== 'false'\n ? import('./html/HTMLRenderer').then((m) => m.HTMLRenderer)\n : null;\n\n// These preloads are read later by `useLoadDynamic`, so the rejection must stay\n// on the promise: a `.catch()` chained into it would resolve with `undefined`\n// and be mistaken for a loaded module. Handle it on the side instead, so an\n// aborted chunk load never escapes as an unhandled rejection.\nmarkdownRendererModulePromise?.catch(() => {});\nhtmlRendererModulePromise?.catch(() => {});\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n // Node-level analytics: record which content is resolved for display.\n // No-op (and dead-code-eliminated) when analytics is disabled.\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'text',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: rest.children,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' && editor.enabled ? (\n <ContentSelector {...rest} key={rest.children}>\n {rest.children}\n </ContentSelector>\n ) : (\n rest.children\n ),\n });\n },\n};\n\n/** ---------------------------------------------\n * PREACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type PreactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? VNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const preactNodePlugins: Plugins =\n process.env.INTLAYER_NODE_TYPE_PREACT_NODE === 'false'\n ? fallbackPlugin\n : {\n id: 'preact-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'preact-node',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: '[[preact-element]]',\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n {renderPreactElement(node)}\n </ContentSelector>\n ) : (\n renderPreactElement(node)\n ),\n });\n },\n };\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, _S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.INSERTION]: infer I; // Accept strings OR nested nodes like enumerations\n fields: readonly (infer F)[]; // Infer the exact string literals in the array\n}\n ? <V extends { [K in Extract<F, string>]: string | number | VNode }>(\n values: V\n ) => I extends string\n ? V[keyof V] extends string | number\n ? IntlayerNode<string>\n : IntlayerNode<VNode>\n : DeepTransformContent<I, L> // Delegate nested nodes (like enumerations) back to the core\n : never;\n\n/**\n * Check if a value is a Preact VNode\n */\nconst isVNode = (value: any): value is VNode => {\n return (\n value !== null &&\n value !== undefined &&\n typeof value !== 'string' &&\n typeof value !== 'number' &&\n typeof value !== 'boolean'\n );\n};\n\n/**\n * Split insertion string and join with Preact VNodes\n */\nconst splitAndJoinInsertion = (\n template: string,\n values: Record<string, string | number | VNode>\n): VNode => {\n // Check if any value is a VNode\n const hasVNode = Object.values(values).some(isVNode);\n\n if (!hasVNode) {\n // Simple string replacement\n return template.replace(/\\{\\{\\s*(.*?)\\s*\\}\\}/g, (_, key) => {\n const trimmedKey = key.trim();\n return (values[trimmedKey] ?? '').toString();\n }) as any;\n }\n\n // Split the template by placeholders while keeping the structure\n const parts: (string | VNode)[] = [];\n let lastIndex = 0;\n const regex = /\\{\\{\\s*(.*?)\\s*\\}\\}/g;\n let match: RegExpExecArray | null = regex.exec(template);\n\n while (match !== null) {\n // Add text before the placeholder\n if (match.index > lastIndex) {\n parts.push(template.substring(lastIndex, match.index));\n }\n\n // Add the replaced value\n const key = match[1].trim();\n const value = values[key];\n if (value !== undefined && value !== null) {\n parts.push(typeof value === 'number' ? String(value) : value);\n }\n\n lastIndex = match.index + match[0].length;\n match = regex.exec(template);\n }\n\n // Add remaining text\n if (lastIndex < template.length) {\n parts.push(template.substring(lastIndex));\n }\n\n // Return as Fragment\n return h(\n Fragment,\n null,\n ...parts.map((part, index) => h(Fragment, { key: index }, part))\n );\n};\n\n/** Insertion plugin for Preact. Handles component/node insertion. */\nexport const insertionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_INSERTION === 'false'\n ? fallbackPlugin\n : {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.INSERTION,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.INSERTION,\n },\n ];\n\n const children = node[NodeTypes.INSERTION];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) =>\n typeof node === 'string' || isInterpolableWrapperNode(node),\n transform: (node, subProps, deepTransformNode) => {\n // `html()`/`markdown()` nodes carry their `{{ … }}` placeholders\n // inside a raw string. Interpolate into that string, then re-run\n // the transform so the html/markdown renderer applies afterwards.\n // VNodes cannot be injected into a raw markup string, so string\n // interpolation (not `splitAndJoinInsertion`) is used here.\n if (isInterpolableWrapperNode(node)) {\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) =>\n transformInterpolableNode(\n node,\n values,\n subProps,\n props.plugins,\n deepTransformNode\n );\n }\n\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]:\n | string\n | number\n | VNode;\n }\n ) => {\n const result = splitAndJoinInsertion(transformedResult, values);\n\n return deepTransformNode(result, {\n ...subProps,\n plugins: props.plugins,\n children: result as any,\n });\n };\n },\n };\n\n const result = deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n\n if (\n typeof children === 'object' &&\n children !== null &&\n 'nodeType' in children &&\n [NodeTypes.ENUMERATION, NodeTypes.CONDITION].includes(\n children.nodeType as\n | typeof NodeTypes.ENUMERATION\n | typeof NodeTypes.CONDITION\n )\n ) {\n return (values: any) => (arg: any) => {\n const func = result as Function;\n const inner = func(arg);\n\n if (typeof inner === 'function') {\n return inner(values);\n }\n return inner;\n };\n }\n\n return result;\n },\n };\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<\n string,\n {\n metadata: DeepTransformContent<string>;\n use: (components?: HTMLComponents<'permissive', {}>) => VNode;\n }\n >\n : never;\n\n/**\n * Code-split renderers are loaded with `lazy` rather than a hand-rolled\n * suspender. A node that suspended on the hand-rolled one never recovered once\n * the chunk landed, so every markdown node present on the first paint stayed\n * blank forever; `lazy` implements the suspend/retry handshake correctly.\n */\nconst MarkdownSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownRendererPlugin as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\nconst MarkdownMetadataSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownMetadataRenderer as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node) ?? {};\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n const render = (components?: any) =>\n renderIntlayerNode({\n ...props,\n value: node,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n\n const element = render() as any;\n\n return new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return node;\n if (prop === Symbol.toPrimitive) return () => node;\n if (prop === 'toString') return () => node;\n if (prop === 'valueOf') return () => node;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(node);\n }\n if (prop === 'metadata') return metadataNodes;\n if (prop === 'use')\n return (components?: any) => render(components);\n return Reflect.get(target, prop);\n },\n }) as any;\n },\n };\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.MARKDOWN]: infer _M;\n metadata?: infer U;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => VNode;\n metadata: DeepTransformContent<U>;\n }\n : never;\n\nexport const markdownPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.MARKDOWN,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.MARKDOWN,\n },\n ];\n\n const children = node[NodeTypes.MARKDOWN];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n };\n\n/** ---------------------------------------------\n * HTML PLUGIN\n * --------------------------------------------- */\n\nexport type HTMLPluginCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.HTML]: infer I;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => IntlayerNode<I>;\n }\n : never;\n\nconst HTMLSuspenseRenderer = lazy(() =>\n htmlRendererModulePromise!.then((HTMLRenderer) => ({\n default: HTMLRenderer as FunctionComponent<Record<string, any>>,\n }))\n);\n\n/** HTML plugin. Replaces node with a function that takes components => VNode. */\nexport const htmlPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_HTML === 'false'\n ? fallbackPlugin\n : {\n id: 'html-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.HTML,\n transform: (node: HTMLContent<string>, props) => {\n const html = node[NodeTypes.HTML];\n const _tags = node.tags ?? [];\n // `children` is dropped deliberately: `HTMLRenderer` resolves its\n // content as `children || html`, so forwarding the raw node here would\n // shadow the HTML string and render nothing.\n const { plugins, children: _nodeChildren, ...rest } = props;\n\n // Type-safe render function that accepts properly typed components\n const render = (userComponents?: HTMLComponents): VNode =>\n renderIntlayerNode({\n ...rest,\n value: html,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled\n ? h(\n ContentSelector,\n { ...rest },\n h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n })\n )\n : h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n }),\n }) as any;\n\n const element = render() as any;\n\n const proxy = new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return html;\n if (prop === Symbol.toPrimitive) return () => html;\n if (prop === 'toString') return () => html;\n if (prop === 'valueOf') return () => html;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(html);\n }\n if (prop === 'use')\n return (userComponents?: HTMLComponents) =>\n render(userComponents);\n return Reflect.get(target, prop);\n },\n });\n\n return proxy;\n },\n };\n\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginPreact<T, S, L extends LocalesValues> {\n preactNode: PreactNodeCond<T>;\n preactIntlayerNode: IntlayerNodeCond<T>;\n preactInsertion: InsertionCond<T, S, L>;\n preactMarkdown: MarkdownCond<T>;\n preactHtml: HTMLPluginCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `preact-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = Omit<\n IInterpreterPluginStateCore,\n 'insertion' // Remove insertion type from core package\n> & {\n preactNode: true;\n preactIntlayerNode: true;\n preactInsertion: true;\n preactMarkdown: true;\n preactHtml: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\nconst pluginsCache = new Map<string, Plugins[]>();\n\n/**\n * Get the plugins array for Preact content transformation.\n * This function is used by both getIntlayer and getDictionary to ensure consistent plugin configuration.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => {\n const currentLocale = locale ?? internationalization.defaultLocale;\n const cacheKey = `${currentLocale}_${fallback}`;\n\n if (pluginsCache.has(cacheKey)) {\n return pluginsCache.get(cacheKey)!;\n }\n\n const plugins = [\n translationPlugin(\n locale ?? internationalization.defaultLocale,\n fallback ? internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n pluralPlugin(locale ?? internationalization.defaultLocale),\n conditionPlugin,\n nestedPlugin(locale ?? internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n selectPlugin,\n // Always include: handle plain strings/numbers and React elements\n intlayerNodePlugins,\n preactNodePlugins,\n insertionPlugin,\n markdownPlugin,\n htmlPlugin,\n ] as Plugins[];\n\n pluginsCache.set(cacheKey, plugins);\n\n return plugins;\n};\n"],"mappings":";;;;;;;;;;;;;AAsCA,MAAM,gCACJ,QAAQ,IAAI,gCAAgC,UACxC,OAAO,wCAAoC,CAAC,MAAM,OAAO;CACvD,wBAAwB,EAAE;CAC1B,0BAA0B,EAAE;AAC9B,EAAE,IACF;AAEN,MAAM,4BACJ,QAAQ,IAAI,4BAA4B,UACpC,OAAO,0BAAsB,CAAC,MAAM,MAAM,EAAE,YAAY,IACxD;AAMN,+BAA+B,YAAY,CAAC,CAAC;AAC7C,2BAA2B,YAAY,CAAC,CAAC;;AAWzC,MAAa,sBAA+B;CAC1C,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;CAClB,YACE,OACA,EACE,SACA,GAAG,WAEF;EAGH,IAAI,QAAQ,IAAI,+BAA+B,SAC7C,eAAe;GACb,eAAe,KAAK;GACpB,SAAS,KAAK;GACd,QAAQ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,UAAU,qBAAqB,aAAa;EACzD;EACA,aAAa,UAAU,qBAAqB,aAAa;EACzD;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;CACF;CAEA,aAAa,IAAI,UAAU,OAAO;CAElC,OAAO;AACT"}
1
+ {"version":3,"file":"plugins.mjs","names":[],"sources":["../../src/plugins.tsx"],"sourcesContent":["import { editor, internationalization } from '@intlayer/config/built';\nimport {\n conditionPlugin,\n type DeepTransformContent as DeepTransformContentCore,\n enumerationPlugin,\n fallbackPlugin,\n filePlugin,\n genderPlugin,\n type IInterpreterPluginState as IInterpreterPluginStateCore,\n isInterpolableWrapperNode,\n nestedPlugin,\n type Plugins,\n pluralPlugin,\n resolveInsertedSelector,\n selectPlugin,\n transformInterpolableNode,\n translationPlugin,\n} from '@intlayer/core/interpreter';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport type {\n HTMLContent,\n InsertionContent,\n MarkdownContent,\n} from '@intlayer/core/transpiler';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { Fragment, type FunctionComponent, h, type VNode } from 'preact';\nimport { lazy } from 'preact/compat';\nimport { reportExposure } from './analytics/exposureSink';\nimport { ContentSelector } from './editor/ContentSelector';\nimport type { HTMLComponents } from './html/types';\nimport { type IntlayerNode, renderIntlayerNode } from './IntlayerNode';\nimport { renderPreactElement } from './preactElement/renderPreactElement';\n\nconst markdownRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN !== 'false'\n ? import('./markdown/MarkdownRendererPlugin').then((m) => ({\n MarkdownRendererPlugin: m.MarkdownRendererPlugin,\n MarkdownMetadataRenderer: m.MarkdownMetadataRenderer,\n }))\n : null;\n\nconst htmlRendererModulePromise =\n process.env.INTLAYER_NODE_TYPE_HTML !== 'false'\n ? import('./html/HTMLRenderer').then((m) => m.HTMLRenderer)\n : null;\n\n// These preloads are read later by `useLoadDynamic`, so the rejection must stay\n// on the promise: a `.catch()` chained into it would resolve with `undefined`\n// and be mistaken for a loaded module. Handle it on the side instead, so an\n// aborted chunk load never escapes as an unhandled rejection.\nmarkdownRendererModulePromise?.catch(() => {});\nhtmlRendererModulePromise?.catch(() => {});\n\n/** ---------------------------------------------\n * INTLAYER NODE PLUGIN\n * --------------------------------------------- */\n\nexport type IntlayerNodeCond<T> = T extends number | string\n ? IntlayerNode<T>\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const intlayerNodePlugins: Plugins = {\n id: 'intlayer-node-plugin',\n canHandle: (node) =>\n typeof node === 'bigint' ||\n typeof node === 'string' ||\n typeof node === 'number',\n transform: (\n _node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n // Node-level analytics: record which content is resolved for display.\n // No-op (and dead-code-eliminated) when analytics is disabled.\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'text',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: rest.children,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' && editor.enabled ? (\n <ContentSelector {...rest} key={rest.children}>\n {rest.children}\n </ContentSelector>\n ) : (\n rest.children\n ),\n });\n },\n};\n\n/** ---------------------------------------------\n * PREACT NODE PLUGIN\n * --------------------------------------------- */\n\nexport type PreactNodeCond<T> = T extends {\n props: any;\n key: any;\n}\n ? VNode\n : never;\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const preactNodePlugins: Plugins =\n process.env.INTLAYER_NODE_TYPE_PREACT_NODE === 'false'\n ? fallbackPlugin\n : {\n id: 'preact-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' &&\n typeof node.props !== 'undefined' &&\n typeof node.key !== 'undefined',\n\n transform: (\n node,\n {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n }\n ) => {\n if (process.env.INTLAYER_ANALYTICS_ENABLED !== 'false') {\n reportExposure({\n dictionaryKey: rest.dictionaryKey,\n keyPath: rest.keyPath,\n locale: rest.locale,\n nodeType: 'preact-node',\n });\n }\n\n return renderIntlayerNode({\n ...rest,\n value: '[[preact-element]]',\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n {renderPreactElement(node)}\n </ContentSelector>\n ) : (\n renderPreactElement(node)\n ),\n });\n },\n };\n\n/** ---------------------------------------------\n * INSERTION PLUGIN\n * --------------------------------------------- */\n\nexport type InsertionCond<T, _S, L extends LocalesValues> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.INSERTION]: infer I; // Accept strings OR nested nodes like enumerations\n fields: readonly (infer F)[]; // Infer the exact string literals in the array\n}\n ? <V extends { [K in Extract<F, string>]: string | number | VNode }>(\n values: V\n ) => I extends string\n ? V[keyof V] extends string | number\n ? IntlayerNode<string>\n : IntlayerNode<VNode>\n : DeepTransformContent<I, L> // Delegate nested nodes (like enumerations) back to the core\n : never;\n\n/**\n * Check if a value is a Preact VNode\n */\nconst isVNode = (value: any): value is VNode => {\n return (\n value !== null &&\n value !== undefined &&\n typeof value !== 'string' &&\n typeof value !== 'number' &&\n typeof value !== 'boolean'\n );\n};\n\n/**\n * Split insertion string and join with Preact VNodes\n */\nconst splitAndJoinInsertion = (\n template: string,\n values: Record<string, string | number | VNode>\n): VNode => {\n // Check if any value is a VNode\n const hasVNode = Object.values(values).some(isVNode);\n\n if (!hasVNode) {\n // Simple string replacement\n return template.replace(/\\{\\{\\s*(.*?)\\s*\\}\\}/g, (_, key) => {\n const trimmedKey = key.trim();\n return (values[trimmedKey] ?? '').toString();\n }) as any;\n }\n\n // Split the template by placeholders while keeping the structure\n const parts: (string | VNode)[] = [];\n let lastIndex = 0;\n const regex = /\\{\\{\\s*(.*?)\\s*\\}\\}/g;\n let match: RegExpExecArray | null = regex.exec(template);\n\n while (match !== null) {\n // Add text before the placeholder\n if (match.index > lastIndex) {\n parts.push(template.substring(lastIndex, match.index));\n }\n\n // Add the replaced value\n const key = match[1].trim();\n const value = values[key];\n if (value !== undefined && value !== null) {\n parts.push(typeof value === 'number' ? String(value) : value);\n }\n\n lastIndex = match.index + match[0].length;\n match = regex.exec(template);\n }\n\n // Add remaining text\n if (lastIndex < template.length) {\n parts.push(template.substring(lastIndex));\n }\n\n // Return as Fragment\n return h(\n Fragment,\n null,\n ...parts.map((part, index) => h(Fragment, { key: index }, part))\n );\n};\n\n/** Insertion plugin for Preact. Handles component/node insertion. */\nexport const insertionPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_INSERTION === 'false'\n ? fallbackPlugin\n : {\n id: 'insertion-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.INSERTION,\n transform: (node: InsertionContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.INSERTION,\n },\n ];\n\n const children = node[NodeTypes.INSERTION];\n\n /** Insertion string plugin. Replaces string node with a component that render the insertion. */\n const insertionStringPlugin: Plugins = {\n id: 'insertion-string-plugin',\n canHandle: (node) =>\n typeof node === 'string' || isInterpolableWrapperNode(node),\n transform: (node, subProps, deepTransformNode) => {\n // `html()`/`markdown()` nodes carry their `{{ … }}` placeholders\n // inside a raw string. Interpolate into that string, then re-run\n // the transform so the html/markdown renderer applies afterwards.\n // VNodes cannot be injected into a raw markup string, so string\n // interpolation (not `splitAndJoinInsertion`) is used here.\n if (isInterpolableWrapperNode(node)) {\n return (\n values: {\n [K in InsertionContent['fields'][number]]: string | number;\n }\n ) =>\n transformInterpolableNode(\n node,\n values,\n subProps,\n props.plugins,\n deepTransformNode\n );\n }\n\n const transformedResult = deepTransformNode(node, {\n ...subProps,\n children: node,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'intlayer-node-plugin'\n ),\n ],\n });\n\n return (\n values: {\n [K in InsertionContent['fields'][number]]:\n | string\n | number\n | VNode;\n }\n ) => {\n const result = splitAndJoinInsertion(transformedResult, values);\n\n return deepTransformNode(result, {\n ...subProps,\n plugins: props.plugins,\n children: result as any,\n });\n };\n },\n };\n\n const result = deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [insertionStringPlugin, ...(props.plugins ?? [])],\n });\n\n return resolveInsertedSelector(children, result);\n },\n };\n\n/**\n * MARKDOWN PLUGIN\n */\n\nexport type MarkdownStringCond<T> = T extends string\n ? IntlayerNode<\n string,\n {\n metadata: DeepTransformContent<string>;\n use: (components?: HTMLComponents<'permissive', {}>) => VNode;\n }\n >\n : never;\n\n/**\n * Code-split renderers are loaded with `lazy` rather than a hand-rolled\n * suspender. A node that suspended on the hand-rolled one never recovered once\n * the chunk landed, so every markdown node present on the first paint stayed\n * blank forever; `lazy` implements the suspend/retry handshake correctly.\n */\nconst MarkdownSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownRendererPlugin as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\nconst MarkdownMetadataSuspenseRenderer = lazy(() =>\n markdownRendererModulePromise!.then((modules) => ({\n default: modules.MarkdownMetadataRenderer as FunctionComponent<\n Record<string, any>\n >,\n }))\n);\n\n/** Markdown string plugin. Replaces string node with a component that render the markdown. */\nexport const markdownStringPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-string-plugin',\n canHandle: (node) => typeof node === 'string',\n transform: (node: string, props, deepTransformNode) => {\n const {\n plugins, // Removed to avoid next error - Functions cannot be passed directly to Client Components\n ...rest\n } = props;\n\n const metadata = getMarkdownMetadata(node) ?? {};\n\n const metadataPlugins: Plugins = {\n id: 'markdown-metadata-plugin',\n canHandle: (metadataNode) =>\n typeof metadataNode === 'string' ||\n typeof metadataNode === 'number' ||\n typeof metadataNode === 'boolean' ||\n !metadataNode,\n transform: (metadataNode, props) =>\n renderIntlayerNode({\n ...props,\n value: metadataNode,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownMetadataSuspenseRenderer\n {...rest}\n metadataKeyPath={props.keyPath}\n >\n {node}\n </MarkdownMetadataSuspenseRenderer>\n ),\n }),\n };\n\n // Transform metadata while keeping the same structure\n const metadataNodes = deepTransformNode(metadata, {\n plugins: [metadataPlugins],\n dictionaryKey: rest.dictionaryKey,\n keyPath: [],\n });\n\n const render = (components?: any) =>\n renderIntlayerNode({\n ...props,\n value: node,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled ? (\n <ContentSelector {...rest}>\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n </ContentSelector>\n ) : (\n <MarkdownSuspenseRenderer {...rest} components={components}>\n {node}\n </MarkdownSuspenseRenderer>\n ),\n additionalProps: {\n metadata: metadataNodes,\n },\n });\n\n const element = render() as any;\n\n return new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return node;\n if (prop === Symbol.toPrimitive) return () => node;\n if (prop === 'toString') return () => node;\n if (prop === 'valueOf') return () => node;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(node);\n }\n if (prop === 'metadata') return metadataNodes;\n if (prop === 'use')\n return (components?: any) => render(components);\n return Reflect.get(target, prop);\n },\n }) as any;\n },\n };\n\nexport type MarkdownCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.MARKDOWN]: infer _M;\n metadata?: infer U;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => VNode;\n metadata: DeepTransformContent<U>;\n }\n : never;\n\nexport const markdownPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_MARKDOWN === 'false'\n ? fallbackPlugin\n : {\n id: 'markdown-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.MARKDOWN,\n transform: (node: MarkdownContent, props, deepTransformNode) => {\n const newKeyPath: KeyPath[] = [\n ...props.keyPath,\n {\n type: NodeTypes.MARKDOWN,\n },\n ];\n\n const children = node[NodeTypes.MARKDOWN];\n\n return deepTransformNode(children, {\n ...props,\n children,\n keyPath: newKeyPath,\n plugins: [markdownStringPlugin, ...(props.plugins ?? [])],\n });\n },\n };\n\n/** ---------------------------------------------\n * HTML PLUGIN\n * --------------------------------------------- */\n\nexport type HTMLPluginCond<T> = T extends {\n nodeType: NodeType | string;\n [NodeTypes.HTML]: infer I;\n tags?: infer U;\n}\n ? {\n use: (components?: HTMLComponents<'permissive', U>) => IntlayerNode<I>;\n }\n : never;\n\nconst HTMLSuspenseRenderer = lazy(() =>\n htmlRendererModulePromise!.then((HTMLRenderer) => ({\n default: HTMLRenderer as FunctionComponent<Record<string, any>>,\n }))\n);\n\n/** HTML plugin. Replaces node with a function that takes components => VNode. */\nexport const htmlPlugin: Plugins =\n process.env.INTLAYER_NODE_TYPE_HTML === 'false'\n ? fallbackPlugin\n : {\n id: 'html-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeTypes.HTML,\n transform: (node: HTMLContent<string>, props) => {\n const html = node[NodeTypes.HTML];\n const _tags = node.tags ?? [];\n // `children` is dropped deliberately: `HTMLRenderer` resolves its\n // content as `children || html`, so forwarding the raw node here would\n // shadow the HTML string and render nothing.\n const { plugins, children: _nodeChildren, ...rest } = props;\n\n // Type-safe render function that accepts properly typed components\n const render = (userComponents?: HTMLComponents): VNode =>\n renderIntlayerNode({\n ...rest,\n value: html,\n children:\n process.env.INTLAYER_EDITOR_ENABLED !== 'false' &&\n editor.enabled\n ? h(\n ContentSelector,\n { ...rest },\n h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n })\n )\n : h(HTMLSuspenseRenderer, {\n ...rest,\n html,\n components: userComponents,\n }),\n }) as any;\n\n const element = render() as any;\n\n const proxy = new Proxy(element, {\n get(target, prop) {\n if (prop === 'value') return html;\n if (prop === Symbol.toPrimitive) return () => html;\n if (prop === 'toString') return () => html;\n if (prop === 'valueOf') return () => html;\n if (typeof prop === 'string' && prop !== 'constructor') {\n const method = (String.prototype as any)[prop];\n if (typeof method === 'function') return method.bind(html);\n }\n if (prop === 'use')\n return (userComponents?: HTMLComponents) =>\n render(userComponents);\n return Reflect.get(target, prop);\n },\n });\n\n return proxy;\n },\n };\n\n/** ---------------------------------------------\n * PLUGINS RESULT\n * --------------------------------------------- */\n\nexport interface IInterpreterPluginPreact<T, S, L extends LocalesValues> {\n preactNode: PreactNodeCond<T>;\n preactIntlayerNode: IntlayerNodeCond<T>;\n preactInsertion: InsertionCond<T, S, L>;\n preactMarkdown: MarkdownCond<T>;\n preactHtml: HTMLPluginCond<T>;\n}\n\n/**\n * Insert this type as param of `DeepTransformContent` to avoid `intlayer` package pollution.\n *\n * Otherwise the the `preact-intlayer` plugins will override the types of `intlayer` functions.\n */\nexport type IInterpreterPluginState = Omit<\n IInterpreterPluginStateCore,\n 'insertion' // Remove insertion type from core package\n> & {\n preactNode: true;\n preactIntlayerNode: true;\n preactInsertion: true;\n preactMarkdown: true;\n preactHtml: true;\n};\n\nexport type DeepTransformContent<\n T,\n L extends LocalesValues = DeclaredLocales,\n> = DeepTransformContentCore<T, IInterpreterPluginState, L>;\n\nconst pluginsCache = new Map<string, Plugins[]>();\n\n/**\n * Get the plugins array for Preact content transformation.\n * This function is used by both getIntlayer and getDictionary to ensure consistent plugin configuration.\n */\nexport const getPlugins = (\n locale?: LocalesValues,\n fallback: boolean = true\n): Plugins[] => {\n const currentLocale = locale ?? internationalization.defaultLocale;\n const cacheKey = `${currentLocale}_${fallback}`;\n\n if (pluginsCache.has(cacheKey)) {\n return pluginsCache.get(cacheKey)!;\n }\n\n const plugins = [\n translationPlugin(\n locale ?? internationalization.defaultLocale,\n fallback ? internationalization.defaultLocale : undefined\n ),\n enumerationPlugin,\n pluralPlugin(locale ?? internationalization.defaultLocale),\n conditionPlugin,\n nestedPlugin(locale ?? internationalization.defaultLocale),\n filePlugin,\n genderPlugin,\n selectPlugin,\n // Always include: handle plain strings/numbers and React elements\n intlayerNodePlugins,\n preactNodePlugins,\n insertionPlugin,\n markdownPlugin,\n htmlPlugin,\n ] as Plugins[];\n\n pluginsCache.set(cacheKey, plugins);\n\n return plugins;\n};\n"],"mappings":";;;;;;;;;;;;;AAuCA,MAAM,gCACJ,QAAQ,IAAI,gCAAgC,UACxC,OAAO,wCAAoC,CAAC,MAAM,OAAO;CACvD,wBAAwB,EAAE;CAC1B,0BAA0B,EAAE;AAC9B,EAAE,IACF;AAEN,MAAM,4BACJ,QAAQ,IAAI,4BAA4B,UACpC,OAAO,0BAAsB,CAAC,MAAM,MAAM,EAAE,YAAY,IACxD;AAMN,+BAA+B,YAAY,CAAC,CAAC;AAC7C,2BAA2B,YAAY,CAAC,CAAC;;AAWzC,MAAa,sBAA+B;CAC1C,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;CAClB,YACE,OACA,EACE,SACA,GAAG,WAEF;EAGH,IAAI,QAAQ,IAAI,+BAA+B,SAC7C,eAAe;GACb,eAAe,KAAK;GACpB,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,UAAU;EACZ,CAAC;EAGH,OAAO,mBAAmB;GACxB,GAAG;GACH,OAAO,KAAK;GACZ,UACE,QAAQ,IAAI,4BAA4B,WAAW,OAAO,UACxD,8BAAC,iBAAD;IAAiB,GAAI;IAAM,KAAK,KAAK;GAEpB,GADd,KAAK,QACS,IAEjB,KAAK;EAEX,CAAC;CACH;AACF;;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GI,UAAU;EACV,MAAM,aAAa,qCAAqC;;;qBA4BnD,sBAAsB;YAiGvB,aAAa,KAAK;EAC5B,UAAU;GACT,UAAU,iBAAiB;EAC5B,iBAAiB;EACjB,aAAa;;EAGT,MAAM,aAAa,6BAA6B,OAAO;EACvD,UAAU,qBAAqB;;qBAIxB,gBAAgB;;;;YA8BjB,eAAe,KAAK;EAC9B,UAAU;GACT,UAAU,aAAa;EACxB,aAAa;;EAGT,MAAM,aAAa,6BAA6B,OAAO,aAAa;;;qBAW7D,YAAY;;;;iBAkER,yBAAyB,GAAG,GAAG,UAAU;EACxD,YAAY,eAAe;EAC3B,oBAAoB,iBAAiB;EACrC,iBAAiB,cAAc,GAAG,GAAG;EACrC,gBAAgB,aAAa;EAC7B,YAAY,eAAe;;;;;;;YAQjB,0BAA0B,KACpC;EAGA;EACA;EACA;EACA;EACA;;YAGU,qBACV,GACA,UAAU,gBAAgB,mBACxB,uBAAyB,GAAG,yBAAyB;;;;;qBAQ5C,aAAU,SACZ,eAAa,uBAErB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "preact-intlayer",
3
- "version": "9.5.7",
3
+ "version": "9.5.9-canary.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Preact applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -101,12 +101,12 @@
101
101
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
102
102
  },
103
103
  "dependencies": {
104
- "@intlayer/api": "9.5.6",
105
- "@intlayer/config": "9.5.6",
106
- "@intlayer/core": "9.5.6",
107
- "@intlayer/editor": "9.5.7",
108
- "@intlayer/engine": "9.5.6",
109
- "@intlayer/types": "9.5.6"
104
+ "@intlayer/api": "9.5.8",
105
+ "@intlayer/config": "9.5.8",
106
+ "@intlayer/core": "9.5.8",
107
+ "@intlayer/editor": "9.5.8",
108
+ "@intlayer/engine": "9.5.8",
109
+ "@intlayer/types": "9.5.8"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@types/node": "^22",
@@ -123,7 +123,7 @@
123
123
  "preact": ">=8.0.0"
124
124
  },
125
125
  "optionalDependencies": {
126
- "@intlayer/analytics": "9.5.7"
126
+ "@intlayer/analytics": "9.5.8"
127
127
  },
128
128
  "engines": {
129
129
  "node": ">=14.18"