@intlayer/next-i18next 8.12.5-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +330 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/cjs/appWithTranslation.cjs +31 -0
- package/dist/cjs/appWithTranslation.cjs.map +1 -0
- package/dist/cjs/index.cjs +69 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/compareUrls.cjs +39 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/compareUrls.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/ContentSelector.cjs +161 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/ContentSelector.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/ContentSelectorWrapper.cjs +269 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/ContentSelectorWrapper.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/EditedContent.cjs +161 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/EditedContent.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/IntlayerEditorElement.cjs +88 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/IntlayerEditorElement.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/defineIntlayerElements.cjs +27 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/components/defineIntlayerElements.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/CrossFrameMessenger.cjs +80 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/CrossFrameMessenger.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/CrossFrameStateManager.cjs +75 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/CrossFrameStateManager.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/EditorStateManager.cjs +383 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/EditorStateManager.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/IframeClickInterceptor.cjs +45 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/IframeClickInterceptor.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/UrlStateManager.cjs +59 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/UrlStateManager.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/editedContentBus.cjs +36 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/editedContentBus.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/focusedContentBus.cjs +42 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/focusedContentBus.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/globalManager.cjs +82 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/globalManager.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/initEditorClient.cjs +55 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/core/initEditorClient.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/index.cjs +19 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/isEnabled.cjs +9 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/isEnabled.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/mergeIframeClick.cjs +22 -0
- package/dist/cjs/packages/@intlayer/editor/dist/esm/mergeIframeClick.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/unmerged-dictionaries-entry/dist/esm/index.cjs +32 -0
- package/dist/cjs/packages/@intlayer/unmerged-dictionaries-entry/dist/esm/index.cjs.map +1 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/client/IntlayerContext.cjs +25 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/client/IntlayerContext.cjs.map +1 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/client/IntlayerProvider.cjs +78 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/client/IntlayerProvider.cjs.map +1 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/client/useLocaleStorage.cjs +24 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/client/useLocaleStorage.cjs.map +1 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/editor/EditorProvider.cjs +11 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/editor/EditorProvider.cjs.map +1 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/editor/useEditor.cjs +39 -0
- package/dist/cjs/packages/react-intlayer/dist/esm/editor/useEditor.cjs.map +1 -0
- package/dist/cjs/plugin/index.cjs +170 -0
- package/dist/cjs/plugin/index.cjs.map +1 -0
- package/dist/cjs/serverSideTranslations.cjs +46 -0
- package/dist/cjs/serverSideTranslations.cjs.map +1 -0
- package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
- package/dist/esm/appWithTranslation.mjs +29 -0
- package/dist/esm/appWithTranslation.mjs.map +1 -0
- package/dist/esm/index.mjs +11 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/compareUrls.mjs +38 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/compareUrls.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/ContentSelector.mjs +160 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/ContentSelector.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/ContentSelectorWrapper.mjs +266 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/ContentSelectorWrapper.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/EditedContent.mjs +159 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/EditedContent.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/IntlayerEditorElement.mjs +88 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/IntlayerEditorElement.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/defineIntlayerElements.mjs +26 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/components/defineIntlayerElements.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/CrossFrameMessenger.mjs +80 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/CrossFrameMessenger.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/CrossFrameStateManager.mjs +74 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/CrossFrameStateManager.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/EditorStateManager.mjs +381 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/EditorStateManager.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/IframeClickInterceptor.mjs +45 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/IframeClickInterceptor.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/UrlStateManager.mjs +58 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/UrlStateManager.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/editedContentBus.mjs +33 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/editedContentBus.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/focusedContentBus.mjs +39 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/focusedContentBus.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/globalManager.mjs +79 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/globalManager.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/initEditorClient.mjs +52 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/core/initEditorClient.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/index.mjs +18 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/isEnabled.mjs +8 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/isEnabled.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/mergeIframeClick.mjs +21 -0
- package/dist/esm/packages/@intlayer/editor/dist/esm/mergeIframeClick.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/unmerged-dictionaries-entry/dist/esm/index.browser.mjs +6 -0
- package/dist/esm/packages/@intlayer/unmerged-dictionaries-entry/dist/esm/index.browser.mjs.map +1 -0
- package/dist/esm/packages/react-intlayer/dist/esm/client/IntlayerContext.mjs +23 -0
- package/dist/esm/packages/react-intlayer/dist/esm/client/IntlayerContext.mjs.map +1 -0
- package/dist/esm/packages/react-intlayer/dist/esm/client/IntlayerProvider.mjs +77 -0
- package/dist/esm/packages/react-intlayer/dist/esm/client/IntlayerProvider.mjs.map +1 -0
- package/dist/esm/packages/react-intlayer/dist/esm/client/useLocaleStorage.mjs +22 -0
- package/dist/esm/packages/react-intlayer/dist/esm/client/useLocaleStorage.mjs.map +1 -0
- package/dist/esm/packages/react-intlayer/dist/esm/editor/EditorProvider.mjs +11 -0
- package/dist/esm/packages/react-intlayer/dist/esm/editor/EditorProvider.mjs.map +1 -0
- package/dist/esm/packages/react-intlayer/dist/esm/editor/useEditor.mjs +38 -0
- package/dist/esm/packages/react-intlayer/dist/esm/editor/useEditor.mjs.map +1 -0
- package/dist/esm/plugin/index.mjs +165 -0
- package/dist/esm/plugin/index.mjs.map +1 -0
- package/dist/esm/serverSideTranslations.mjs +44 -0
- package/dist/esm/serverSideTranslations.mjs.map +1 -0
- package/dist/types/appWithTranslation.d.ts +18 -0
- package/dist/types/appWithTranslation.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugin/index.d.ts +23 -0
- package/dist/types/plugin/index.d.ts.map +1 -0
- package/dist/types/serverSideTranslations.d.ts +33 -0
- package/dist/types/serverSideTranslations.d.ts.map +1 -0
- package/package.json +116 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
4
|
+
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
5
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
6
|
+
let node_module = require("node:module");
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
let _intlayer_chokidar_utils = require("@intlayer/chokidar/utils");
|
|
9
|
+
let _intlayer_config_node = require("@intlayer/config/node");
|
|
10
|
+
let next_intlayer_server = require("next-intlayer/server");
|
|
11
|
+
|
|
12
|
+
//#region src/plugin/index.ts
|
|
13
|
+
/**
|
|
14
|
+
* `require` that works in both the CJS and ESM builds of this plugin.
|
|
15
|
+
* `import.meta.url` is rewritten to the module path in the CJS output by the
|
|
16
|
+
* bundler, so `createRequire` resolves correctly in either format.
|
|
17
|
+
*/
|
|
18
|
+
const compatRequire = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
19
|
+
/**
|
|
20
|
+
* Maps each original import specifier (next-i18next, react-i18next, i18next) to
|
|
21
|
+
* the `@intlayer/*` specifier that should serve it instead.
|
|
22
|
+
*/
|
|
23
|
+
const ALIAS_ENTRIES = [
|
|
24
|
+
{
|
|
25
|
+
request: "next-i18next",
|
|
26
|
+
replacement: "@intlayer/next-i18next"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
request: "react-i18next",
|
|
30
|
+
replacement: "@intlayer/react-i18next"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
request: "i18next",
|
|
34
|
+
replacement: "@intlayer/i18next"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* Split a package specifier into its package name and export subpath.
|
|
39
|
+
*
|
|
40
|
+
* @param specifier - e.g. `@intlayer/react-i18next` or `i18next`.
|
|
41
|
+
* @returns `{ packageName, exportKey }` where `exportKey` is the `exports` map
|
|
42
|
+
* key (`.` for the package root).
|
|
43
|
+
*/
|
|
44
|
+
const splitSpecifier = (specifier) => {
|
|
45
|
+
const segments = specifier.split("/");
|
|
46
|
+
const packageName = specifier.startsWith("@") ? segments.slice(0, 2).join("/") : segments[0] ?? specifier;
|
|
47
|
+
const subpath = specifier.slice(packageName.length);
|
|
48
|
+
return {
|
|
49
|
+
packageName,
|
|
50
|
+
exportKey: subpath === "" ? "." : `.${subpath}`
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the absolute path of a package export, preferring the ESM (`import`)
|
|
55
|
+
* condition so Turbopack and modern bundlers load the `.mjs` build (which keeps
|
|
56
|
+
* the `"use client"` directives) rather than the CommonJS fallback.
|
|
57
|
+
*
|
|
58
|
+
* Both Turbopack and webpack ignore alias values that are bare package
|
|
59
|
+
* specifiers, so the aliases must point at real files.
|
|
60
|
+
*
|
|
61
|
+
* @param specifier - Package specifier, e.g. `@intlayer/react-i18next`.
|
|
62
|
+
* @returns Absolute path to the resolved module file.
|
|
63
|
+
*/
|
|
64
|
+
const resolveEsmPath = (specifier) => {
|
|
65
|
+
const { packageName, exportKey } = splitSpecifier(specifier);
|
|
66
|
+
const packageJson = compatRequire(`${packageName}/package.json`);
|
|
67
|
+
const packageDir = (0, node_path.dirname)(compatRequire.resolve(`${packageName}/package.json`));
|
|
68
|
+
const exportEntry = packageJson.exports?.[exportKey];
|
|
69
|
+
const relativeFile = typeof exportEntry === "string" ? exportEntry : exportEntry?.import ?? exportEntry?.require ?? exportEntry?.default;
|
|
70
|
+
if (!relativeFile) return compatRequire.resolve(specifier);
|
|
71
|
+
return (0, node_path.resolve)(packageDir, relativeFile);
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Format an absolute path as a project-root-relative specifier (prefixed with
|
|
75
|
+
* `./` and using forward slashes). Turbopack only honours `resolveAlias` values
|
|
76
|
+
* that are project-root-relative paths — bare specifiers are ignored and
|
|
77
|
+
* absolute paths are misread as root-relative. Mirrors `withIntlayer`'s
|
|
78
|
+
* Turbopack alias formatter.
|
|
79
|
+
*
|
|
80
|
+
* @param absolutePath - Absolute path to the target module file.
|
|
81
|
+
* @returns Relative specifier such as `./node_modules/@intlayer/react-i18next/...`.
|
|
82
|
+
*/
|
|
83
|
+
const toTurbopackAlias = (absolutePath) => `./${(0, node_path.relative)(process.cwd(), absolutePath).split(node_path.sep).join("/")}`;
|
|
84
|
+
const NEXT_I18NEXT_SWC_CALLERS = [{
|
|
85
|
+
callerName: "useTranslation",
|
|
86
|
+
importSources: [
|
|
87
|
+
"react-i18next",
|
|
88
|
+
"@intlayer/react-i18next",
|
|
89
|
+
"next-i18next"
|
|
90
|
+
],
|
|
91
|
+
namespaceArgIndex: 0,
|
|
92
|
+
staticReplacement: "useDictionary",
|
|
93
|
+
dynamicReplacement: "useDictionaryDynamic"
|
|
94
|
+
}];
|
|
95
|
+
/**
|
|
96
|
+
* Disables the SWC `replaceDictionaryEntry` optimization on the resolved Next.js
|
|
97
|
+
* config so the runtime dictionary registry stays populated. Mutates the
|
|
98
|
+
* `@intlayer/swc` plugin options in place (both webpack and Turbopack read the
|
|
99
|
+
* same `experimental.swcPlugins` entry).
|
|
100
|
+
*
|
|
101
|
+
* @param config - The Next.js config returned by `withIntlayer`.
|
|
102
|
+
*/
|
|
103
|
+
const keepDictionaryRegistry = (config) => {
|
|
104
|
+
const swcPlugins = config.experimental?.swcPlugins;
|
|
105
|
+
if (!Array.isArray(swcPlugins)) return;
|
|
106
|
+
for (const plugin of swcPlugins) {
|
|
107
|
+
if (!Array.isArray(plugin)) continue;
|
|
108
|
+
const [pluginPath, pluginOptions] = plugin;
|
|
109
|
+
if (typeof pluginPath === "string" && pluginPath.includes("@intlayer/swc") && pluginOptions !== null && typeof pluginOptions === "object") pluginOptions.replaceDictionaryEntry = false;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* A Next.js plugin for next-i18next compat that wraps next-intlayer's plugin
|
|
114
|
+
* and configures resolve aliases so `next-i18next` imports are served by
|
|
115
|
+
* `@intlayer/next-i18next`.
|
|
116
|
+
*/
|
|
117
|
+
const createNextI18nPlugin = (_i18nPath) => {
|
|
118
|
+
return async (nextConfig = {}) => {
|
|
119
|
+
const intlayerConfig = (0, _intlayer_config_node.getConfiguration)();
|
|
120
|
+
const appLogger = (0, _intlayer_config_logger.getAppLogger)(intlayerConfig);
|
|
121
|
+
(0, _intlayer_chokidar_utils.runOnce)((0, node_path.join)(intlayerConfig.system.baseDir, ".intlayer", "cache", "intlayer-issues-invitation.lock"), () => {
|
|
122
|
+
appLogger([(0, _intlayer_config_logger.colorize)("Please report any issues you met on GitHub:", _intlayer_config_colors.GREY), (0, _intlayer_config_logger.colorize)("https://github.com/aymericzip/intlayer/issues", _intlayer_config_colors.GREY_LIGHT)]);
|
|
123
|
+
}, { cacheTimeoutMs: 1e3 * 60 * 60 });
|
|
124
|
+
const customWebpack = nextConfig.webpack;
|
|
125
|
+
const resolvedTargets = ALIAS_ENTRIES.map(({ request, replacement }) => ({
|
|
126
|
+
request,
|
|
127
|
+
absolutePath: resolveEsmPath(replacement)
|
|
128
|
+
}));
|
|
129
|
+
const webpackAlias = Object.fromEntries(resolvedTargets.map(({ request, absolutePath }) => [request, absolutePath]));
|
|
130
|
+
const turboAlias = Object.fromEntries(resolvedTargets.map(({ request, absolutePath }) => [request, toTurbopackAlias(absolutePath)]));
|
|
131
|
+
const aliasConfig = { webpack: (config, options) => {
|
|
132
|
+
config.resolve.alias = {
|
|
133
|
+
...config.resolve.alias,
|
|
134
|
+
...webpackAlias
|
|
135
|
+
};
|
|
136
|
+
if (typeof customWebpack === "function") return customWebpack(config, options);
|
|
137
|
+
return config;
|
|
138
|
+
} };
|
|
139
|
+
const finalConfig = await (0, next_intlayer_server.withIntlayer)({
|
|
140
|
+
...nextConfig,
|
|
141
|
+
...aliasConfig,
|
|
142
|
+
turbopack: {
|
|
143
|
+
...nextConfig.turbopack ?? {},
|
|
144
|
+
resolveAlias: {
|
|
145
|
+
...nextConfig.turbopack?.resolveAlias ?? {},
|
|
146
|
+
...turboAlias
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, { swcExtraCallers: NEXT_I18NEXT_SWC_CALLERS });
|
|
150
|
+
keepDictionaryRegistry(finalConfig);
|
|
151
|
+
return finalConfig;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* A pre-instantiated Next.js plugin for next-i18next compat.
|
|
156
|
+
* Wraps a NextConfig directly without requiring the factory call pattern.
|
|
157
|
+
*
|
|
158
|
+
* Usage:
|
|
159
|
+
* ```ts
|
|
160
|
+
* import { withI18next } from '@intlayer/next-i18next/plugin';
|
|
161
|
+
* export default withI18next(nextConfig);
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
const withI18next = createNextI18nPlugin();
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
exports.createNextI18nPlugin = createNextI18nPlugin;
|
|
168
|
+
exports.default = createNextI18nPlugin;
|
|
169
|
+
exports.withI18next = withI18next;
|
|
170
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["sep","ANSIColors"],"sources":["../../../src/plugin/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { dirname, join, relative, resolve, sep } from 'node:path';\nimport { runOnce } from '@intlayer/chokidar/utils';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { NextConfig } from 'next';\nimport { withIntlayer } from 'next-intlayer/server';\n\n/**\n * `require` that works in both the CJS and ESM builds of this plugin.\n * `import.meta.url` is rewritten to the module path in the CJS output by the\n * bundler, so `createRequire` resolves correctly in either format.\n */\nconst compatRequire = createRequire(import.meta.url);\n\n/**\n * Maps each original import specifier (next-i18next, react-i18next, i18next) to\n * the `@intlayer/*` specifier that should serve it instead.\n */\nconst ALIAS_ENTRIES: { request: string; replacement: string }[] = [\n { request: 'next-i18next', replacement: '@intlayer/next-i18next' },\n { request: 'react-i18next', replacement: '@intlayer/react-i18next' },\n { request: 'i18next', replacement: '@intlayer/i18next' },\n];\n\n/**\n * Split a package specifier into its package name and export subpath.\n *\n * @param specifier - e.g. `@intlayer/react-i18next` or `i18next`.\n * @returns `{ packageName, exportKey }` where `exportKey` is the `exports` map\n * key (`.` for the package root).\n */\nconst splitSpecifier = (\n specifier: string\n): { packageName: string; exportKey: string } => {\n const segments = specifier.split('/');\n const packageName = specifier.startsWith('@')\n ? segments.slice(0, 2).join('/')\n : (segments[0] ?? specifier);\n const subpath = specifier.slice(packageName.length);\n return { packageName, exportKey: subpath === '' ? '.' : `.${subpath}` };\n};\n\n/**\n * Resolve the absolute path of a package export, preferring the ESM (`import`)\n * condition so Turbopack and modern bundlers load the `.mjs` build (which keeps\n * the `\"use client\"` directives) rather than the CommonJS fallback.\n *\n * Both Turbopack and webpack ignore alias values that are bare package\n * specifiers, so the aliases must point at real files.\n *\n * @param specifier - Package specifier, e.g. `@intlayer/react-i18next`.\n * @returns Absolute path to the resolved module file.\n */\nconst resolveEsmPath = (specifier: string): string => {\n const { packageName, exportKey } = splitSpecifier(specifier);\n const packageJson = compatRequire(`${packageName}/package.json`) as {\n exports?: Record<\n string,\n string | { import?: string; require?: string; default?: string }\n >;\n };\n const packageDir = dirname(\n compatRequire.resolve(`${packageName}/package.json`)\n );\n\n const exportEntry = packageJson.exports?.[exportKey];\n const relativeFile =\n typeof exportEntry === 'string'\n ? exportEntry\n : (exportEntry?.import ?? exportEntry?.require ?? exportEntry?.default);\n\n // Fall back to Node resolution if the exports map is unexpected.\n if (!relativeFile) return compatRequire.resolve(specifier);\n\n return resolve(packageDir, relativeFile);\n};\n\n/**\n * Format an absolute path as a project-root-relative specifier (prefixed with\n * `./` and using forward slashes). Turbopack only honours `resolveAlias` values\n * that are project-root-relative paths — bare specifiers are ignored and\n * absolute paths are misread as root-relative. Mirrors `withIntlayer`'s\n * Turbopack alias formatter.\n *\n * @param absolutePath - Absolute path to the target module file.\n * @returns Relative specifier such as `./node_modules/@intlayer/react-i18next/...`.\n */\nconst toTurbopackAlias = (absolutePath: string): string =>\n `./${relative(process.cwd(), absolutePath).split(sep).join('/')}`;\n\nconst NEXT_I18NEXT_SWC_CALLERS = [\n {\n callerName: 'useTranslation',\n importSources: ['react-i18next', '@intlayer/react-i18next', 'next-i18next'],\n namespaceArgIndex: 0,\n staticReplacement: 'useDictionary',\n dynamicReplacement: 'useDictionaryDynamic',\n },\n];\n\n/**\n * Disables the SWC `replaceDictionaryEntry` optimization on the resolved Next.js\n * config so the runtime dictionary registry stays populated. Mutates the\n * `@intlayer/swc` plugin options in place (both webpack and Turbopack read the\n * same `experimental.swcPlugins` entry).\n *\n * @param config - The Next.js config returned by `withIntlayer`.\n */\nconst keepDictionaryRegistry = (config: NextConfig): void => {\n const swcPlugins = (\n config.experimental as { swcPlugins?: unknown[] } | undefined\n )?.swcPlugins;\n if (!Array.isArray(swcPlugins)) return;\n\n for (const plugin of swcPlugins) {\n if (!Array.isArray(plugin)) continue;\n const [pluginPath, pluginOptions] = plugin as [unknown, unknown];\n if (\n typeof pluginPath === 'string' &&\n pluginPath.includes('@intlayer/swc') &&\n pluginOptions !== null &&\n typeof pluginOptions === 'object'\n ) {\n (pluginOptions as Record<string, unknown>).replaceDictionaryEntry = false;\n }\n }\n};\n\n/**\n * A Next.js plugin for next-i18next compat that wraps next-intlayer's plugin\n * and configures resolve aliases so `next-i18next` imports are served by\n * `@intlayer/next-i18next`.\n */\nexport const createNextI18nPlugin = (_i18nPath?: string) => {\n return async (nextConfig: NextConfig = {}): Promise<NextConfig> => {\n const intlayerConfig = getConfiguration();\n const appLogger = getAppLogger(intlayerConfig);\n\n runOnce(\n join(\n intlayerConfig.system.baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-issues-invitation.lock'\n ),\n () => {\n appLogger([\n colorize(\n 'Please report any issues you met on GitHub:',\n ANSIColors.GREY\n ),\n colorize(\n 'https://github.com/aymericzip/intlayer/issues',\n ANSIColors.GREY_LIGHT\n ),\n ]);\n },\n {\n cacheTimeoutMs: 1000 * 60 * 60, // 1 hour\n }\n );\n\n const customWebpack = nextConfig.webpack;\n\n const resolvedTargets = ALIAS_ENTRIES.map(({ request, replacement }) => ({\n request,\n absolutePath: resolveEsmPath(replacement),\n }));\n\n // Webpack resolves aliases from absolute paths.\n const webpackAlias = Object.fromEntries(\n resolvedTargets.map(({ request, absolutePath }) => [\n request,\n absolutePath,\n ])\n );\n\n // Turbopack only honours project-root-relative `./` paths.\n const turboAlias = Object.fromEntries(\n resolvedTargets.map(({ request, absolutePath }) => [\n request,\n toTurbopackAlias(absolutePath),\n ])\n );\n\n const aliasConfig = {\n webpack: (config: any, options: any) => {\n config.resolve.alias = {\n ...config.resolve.alias,\n ...webpackAlias,\n };\n\n if (typeof customWebpack === 'function') {\n return customWebpack(config, options);\n }\n return config;\n },\n };\n\n const mergedConfig: NextConfig = {\n ...nextConfig,\n ...aliasConfig,\n turbopack: {\n ...(nextConfig.turbopack ?? {}),\n resolveAlias: {\n ...(nextConfig.turbopack?.resolveAlias ?? {}),\n ...turboAlias,\n },\n },\n };\n\n const finalConfig = await withIntlayer(mergedConfig, {\n swcExtraCallers: NEXT_I18NEXT_SWC_CALLERS,\n });\n\n // i18next exposes runtime namespace APIs (`i18n.getFixedT(locale, ns)`,\n // `t('ns:key')`) that resolve dictionaries at runtime through `getIntlayer`.\n // Unlike `useTranslation('ns')`, these are not statically analyzable, so the\n // SWC cannot rewrite them to direct dictionary imports. The build optimization\n // normally empties the runtime dictionary registry (`replaceDictionaryEntry`),\n // which would make those APIs fall back to raw keys on the server. Keeping the\n // registry populated restores them; statically analyzable call sites are still\n // rewritten to direct imports, so client bundles stay tree-shaken.\n keepDictionaryRegistry(finalConfig);\n\n return finalConfig;\n };\n};\n\nexport default createNextI18nPlugin;\n\n/**\n * A pre-instantiated Next.js plugin for next-i18next compat.\n * Wraps a NextConfig directly without requiring the factory call pattern.\n *\n * Usage:\n * ```ts\n * import { withI18next } from '@intlayer/next-i18next/plugin';\n * export default withI18next(nextConfig);\n * ```\n */\nexport const withI18next = createNextI18nPlugin();\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAM,6FAA8C;;;;;AAMpD,MAAM,gBAA4D;CAChE;EAAE,SAAS;EAAgB,aAAa;EAA0B;CAClE;EAAE,SAAS;EAAiB,aAAa;EAA2B;CACpE;EAAE,SAAS;EAAW,aAAa;EAAqB;CACzD;;;;;;;;AASD,MAAM,kBACJ,cAC+C;CAC/C,MAAM,WAAW,UAAU,MAAM,IAAI;CACrC,MAAM,cAAc,UAAU,WAAW,IAAI,GACzC,SAAS,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,GAC7B,SAAS,MAAM;CACpB,MAAM,UAAU,UAAU,MAAM,YAAY,OAAO;AACnD,QAAO;EAAE;EAAa,WAAW,YAAY,KAAK,MAAM,IAAI;EAAW;;;;;;;;;;;;;AAczE,MAAM,kBAAkB,cAA8B;CACpD,MAAM,EAAE,aAAa,cAAc,eAAe,UAAU;CAC5D,MAAM,cAAc,cAAc,GAAG,YAAY,eAAe;CAMhE,MAAM,oCACJ,cAAc,QAAQ,GAAG,YAAY,eAAe,CACrD;CAED,MAAM,cAAc,YAAY,UAAU;CAC1C,MAAM,eACJ,OAAO,gBAAgB,WACnB,cACC,aAAa,UAAU,aAAa,WAAW,aAAa;AAGnE,KAAI,CAAC,aAAc,QAAO,cAAc,QAAQ,UAAU;AAE1D,+BAAe,YAAY,aAAa;;;;;;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iB;AACtC,UAAO,QAAQ,QAAQ;IACrB,GAAG,OAAO,QAAQ;IAClB,GAAG;IACJ;AAED,OAAI,OAAO,kBAAkB,WAC3B,QAAO,cAAc,QAAQ,QAAQ;AAEvC,UAAO;KAEV;EAcD,MAAM,cAAc,6CAAmB;GAXrC,GAAG;GACH,GAAG;GACH,WAAW;IACT,GAAI,WAAW,aAAa,EAAE;IAC9B,cAAc;KACZ,GAAI,WAAW,WAAW,gBAAgB,EAAE;KAC5C,GAAG;KACJ;IACF;GAGgD,EAAE,EACnD,iBAAiB,0BAClB,CAAC;AAUF,yBAAuB,YAAY;AAEnC,SAAO;;;;;;;;;;;;;AAgBX,MAAa,cAAc,sBAAsB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
+
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
5
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
6
|
+
|
|
7
|
+
//#region src/serverSideTranslations.ts
|
|
8
|
+
/**
|
|
9
|
+
* Drop-in replacement for next-i18next's `serverSideTranslations`.
|
|
10
|
+
*
|
|
11
|
+
* In next-i18next this function loads translation JSON files and injects
|
|
12
|
+
* them as `_nextI18Next` props so `useTranslation` can hydrate on the client.
|
|
13
|
+
*
|
|
14
|
+
* With Intlayer all dictionaries are compiled at build time so no runtime
|
|
15
|
+
* loading is needed. This function returns the minimal shape expected by
|
|
16
|
+
* `appWithTranslation` / `useTranslation` for drop-in compatibility.
|
|
17
|
+
*
|
|
18
|
+
* @deprecated serverSideTranslations has no use case with intlayer.
|
|
19
|
+
* Dictionaries are compiled at build time and loaded automatically.
|
|
20
|
+
*
|
|
21
|
+
* @param locale - The active locale (e.g. from `getStaticProps` context).
|
|
22
|
+
* @param namespacesRequired - Namespace list; recorded but not loaded.
|
|
23
|
+
* @param configOverride - Config override; recorded but not applied.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* export const getStaticProps = async ({ locale }) => ({
|
|
28
|
+
* props: {
|
|
29
|
+
* ...(await serverSideTranslations(locale, ['common'])),
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
const serverSideTranslations = async (locale, namespacesRequired, configOverride) => {
|
|
35
|
+
if (process.env.NODE_ENV === "development") (0, _intlayer_config_logger.getAppLogger)({ log: _intlayer_config_built.log })(`${(0, _intlayer_config_logger.colorize)("serverSideTranslations", _intlayer_config_colors.CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`);
|
|
36
|
+
return { _nextI18Next: {
|
|
37
|
+
initialLocale: locale,
|
|
38
|
+
initialI18nStore: {},
|
|
39
|
+
ns: namespacesRequired ?? ["common"],
|
|
40
|
+
userConfig: configOverride ?? null
|
|
41
|
+
} };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.serverSideTranslations = serverSideTranslations;
|
|
46
|
+
//# sourceMappingURL=serverSideTranslations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverSideTranslations.cjs","names":["CYAN"],"sources":["../../src/serverSideTranslations.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Drop-in replacement for next-i18next's `serverSideTranslations`.\n *\n * In next-i18next this function loads translation JSON files and injects\n * them as `_nextI18Next` props so `useTranslation` can hydrate on the client.\n *\n * With Intlayer all dictionaries are compiled at build time so no runtime\n * loading is needed. This function returns the minimal shape expected by\n * `appWithTranslation` / `useTranslation` for drop-in compatibility.\n *\n * @deprecated serverSideTranslations has no use case with intlayer.\n * Dictionaries are compiled at build time and loaded automatically.\n *\n * @param locale - The active locale (e.g. from `getStaticProps` context).\n * @param namespacesRequired - Namespace list; recorded but not loaded.\n * @param configOverride - Config override; recorded but not applied.\n *\n * @example\n * ```ts\n * export const getStaticProps = async ({ locale }) => ({\n * props: {\n * ...(await serverSideTranslations(locale, ['common'])),\n * },\n * });\n * ```\n */\nexport const serverSideTranslations = async (\n locale: string,\n namespacesRequired?: string[],\n configOverride?: Record<string, unknown>\n): Promise<{ _nextI18Next: Record<string, unknown> }> => {\n if (process.env.NODE_ENV === 'development') {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('serverSideTranslations', CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`\n );\n }\n\n return {\n _nextI18Next: {\n initialLocale: locale,\n initialI18nStore: {},\n ns: namespacesRequired ?? ['common'],\n userConfig: configOverride ?? null,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyB,OACpC,QACA,oBACA,mBACuD;AACvD,KAAI,QAAQ,IAAI,aAAa,cAE3B,2CAD+B,EAAE,iCAAK,CAC7B,CACP,yCAAY,0BAA0BA,6BAAK,CAAC,kHAC7C;AAGH,QAAO,EACL,cAAc;EACZ,eAAe;EACf,kBAAkB,EAAE;EACpB,IAAI,sBAAsB,CAAC,SAAS;EACpC,YAAY,kBAAkB;EAC/B,EACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
3
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
4
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { __require };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IntlayerProvider } from "react-intlayer";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/appWithTranslation.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Drop-in replacement for next-i18next's `appWithTranslation` HOC.
|
|
7
|
+
*
|
|
8
|
+
* Wraps the Next.js `App` component in `IntlayerProvider` and passes the
|
|
9
|
+
* active locale from `_nextI18Next.initialLocale` or the Next.js router.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* export default appWithTranslation(MyApp);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
const appWithTranslation = (WrappedApp, _configOverride) => {
|
|
17
|
+
const AppWithTranslation = (props) => {
|
|
18
|
+
return /* @__PURE__ */ jsx(IntlayerProvider, {
|
|
19
|
+
locale: props.pageProps?._nextI18Next?.initialLocale ?? props.router?.locale,
|
|
20
|
+
children: /* @__PURE__ */ jsx(WrappedApp, { ...props })
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
AppWithTranslation.displayName = `appWithTranslation(${WrappedApp.displayName ?? WrappedApp.name ?? "App"})`;
|
|
24
|
+
return AppWithTranslation;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { appWithTranslation };
|
|
29
|
+
//# sourceMappingURL=appWithTranslation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appWithTranslation.mjs","names":[],"sources":["../../src/appWithTranslation.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { appWithTranslation as _appWithTranslation } from 'next-i18next/pages';\nimport type * as React from 'react';\nimport { IntlayerProvider } from 'react-intlayer';\n\n/**\n * Drop-in replacement for next-i18next's `appWithTranslation` HOC.\n *\n * Wraps the Next.js `App` component in `IntlayerProvider` and passes the\n * active locale from `_nextI18Next.initialLocale` or the Next.js router.\n *\n * @example\n * ```tsx\n * export default appWithTranslation(MyApp);\n * ```\n */\nexport const appWithTranslation: typeof _appWithTranslation = (\n WrappedApp,\n _configOverride?\n) => {\n const AppWithTranslation = (\n props: React.ComponentProps<typeof WrappedApp> & {\n pageProps: {\n _nextI18Next?: { initialLocale?: string };\n [key: string]: unknown;\n };\n router?: { locale?: string };\n }\n ) => {\n const locale: string | undefined =\n props.pageProps?._nextI18Next?.initialLocale ?? props.router?.locale;\n\n return (\n <IntlayerProvider locale={locale as LocalesValues}>\n <WrappedApp {...props} />\n </IntlayerProvider>\n );\n };\n\n AppWithTranslation.displayName = `appWithTranslation(${\n WrappedApp.displayName ?? WrappedApp.name ?? 'App'\n })`;\n\n return AppWithTranslation as unknown as ReturnType<\n typeof _appWithTranslation\n >;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAa,sBACX,YACA,oBACG;CACH,MAAM,sBACJ,UAOG;AAIH,SACE,oBAAC,kBAAD;GAAkB,QAHlB,MAAM,WAAW,cAAc,iBAAiB,MAAM,QAAQ;aAI5D,oBAAC,YAAD,EAAY,GAAI,OAAS;GACR;;AAIvB,oBAAmB,cAAc,sBAC/B,WAAW,eAAe,WAAW,QAAQ,MAC9C;AAED,QAAO"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { appWithTranslation } from "./appWithTranslation.mjs";
|
|
2
|
+
import { serverSideTranslations } from "./serverSideTranslations.mjs";
|
|
3
|
+
import { i18next } from "@intlayer/i18next";
|
|
4
|
+
import { I18nContext, I18nextProvider, Trans, Translation, initReactI18next, useDictionary, useDictionaryDynamic, useTranslation, withTranslation } from "@intlayer/react-i18next";
|
|
5
|
+
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const i18n = i18next;
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { I18nContext, I18nextProvider, Trans, Translation, appWithTranslation, i18n, initReactI18next, serverSideTranslations, useDictionary, useDictionaryDynamic, useTranslation, withTranslation };
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { type i18n as I18nType, i18next } from '@intlayer/i18next';\n\nexport const i18n = i18next as unknown as I18nType;\n\nexport {\n I18nContext,\n I18nextProvider,\n initReactI18next,\n Trans,\n Translation,\n useDictionary,\n useDictionaryDynamic,\n useTranslation,\n withTranslation,\n} from '@intlayer/react-i18next';\n\nexport { appWithTranslation } from './appWithTranslation';\nexport { serverSideTranslations } from './serverSideTranslations';\n"],"mappings":";;;;;;AAEA,MAAa,OAAO"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region ../../packages/@intlayer/editor/dist/esm/compareUrls.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Compare two URLs for equality.
|
|
4
|
+
* This function is used to determine if a message originates from the same origin.
|
|
5
|
+
*
|
|
6
|
+
* ```js
|
|
7
|
+
* // Example usage
|
|
8
|
+
* console.log(compareUrls("http://localhost:5173/", "http://localhost:5173")); // true
|
|
9
|
+
* console.log(compareUrls("http://localhost:5173", "http://localhost:5173?myParam=true")); // true
|
|
10
|
+
* console.log(compareUrls("http://localhost:5173/subpath", "http://localhost:5173")); // true
|
|
11
|
+
* console.log(compareUrls("http://localhost:5172", "http://localhost:5173")); // false
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param url1 - The first URL to compare.
|
|
15
|
+
* @param url2 - The second URL to compare.
|
|
16
|
+
* @returns Whether the two URLs are equal.
|
|
17
|
+
*/
|
|
18
|
+
const compareUrls = (url1, url2) => {
|
|
19
|
+
try {
|
|
20
|
+
const parsedUrl1 = new URL(url1);
|
|
21
|
+
const parsedUrl2 = new URL(url2);
|
|
22
|
+
if (parsedUrl1.protocol !== parsedUrl2.protocol || parsedUrl1.hostname !== parsedUrl2.hostname || parsedUrl1.port !== parsedUrl2.port) return false;
|
|
23
|
+
const path1 = parsedUrl1.pathname.replace(/\/$/, "");
|
|
24
|
+
const path2 = parsedUrl2.pathname.replace(/\/$/, "");
|
|
25
|
+
if (path1 !== "" && path2 !== "" && path1 !== path2) return false;
|
|
26
|
+
return true;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error("Invalid URL(s)", error, {
|
|
29
|
+
url1,
|
|
30
|
+
url2
|
|
31
|
+
});
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { compareUrls };
|
|
38
|
+
//# sourceMappingURL=compareUrls.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareUrls.mjs","names":[],"sources":["../../../../../../../../../packages/@intlayer/editor/dist/esm/compareUrls.mjs"],"sourcesContent":["//#region src/compareUrls.ts\n/**\n* Compare two URLs for equality.\n* This function is used to determine if a message originates from the same origin.\n*\n* ```js\n* // Example usage\n* console.log(compareUrls(\"http://localhost:5173/\", \"http://localhost:5173\")); // true\n* console.log(compareUrls(\"http://localhost:5173\", \"http://localhost:5173?myParam=true\")); // true\n* console.log(compareUrls(\"http://localhost:5173/subpath\", \"http://localhost:5173\")); // true\n* console.log(compareUrls(\"http://localhost:5172\", \"http://localhost:5173\")); // false\n* ```\n*\n* @param url1 - The first URL to compare.\n* @param url2 - The second URL to compare.\n* @returns Whether the two URLs are equal.\n*/\nconst compareUrls = (url1, url2) => {\n\ttry {\n\t\tconst parsedUrl1 = new URL(url1);\n\t\tconst parsedUrl2 = new URL(url2);\n\t\tif (parsedUrl1.protocol !== parsedUrl2.protocol || parsedUrl1.hostname !== parsedUrl2.hostname || parsedUrl1.port !== parsedUrl2.port) return false;\n\t\tconst path1 = parsedUrl1.pathname.replace(/\\/$/, \"\");\n\t\tconst path2 = parsedUrl2.pathname.replace(/\\/$/, \"\");\n\t\tif (path1 !== \"\" && path2 !== \"\" && path1 !== path2) return false;\n\t\treturn true;\n\t} catch (error) {\n\t\tconsole.error(\"Invalid URL(s)\", error, {\n\t\t\turl1,\n\t\t\turl2\n\t\t});\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { compareUrls };\n//# sourceMappingURL=compareUrls.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,eAAe,MAAM,SAAS;AACnC,KAAI;EACH,MAAM,aAAa,IAAI,IAAI,KAAK;EAChC,MAAM,aAAa,IAAI,IAAI,KAAK;AAChC,MAAI,WAAW,aAAa,WAAW,YAAY,WAAW,aAAa,WAAW,YAAY,WAAW,SAAS,WAAW,KAAM,QAAO;EAC9I,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;EACpD,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;AACpD,MAAI,UAAU,MAAM,UAAU,MAAM,UAAU,MAAO,QAAO;AAC5D,SAAO;UACC,OAAO;AACf,UAAQ,MAAM,kBAAkB,OAAO;GACtC;GACA;GACA,CAAC;AACF,SAAO"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
//#region ../../packages/@intlayer/editor/dist/esm/components/ContentSelector.mjs
|
|
2
|
+
const DEFAULT_PRESS_DURATION = 250;
|
|
3
|
+
const STYLES = `
|
|
4
|
+
:host {
|
|
5
|
+
display: contents;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.wrapper {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
user-select: none;
|
|
12
|
+
border-radius: 0.375rem;
|
|
13
|
+
outline-width: 2px;
|
|
14
|
+
outline-offset: 4px;
|
|
15
|
+
outline-style: solid;
|
|
16
|
+
outline-color: transparent;
|
|
17
|
+
transition: all 100ms 50ms ease-in-out;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.wrapper[data-active] {
|
|
21
|
+
outline-color: inherit;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const _HTMLElement = typeof HTMLElement !== "undefined" ? HTMLElement : class {};
|
|
25
|
+
/**
|
|
26
|
+
* <intlayer-content-selector>
|
|
27
|
+
*
|
|
28
|
+
* A framework-agnostic web component that wraps content with Intlayer editor
|
|
29
|
+
* selection UI (hover outline, long-press to select, click-outside to deselect).
|
|
30
|
+
*
|
|
31
|
+
* @fires intlayer:press - Fired after a long press (pressDuration ms). Bubbles.
|
|
32
|
+
* @fires intlayer:hover - Fired on mouseenter. Bubbles.
|
|
33
|
+
* @fires intlayer:unhover - Fired on mouseleave / mouseup. Bubbles.
|
|
34
|
+
* @fires intlayer:click-outside - Fired when a click occurs outside the element. Bubbles.
|
|
35
|
+
*
|
|
36
|
+
* @prop {boolean} isSelecting - Whether this element is currently selected (external state)
|
|
37
|
+
* @prop {number} pressDuration - Long-press threshold in ms. Default: 250
|
|
38
|
+
*/
|
|
39
|
+
var IntlayerContentSelectorElement = class extends _HTMLElement {
|
|
40
|
+
_isSelecting = false;
|
|
41
|
+
_pressDuration = DEFAULT_PRESS_DURATION;
|
|
42
|
+
_isHovered = false;
|
|
43
|
+
_isSelectingState = false;
|
|
44
|
+
_wrapper;
|
|
45
|
+
_pressTimer = null;
|
|
46
|
+
_clickOutsideHandler = null;
|
|
47
|
+
static get observedAttributes() {
|
|
48
|
+
return ["is-selecting", "press-duration"];
|
|
49
|
+
}
|
|
50
|
+
get isSelecting() {
|
|
51
|
+
return this._isSelecting;
|
|
52
|
+
}
|
|
53
|
+
set isSelecting(v) {
|
|
54
|
+
this._isSelecting = v;
|
|
55
|
+
this._updateActiveState();
|
|
56
|
+
}
|
|
57
|
+
get pressDuration() {
|
|
58
|
+
return this._pressDuration;
|
|
59
|
+
}
|
|
60
|
+
set pressDuration(v) {
|
|
61
|
+
this._pressDuration = v;
|
|
62
|
+
}
|
|
63
|
+
constructor() {
|
|
64
|
+
super();
|
|
65
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
66
|
+
const style = document.createElement("style");
|
|
67
|
+
style.textContent = STYLES;
|
|
68
|
+
shadow.appendChild(style);
|
|
69
|
+
const wrapper = document.createElement("span");
|
|
70
|
+
wrapper.className = "wrapper";
|
|
71
|
+
wrapper.setAttribute("role", "button");
|
|
72
|
+
wrapper.setAttribute("tabindex", "0");
|
|
73
|
+
wrapper.appendChild(document.createElement("slot"));
|
|
74
|
+
shadow.appendChild(wrapper);
|
|
75
|
+
this._wrapper = wrapper;
|
|
76
|
+
wrapper.addEventListener("mousedown", () => this._handleMouseDown());
|
|
77
|
+
wrapper.addEventListener("mouseup", () => this._handleMouseUpOrLeave());
|
|
78
|
+
wrapper.addEventListener("mouseleave", () => this._handleMouseUpOrLeave());
|
|
79
|
+
wrapper.addEventListener("mouseenter", () => this._handleMouseEnter());
|
|
80
|
+
wrapper.addEventListener("click", (e) => this._handleClick(e));
|
|
81
|
+
wrapper.addEventListener("touchstart", () => this._handleMouseDown());
|
|
82
|
+
wrapper.addEventListener("touchend", () => this._handleMouseUpOrLeave());
|
|
83
|
+
wrapper.addEventListener("touchcancel", () => this._handleMouseUpOrLeave());
|
|
84
|
+
wrapper.addEventListener("blur", () => this._handleBlur());
|
|
85
|
+
}
|
|
86
|
+
attributeChangedCallback(name, _oldVal, newVal) {
|
|
87
|
+
if (name === "is-selecting") {
|
|
88
|
+
this._isSelecting = newVal !== null;
|
|
89
|
+
this._updateActiveState();
|
|
90
|
+
} else if (name === "press-duration") this._pressDuration = newVal !== null ? parseInt(newVal, 10) : DEFAULT_PRESS_DURATION;
|
|
91
|
+
}
|
|
92
|
+
connectedCallback() {
|
|
93
|
+
this._clickOutsideHandler = (e) => {
|
|
94
|
+
if (!e.composedPath().includes(this)) {
|
|
95
|
+
this._isSelectingState = false;
|
|
96
|
+
this._dispatch("intlayer:click-outside");
|
|
97
|
+
this._updateActiveState();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
document.addEventListener("mousedown", this._clickOutsideHandler);
|
|
101
|
+
}
|
|
102
|
+
disconnectedCallback() {
|
|
103
|
+
if (this._clickOutsideHandler) {
|
|
104
|
+
document.removeEventListener("mousedown", this._clickOutsideHandler);
|
|
105
|
+
this._clickOutsideHandler = null;
|
|
106
|
+
}
|
|
107
|
+
this._clearPressTimer();
|
|
108
|
+
}
|
|
109
|
+
_updateActiveState() {
|
|
110
|
+
if (this._isSelecting || this._isSelectingState || this._isHovered) this._wrapper.setAttribute("data-active", "");
|
|
111
|
+
else this._wrapper.removeAttribute("data-active");
|
|
112
|
+
}
|
|
113
|
+
_clearPressTimer() {
|
|
114
|
+
if (this._pressTimer !== null) {
|
|
115
|
+
clearTimeout(this._pressTimer);
|
|
116
|
+
this._pressTimer = null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
_dispatch(eventName) {
|
|
120
|
+
this.dispatchEvent(new CustomEvent(eventName, {
|
|
121
|
+
bubbles: true,
|
|
122
|
+
composed: true
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
_handleMouseDown() {
|
|
126
|
+
this._clearPressTimer();
|
|
127
|
+
this._pressTimer = setTimeout(() => {
|
|
128
|
+
this._isSelectingState = true;
|
|
129
|
+
this._updateActiveState();
|
|
130
|
+
this._dispatch("intlayer:press");
|
|
131
|
+
}, this._pressDuration);
|
|
132
|
+
}
|
|
133
|
+
_handleMouseEnter() {
|
|
134
|
+
this._isHovered = true;
|
|
135
|
+
this._updateActiveState();
|
|
136
|
+
this._dispatch("intlayer:hover");
|
|
137
|
+
}
|
|
138
|
+
_handleMouseUpOrLeave() {
|
|
139
|
+
if (this._isHovered) {
|
|
140
|
+
this._isHovered = false;
|
|
141
|
+
this._dispatch("intlayer:unhover");
|
|
142
|
+
}
|
|
143
|
+
this._clearPressTimer();
|
|
144
|
+
this._updateActiveState();
|
|
145
|
+
}
|
|
146
|
+
_handleClick(e) {
|
|
147
|
+
if (this._isSelecting || this._isSelectingState) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
_handleBlur() {
|
|
153
|
+
this._isSelectingState = false;
|
|
154
|
+
this._updateActiveState();
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
export { IntlayerContentSelectorElement };
|
|
160
|
+
//# sourceMappingURL=ContentSelector.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentSelector.mjs","names":[],"sources":["../../../../../../../../../../packages/@intlayer/editor/dist/esm/components/ContentSelector.mjs"],"sourcesContent":["//#region src/components/ContentSelector.ts\nconst DEFAULT_PRESS_DURATION = 250;\nconst STYLES = `\n :host {\n display: contents;\n }\n\n .wrapper {\n display: inline-block;\n cursor: pointer;\n user-select: none;\n border-radius: 0.375rem;\n outline-width: 2px;\n outline-offset: 4px;\n outline-style: solid;\n outline-color: transparent;\n transition: all 100ms 50ms ease-in-out;\n }\n\n .wrapper[data-active] {\n outline-color: inherit;\n }\n`;\nconst _HTMLElement = typeof HTMLElement !== \"undefined\" ? HTMLElement : class {};\n/**\n* <intlayer-content-selector>\n*\n* A framework-agnostic web component that wraps content with Intlayer editor\n* selection UI (hover outline, long-press to select, click-outside to deselect).\n*\n* @fires intlayer:press - Fired after a long press (pressDuration ms). Bubbles.\n* @fires intlayer:hover - Fired on mouseenter. Bubbles.\n* @fires intlayer:unhover - Fired on mouseleave / mouseup. Bubbles.\n* @fires intlayer:click-outside - Fired when a click occurs outside the element. Bubbles.\n*\n* @prop {boolean} isSelecting - Whether this element is currently selected (external state)\n* @prop {number} pressDuration - Long-press threshold in ms. Default: 250\n*/\nvar IntlayerContentSelectorElement = class extends _HTMLElement {\n\t_isSelecting = false;\n\t_pressDuration = DEFAULT_PRESS_DURATION;\n\t_isHovered = false;\n\t_isSelectingState = false;\n\t_wrapper;\n\t_pressTimer = null;\n\t_clickOutsideHandler = null;\n\tstatic get observedAttributes() {\n\t\treturn [\"is-selecting\", \"press-duration\"];\n\t}\n\tget isSelecting() {\n\t\treturn this._isSelecting;\n\t}\n\tset isSelecting(v) {\n\t\tthis._isSelecting = v;\n\t\tthis._updateActiveState();\n\t}\n\tget pressDuration() {\n\t\treturn this._pressDuration;\n\t}\n\tset pressDuration(v) {\n\t\tthis._pressDuration = v;\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: \"open\" });\n\t\tconst style = document.createElement(\"style\");\n\t\tstyle.textContent = STYLES;\n\t\tshadow.appendChild(style);\n\t\tconst wrapper = document.createElement(\"span\");\n\t\twrapper.className = \"wrapper\";\n\t\twrapper.setAttribute(\"role\", \"button\");\n\t\twrapper.setAttribute(\"tabindex\", \"0\");\n\t\twrapper.appendChild(document.createElement(\"slot\"));\n\t\tshadow.appendChild(wrapper);\n\t\tthis._wrapper = wrapper;\n\t\twrapper.addEventListener(\"mousedown\", () => this._handleMouseDown());\n\t\twrapper.addEventListener(\"mouseup\", () => this._handleMouseUpOrLeave());\n\t\twrapper.addEventListener(\"mouseleave\", () => this._handleMouseUpOrLeave());\n\t\twrapper.addEventListener(\"mouseenter\", () => this._handleMouseEnter());\n\t\twrapper.addEventListener(\"click\", (e) => this._handleClick(e));\n\t\twrapper.addEventListener(\"touchstart\", () => this._handleMouseDown());\n\t\twrapper.addEventListener(\"touchend\", () => this._handleMouseUpOrLeave());\n\t\twrapper.addEventListener(\"touchcancel\", () => this._handleMouseUpOrLeave());\n\t\twrapper.addEventListener(\"blur\", () => this._handleBlur());\n\t}\n\tattributeChangedCallback(name, _oldVal, newVal) {\n\t\tif (name === \"is-selecting\") {\n\t\t\tthis._isSelecting = newVal !== null;\n\t\t\tthis._updateActiveState();\n\t\t} else if (name === \"press-duration\") this._pressDuration = newVal !== null ? parseInt(newVal, 10) : DEFAULT_PRESS_DURATION;\n\t}\n\tconnectedCallback() {\n\t\tthis._clickOutsideHandler = (e) => {\n\t\t\tif (!e.composedPath().includes(this)) {\n\t\t\t\tthis._isSelectingState = false;\n\t\t\t\tthis._dispatch(\"intlayer:click-outside\");\n\t\t\t\tthis._updateActiveState();\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener(\"mousedown\", this._clickOutsideHandler);\n\t}\n\tdisconnectedCallback() {\n\t\tif (this._clickOutsideHandler) {\n\t\t\tdocument.removeEventListener(\"mousedown\", this._clickOutsideHandler);\n\t\t\tthis._clickOutsideHandler = null;\n\t\t}\n\t\tthis._clearPressTimer();\n\t}\n\t_updateActiveState() {\n\t\tif (this._isSelecting || this._isSelectingState || this._isHovered) this._wrapper.setAttribute(\"data-active\", \"\");\n\t\telse this._wrapper.removeAttribute(\"data-active\");\n\t}\n\t_clearPressTimer() {\n\t\tif (this._pressTimer !== null) {\n\t\t\tclearTimeout(this._pressTimer);\n\t\t\tthis._pressTimer = null;\n\t\t}\n\t}\n\t_dispatch(eventName) {\n\t\tthis.dispatchEvent(new CustomEvent(eventName, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t}));\n\t}\n\t_handleMouseDown() {\n\t\tthis._clearPressTimer();\n\t\tthis._pressTimer = setTimeout(() => {\n\t\t\tthis._isSelectingState = true;\n\t\t\tthis._updateActiveState();\n\t\t\tthis._dispatch(\"intlayer:press\");\n\t\t}, this._pressDuration);\n\t}\n\t_handleMouseEnter() {\n\t\tthis._isHovered = true;\n\t\tthis._updateActiveState();\n\t\tthis._dispatch(\"intlayer:hover\");\n\t}\n\t_handleMouseUpOrLeave() {\n\t\tif (this._isHovered) {\n\t\t\tthis._isHovered = false;\n\t\t\tthis._dispatch(\"intlayer:unhover\");\n\t\t}\n\t\tthis._clearPressTimer();\n\t\tthis._updateActiveState();\n\t}\n\t_handleClick(e) {\n\t\tif (this._isSelecting || this._isSelectingState) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\t_handleBlur() {\n\t\tthis._isSelectingState = false;\n\t\tthis._updateActiveState();\n\t}\n};\n\n//#endregion\nexport { IntlayerContentSelectorElement };\n//# sourceMappingURL=ContentSelector.mjs.map"],"mappings":";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