solid-intlayer 9.9.0 → 9.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/cjs/LoadingBoundary.cjs +1 -1
  2. package/dist/cjs/analytics/useAnalytics.cjs +1 -1
  3. package/dist/cjs/analytics/useConversion.cjs +1 -1
  4. package/dist/cjs/analytics/useExperiment.cjs +1 -1
  5. package/dist/cjs/client/IntlayerProvider.cjs +1 -1
  6. package/dist/cjs/client/getBrowserLocale.cjs +1 -1
  7. package/dist/cjs/client/t.cjs +1 -1
  8. package/dist/cjs/client/useDictionary.cjs +1 -1
  9. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  10. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  11. package/dist/cjs/client/useIntlayer.cjs +1 -1
  12. package/dist/cjs/client/useLoadDynamic.cjs +1 -1
  13. package/dist/cjs/client/useLocale.cjs +1 -1
  14. package/dist/cjs/client/useLocaleBase.cjs +1 -1
  15. package/dist/cjs/client/usePathname.cjs +1 -1
  16. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  17. package/dist/cjs/client/useTraduction.cjs +1 -1
  18. package/dist/cjs/editor/createEditedContentSource.cjs +1 -1
  19. package/dist/cjs/editor/useEditor.cjs +1 -1
  20. package/dist/cjs/format/useCompact.cjs +1 -1
  21. package/dist/cjs/format/useCurrency.cjs +1 -1
  22. package/dist/cjs/format/useDate.cjs +1 -1
  23. package/dist/cjs/format/useIntl.cjs +1 -1
  24. package/dist/cjs/format/useList.cjs +1 -1
  25. package/dist/cjs/format/useNumber.cjs +1 -1
  26. package/dist/cjs/format/usePercentage.cjs +1 -1
  27. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  28. package/dist/cjs/format/useUnit.cjs +1 -1
  29. package/dist/cjs/getDictionary.cjs +1 -1
  30. package/dist/cjs/getIntlayer.cjs +1 -1
  31. package/dist/cjs/html/HTMLProvider.cjs +1 -1
  32. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  33. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
  34. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  35. package/dist/cjs/plugins.cjs +1 -1
  36. package/dist/cjs/solidTypes.cjs +1 -0
  37. package/dist/esm/LoadingBoundary.mjs +3 -3
  38. package/dist/esm/analytics/useAnalytics.mjs +11 -11
  39. package/dist/esm/analytics/useConversion.mjs +1 -1
  40. package/dist/esm/analytics/useExperiment.mjs +7 -7
  41. package/dist/esm/client/IntlayerProvider.mjs +26 -26
  42. package/dist/esm/client/getBrowserLocale.mjs +21 -21
  43. package/dist/esm/client/t.mjs +5 -5
  44. package/dist/esm/client/useDictionary.mjs +17 -17
  45. package/dist/esm/client/useDictionaryAsync.mjs +7 -7
  46. package/dist/esm/client/useDictionaryDynamic.mjs +23 -23
  47. package/dist/esm/client/useIntlayer.mjs +8 -8
  48. package/dist/esm/client/useLoadDynamic.mjs +19 -19
  49. package/dist/esm/client/useLocale.mjs +10 -10
  50. package/dist/esm/client/useLocaleBase.mjs +6 -6
  51. package/dist/esm/client/usePathname.mjs +4 -4
  52. package/dist/esm/client/useRewriteURL.mjs +8 -8
  53. package/dist/esm/client/useTraduction.mjs +5 -5
  54. package/dist/esm/editor/createEditedContentSource.mjs +3 -3
  55. package/dist/esm/editor/useEditor.mjs +10 -10
  56. package/dist/esm/format/useCompact.mjs +6 -6
  57. package/dist/esm/format/useCurrency.mjs +6 -6
  58. package/dist/esm/format/useDate.mjs +10 -10
  59. package/dist/esm/format/useIntl.mjs +5 -5
  60. package/dist/esm/format/useList.mjs +6 -6
  61. package/dist/esm/format/useNumber.mjs +6 -6
  62. package/dist/esm/format/usePercentage.mjs +6 -6
  63. package/dist/esm/format/useRelativeTime.mjs +6 -6
  64. package/dist/esm/format/useUnit.mjs +6 -6
  65. package/dist/esm/getDictionary.mjs +4 -4
  66. package/dist/esm/getIntlayer.mjs +3 -3
  67. package/dist/esm/html/HTMLProvider.mjs +6 -6
  68. package/dist/esm/html/HTMLRenderer.mjs +14 -14
  69. package/dist/esm/markdown/MarkdownProvider.mjs +19 -19
  70. package/dist/esm/markdown/MarkdownRenderer.mjs +28 -28
  71. package/dist/esm/plugins.mjs +97 -97
  72. package/dist/esm/solidTypes.mjs +0 -0
  73. package/dist/{esm-BnFj8Txc.js → esm-YGODKOLP.js} +1 -1
  74. package/dist/{esm-hfQR-yiQ.mjs → esm-bdKnuomJ.mjs} +2 -2
  75. package/dist/solid/analytics/useAnalytics.jsx +3 -3
  76. package/dist/solid/analytics/useConversion.js +1 -1
  77. package/dist/solid/analytics/useExperiment.js +3 -3
  78. package/dist/solid/client/IntlayerProvider.jsx +4 -4
  79. package/dist/solid/client/getBrowserLocale.jsx +1 -1
  80. package/dist/solid/client/t.js +1 -1
  81. package/dist/solid/client/useDictionary.js +3 -3
  82. package/dist/solid/client/useDictionaryAsync.js +3 -3
  83. package/dist/solid/client/useDictionaryDynamic.js +2 -2
  84. package/dist/solid/client/useIntlayer.js +2 -2
  85. package/dist/solid/client/useLoadDynamic.js +1 -1
  86. package/dist/solid/client/useLocale.js +2 -2
  87. package/dist/solid/client/useLocaleBase.js +1 -1
  88. package/dist/solid/client/usePathname.js +2 -2
  89. package/dist/solid/client/useRewriteURL.js +2 -2
  90. package/dist/solid/client/useTraduction.js +2 -2
  91. package/dist/solid/editor/createEditedContentSource.js +2 -2
  92. package/dist/solid/editor/useEditor.jsx +2 -2
  93. package/dist/solid/{esm-BS5TZIsL.js → esm-1cHk4dPd.js} +2 -2
  94. package/dist/solid/format/useCompact.js +1 -1
  95. package/dist/solid/format/useCurrency.js +2 -2
  96. package/dist/solid/format/useDate.js +2 -2
  97. package/dist/solid/format/useIntl.js +2 -2
  98. package/dist/solid/format/useList.js +1 -1
  99. package/dist/solid/format/useNumber.js +2 -2
  100. package/dist/solid/format/usePercentage.js +2 -2
  101. package/dist/solid/format/useRelativeTime.js +2 -2
  102. package/dist/solid/format/useUnit.js +1 -1
  103. package/dist/solid/getDictionary.js +1 -1
  104. package/dist/solid/getIntlayer.js +1 -1
  105. package/dist/solid/html/HTMLProvider.jsx +1 -1
  106. package/dist/solid/html/HTMLRenderer.jsx +1 -1
  107. package/dist/solid/markdown/MarkdownProvider.jsx +1 -1
  108. package/dist/solid/markdown/MarkdownRenderer.jsx +3 -3
  109. package/dist/solid/plugins.jsx +5 -5
  110. package/dist/solid/solidTypes.js +0 -0
  111. package/dist/types/IntlayerNode.d.ts +4 -3
  112. package/dist/types/LoadingBoundary.d.ts +4 -3
  113. package/dist/types/client/useLocaleStorage.d.ts +4 -8
  114. package/dist/types/editor/ContentSelector.d.ts +4 -13
  115. package/dist/types/format/useIntl.d.ts +2 -1
  116. package/dist/types/html/HTMLRenderer.d.ts +4 -3
  117. package/dist/types/html/types.d.ts +5 -4
  118. package/dist/types/markdown/MarkdownProvider.d.ts +4 -3
  119. package/dist/types/markdown/MarkdownRenderer.d.ts +5 -4
  120. package/dist/types/markdown/compiler.d.ts +2 -2
  121. package/dist/types/plugins.d.ts +7 -7
  122. package/dist/types/solidCompat.d.ts +7 -1
  123. package/dist/types/solidElement/renderSolidElement.d.ts +2 -2
  124. package/dist/types/solidTypes.d.ts +15 -0
  125. package/package.json +13 -11
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "./IntlayerProvider.jsx";
2
1
  import { getTranslation } from "@intlayer/core/interpreter";
3
2
  import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "./IntlayerProvider.jsx";
4
4
  // src/client/t.ts
5
5
  /**
6
6
  * On the client side, this function returns the translation of the provided multilang content.
@@ -1,11 +1,11 @@
1
+ import { resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
2
+ import { collectTransformCacheWrites, deleteTransformCacheWrites } from "@intlayer/core/interpreter";
3
+ import { createMemo, onCleanup, useContext } from "solid-js";
1
4
  import { getDictionary as getDictionary$1 } from "../getDictionary.js";
2
5
  import { getPlugins } from "../plugins.jsx";
3
6
  import { createContentProxy } from "./contentProxy.js";
4
7
  import { IntlayerClientContext } from "./IntlayerProvider.jsx";
5
8
  import { unwrapLoadable } from "./useLoadDynamic.js";
6
- import { collectTransformCacheWrites, deleteTransformCacheWrites } from "@intlayer/core/interpreter";
7
- import { createMemo, onCleanup, useContext } from "solid-js";
8
- import { resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
9
9
  // src/client/useDictionary.ts
10
10
  /**
11
11
  * On the client side, Hook that transforms a dictionary (or qualified
@@ -1,8 +1,8 @@
1
- import { IntlayerClientContext } from "./IntlayerProvider.jsx";
2
- import { useDictionary } from "./useDictionary.js";
1
+ import { loadDynamicDictionary } from "@intlayer/core/dictionaryManipulator";
3
2
  import { resolveInterpreterLocale } from "@intlayer/core/interpreter";
4
3
  import { useContext } from "solid-js";
5
- import { loadDynamicDictionary } from "@intlayer/core/dictionaryManipulator";
4
+ import { IntlayerClientContext } from "./IntlayerProvider.jsx";
5
+ import { useDictionary } from "./useDictionary.js";
6
6
  // src/client/useDictionaryAsync.ts
7
7
  /**
8
8
  * On the server side, Hook that transform a dictionary and return the content
@@ -1,11 +1,11 @@
1
+ import { QUALIFIER_DYNAMIC_TYPES_KEY, getDictionarySelectorCacheKey, getDynamicChunkArgument, getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryRead, resolveDynamicContentAsync } from "@intlayer/core/dictionaryManipulator";
2
+ import { createMemo, useContext } from "solid-js";
1
3
  import { getDictionary } from "../getDictionary.js";
2
4
  import { createAsyncValue, trackAsyncValue } from "../solidCompat.js";
3
5
  import { createContentProxy } from "./contentProxy.js";
4
6
  import { IntlayerClientContext } from "./IntlayerProvider.jsx";
5
7
  import { useDictionary } from "./useDictionary.js";
6
8
  import { seedDynamicValue, useLoadDynamic } from "./useLoadDynamic.js";
7
- import { createMemo, useContext } from "solid-js";
8
- import { QUALIFIER_DYNAMIC_TYPES_KEY, getDictionarySelectorCacheKey, getDynamicChunkArgument, getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryRead, resolveDynamicContentAsync } from "@intlayer/core/dictionaryManipulator";
9
9
  // src/client/useDictionaryDynamic.ts
10
10
  /**
11
11
  * Loaded chunks stay raw (serializable for hydration) and are interpreted
@@ -1,8 +1,8 @@
1
+ import { resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
2
+ import { createMemo, useContext } from "solid-js";
1
3
  import { getIntlayer } from "../getIntlayer.js";
2
4
  import { createContentProxy } from "./contentProxy.js";
3
5
  import { IntlayerClientContext } from "./IntlayerProvider.jsx";
4
- import { createMemo, useContext } from "solid-js";
5
- import { resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
6
6
  // src/client/useIntlayer.ts
7
7
  /**
8
8
  * Solid hook that picks one dictionary by its key and returns its reactive content.
@@ -1,6 +1,6 @@
1
+ import { untrack } from "solid-js";
1
2
  import { PROXY_RESERVED_KEYS } from "../proxyKeys.js";
2
3
  import { createAsyncValue, trackAsyncValue } from "../solidCompat.js";
3
- import { untrack } from "solid-js";
4
4
  // src/client/useLoadDynamic.ts
5
5
  var NO_PENDING_PRIMITIVE_FALLBACK = Symbol("NO_PENDING_PRIMITIVE_FALLBACK");
6
6
  /**
@@ -1,8 +1,8 @@
1
+ import { internationalization } from "@intlayer/config/built";
2
+ import { useContext } from "solid-js";
1
3
  import { createChangeEffect } from "../solidCompat.js";
2
4
  import { IntlayerClientContext } from "./IntlayerProvider.jsx";
3
5
  import { setLocaleInStorage } from "./useLocaleStorage.js";
4
- import { internationalization } from "@intlayer/config/built";
5
- import { useContext } from "solid-js";
6
6
  // src/client/useLocale.ts
7
7
  var { defaultLocale, locales: availableLocales } = internationalization ?? {};
8
8
  /**
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "./IntlayerProvider.jsx";
2
1
  import { internationalization } from "@intlayer/config/built";
3
2
  import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "./IntlayerProvider.jsx";
4
4
  // src/client/useLocaleBase.ts
5
5
  var { defaultLocale, locales: availableLocales } = internationalization;
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { onMounted } from "../solidCompat.js";
2
- import { createSignal } from "solid-js";
3
1
  import { getPathWithoutLocale } from "@intlayer/core/localization";
2
+ import { createSignal } from "solid-js";
3
+ import { onMounted } from "../solidCompat.js";
4
4
  // src/client/usePathname.ts
5
5
  /**
6
6
  * Solid hook that returns an accessor containing the current pathname with
@@ -1,7 +1,7 @@
1
- import { createWatchEffect } from "../solidCompat.js";
2
- import { useLocale } from "./useLocale.js";
3
1
  import { routing } from "@intlayer/config/built";
4
2
  import { getRewritePath } from "@intlayer/core/localization";
3
+ import { createWatchEffect } from "../solidCompat.js";
4
+ import { useLocale } from "./useLocale.js";
5
5
  // src/client/useRewriteURL.ts
6
6
  /**
7
7
  * Client-side hook to manage URL rewrites in Solid without triggering a router navigation.
@@ -1,7 +1,7 @@
1
- import { IntlayerClientContext } from "./IntlayerProvider.jsx";
2
- import { getTranslation } from "@intlayer/core/interpreter";
3
1
  import { internationalization } from "@intlayer/config/built";
2
+ import { getTranslation } from "@intlayer/core/interpreter";
4
3
  import { useContext } from "solid-js";
4
+ import { IntlayerClientContext } from "./IntlayerProvider.jsx";
5
5
  // src/client/useTraduction.ts
6
6
  /**
7
7
  * On the client side, Hook that picking one dictionary by its id and return the content.
@@ -1,6 +1,6 @@
1
- import { createWatchEffect } from "../solidCompat.js";
2
- import { createSignal } from "solid-js";
3
1
  import { isEnabled } from "@intlayer/editor/isEnabled";
2
+ import { createSignal } from "solid-js";
3
+ import { createWatchEffect } from "../solidCompat.js";
4
4
  // src/editor/createEditedContentSource.ts
5
5
  /**
6
6
  * Tracks the source string edited in the visual editor for a markdown / html
@@ -1,7 +1,7 @@
1
+ import { isEnabled } from "@intlayer/editor/isEnabled";
2
+ import { createSignal, onCleanup } from "solid-js";
1
3
  import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
2
4
  import { createWatchEffect, onMounted } from "../solidCompat.js";
3
- import { createSignal, onCleanup } from "solid-js";
4
- import { isEnabled } from "@intlayer/editor/isEnabled";
5
5
  // src/editor/useEditor.tsx
6
6
  /**
7
7
  * Initialises the Intlayer editor client singleton when the editor is enabled.
@@ -45,7 +45,7 @@ var buildContentExposure = (params) => ({
45
45
  * hashString('session-1:homepage-hero'); // 3039336720
46
46
  */
47
47
  var hashString = (input) => {
48
- let hash = 2166136261;
48
+ let hash = 0x811c9dc5;
49
49
  for (let index = 0; index < input.length; index++) {
50
50
  hash ^= input.charCodeAt(index);
51
51
  hash = Math.imul(hash, 16777619);
@@ -170,7 +170,7 @@ var createEventBuffer = ({ max }) => {
170
170
  var isSampledIn = (sessionId, sampleRate) => {
171
171
  if (sampleRate >= 1) return true;
172
172
  if (sampleRate <= 0) return false;
173
- return hashString(sessionId) / 4294967295 < sampleRate;
173
+ return hashString(sessionId) / 0xffffffff < sampleRate;
174
174
  };
175
175
  // ../@intlayer/analytics/dist/esm/core/session.mjs
176
176
  /**
@@ -1,5 +1,5 @@
1
- import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
2
1
  import { compact } from "@intlayer/core/formatters";
2
+ import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
3
3
  // src/format/useCompact.ts
4
4
  /**
5
5
  * Solid client hook that provides a localized compact number formatter.
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
2
- import { useContext } from "solid-js";
3
1
  import { currency } from "@intlayer/core/formatters";
2
+ import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
4
4
  // src/format/useCurrency.ts
5
5
  /**
6
6
  * Solid client hook that provides a localized currency formatter.
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
2
- import { useContext } from "solid-js";
3
1
  import { date, presets } from "@intlayer/core/formatters";
2
+ import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
4
4
  // src/format/useDate.ts
5
5
  /**
6
6
  * Solid client hook that provides a localized date/time formatter.
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
2
- import { createMemo, useContext } from "solid-js";
3
1
  import { bindIntl } from "@intlayer/core/formatters";
2
+ import { createMemo, useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
4
4
  // src/format/useIntl.ts
5
5
  /**
6
6
  * Solid client hook that provides a locale-bound `Intl` object.
@@ -1,5 +1,5 @@
1
- import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
2
1
  import { list } from "@intlayer/core/formatters";
2
+ import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
3
3
  // src/format/useList.ts
4
4
  /**
5
5
  * Solid client hook that provides a localized list formatter.
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
2
- import { useContext } from "solid-js";
3
1
  import { number } from "@intlayer/core/formatters";
2
+ import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
4
4
  // src/format/useNumber.ts
5
5
  /**
6
6
  * Solid client hook that provides a localized number formatter.
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
2
- import { useContext } from "solid-js";
3
1
  import { percentage } from "@intlayer/core/formatters";
2
+ import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
4
4
  // src/format/usePercentage.ts
5
5
  /**
6
6
  * Solid client hook that provides a localized percentage formatter.
@@ -1,6 +1,6 @@
1
- import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
2
- import { useContext } from "solid-js";
3
1
  import { relativeTime } from "@intlayer/core/formatters";
2
+ import { useContext } from "solid-js";
3
+ import { IntlayerClientContext } from "../client/IntlayerProvider.jsx";
4
4
  // src/format/useRelativeTime.ts
5
5
  /**
6
6
  * Solid client hook that provides a localized relative time formatter.
@@ -1,5 +1,5 @@
1
- import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
2
1
  import { units } from "@intlayer/core/formatters";
2
+ import { useIntlayerContext } from "../client/IntlayerProvider.jsx";
3
3
  // src/format/useUnit.ts
4
4
  /**
5
5
  * Solid client hook that provides a localized unit formatter.
@@ -1,5 +1,5 @@
1
- import { getPlugins } from "./plugins.jsx";
2
1
  import { getDictionary as getDictionary$1 } from "@intlayer/core/interpreter";
2
+ import { getPlugins } from "./plugins.jsx";
3
3
  // src/getDictionary.ts
4
4
  /**
5
5
  * Transforms a dictionary (or qualified dictionary group) and returns its
@@ -1,5 +1,5 @@
1
- import { getPlugins } from "./plugins.jsx";
2
1
  import { getIntlayer as getIntlayer$1 } from "@intlayer/core/interpreter";
2
+ import { getPlugins } from "./plugins.jsx";
3
3
  // src/getIntlayer.ts
4
4
  /**
5
5
  * Picks one dictionary by its key and returns its content for the given
@@ -1,5 +1,5 @@
1
- import { getContextProvider } from "../solidCompat.js";
2
1
  import { createContext, useContext } from "solid-js";
2
+ import { getContextProvider } from "../solidCompat.js";
3
3
  // src/html/HTMLProvider.tsx
4
4
  /**
5
5
  * `null` outside a provider. An explicit default keeps `useContext` from
@@ -1,6 +1,6 @@
1
- import { useHTMLContext } from "./HTMLProvider.jsx";
2
1
  import { getHTML } from "@intlayer/core/interpreter";
3
2
  import { VOID_HTML_ELEMENTS } from "@intlayer/core/transpiler";
3
+ import { useHTMLContext } from "./HTMLProvider.jsx";
4
4
  // src/html/HTMLRenderer.tsx
5
5
  /**
6
6
  * Renders HTML-like content to JSX with the provided components.
@@ -1,6 +1,6 @@
1
+ import { createContext, useContext } from "solid-js";
1
2
  import { getContextProvider } from "../solidCompat.js";
2
3
  import { compileMarkdown } from "./compiler.jsx";
3
- import { createContext, useContext } from "solid-js";
4
4
  // src/markdown/MarkdownProvider.tsx
5
5
  /**
6
6
  * `null` outside a provider. An explicit default keeps `useContext` from
@@ -1,11 +1,11 @@
1
+ import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
2
+ import { getMarkdownMetadata } from "@intlayer/core/markdown";
3
+ import { createMemo, useContext } from "solid-js";
1
4
  import { createEditedContentSource } from "../editor/createEditedContentSource.js";
2
5
  import { LoadingBoundary } from "../LoadingBoundary.jsx";
3
6
  import { createAsyncValue } from "../solidCompat.js";
4
7
  import { compileMarkdown } from "./compiler.jsx";
5
8
  import { MarkdownContext, useMarkdown } from "./MarkdownProvider.jsx";
6
- import { getMarkdownMetadata } from "@intlayer/core/markdown";
7
- import { createMemo, useContext } from "solid-js";
8
- import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
9
9
  // src/markdown/MarkdownRenderer.tsx
10
10
  var renderMarkdown = (content, options = {}) => {
11
11
  return compileMarkdown(content, options);
@@ -1,12 +1,12 @@
1
+ import { editor, internationalization } from "@intlayer/config/built";
2
+ import { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, resolveInterpreterLocale, selectPlugin, splitInsertionTemplate, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
3
+ import { getMarkdownMetadata } from "@intlayer/core/markdown";
4
+ import * as NodeTypes from "@intlayer/types/nodeType";
1
5
  import { reportExposure } from "./analytics/exposureSink.js";
2
6
  import { renderIntlayerNode } from "./IntlayerNode.jsx";
3
7
  import { LoadingBoundary } from "./LoadingBoundary.jsx";
4
8
  import { lazyComponent } from "./solidCompat.js";
5
9
  import { renderSolidElement } from "./solidElement/renderSolidElement.jsx";
6
- import { bindInsertedValues, conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, resolveInterpreterLocale, selectPlugin, splitInsertionTemplate, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
7
- import { editor, internationalization } from "@intlayer/config/built";
8
- import { getMarkdownMetadata } from "@intlayer/core/markdown";
9
- import * as NodeTypes from "@intlayer/types/nodeType";
10
10
  // src/plugins.tsx
11
11
  var LazyContentSelector = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : lazyComponent(() => import("./editor/ContentSelector.jsx").then((m) => ({ default: m.ContentSelector })));
12
12
  var markdownRendererModulePromise = process.env.INTLAYER_NODE_TYPE_MARKDOWN !== "false" ? import("./markdown/MarkdownRenderer.jsx").then((m) => ({
@@ -180,7 +180,7 @@ var markdownPlugin = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? fallb
180
180
  }
181
181
  };
182
182
  var HTMLSuspenseRenderer = lazyComponent(() => htmlRendererModulePromise.then((HTMLRenderer) => ({ default: HTMLRenderer })));
183
- /** HTML plugin. Replaces node with a function that takes components => JSX.Element. */
183
+ /** HTML plugin. Replaces node with a function that takes components => SolidElement. */
184
184
  var htmlPlugin = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? fallbackPlugin : {
185
185
  id: "html-plugin",
186
186
  canHandle: (node) => typeof node === "object" && node?.nodeType === NodeTypes.HTML,
File without changes
@@ -1,6 +1,7 @@
1
1
  import { NodeProps } from '@intlayer/core/interpreter';
2
2
  import { ResolvedEditor } from '@intlayer/types/module_augmentation';
3
- import { JSX, ParentProps } from 'solid-js';
3
+ import { ParentProps } from 'solid-js';
4
+ import { SolidElement } from './solidTypes';
4
5
  /**
5
6
  * Content node returned by `useIntlayer`.
6
7
  *
@@ -11,12 +12,12 @@ import { JSX, ParentProps } from 'solid-js';
11
12
  */
12
13
  export type IntlayerNode<T = NodeProps['children'], AdditionalProps = unknown> = ResolvedEditor<T & {
13
14
  value: T;
14
- } & AdditionalProps, JSX.Element & {
15
+ } & AdditionalProps, SolidElement & {
15
16
  value: T;
16
17
  } & AdditionalProps>;
17
18
  type RenderIntlayerNodeProps<T> = ParentProps<{
18
19
  value: T;
19
- children: JSX.Element;
20
+ children: SolidElement;
20
21
  additionalProps?: Record<string, unknown>;
21
22
  }>;
22
23
  export declare const renderIntlayerNode: <T>({ children, value, additionalProps, }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
@@ -1,7 +1,8 @@
1
- import { Component, JSX } from 'solid-js';
1
+ import { Component } from 'solid-js';
2
+ import { SolidElement } from './solidTypes';
2
3
  export type LoadingBoundaryProps = {
3
- fallback?: JSX.Element;
4
- children: JSX.Element;
4
+ fallback?: SolidElement;
5
+ children: SolidElement;
5
6
  };
6
7
  /**
7
8
  * Shows `fallback` while async reads below it are pending: `Suspense` in
@@ -1,4 +1,6 @@
1
+ import { LocaleStorageClient } from '@intlayer/core/utils';
1
2
  import { LocalesValues } from '@intlayer/types/module_augmentation';
3
+ import { Accessor } from 'solid-js';
2
4
  /**
3
5
  * Reads the locale persisted in the browser storage (cookie, localStorage…).
4
6
  *
@@ -32,10 +34,7 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled?:
32
34
  /**
33
35
  * Hook that provides the locale storage and a function to set it
34
36
  */
35
- export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('solid-js').SourceAccessor<{
36
- getLocale: () => import('@intlayer/types').Locale;
37
- setLocale: (locale: LocalesValues) => void;
38
- }>;
37
+ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => Accessor<ReturnType<typeof LocaleStorageClient>>;
39
38
  /**
40
39
  * @deprecated Use useLocaleStorage instead
41
40
  *
@@ -43,7 +42,4 @@ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('so
43
42
  *
44
43
  * Hook that provides the locale cookie and a function to set it
45
44
  */
46
- export declare const useLocaleCookie: (isCookieEnabled?: boolean) => import('solid-js').SourceAccessor<{
47
- getLocale: () => import('@intlayer/types').Locale;
48
- setLocale: (locale: LocalesValues) => void;
49
- }>;
45
+ export declare const useLocaleCookie: (isCookieEnabled?: boolean) => Accessor<ReturnType<typeof LocaleStorageClient>>;
@@ -1,16 +1,7 @@
1
1
  import { NodeProps } from '@intlayer/core/interpreter';
2
- import { Component, JSX } from 'solid-js';
3
- declare module 'solid-js' {
4
- namespace JSX {
5
- interface IntrinsicElements {
6
- 'intlayer-content-selector-wrapper': JSX.HTMLAttributes<HTMLElement> & {
7
- 'key-path'?: string;
8
- 'dictionary-key'?: string;
9
- };
10
- }
11
- }
12
- }
13
- export type ContentSelectorWrapperProps = NodeProps & Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children'> & {
14
- children?: JSX.Element;
2
+ import { Component } from 'solid-js';
3
+ import { IntrinsicElementProps, SolidElement } from '../solidTypes';
4
+ export type ContentSelectorWrapperProps = NodeProps & Omit<IntrinsicElementProps<'div'>, 'children'> & {
5
+ children?: SolidElement;
15
6
  };
16
7
  export declare const ContentSelector: Component<ContentSelectorWrapperProps>;
@@ -1,5 +1,6 @@
1
1
  import { WrappedIntl } from '@intlayer/core/formatters';
2
2
  import { LocalesValues } from '@intlayer/types/module_augmentation';
3
+ import { Accessor } from 'solid-js';
3
4
  /**
4
5
  * Solid client hook that provides a locale-bound `Intl` object.
5
6
  *
@@ -18,4 +19,4 @@ import { LocalesValues } from '@intlayer/types/module_augmentation';
18
19
  * }).format(123.45);
19
20
  * ```
20
21
  */
21
- export declare const useIntl: (locale?: LocalesValues) => import('solid-js').SourceAccessor<WrappedIntl>;
22
+ export declare const useIntl: (locale?: LocalesValues) => Accessor<WrappedIntl>;
@@ -1,5 +1,6 @@
1
1
  import { KeyPath } from '@intlayer/types/keyPath';
2
- import { Component, JSX } from 'solid-js';
2
+ import { Component } from 'solid-js';
3
+ import { SolidElement } from '../solidTypes';
3
4
  import { HTMLComponents } from './types';
4
5
  export type RenderHTMLProps = {
5
6
  /**
@@ -14,14 +15,14 @@ export type RenderHTMLProps = {
14
15
  * This function does not use context from HTMLProvider. Use `useHTMLRenderer`
15
16
  * hook if you want to leverage provider context.
16
17
  */
17
- export declare const renderHTML: (content: string, { components }?: RenderHTMLProps) => JSX.Element;
18
+ export declare const renderHTML: (content: string, { components }?: RenderHTMLProps) => SolidElement;
18
19
  /**
19
20
  * Hook that returns a function to render HTML content.
20
21
  *
21
22
  * This hook considers the configuration from the `HTMLProvider` context if available,
22
23
  * falling back to the provided components.
23
24
  */
24
- export declare const useHTMLRenderer: ({ components }?: RenderHTMLProps) => (content: string) => JSX.Element;
25
+ export declare const useHTMLRenderer: ({ components }?: RenderHTMLProps) => ((content: string) => SolidElement);
25
26
  export type HTMLRendererProps = RenderHTMLProps & {
26
27
  /**
27
28
  * The HTML content to render as a string.
@@ -1,17 +1,18 @@
1
1
  import { HTMLTagsType } from '@intlayer/core/transpiler';
2
- import { JSX } from 'solid-js';
2
+ import { IntrinsicElementProps, SolidElement } from '../solidTypes';
3
3
  /**
4
4
  * Helper to extract specific props from the configuration value.
5
5
  */
6
6
  type PropsFromConfig<Value> = Value extends true ? {} : Value extends object ? Value : {};
7
7
  /**
8
- * Common props for all elements
8
+ * Common props for all elements: `HTMLAttributes<HTMLElement>`, which Solid 1
9
+ * gives `<section>`.
9
10
  */
10
- type ElementProps = JSX.HTMLAttributes<HTMLElement>;
11
+ type ElementProps = IntrinsicElementProps<'section'>;
11
12
  /**
12
13
  * Solid Component type
13
14
  */
14
- type SolidComponentType<P = {}> = (props: P) => JSX.Element;
15
+ type SolidComponentType<P = {}> = (props: P) => SolidElement;
15
16
  /**
16
17
  * Helper: Defines the mapping for the explicitly listed keys in T.
17
18
  * Handles whether they are Required or Optional.
@@ -1,5 +1,6 @@
1
- import { Component, JSXElement, ParentProps, ValidComponent } from 'solid-js';
1
+ import { Component, ParentProps, ValidComponent } from 'solid-js';
2
2
  import { HTMLComponents } from '../html/types';
3
+ import { SolidElement } from '../solidTypes';
3
4
  import { ParsedMarkdown } from './compiler';
4
5
  export type MarkdownProviderOptions = {
5
6
  /** Forces the compiler to always output content with a block-level wrapper. */
@@ -11,7 +12,7 @@ export type MarkdownProviderOptions = {
11
12
  };
12
13
  type MarkdownProviderValue = {
13
14
  components?: HTMLComponents<'permissive', {}>;
14
- renderMarkdown: (content: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => JSXElement | Promise<JSXElement>;
15
+ renderMarkdown: (content: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => SolidElement | Promise<SolidElement>;
15
16
  };
16
17
  /**
17
18
  * `null` outside a provider. An explicit default keeps `useContext` from
@@ -24,7 +25,7 @@ export type MarkdownProviderProps = ParentProps<{
24
25
  forceBlock?: boolean;
25
26
  preserveFrontmatter?: boolean;
26
27
  tagfilter?: boolean;
27
- renderMarkdown?: (content: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => JSXElement | Promise<JSXElement>;
28
+ renderMarkdown?: (content: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: ValidComponent) => SolidElement | Promise<SolidElement>;
28
29
  }>;
29
30
  export declare const MarkdownProvider: Component<MarkdownProviderProps>;
30
31
  export declare const useMarkdown: () => MarkdownProviderValue;
@@ -1,7 +1,8 @@
1
1
  import { KeyPath } from '@intlayer/types/keyPath';
2
2
  import { LocalesValues } from '@intlayer/types/module_augmentation';
3
- import { Component, JSX, ValidComponent } from 'solid-js';
3
+ import { Component, ValidComponent } from 'solid-js';
4
4
  import { HTMLComponents } from '../html/types';
5
+ import { SolidElement } from '../solidTypes';
5
6
  import { ParsedMarkdown } from './compiler';
6
7
  export type RenderMarkdownOptions = {
7
8
  components?: HTMLComponents<'permissive', {}>;
@@ -10,15 +11,15 @@ export type RenderMarkdownOptions = {
10
11
  preserveFrontmatter?: boolean;
11
12
  tagfilter?: boolean;
12
13
  };
13
- export declare const renderMarkdown: (content: string | ParsedMarkdown, options?: RenderMarkdownOptions) => Promise<JSX.Element>;
14
- export declare const useMarkdownRenderer: (options?: RenderMarkdownOptions) => (content: string | ParsedMarkdown) => Promise<JSX.Element>;
14
+ export declare const renderMarkdown: (content: string | ParsedMarkdown, options?: RenderMarkdownOptions) => Promise<SolidElement>;
15
+ export declare const useMarkdownRenderer: (options?: RenderMarkdownOptions) => (content: string | ParsedMarkdown) => Promise<SolidElement>;
15
16
  export type MarkdownRendererProps = RenderMarkdownOptions & {
16
17
  dictionaryKey: string;
17
18
  keyPath: KeyPath[];
18
19
  locale?: LocalesValues;
19
20
  children: string | ParsedMarkdown;
20
21
  };
21
- export declare const MarkdownRenderer: (props: MarkdownRendererProps) => JSX.Element;
22
+ export declare const MarkdownRenderer: (props: MarkdownRendererProps) => SolidElement;
22
23
  export type MarkdownMetadataRendererProps = MarkdownRendererProps & {
23
24
  metadataKeyPath: KeyPath[];
24
25
  };
@@ -1,5 +1,5 @@
1
1
  import { CompileOptions, ParsedMarkdown } from '@intlayer/core/markdown';
2
- import { JSX } from 'solid-js';
2
+ import { SolidElement } from '../solidTypes';
3
3
  /**
4
4
  * Intermediate AST produced by `parseMarkdown`.
5
5
  * Pass this to `compileMarkdown` to skip re-parsing when the same content is
@@ -40,4 +40,4 @@ export declare const parseMarkdown: (markdown?: string, options?: CompileOptions
40
40
  * const element = await compileMarkdown('# Hello **world**');
41
41
  * ```
42
42
  */
43
- export declare const compileMarkdown: (input?: string | ParsedMarkdown, options?: CompileOptions) => Promise<JSX.Element>;
43
+ export declare const compileMarkdown: (input?: string | ParsedMarkdown, options?: CompileOptions) => Promise<SolidElement>;
@@ -1,9 +1,9 @@
1
1
  import { DeepTransformContent as DeepTransformContentCore, IInterpreterPluginState as IInterpreterPluginStateCore, Plugins } from '@intlayer/core/interpreter';
2
2
  import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
3
3
  import { NodeType } from '@intlayer/types/nodeType';
4
- import { JSX } from 'solid-js';
5
4
  import { HTMLComponents } from './html/types';
6
5
  import { IntlayerNode } from './IntlayerNode';
6
+ import { SolidElement } from './solidTypes';
7
7
  import * as NodeTypes from '@intlayer/types/nodeType';
8
8
  /** ---------------------------------------------
9
9
  * INTLAYER NODE PLUGIN
@@ -17,7 +17,7 @@ export declare const intlayerNodePlugins: Plugins;
17
17
  export type SolidNodeCond<T> = T extends {
18
18
  props: any;
19
19
  key?: any;
20
- } ? JSX.Element : never;
20
+ } ? SolidElement : never;
21
21
  /** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
22
22
  export declare const solidNodePlugins: Plugins;
23
23
  /** ---------------------------------------------
@@ -28,8 +28,8 @@ export type InsertionCond<T, _S, L extends LocalesValues> = T extends {
28
28
  [NodeTypes.INSERTION]: infer I;
29
29
  fields: readonly (infer F)[];
30
30
  } ? <V extends {
31
- [K in Extract<F, string>]: string | number | JSX.Element;
32
- }>(values: V) => I extends string ? V[keyof V] extends string | number ? IntlayerNode<string> : IntlayerNode<JSX.Element> : DeepTransformContent<I, L> : never;
31
+ [K in Extract<F, string>]: string | number | SolidElement;
32
+ }>(values: V) => I extends string ? V[keyof V] extends string | number ? IntlayerNode<string> : IntlayerNode<SolidElement> : DeepTransformContent<I, L> : never;
33
33
  /** Insertion plugin for Solid. Handles component/element insertion. */
34
34
  export declare const insertionPlugin: Plugins;
35
35
  /**
@@ -37,7 +37,7 @@ export declare const insertionPlugin: Plugins;
37
37
  */
38
38
  export type MarkdownStringCond<T> = T extends string ? IntlayerNode<string, {
39
39
  metadata: DeepTransformContent<string>;
40
- use: (components?: HTMLComponents<'permissive', {}>) => JSX.Element;
40
+ use: (components?: HTMLComponents<'permissive', {}>) => SolidElement;
41
41
  }> : never;
42
42
  /** Markdown string plugin. Replaces string node with a component that render the markdown. */
43
43
  export declare const markdownStringPlugin: Plugins;
@@ -47,7 +47,7 @@ export type MarkdownCond<T> = T extends {
47
47
  metadata?: infer U;
48
48
  tags?: infer U;
49
49
  } ? IntlayerNode<M, {
50
- use: (components?: HTMLComponents<'permissive', U>) => JSX.Element;
50
+ use: (components?: HTMLComponents<'permissive', U>) => SolidElement;
51
51
  metadata: DeepTransformContent<U>;
52
52
  }> : never;
53
53
  export declare const markdownPlugin: Plugins;
@@ -61,7 +61,7 @@ export type HTMLPluginCond<T> = T extends {
61
61
  } ? IntlayerNode<I, {
62
62
  use: (components?: HTMLComponents<'permissive', U>) => IntlayerNode<I>;
63
63
  }> : never;
64
- /** HTML plugin. Replaces node with a function that takes components => JSX.Element. */
64
+ /** HTML plugin. Replaces node with a function that takes components => SolidElement. */
65
65
  export declare const htmlPlugin: Plugins;
66
66
  /** ---------------------------------------------
67
67
  * PLUGINS RESULT