react-intlayer 9.5.3 → 9.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/cjs/analytics/useAnalytics.cjs +2 -2
- package/dist/cjs/analytics/useConversion.cjs +1 -1
- package/dist/cjs/analytics/useExperiment.cjs +1 -1
- package/dist/cjs/client/IntlayerProvider.cjs +2 -2
- package/dist/cjs/client/format/index.cjs +3 -3
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/t.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +2 -2
- package/dist/cjs/client/useI18n.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleBase.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/client/useTraduction.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/markdown/runtime.cjs +2 -6
- package/dist/cjs/markdown/runtime.cjs.map +1 -1
- package/dist/cjs/plugins.cjs +2 -2
- package/dist/cjs/server/format/index.cjs +3 -3
- package/dist/cjs/server/index.cjs +4 -4
- package/dist/esm/analytics/useAnalytics.mjs +2 -2
- package/dist/esm/analytics/useConversion.mjs +1 -1
- package/dist/esm/analytics/useExperiment.mjs +1 -1
- package/dist/esm/client/IntlayerProvider.mjs +2 -2
- package/dist/esm/client/format/index.mjs +3 -3
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/t.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +2 -2
- package/dist/esm/client/useI18n.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useLocaleBase.mjs +1 -1
- package/dist/esm/client/useRewriteURL.mjs +1 -1
- package/dist/esm/client/useTraduction.mjs +1 -1
- package/dist/esm/html/HTMLRenderer.mjs +1 -1
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/markdown/runtime.mjs +2 -6
- package/dist/esm/markdown/runtime.mjs.map +1 -1
- package/dist/esm/plugins.mjs +2 -2
- package/dist/esm/server/format/index.mjs +3 -3
- package/dist/esm/server/index.mjs +4 -4
- package/dist/types/markdown/runtime.d.ts.map +1 -1
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://intlayer.org" rel="">
|
|
3
|
-
<img src="https://raw.githubusercontent.com/aymericzip/intlayer/main/docs/assets/cover.
|
|
3
|
+
<img src="https://raw.githubusercontent.com/aymericzip/intlayer/main/docs/assets/cover.webp" width="60%" alt="Intlayer Logo" />
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -49,10 +49,10 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
49
49
|
|
|
50
50
|
| Feature | Description |
|
|
51
51
|
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.
|
|
52
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.webp?raw=true" alt="Feature" width="700"> | **Cross-Frameworks Support**<br><br>Intlayer is compatible with all major frameworks and libraries, including Next.js, React, Vite, Vue.js, Nuxt, Preact, Express, and more. |
|
|
53
53
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript-Powered Content Management**<br><br>Harness the flexibility of JavaScript to define and manage your content efficiently. <br><br> - [Content declaration](https://intlayer.org/doc/concept/content) |
|
|
54
54
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **Per-Locale Content Declaration File**<br><br>Speed up your development by declaring your content once, before auto generation.<br><br> - [Per-Locale Content Declaration File](https://intlayer.org/doc/concept/per-locale-file) |
|
|
55
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/compiler.
|
|
55
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/compiler.webp?raw=true" alt="Feature" width="700"> | **Compiler**<br><br>The Intlayer Compiler extract automatically the content from the components and generate the dictionary files.<br><br> - [Compiler](https://intlayer.org/doc/compiler) |
|
|
56
56
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **Type-Safe Environment**<br><br>Leverage TypeScript to ensure your content definitions and code are error-free, while also benefiting from IDE autocompletion.<br><br> - [TypeScript configuration](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
|
|
57
57
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="Feature" width="700"> | **Simplified Setup**<br><br>Get up and running quickly with minimal configuration. Adjust settings for internationalization, routing, AI, build, and content handling with ease. <br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
58
58
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true" alt="Feature" width="700"> | **Simplified Content Retrieval**<br><br>No need to call your `t` function for each piece of content. Retrieve all your content directly using a single hook.<br><br> - [React integration](https://intlayer.org/doc/environment/create-react-app) |
|
|
@@ -60,12 +60,12 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
60
60
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true" alt="Feature" width="700"> | **Organized Codebase**<br><br>Keep your codebase more organized: 1 component = 1 dictionary in the same folder. Translations close to their respective components, enhance maintainability and clarity. <br><br> - [How Intlayer works](https://intlayer.org/doc/concept/how-works-intlayer) |
|
|
61
61
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true" alt="Feature" width="700"> | **Enhanced Routing**<br><br>Full support of app routing, adapting seamlessly to complex application structures, for Next.js, React, Vite, Vue.js, etc.<br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
62
62
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true" alt="Feature" width="700"> | **Markdown Support**<br><br>Import and interpret, locale files and remote Markdown for multilingual content like privacy policies, documentation, etc. Interpret and make Markdown metadata accessible in your code.<br><br> - [Content files](https://intlayer.org/doc/concept/content/file) |
|
|
63
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.
|
|
64
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.
|
|
65
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.
|
|
63
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.webp?raw=true" alt="Feature" width="700"> | **Free Visual Editor & CMS**<br><br>A free visual editor and CMS are available for content writers, removing the need for a localization platform. Keep your content synchronized using Git, or externalize it totally or partially with the CMS.<br><br> - [Intlayer Editor](https://intlayer.org/doc/concept/editor) <br> - [Intlayer CMS](https://intlayer.org/doc/concept/cms) |
|
|
64
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.webp?raw=true" alt="Feature" width="700"> | **Tree-shakable Content**<br><br>Tree-shakable content, reducing the size of the final bundle. Loads content per component, excluding any unused content from your bundle. Supports lazy loading to enhance app loading efficiency. <br><br> - [App build optimization](https://intlayer.org/doc/concept/how-works-intlayer#app-build-optimization) |
|
|
65
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.webp?raw=true" alt="Feature" width="700"> | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
66
66
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true" alt="Feature" width="700"> | **AI-Powered Translation**<br><br>Transform your website into 231 languages with just one click using Intlayer's advanced AI-powered translation tools using your own AI provider / API key. <br><br> - [CI/CD integration](https://intlayer.org/doc/concept/ci-cd) <br> - [Intlayer CLI](https://intlayer.org/doc/concept/cli) <br> - [Auto fill](https://intlayer.org/doc/concept/auto-fill) |
|
|
67
67
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
|
|
68
|
-
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.
|
|
68
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.webp?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
|
|
69
69
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) <br> - [Intlayer compat adapters](https://intlayer.org/doc/compatibility) |
|
|
70
70
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/benchmark.png?raw=true" alt="Feature" width="700"> | **Performances & Benchmark**<br><br>Uses advanced tree-shaking and dynamic loading to boost performances and keep the solution as light as possible. <br><br> - [Performances & Benchmark](https://intlayer.org/doc/benchmark) |
|
|
71
71
|
|
|
@@ -262,7 +262,7 @@ Intlayer connects **developers**, **copywriters**, and **AI agents** in one work
|
|
|
262
262
|
- Feature flags
|
|
263
263
|
- Headless CMSs (e.g. Contentful, Strapi, Sanity)
|
|
264
264
|
|
|
265
|
-

|
|
266
266
|
|
|
267
267
|
## 🌐 Readme in other languages
|
|
268
268
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_analytics_exposureSink = require('./exposureSink.cjs');
|
|
5
4
|
const require_client_IntlayerProvider = require('../client/IntlayerProvider.cjs');
|
|
6
|
-
|
|
5
|
+
const require_analytics_exposureSink = require('./exposureSink.cjs');
|
|
7
6
|
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
7
|
+
let react = require("react");
|
|
8
8
|
|
|
9
9
|
//#region src/analytics/useAnalytics.tsx
|
|
10
10
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
let react = require("react");
|
|
5
4
|
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
5
|
+
let react = require("react");
|
|
6
6
|
|
|
7
7
|
//#region src/analytics/useConversion.tsx
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
let react = require("react");
|
|
5
4
|
let _intlayer_analytics_isEnabled = require("@intlayer/analytics/isEnabled");
|
|
5
|
+
let react = require("react");
|
|
6
6
|
|
|
7
7
|
//#region src/analytics/useExperiment.tsx
|
|
8
8
|
/**
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_editor_EditorProvider = require('../editor/EditorProvider.cjs');
|
|
5
5
|
const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
|
|
6
6
|
const require_analytics_AnalyticsProvider = require('../analytics/AnalyticsProvider.cjs');
|
|
7
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
8
7
|
let react = require("react");
|
|
9
|
-
let
|
|
8
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
10
9
|
let _intlayer_config_client = require("@intlayer/config/client");
|
|
11
10
|
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
|
|
13
13
|
//#region src/client/IntlayerProvider.tsx
|
|
14
14
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_client_format_useIntl = require('./useIntl.cjs');
|
|
3
|
+
const require_client_format_useCurrency = require('./useCurrency.cjs');
|
|
3
4
|
const require_client_format_useUnit = require('./useUnit.cjs');
|
|
4
5
|
const require_client_format_useDate = require('./useDate.cjs');
|
|
5
|
-
const require_client_format_useNumber = require('./useNumber.cjs');
|
|
6
|
-
const require_client_format_useRelativeTime = require('./useRelativeTime.cjs');
|
|
7
6
|
const require_client_format_useCompact = require('./useCompact.cjs');
|
|
8
7
|
const require_client_format_useList = require('./useList.cjs');
|
|
8
|
+
const require_client_format_useNumber = require('./useNumber.cjs');
|
|
9
9
|
const require_client_format_usePercentage = require('./usePercentage.cjs');
|
|
10
|
-
const
|
|
10
|
+
const require_client_format_useRelativeTime = require('./useRelativeTime.cjs');
|
|
11
11
|
|
|
12
12
|
exports.useCompact = require_client_format_useCompact.useCompact;
|
|
13
13
|
exports.useCurrency = require_client_format_useCurrency.useCurrency;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_useLoadDynamic = require('./useLoadDynamic.cjs');
|
|
3
2
|
const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
|
|
4
3
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
4
|
const require_client_t = require('./t.cjs');
|
|
5
|
+
const require_client_useLoadDynamic = require('./useLoadDynamic.cjs');
|
|
6
6
|
const require_client_useDictionary = require('./useDictionary.cjs');
|
|
7
7
|
const require_client_useDictionaryAsync = require('./useDictionaryAsync.cjs');
|
|
8
8
|
const require_client_useDictionaryDynamic = require('./useDictionaryDynamic.cjs');
|
package/dist/cjs/client/t.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
6
5
|
let react = require("react");
|
|
6
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
7
7
|
|
|
8
8
|
//#region src/client/t.ts
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_getDictionary = require('../getDictionary.cjs');
|
|
5
4
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
|
+
const require_getDictionary = require('../getDictionary.cjs');
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
8
8
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
5
|
const require_client_useDictionary = require('./useDictionary.cjs');
|
|
6
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
7
6
|
let react = require("react");
|
|
7
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
8
8
|
|
|
9
9
|
//#region src/client/useDictionaryAsync.ts
|
|
10
10
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
4
5
|
const require_client_useLoadDynamic = require('./useLoadDynamic.cjs');
|
|
5
6
|
const require_getDictionary = require('../getDictionary.cjs');
|
|
6
|
-
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
7
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
8
7
|
let react = require("react");
|
|
8
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
9
9
|
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
10
10
|
|
|
11
11
|
//#region src/client/useDictionaryDynamic.ts
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
6
5
|
let react = require("react");
|
|
6
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
7
7
|
|
|
8
8
|
//#region src/client/useI18n.ts
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_getIntlayer = require('../getIntlayer.cjs');
|
|
5
4
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
|
+
const require_getIntlayer = require('../getIntlayer.cjs');
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
8
8
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
|
|
5
5
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
6
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
7
6
|
let react = require("react");
|
|
7
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
8
8
|
|
|
9
9
|
//#region src/client/useLocale.ts
|
|
10
10
|
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_client_IntlayerProvider = require('./IntlayerProvider.cjs');
|
|
5
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
6
5
|
let react = require("react");
|
|
6
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
7
7
|
|
|
8
8
|
//#region src/client/useLocaleBase.ts
|
|
9
9
|
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_client_useLocale = require('./useLocale.cjs');
|
|
5
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
6
5
|
let react = require("react");
|
|
6
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
7
7
|
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
8
8
|
|
|
9
9
|
//#region src/client/useRewriteURL.ts
|
|
@@ -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 react = require("react");
|
|
4
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
5
5
|
|
|
6
6
|
//#region src/client/useTraduction.ts
|
|
7
7
|
/**
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_html_HTMLProvider = require('./HTMLProvider.cjs');
|
|
5
|
-
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
6
5
|
let react = require("react");
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
8
8
|
let _intlayer_core_transpiler = require("@intlayer/core/transpiler");
|
|
9
9
|
|
|
10
10
|
//#region src/html/HTMLRenderer.tsx
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_client_useLoadDynamic = require('./client/useLoadDynamic.cjs');
|
|
3
|
-
const require_getIntlayer = require('./getIntlayer.cjs');
|
|
4
|
-
const require_getDictionary = require('./getDictionary.cjs');
|
|
5
2
|
const require_client_useLocaleStorage = require('./client/useLocaleStorage.cjs');
|
|
6
3
|
const require_client_IntlayerProvider = require('./client/IntlayerProvider.cjs');
|
|
7
4
|
const require_analytics_useAnalytics = require('./analytics/useAnalytics.cjs');
|
|
@@ -10,10 +7,13 @@ const require_analytics_useConversion = require('./analytics/useConversion.cjs')
|
|
|
10
7
|
const require_analytics_useExperiment = require('./analytics/useExperiment.cjs');
|
|
11
8
|
const require_client_format_useIntl = require('./client/format/useIntl.cjs');
|
|
12
9
|
const require_client_t = require('./client/t.cjs');
|
|
10
|
+
const require_client_useLoadDynamic = require('./client/useLoadDynamic.cjs');
|
|
11
|
+
const require_getDictionary = require('./getDictionary.cjs');
|
|
13
12
|
const require_client_useDictionary = require('./client/useDictionary.cjs');
|
|
14
13
|
const require_client_useDictionaryAsync = require('./client/useDictionaryAsync.cjs');
|
|
15
14
|
const require_client_useDictionaryDynamic = require('./client/useDictionaryDynamic.cjs');
|
|
16
15
|
const require_client_useI18n = require('./client/useI18n.cjs');
|
|
16
|
+
const require_getIntlayer = require('./getIntlayer.cjs');
|
|
17
17
|
const require_client_useIntlayer = require('./client/useIntlayer.cjs');
|
|
18
18
|
const require_client_useLocale = require('./client/useLocale.cjs');
|
|
19
19
|
const require_client_useLocaleBase = require('./client/useLocaleBase.cjs');
|
|
@@ -23,12 +23,8 @@ const reactRuntime = {
|
|
|
23
23
|
* Handles the conversion of props and children to React format.
|
|
24
24
|
*/
|
|
25
25
|
createElement: (type, props, ...children) => {
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
if (props && props.key != null) {
|
|
29
|
-
key = String(props.key);
|
|
30
|
-
finalProps.key = void 0;
|
|
31
|
-
}
|
|
26
|
+
const { key: rawKey, ...finalProps } = props ?? {};
|
|
27
|
+
const key = rawKey != null ? String(rawKey) : null;
|
|
32
28
|
const childCount = children.length;
|
|
33
29
|
if (childCount === 1) finalProps.children = children[0];
|
|
34
30
|
else if (childCount > 1) finalProps.children = children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.cjs","names":["createElement","cloneElement"],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nlet REACT_ELEMENT_TYPE: symbol;\ntry {\n const sample = createElement('div');\n REACT_ELEMENT_TYPE =\n sample &&\n typeof sample === 'object' &&\n '$$typeof' in sample &&\n typeof sample.$$typeof === 'symbol'\n ? (sample.$$typeof as symbol)\n : Symbol.for('react.transitional.element');\n} catch {\n REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element');\n}\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n
|
|
1
|
+
{"version":3,"file":"runtime.cjs","names":["createElement","cloneElement"],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nlet REACT_ELEMENT_TYPE: symbol;\ntry {\n const sample = createElement('div');\n REACT_ELEMENT_TYPE =\n sample &&\n typeof sample === 'object' &&\n '$$typeof' in sample &&\n typeof sample.$$typeof === 'symbol'\n ? (sample.$$typeof as symbol)\n : Symbol.for('react.transitional.element');\n} catch {\n REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element');\n}\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n // `key` must not survive as an own property: React warns when a props\n // object that owns `key` is later spread into JSX by a custom renderer.\n const { key: rawKey, ...finalProps } = (props ?? {}) as Record<string, any>;\n const key: string | null = rawKey != null ? String(rawKey) : null;\n\n const childCount = children.length;\n if (childCount === 1) {\n finalProps.children = children[0];\n } else if (childCount > 1) {\n finalProps.children = children;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type,\n key,\n ref: null,\n props: finalProps,\n _owner: null,\n _store: {},\n _debugStack: null,\n _debugTask: null,\n } as unknown as ReactNode;\n },\n\n /**\n * Clones a React element with new props.\n */\n cloneElement: (\n element: unknown,\n props: Record<string, any>,\n ...children: any[]\n ): ReactNode => {\n if (children.length === 0) {\n return cloneElement(element as ReactElement, props);\n }\n return cloneElement(element as ReactElement, props, ...children);\n },\n\n /**\n * React Fragment component.\n */\n Fragment,\n\n /**\n * React-specific prop normalization.\n * React uses className instead of class, htmlFor instead of for, etc.\n * The core processor already handles ATTRIBUTE_TO_NODE_PROP_MAP,\n * so this is mostly a no-op but can be used for additional React-specific transforms.\n */\n normalizeProps: (\n _tag: HTMLTag,\n props: Record<string, any>\n ): Record<string, any> => {\n // The core already handles class -> className and for -> htmlFor\n // via ATTRIBUTE_TO_NODE_PROP_MAP in the attrStringToMap function.\n // This hook is available for any additional React-specific transforms.\n return props;\n },\n};\n\n/**\n * Creates a React runtime with custom createElement for advanced use cases.\n * Useful for wrapping elements or adding middleware.\n */\nexport const createReactRuntime = (\n options: {\n onCreateElement?: (\n type: string | any,\n props: Record<string, any> | null,\n children: any[]\n ) => ReactNode;\n } = {}\n): MarkdownRuntime => {\n const { onCreateElement } = options;\n\n if (onCreateElement) {\n return {\n ...reactRuntime,\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n return onCreateElement(type, props, children);\n },\n };\n }\n\n return reactRuntime;\n};\n"],"mappings":";;;;;;;;AAaA,IAAI;AACJ,IAAI;CACF,MAAM,aAASA,qBAAc,KAAK;CAClC,qBACE,UACA,OAAO,WAAW,YAClB,cAAc,UACd,OAAO,OAAO,aAAa,WACtB,OAAO,WACR,OAAO,IAAI,4BAA4B;AAC/C,QAAQ;CACN,qBAAqB,OAAO,IAAI,4BAA4B;AAC9D;;;;;AAMA,MAAa,eAAgC;;;;;CAK3C,gBACE,MACA,OACA,GAAG,aACW;EAGd,MAAM,EAAE,KAAK,QAAQ,GAAG,eAAgB,SAAS,CAAC;EAClD,MAAM,MAAqB,UAAU,OAAO,OAAO,MAAM,IAAI;EAE7D,MAAM,aAAa,SAAS;EAC5B,IAAI,eAAe,GACjB,WAAW,WAAW,SAAS;OAC1B,IAAI,aAAa,GACtB,WAAW,WAAW;EAGxB,OAAO;GACL,UAAU;GACV;GACA;GACA,KAAK;GACL,OAAO;GACP,QAAQ;GACR,QAAQ,CAAC;GACT,aAAa;GACb,YAAY;EACd;CACF;;;;CAKA,eACE,SACA,OACA,GAAG,aACW;EACd,IAAI,SAAS,WAAW,GACtB,WAAOC,oBAAa,SAAyB,KAAK;EAEpD,WAAOA,oBAAa,SAAyB,OAAO,GAAG,QAAQ;CACjE;;;;CAKA;;;;;;;CAQA,iBACE,MACA,UACwB;EAIxB,OAAO;CACT;AACF;;;;;AAMA,MAAa,sBACX,UAMI,CAAC,MACe;CACpB,MAAM,EAAE,oBAAoB;CAE5B,IAAI,iBACF,OAAO;EACL,GAAG;EACH,gBACE,MACA,OACA,GAAG,aACW;GACd,OAAO,gBAAgB,MAAM,OAAO,QAAQ;EAC9C;CACF;CAGF,OAAO;AACT"}
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -5,13 +5,13 @@ const require_client_useLoadDynamic = require('./client/useLoadDynamic.cjs');
|
|
|
5
5
|
const require_editor_ContentSelector = require('./editor/ContentSelector.cjs');
|
|
6
6
|
const require_IntlayerNode = require('./IntlayerNode.cjs');
|
|
7
7
|
const require_reactElement_renderReactElement = require('./reactElement/renderReactElement.cjs');
|
|
8
|
+
let react = require("react");
|
|
8
9
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
11
|
let _intlayer_core_interpreter = require("@intlayer/core/interpreter");
|
|
10
12
|
let _intlayer_core_markdown = require("@intlayer/core/markdown");
|
|
11
13
|
let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
|
|
12
14
|
_intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
|
|
13
|
-
let react = require("react");
|
|
14
|
-
let react_jsx_runtime = require("react/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) => m.MarkdownRendererPlugin) : null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_server_format_useCurrency = require('./useCurrency.cjs');
|
|
2
3
|
const require_server_format_useUnit = require('./useUnit.cjs');
|
|
3
4
|
const require_server_format_useDate = require('./useDate.cjs');
|
|
4
|
-
const require_server_format_useNumber = require('./useNumber.cjs');
|
|
5
|
-
const require_server_format_useRelativeTime = require('./useRelativeTime.cjs');
|
|
6
5
|
const require_server_format_useCompact = require('./useCompact.cjs');
|
|
7
6
|
const require_server_format_useList = require('./useList.cjs');
|
|
7
|
+
const require_server_format_useNumber = require('./useNumber.cjs');
|
|
8
8
|
const require_server_format_usePercentage = require('./usePercentage.cjs');
|
|
9
|
-
const
|
|
9
|
+
const require_server_format_useRelativeTime = require('./useRelativeTime.cjs');
|
|
10
10
|
|
|
11
11
|
exports.useCompact = require_server_format_useCompact.useCompact;
|
|
12
12
|
exports.useCurrency = require_server_format_useCurrency.useCurrency;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_server_serverContext = require('./serverContext.cjs');
|
|
3
3
|
const require_server_IntlayerServerProvider = require('./IntlayerServerProvider.cjs');
|
|
4
|
-
const require_server_t = require('./t.cjs');
|
|
5
|
-
const require_server_useI18n = require('./useI18n.cjs');
|
|
6
4
|
const require_server_useIntlayer = require('./useIntlayer.cjs');
|
|
5
|
+
const require_server_format_useIntl = require('./format/useIntl.cjs');
|
|
6
|
+
const require_server_t = require('./t.cjs');
|
|
7
7
|
const require_server_useDictionary = require('./useDictionary.cjs');
|
|
8
8
|
const require_server_useDictionaryAsync = require('./useDictionaryAsync.cjs');
|
|
9
|
-
const require_server_useLocale = require('./useLocale.cjs');
|
|
10
9
|
const require_server_useLoadDynamic = require('./useLoadDynamic.cjs');
|
|
11
10
|
const require_server_useDictionaryDynamic = require('./useDictionaryDynamic.cjs');
|
|
12
|
-
const
|
|
11
|
+
const require_server_useI18n = require('./useI18n.cjs');
|
|
12
|
+
const require_server_useLocale = require('./useLocale.cjs');
|
|
13
13
|
|
|
14
14
|
exports.IntlayerServer = require_server_IntlayerServerProvider.IntlayerServerContext;
|
|
15
15
|
exports.IntlayerServerProvider = require_server_IntlayerServerProvider.IntlayerServerProvider;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { setExposureSink } from "./exposureSink.mjs";
|
|
4
3
|
import { IntlayerClientContext } from "../client/IntlayerProvider.mjs";
|
|
5
|
-
import {
|
|
4
|
+
import { setExposureSink } from "./exposureSink.mjs";
|
|
6
5
|
import { isEnabled } from "@intlayer/analytics/isEnabled";
|
|
6
|
+
import { useContext, useEffect, useRef } from "react";
|
|
7
7
|
|
|
8
8
|
//#region src/analytics/useAnalytics.tsx
|
|
9
9
|
/**
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { EditorProvider } from "../editor/EditorProvider.mjs";
|
|
4
4
|
import { localeInStorage, setLocaleInStorage } from "./useLocaleStorage.mjs";
|
|
5
5
|
import { AnalyticsProvider } from "../analytics/AnalyticsProvider.mjs";
|
|
6
|
-
import { internationalization } from "@intlayer/config/built";
|
|
7
6
|
import { createContext, useContext, useEffect, useState } from "react";
|
|
8
|
-
import {
|
|
7
|
+
import { internationalization } from "@intlayer/config/built";
|
|
9
8
|
import { setIntlayerIdentifier } from "@intlayer/config/client";
|
|
10
9
|
import { localeResolver } from "@intlayer/core/localization";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
|
|
12
12
|
//#region src/client/IntlayerProvider.tsx
|
|
13
13
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useIntl } from "./useIntl.mjs";
|
|
2
|
+
import { useCurrency } from "./useCurrency.mjs";
|
|
2
3
|
import { useUnit } from "./useUnit.mjs";
|
|
3
4
|
import { useDate } from "./useDate.mjs";
|
|
4
|
-
import { useNumber } from "./useNumber.mjs";
|
|
5
|
-
import { useRelativeTime } from "./useRelativeTime.mjs";
|
|
6
5
|
import { useCompact } from "./useCompact.mjs";
|
|
7
6
|
import { useList } from "./useList.mjs";
|
|
7
|
+
import { useNumber } from "./useNumber.mjs";
|
|
8
8
|
import { usePercentage } from "./usePercentage.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { useRelativeTime } from "./useRelativeTime.mjs";
|
|
10
10
|
|
|
11
11
|
export { useCompact, useCurrency, useDate, useIntl, useList, useNumber, usePercentage, useRelativeTime, useUnit };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
2
1
|
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./useLocaleStorage.mjs";
|
|
3
2
|
import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./IntlayerProvider.mjs";
|
|
4
3
|
import { t } from "./t.mjs";
|
|
4
|
+
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
5
5
|
import { useDictionary } from "./useDictionary.mjs";
|
|
6
6
|
import { useDictionaryAsync } from "./useDictionaryAsync.mjs";
|
|
7
7
|
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
package/dist/esm/client/t.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
-
import { getTranslation } from "@intlayer/core/interpreter";
|
|
5
4
|
import { useContext } from "react";
|
|
5
|
+
import { getTranslation } from "@intlayer/core/interpreter";
|
|
6
6
|
|
|
7
7
|
//#region src/client/t.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { getDictionary } from "../getDictionary.mjs";
|
|
4
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
+
import { getDictionary } from "../getDictionary.mjs";
|
|
5
5
|
import { useContext, useMemo } from "react";
|
|
6
6
|
import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
|
|
7
7
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
4
|
import { useDictionary } from "./useDictionary.mjs";
|
|
5
|
-
import { internationalization } from "@intlayer/config/built";
|
|
6
5
|
import { useContext, useMemo } from "react";
|
|
6
|
+
import { internationalization } from "@intlayer/config/built";
|
|
7
7
|
|
|
8
8
|
//#region src/client/useDictionaryAsync.ts
|
|
9
9
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
3
4
|
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
4
5
|
import { getDictionary } from "../getDictionary.mjs";
|
|
5
|
-
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
6
|
-
import { internationalization } from "@intlayer/config/built";
|
|
7
6
|
import { useContext } from "react";
|
|
7
|
+
import { internationalization } from "@intlayer/config/built";
|
|
8
8
|
import { getPreloadedDictionary, isQualifiedDynamicLoaderMap, parseDictionarySelector, resolveDictionaryArgument, resolveQualifiedDynamicContent } from "@intlayer/core/dictionaryManipulator";
|
|
9
9
|
|
|
10
10
|
//#region src/client/useDictionaryDynamic.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
-
import { getIntlayer } from "@intlayer/core/interpreter";
|
|
5
4
|
import { useContext, useMemo } from "react";
|
|
5
|
+
import { getIntlayer } from "@intlayer/core/interpreter";
|
|
6
6
|
|
|
7
7
|
//#region src/client/useI18n.ts
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { getIntlayer } from "../getIntlayer.mjs";
|
|
4
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
+
import { getIntlayer } from "../getIntlayer.mjs";
|
|
5
5
|
import { useContext, useMemo } from "react";
|
|
6
6
|
import { getDictionarySelectorCacheKey, resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
|
|
7
7
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { setLocaleInStorage } from "./useLocaleStorage.mjs";
|
|
4
4
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
5
|
-
import { internationalization } from "@intlayer/config/built";
|
|
6
5
|
import { useCallback, useContext } from "react";
|
|
6
|
+
import { internationalization } from "@intlayer/config/built";
|
|
7
7
|
|
|
8
8
|
//#region src/client/useLocale.ts
|
|
9
9
|
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
4
|
-
import { internationalization } from "@intlayer/config/built";
|
|
5
4
|
import { useContext } from "react";
|
|
5
|
+
import { internationalization } from "@intlayer/config/built";
|
|
6
6
|
|
|
7
7
|
//#region src/client/useLocaleBase.ts
|
|
8
8
|
const { defaultLocale, locales: availableLocales } = internationalization;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useLocale } from "./useLocale.mjs";
|
|
4
|
-
import { routing } from "@intlayer/config/built";
|
|
5
4
|
import { useEffect } from "react";
|
|
5
|
+
import { routing } from "@intlayer/config/built";
|
|
6
6
|
import { getRewritePath } from "@intlayer/core/localization";
|
|
7
7
|
|
|
8
8
|
//#region src/client/useRewriteURL.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntlayerClientContext } from "./IntlayerProvider.mjs";
|
|
2
|
-
import { getTranslation } from "@intlayer/core/interpreter";
|
|
3
2
|
import { useContext, useMemo } from "react";
|
|
3
|
+
import { getTranslation } from "@intlayer/core/interpreter";
|
|
4
4
|
|
|
5
5
|
//#region src/client/useTraduction.ts
|
|
6
6
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useHTMLContext } from "./HTMLProvider.mjs";
|
|
4
|
-
import { getHTML } from "@intlayer/core/interpreter";
|
|
5
4
|
import { Fragment, createElement } from "react";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { getHTML } from "@intlayer/core/interpreter";
|
|
7
7
|
import { VOID_HTML_ELEMENTS } from "@intlayer/core/transpiler";
|
|
8
8
|
|
|
9
9
|
//#region src/html/HTMLRenderer.tsx
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
|
|
2
|
-
import { getIntlayer } from "./getIntlayer.mjs";
|
|
3
|
-
import { getDictionary } from "./getDictionary.mjs";
|
|
4
1
|
import { localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage } from "./client/useLocaleStorage.mjs";
|
|
5
2
|
import { IntlayerClientContext, IntlayerProvider, IntlayerProviderContent, useIntlayerContext } from "./client/IntlayerProvider.mjs";
|
|
6
3
|
import { useAnalytics } from "./analytics/useAnalytics.mjs";
|
|
@@ -9,10 +6,13 @@ import { useConversion } from "./analytics/useConversion.mjs";
|
|
|
9
6
|
import { useExperiment } from "./analytics/useExperiment.mjs";
|
|
10
7
|
import { useIntl } from "./client/format/useIntl.mjs";
|
|
11
8
|
import { t } from "./client/t.mjs";
|
|
9
|
+
import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
|
|
10
|
+
import { getDictionary } from "./getDictionary.mjs";
|
|
12
11
|
import { useDictionary } from "./client/useDictionary.mjs";
|
|
13
12
|
import { useDictionaryAsync } from "./client/useDictionaryAsync.mjs";
|
|
14
13
|
import { useDictionaryDynamic } from "./client/useDictionaryDynamic.mjs";
|
|
15
14
|
import { useI18n } from "./client/useI18n.mjs";
|
|
15
|
+
import { getIntlayer } from "./getIntlayer.mjs";
|
|
16
16
|
import { useIntlayer } from "./client/useIntlayer.mjs";
|
|
17
17
|
import { useLocale } from "./client/useLocale.mjs";
|
|
18
18
|
import { useLocaleBase } from "./client/useLocaleBase.mjs";
|
|
@@ -22,12 +22,8 @@ const reactRuntime = {
|
|
|
22
22
|
* Handles the conversion of props and children to React format.
|
|
23
23
|
*/
|
|
24
24
|
createElement: (type, props, ...children) => {
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
if (props && props.key != null) {
|
|
28
|
-
key = String(props.key);
|
|
29
|
-
finalProps.key = void 0;
|
|
30
|
-
}
|
|
25
|
+
const { key: rawKey, ...finalProps } = props ?? {};
|
|
26
|
+
const key = rawKey != null ? String(rawKey) : null;
|
|
31
27
|
const childCount = children.length;
|
|
32
28
|
if (childCount === 1) finalProps.children = children[0];
|
|
33
29
|
else if (childCount > 1) finalProps.children = children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nlet REACT_ELEMENT_TYPE: symbol;\ntry {\n const sample = createElement('div');\n REACT_ELEMENT_TYPE =\n sample &&\n typeof sample === 'object' &&\n '$$typeof' in sample &&\n typeof sample.$$typeof === 'symbol'\n ? (sample.$$typeof as symbol)\n : Symbol.for('react.transitional.element');\n} catch {\n REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element');\n}\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../src/markdown/runtime.ts"],"sourcesContent":["import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown';\nimport {\n cloneElement,\n createElement,\n Fragment,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nlet REACT_ELEMENT_TYPE: symbol;\ntry {\n const sample = createElement('div');\n REACT_ELEMENT_TYPE =\n sample &&\n typeof sample === 'object' &&\n '$$typeof' in sample &&\n typeof sample.$$typeof === 'symbol'\n ? (sample.$$typeof as symbol)\n : Symbol.for('react.transitional.element');\n} catch {\n REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element');\n}\n\n/**\n * React-specific runtime for the markdown processor.\n * Implements the MarkdownRuntime interface using React's primitives.\n */\nexport const reactRuntime: MarkdownRuntime = {\n /**\n * Creates a React element.\n * Handles the conversion of props and children to React format.\n */\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n // `key` must not survive as an own property: React warns when a props\n // object that owns `key` is later spread into JSX by a custom renderer.\n const { key: rawKey, ...finalProps } = (props ?? {}) as Record<string, any>;\n const key: string | null = rawKey != null ? String(rawKey) : null;\n\n const childCount = children.length;\n if (childCount === 1) {\n finalProps.children = children[0];\n } else if (childCount > 1) {\n finalProps.children = children;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type,\n key,\n ref: null,\n props: finalProps,\n _owner: null,\n _store: {},\n _debugStack: null,\n _debugTask: null,\n } as unknown as ReactNode;\n },\n\n /**\n * Clones a React element with new props.\n */\n cloneElement: (\n element: unknown,\n props: Record<string, any>,\n ...children: any[]\n ): ReactNode => {\n if (children.length === 0) {\n return cloneElement(element as ReactElement, props);\n }\n return cloneElement(element as ReactElement, props, ...children);\n },\n\n /**\n * React Fragment component.\n */\n Fragment,\n\n /**\n * React-specific prop normalization.\n * React uses className instead of class, htmlFor instead of for, etc.\n * The core processor already handles ATTRIBUTE_TO_NODE_PROP_MAP,\n * so this is mostly a no-op but can be used for additional React-specific transforms.\n */\n normalizeProps: (\n _tag: HTMLTag,\n props: Record<string, any>\n ): Record<string, any> => {\n // The core already handles class -> className and for -> htmlFor\n // via ATTRIBUTE_TO_NODE_PROP_MAP in the attrStringToMap function.\n // This hook is available for any additional React-specific transforms.\n return props;\n },\n};\n\n/**\n * Creates a React runtime with custom createElement for advanced use cases.\n * Useful for wrapping elements or adding middleware.\n */\nexport const createReactRuntime = (\n options: {\n onCreateElement?: (\n type: string | any,\n props: Record<string, any> | null,\n children: any[]\n ) => ReactNode;\n } = {}\n): MarkdownRuntime => {\n const { onCreateElement } = options;\n\n if (onCreateElement) {\n return {\n ...reactRuntime,\n createElement: (\n type: string | any,\n props: Record<string, any> | null,\n ...children: any[]\n ): ReactNode => {\n return onCreateElement(type, props, children);\n },\n };\n }\n\n return reactRuntime;\n};\n"],"mappings":";;;;;;;AAaA,IAAI;AACJ,IAAI;CACF,MAAM,SAAS,cAAc,KAAK;CAClC,qBACE,UACA,OAAO,WAAW,YAClB,cAAc,UACd,OAAO,OAAO,aAAa,WACtB,OAAO,WACR,OAAO,IAAI,4BAA4B;AAC/C,QAAQ;CACN,qBAAqB,OAAO,IAAI,4BAA4B;AAC9D;;;;;AAMA,MAAa,eAAgC;;;;;CAK3C,gBACE,MACA,OACA,GAAG,aACW;EAGd,MAAM,EAAE,KAAK,QAAQ,GAAG,eAAgB,SAAS,CAAC;EAClD,MAAM,MAAqB,UAAU,OAAO,OAAO,MAAM,IAAI;EAE7D,MAAM,aAAa,SAAS;EAC5B,IAAI,eAAe,GACjB,WAAW,WAAW,SAAS;OAC1B,IAAI,aAAa,GACtB,WAAW,WAAW;EAGxB,OAAO;GACL,UAAU;GACV;GACA;GACA,KAAK;GACL,OAAO;GACP,QAAQ;GACR,QAAQ,CAAC;GACT,aAAa;GACb,YAAY;EACd;CACF;;;;CAKA,eACE,SACA,OACA,GAAG,aACW;EACd,IAAI,SAAS,WAAW,GACtB,OAAO,aAAa,SAAyB,KAAK;EAEpD,OAAO,aAAa,SAAyB,OAAO,GAAG,QAAQ;CACjE;;;;CAKA;;;;;;;CAQA,iBACE,MACA,UACwB;EAIxB,OAAO;CACT;AACF;;;;;AAMA,MAAa,sBACX,UAMI,CAAC,MACe;CACpB,MAAM,EAAE,oBAAoB;CAE5B,IAAI,iBACF,OAAO;EACL,GAAG;EACH,gBACE,MACA,OACA,GAAG,aACW;GACd,OAAO,gBAAgB,MAAM,OAAO,QAAQ;EAC9C;CACF;CAGF,OAAO;AACT"}
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { useLoadDynamic } from "./client/useLoadDynamic.mjs";
|
|
|
3
3
|
import { ContentSelector } from "./editor/ContentSelector.mjs";
|
|
4
4
|
import { renderIntlayerNode } from "./IntlayerNode.mjs";
|
|
5
5
|
import { renderReactElement } from "./reactElement/renderReactElement.mjs";
|
|
6
|
+
import { Fragment, createElement } from "react";
|
|
6
7
|
import { editor, internationalization } from "@intlayer/config/built";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
9
|
import { conditionPlugin, enumerationPlugin, fallbackPlugin, filePlugin, genderPlugin, isInterpolableWrapperNode, nestedPlugin, pluralPlugin, selectPlugin, splitInsertionTemplate, transformInterpolableNode, translationPlugin } from "@intlayer/core/interpreter";
|
|
8
10
|
import { getMarkdownMetadata } from "@intlayer/core/markdown";
|
|
9
11
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
10
|
-
import { Fragment, createElement } from "react";
|
|
11
|
-
import { jsx } from "react/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) => m.MarkdownRendererPlugin) : null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { useCurrency } from "./useCurrency.mjs";
|
|
1
2
|
import { useUnit } from "./useUnit.mjs";
|
|
2
3
|
import { useDate } from "./useDate.mjs";
|
|
3
|
-
import { useNumber } from "./useNumber.mjs";
|
|
4
|
-
import { useRelativeTime } from "./useRelativeTime.mjs";
|
|
5
4
|
import { useCompact } from "./useCompact.mjs";
|
|
6
5
|
import { useList } from "./useList.mjs";
|
|
6
|
+
import { useNumber } from "./useNumber.mjs";
|
|
7
7
|
import { usePercentage } from "./usePercentage.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { useRelativeTime } from "./useRelativeTime.mjs";
|
|
9
9
|
|
|
10
10
|
export { useCompact, useCurrency, useDate, useList, useNumber, usePercentage, useRelativeTime, useUnit };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getServerContext } from "./serverContext.mjs";
|
|
2
2
|
import { IntlayerServerContext, IntlayerServerProvider, IntlayerServerVariantContext, locale, setLocale, setVariant } from "./IntlayerServerProvider.mjs";
|
|
3
|
-
import { t } from "./t.mjs";
|
|
4
|
-
import { useI18n } from "./useI18n.mjs";
|
|
5
3
|
import { useIntlayer } from "./useIntlayer.mjs";
|
|
4
|
+
import { useIntl } from "./format/useIntl.mjs";
|
|
5
|
+
import { t } from "./t.mjs";
|
|
6
6
|
import { useDictionary } from "./useDictionary.mjs";
|
|
7
7
|
import { useDictionaryAsync } from "./useDictionaryAsync.mjs";
|
|
8
|
-
import { useLocale } from "./useLocale.mjs";
|
|
9
8
|
import { useLoadDynamic } from "./useLoadDynamic.mjs";
|
|
10
9
|
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
11
|
-
import {
|
|
10
|
+
import { useI18n } from "./useI18n.mjs";
|
|
11
|
+
import { useLocale } from "./useLocale.mjs";
|
|
12
12
|
|
|
13
13
|
export { IntlayerServerContext as IntlayerServer, IntlayerServerProvider, IntlayerServerVariantContext, getServerContext, locale, setLocale, setVariant, t, useDictionary, useDictionaryAsync, useDictionaryDynamic, useI18n, useIntl, useIntlayer, useLoadDynamic, useLocale };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../../../src/markdown/runtime.ts"],"mappings":";;;;;;;qBA+Ba,cAAc;;;;;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../../../src/markdown/runtime.ts"],"mappings":";;;;;;;qBA+Ba,cAAc;;;;;qBA2Ed,qBAAkB;EAE3B,mBACE,oBACA,OAAO,4BACP,oBACG;MAEN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -126,18 +126,19 @@
|
|
|
126
126
|
"prepublish": "cp -f ../../README.md ./README.md",
|
|
127
127
|
"publish": "bun publish || true",
|
|
128
128
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
129
|
+
"publish:ci": "bun ../../scripts/publish-package.mjs",
|
|
129
130
|
"publish:latest": "bun publish --access public --tag latest || true",
|
|
130
131
|
"test": "bun --bun vitest run",
|
|
131
132
|
"test:watch": "bun --bun vitest",
|
|
132
133
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
133
134
|
},
|
|
134
135
|
"dependencies": {
|
|
135
|
-
"@intlayer/api": "9.5.
|
|
136
|
-
"@intlayer/config": "9.5.
|
|
137
|
-
"@intlayer/core": "9.5.
|
|
138
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
139
|
-
"@intlayer/editor": "9.5.
|
|
140
|
-
"@intlayer/types": "9.5.
|
|
136
|
+
"@intlayer/api": "9.5.4",
|
|
137
|
+
"@intlayer/config": "9.5.4",
|
|
138
|
+
"@intlayer/core": "9.5.4",
|
|
139
|
+
"@intlayer/dictionaries-entry": "9.5.4",
|
|
140
|
+
"@intlayer/editor": "9.5.4",
|
|
141
|
+
"@intlayer/types": "9.5.4"
|
|
141
142
|
},
|
|
142
143
|
"devDependencies": {
|
|
143
144
|
"@craco/types": "7.1.0",
|
|
@@ -151,14 +152,14 @@
|
|
|
151
152
|
"rimraf": "6.1.3",
|
|
152
153
|
"tsdown": "0.23.0",
|
|
153
154
|
"typescript": "7.0.2",
|
|
154
|
-
"vitest": "5.0.
|
|
155
|
+
"vitest": "5.0.1"
|
|
155
156
|
},
|
|
156
157
|
"peerDependencies": {
|
|
157
158
|
"react": ">=16.0.0",
|
|
158
159
|
"react-dom": ">=16.0.0"
|
|
159
160
|
},
|
|
160
161
|
"optionalDependencies": {
|
|
161
|
-
"@intlayer/analytics": "9.5.
|
|
162
|
+
"@intlayer/analytics": "9.5.4"
|
|
162
163
|
},
|
|
163
164
|
"engines": {
|
|
164
165
|
"node": ">=14.18"
|