nuxt-intlayer 7.1.3 → 7.1.5
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 +0 -3
- package/package.json +7 -7
- package/dist/cjs/_virtual/rolldown_runtime.cjs +0 -25
- package/dist/cjs/packages/@intlayer/dictionaries-entry/dist/esm/index.cjs +0 -25
- package/dist/cjs/packages/@intlayer/dictionaries-entry/dist/esm/index.cjs.map +0 -1
- package/dist/cjs/packages/@intlayer/editor/dist/esm/compareUrls.cjs +0 -36
- package/dist/cjs/packages/@intlayer/editor/dist/esm/compareUrls.cjs.map +0 -1
- package/dist/cjs/packages/@intlayer/editor/dist/esm/messagesKeys.cjs +0 -19
- package/dist/cjs/packages/@intlayer/editor/dist/esm/messagesKeys.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/client/installIntlayer.cjs +0 -31
- package/dist/cjs/packages/vue-intlayer/dist/esm/client/installIntlayer.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/communicator.cjs +0 -39
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/communicator.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/createSharedComposable.cjs +0 -17
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/createSharedComposable.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/dictionariesRecord.cjs +0 -38
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/dictionariesRecord.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/editedContent.cjs +0 -46
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/editedContent.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/editorEnabled.cjs +0 -44
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/editorEnabled.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/focusDictionary.cjs +0 -38
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/focusDictionary.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/installIntlayerEditor.cjs +0 -26
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/installIntlayerEditor.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.cjs +0 -35
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.cjs.map +0 -1
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/useCrossFrameState.cjs +0 -57
- package/dist/cjs/packages/vue-intlayer/dist/esm/editor/useCrossFrameState.cjs.map +0 -1
- package/dist/esm/_virtual/rolldown_runtime.mjs +0 -38
- package/dist/esm/packages/@intlayer/dictionaries-entry/dist/esm/index.mjs +0 -20
- package/dist/esm/packages/@intlayer/dictionaries-entry/dist/esm/index.mjs.map +0 -1
- package/dist/esm/packages/@intlayer/editor/dist/esm/compareUrls.mjs +0 -35
- package/dist/esm/packages/@intlayer/editor/dist/esm/compareUrls.mjs.map +0 -1
- package/dist/esm/packages/@intlayer/editor/dist/esm/messagesKeys.mjs +0 -18
- package/dist/esm/packages/@intlayer/editor/dist/esm/messagesKeys.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/client/installIntlayer.mjs +0 -28
- package/dist/esm/packages/vue-intlayer/dist/esm/client/installIntlayer.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/communicator.mjs +0 -38
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/communicator.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/createSharedComposable.mjs +0 -18
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/createSharedComposable.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/dictionariesRecord.mjs +0 -40
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/dictionariesRecord.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/editedContent.mjs +0 -46
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/editedContent.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/editorEnabled.mjs +0 -44
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/editorEnabled.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/focusDictionary.mjs +0 -40
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/focusDictionary.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/installIntlayerEditor.mjs +0 -24
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/installIntlayerEditor.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.mjs +0 -37
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.mjs.map +0 -1
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/useCrossFrameState.mjs +0 -59
- package/dist/esm/packages/vue-intlayer/dist/esm/editor/useCrossFrameState.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -247,9 +247,6 @@ You can also follow us on :
|
|
|
247
247
|
<a href="https://www.linkedin.com/company/intlayerorg" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
248
248
|
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
249
249
|
alt="Intlayer LinkedIn" height="30"/></a>
|
|
250
|
-
<a href="https://www.facebook.com/intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
251
|
-
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
252
|
-
alt="Intlayer Facebook" height="30"/></a>
|
|
253
250
|
<a href="https://www.instagram.com/intlayer/" target="blank" rel='noopener noreferrer nofollow'><img align="center"
|
|
254
251
|
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
255
252
|
alt="Intlayer Instagram" height="30"/></a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-intlayer",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Nuxt applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@intlayer/chokidar": "7.1.
|
|
80
|
-
"@intlayer/config": "7.1.
|
|
81
|
-
"@intlayer/core": "7.1.
|
|
82
|
-
"@intlayer/types": "7.1.
|
|
83
|
-
"vite-intlayer": "7.1.
|
|
84
|
-
"vue-intlayer": "7.1.
|
|
79
|
+
"@intlayer/chokidar": "7.1.5",
|
|
80
|
+
"@intlayer/config": "7.1.5",
|
|
81
|
+
"@intlayer/core": "7.1.5",
|
|
82
|
+
"@intlayer/types": "7.1.5",
|
|
83
|
+
"vite-intlayer": "7.1.5",
|
|
84
|
+
"vue-intlayer": "7.1.5"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/node": "24.10.1",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
|
|
25
|
-
exports.__toESM = __toESM;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let node_path = require("node:path");
|
|
3
|
-
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
4
|
-
let __intlayer_config = require("@intlayer/config");
|
|
5
|
-
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
6
|
-
let __intlayer_config_built = require("@intlayer/config/built");
|
|
7
|
-
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
8
|
-
let node_fs = require("node:fs");
|
|
9
|
-
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
10
|
-
|
|
11
|
-
//#region ../@intlayer/dictionaries-entry/dist/esm/index.mjs
|
|
12
|
-
const getDictionaries = (configuration = __intlayer_config_built.default) => {
|
|
13
|
-
const { content, build } = configuration;
|
|
14
|
-
const dictionariesPath = (0, node_path.join)(content.mainDir, `dictionaries.cjs`);
|
|
15
|
-
let dictionaries = {};
|
|
16
|
-
if ((0, node_fs.existsSync)(dictionariesPath)) {
|
|
17
|
-
(0, __intlayer_config.clearModuleCache)(dictionariesPath);
|
|
18
|
-
dictionaries = (build.require ?? __intlayer_config.ESMxCJSRequire)(dictionariesPath);
|
|
19
|
-
}
|
|
20
|
-
return dictionaries ?? {};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.getDictionaries = getDictionaries;
|
|
25
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["config","ESMxCJSRequire"],"sources":["../../../../../../../../@intlayer/dictionaries-entry/dist/esm/index.mjs"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { ESMxCJSRequire, clearModuleCache } from \"@intlayer/config\";\nimport config from \"@intlayer/config/built\";\n\n//#region src/index.ts\nconst getDictionaries = (configuration = config) => {\n\tconst { content, build } = configuration;\n\tconst dictionariesPath = join(content.mainDir, `dictionaries.cjs`);\n\tlet dictionaries = {};\n\tif (existsSync(dictionariesPath)) {\n\t\tclearModuleCache(dictionariesPath);\n\t\tdictionaries = (build.require ?? ESMxCJSRequire)(dictionariesPath);\n\t}\n\treturn dictionaries ?? {};\n};\n\n//#endregion\nexport { getDictionaries };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;AAMA,MAAM,mBAAmB,gBAAgBA,oCAAW;CACnD,MAAM,EAAE,SAAS,UAAU;CAC3B,MAAM,uCAAwB,QAAQ,SAAS,mBAAmB;CAClE,IAAI,eAAe,EAAE;AACrB,6BAAe,iBAAiB,EAAE;AACjC,0CAAiB,iBAAiB;AAClC,kBAAgB,MAAM,WAAWC,kCAAgB,iBAAiB;;AAEnE,QAAO,gBAAgB,EAAE"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../@intlayer/editor/dist/esm/compareUrls.mjs
|
|
3
|
-
/**
|
|
4
|
-
* Compare two URLs for equality.
|
|
5
|
-
* This function is used to determine if a message originates from the same origin.
|
|
6
|
-
*
|
|
7
|
-
* ```js
|
|
8
|
-
* // Example usage
|
|
9
|
-
* console.log(compareUrls("http://localhost:5173/", "http://localhost:5173")); // true
|
|
10
|
-
* console.log(compareUrls("http://localhost:5173", "http://localhost:5173?myParam=true")); // true
|
|
11
|
-
* console.log(compareUrls("http://localhost:5173/subpath", "http://localhost:5173")); // true
|
|
12
|
-
* console.log(compareUrls("http://localhost:5172", "http://localhost:5173")); // false
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @param url1 - The first URL to compare.
|
|
16
|
-
* @param url2 - The second URL to compare.
|
|
17
|
-
* @returns Whether the two URLs are equal.
|
|
18
|
-
*/
|
|
19
|
-
const compareUrls = (url1, url2) => {
|
|
20
|
-
try {
|
|
21
|
-
const parsedUrl1 = new URL(url1);
|
|
22
|
-
const parsedUrl2 = new URL(url2);
|
|
23
|
-
if (parsedUrl1.protocol !== parsedUrl2.protocol || parsedUrl1.hostname !== parsedUrl2.hostname || parsedUrl1.port !== parsedUrl2.port) return false;
|
|
24
|
-
const path1 = parsedUrl1.pathname.replace(/\/$/, "");
|
|
25
|
-
const path2 = parsedUrl2.pathname.replace(/\/$/, "");
|
|
26
|
-
if (path1 !== "" && path2 !== "" && path1 !== path2) return false;
|
|
27
|
-
return true;
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.error("Invalid URL(s)", error);
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.compareUrls = compareUrls;
|
|
36
|
-
//# sourceMappingURL=compareUrls.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareUrls.cjs","names":[],"sources":["../../../../../../../../@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\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,MAAM;AACtC,SAAO"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../@intlayer/editor/dist/esm/messagesKeys.mjs
|
|
3
|
-
let MessageKey = /* @__PURE__ */ function(MessageKey$1) {
|
|
4
|
-
MessageKey$1["INTLAYER_CONFIGURATION"] = "INTLAYER_CONFIGURATION";
|
|
5
|
-
MessageKey$1["INTLAYER_CURRENT_LOCALE"] = "INTLAYER_CURRENT_LOCALE";
|
|
6
|
-
MessageKey$1["INTLAYER_EDITOR_ENABLED"] = "INTLAYER_EDITOR_ENABLED";
|
|
7
|
-
MessageKey$1["INTLAYER_URL_CHANGE"] = "INTLAYER_URL_CHANGE";
|
|
8
|
-
MessageKey$1["INTLAYER_HOVERED_CONTENT_CHANGED"] = "INTLAYER_HOVERED_CONTENT_CHANGED";
|
|
9
|
-
MessageKey$1["INTLAYER_FOCUSED_CONTENT_CHANGED"] = "INTLAYER_FOCUSED_CONTENT_CHANGED";
|
|
10
|
-
MessageKey$1["INTLAYER_LOCALE_DICTIONARIES_CHANGED"] = "INTLAYER_LOCALE_DICTIONARIES_CHANGED";
|
|
11
|
-
MessageKey$1["INTLAYER_DISTANT_DICTIONARIES_CHANGED"] = "INTLAYER_DISTANT_DICTIONARIES_CHANGED";
|
|
12
|
-
MessageKey$1["INTLAYER_EDITED_CONTENT_CHANGED"] = "INTLAYER_EDITED_CONTENT_CHANGED";
|
|
13
|
-
MessageKey$1["INTLAYER_IFRAME_CLICKED"] = "INTLAYER_IFRAME_CLICKED";
|
|
14
|
-
return MessageKey$1;
|
|
15
|
-
}({});
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
exports.MessageKey = MessageKey;
|
|
19
|
-
//# sourceMappingURL=messagesKeys.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messagesKeys.cjs","names":[],"sources":["../../../../../../../../@intlayer/editor/dist/esm/messagesKeys.mjs"],"sourcesContent":["//#region src/messagesKeys.ts\nlet MessageKey = /* @__PURE__ */ function(MessageKey$1) {\n\tMessageKey$1[\"INTLAYER_CONFIGURATION\"] = \"INTLAYER_CONFIGURATION\";\n\tMessageKey$1[\"INTLAYER_CURRENT_LOCALE\"] = \"INTLAYER_CURRENT_LOCALE\";\n\tMessageKey$1[\"INTLAYER_EDITOR_ENABLED\"] = \"INTLAYER_EDITOR_ENABLED\";\n\tMessageKey$1[\"INTLAYER_URL_CHANGE\"] = \"INTLAYER_URL_CHANGE\";\n\tMessageKey$1[\"INTLAYER_HOVERED_CONTENT_CHANGED\"] = \"INTLAYER_HOVERED_CONTENT_CHANGED\";\n\tMessageKey$1[\"INTLAYER_FOCUSED_CONTENT_CHANGED\"] = \"INTLAYER_FOCUSED_CONTENT_CHANGED\";\n\tMessageKey$1[\"INTLAYER_LOCALE_DICTIONARIES_CHANGED\"] = \"INTLAYER_LOCALE_DICTIONARIES_CHANGED\";\n\tMessageKey$1[\"INTLAYER_DISTANT_DICTIONARIES_CHANGED\"] = \"INTLAYER_DISTANT_DICTIONARIES_CHANGED\";\n\tMessageKey$1[\"INTLAYER_EDITED_CONTENT_CHANGED\"] = \"INTLAYER_EDITED_CONTENT_CHANGED\";\n\tMessageKey$1[\"INTLAYER_IFRAME_CLICKED\"] = \"INTLAYER_IFRAME_CLICKED\";\n\treturn MessageKey$1;\n}({});\n\n//#endregion\nexport { MessageKey };\n//# sourceMappingURL=messagesKeys.mjs.map"],"mappings":";;AACA,IAAI,aAA6B,yBAAS,cAAc;AACvD,cAAa,4BAA4B;AACzC,cAAa,6BAA6B;AAC1C,cAAa,6BAA6B;AAC1C,cAAa,yBAAyB;AACtC,cAAa,sCAAsC;AACnD,cAAa,sCAAsC;AACnD,cAAa,0CAA0C;AACvD,cAAa,2CAA2C;AACxD,cAAa,qCAAqC;AAClD,cAAa,6BAA6B;AAC1C,QAAO;EACN,EAAE,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
3
|
-
const require_installIntlayerEditor = require('../editor/installIntlayerEditor.cjs');
|
|
4
|
-
let __intlayer_core = require("@intlayer/core");
|
|
5
|
-
__intlayer_core = require_rolldown_runtime.__toESM(__intlayer_core);
|
|
6
|
-
let __intlayer_config_built = require("@intlayer/config/built");
|
|
7
|
-
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
8
|
-
require("@intlayer/types");
|
|
9
|
-
|
|
10
|
-
//#region ../vue-intlayer/dist/esm/client/installIntlayer.mjs
|
|
11
|
-
const p = Symbol("intlayer");
|
|
12
|
-
let r = null;
|
|
13
|
-
const u$1 = (t, e = !0) => {
|
|
14
|
-
if (r) return r;
|
|
15
|
-
const { defaultLocale: n } = __intlayer_config_built.default.internationalization ?? {}, o = (0, require_index.vue_exports.ref)(t ?? n), i = (l) => {
|
|
16
|
-
o.value = l;
|
|
17
|
-
};
|
|
18
|
-
return r = {
|
|
19
|
-
locale: (0, require_index.vue_exports.readonly)(o),
|
|
20
|
-
setLocale: i,
|
|
21
|
-
isCookieEnabled: e
|
|
22
|
-
}, r;
|
|
23
|
-
}, Y = (t, e, n = !0) => {
|
|
24
|
-
const o = u$1(e, n);
|
|
25
|
-
t.provide(p, o), require_installIntlayerEditor.u(t);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
exports.Y = Y;
|
|
30
|
-
exports.u = u$1;
|
|
31
|
-
//# sourceMappingURL=installIntlayer.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayer.cjs","names":["u","a","s"],"sources":["../../../../../../../../vue-intlayer/dist/esm/client/installIntlayer.mjs"],"sourcesContent":["import a from \"@intlayer/config/built\";\nimport { ref as c, readonly as m } from \"vue\";\nimport \"@intlayer/core\";\nimport \"@intlayer/editor\";\nimport \"../editor/communicator.mjs\";\nimport \"@intlayer/dictionaries-entry\";\nimport \"@intlayer/types\";\nimport \"./useLocaleStorage.mjs\";\nimport { installIntlayerEditor as s } from \"../editor/installIntlayerEditor.mjs\";\nconst p = Symbol(\"intlayer\");\nlet r = null;\nconst u = (t, e = !0) => {\n if (r) return r;\n const { defaultLocale: n } = a.internationalization ?? {}, o = c(t ?? n), i = (l) => {\n o.value = l;\n };\n return r = {\n locale: m(o),\n setLocale: i,\n isCookieEnabled: e\n }, r;\n}, Y = (t, e, n = !0) => {\n const o = u(e, n);\n t.provide(p, o), s(t);\n};\nexport {\n p as INTLAYER_SYMBOL,\n u as createIntlayerClient,\n Y as installIntlayer\n};\n"],"mappings":";;;;;;;;;;AASA,MAAM,IAAI,OAAO,WAAW;AAC5B,IAAI,IAAI;AACR,MAAMA,OAAK,GAAG,IAAI,CAAC,MAAM;AACvB,KAAI,EAAG,QAAO;CACd,MAAM,EAAE,eAAe,MAAMC,gCAAE,wBAAwB,EAAE,EAAE,uCAAM,KAAK,EAAE,EAAE,KAAK,MAAM;AACnF,IAAE,QAAQ;;AAEZ,QAAO,IAAI;EACT,gDAAU,EAAE;EACZ,WAAW;EACX,iBAAiB;EAClB,EAAE;GACF,KAAK,GAAG,GAAG,IAAI,CAAC,MAAM;CACvB,MAAM,IAAID,IAAE,GAAG,EAAE;AACjB,GAAE,QAAQ,GAAG,EAAE,EAAEE,gCAAE,EAAE"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
3
|
-
const require_v4 = require('../../../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v4.cjs');
|
|
4
|
-
let __intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
-
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
6
|
-
|
|
7
|
-
//#region ../vue-intlayer/dist/esm/editor/communicator.mjs
|
|
8
|
-
const { editor: n } = __intlayer_config_built.default, o = {
|
|
9
|
-
postMessage: () => null,
|
|
10
|
-
allowedOrigins: [
|
|
11
|
-
n?.applicationURL,
|
|
12
|
-
n?.editorURL,
|
|
13
|
-
n?.cmsURL
|
|
14
|
-
],
|
|
15
|
-
senderId: ""
|
|
16
|
-
};
|
|
17
|
-
let t = null;
|
|
18
|
-
const r = Symbol("Communicator"), m = (e = { postMessage: () => null }) => t || (t = (0, require_index.vue_exports.reactive)({
|
|
19
|
-
...o,
|
|
20
|
-
...e,
|
|
21
|
-
senderId: require_v4.default()
|
|
22
|
-
}), t), g = (e, s = { postMessage: () => null }) => {
|
|
23
|
-
const c = m(s);
|
|
24
|
-
e.provide(r, c);
|
|
25
|
-
}, C = () => {
|
|
26
|
-
try {
|
|
27
|
-
return (0, require_index.vue_exports.inject)(r, o);
|
|
28
|
-
} catch {
|
|
29
|
-
return console.warn("useCommunicator: inject can only be used in setup(). Returning default communicator."), {
|
|
30
|
-
postMessage: () => null,
|
|
31
|
-
senderId: ""
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
exports.C = C;
|
|
38
|
-
exports.g = g;
|
|
39
|
-
//# sourceMappingURL=communicator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"communicator.cjs","names":["i","a"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/communicator.mjs"],"sourcesContent":["import i from \"@intlayer/config/built\";\nimport { v4 as a } from \"uuid\";\nimport { inject as u, reactive as l } from \"vue\";\nconst { editor: n } = i, o = {\n postMessage: () => null,\n allowedOrigins: [\n n?.applicationURL,\n n?.editorURL,\n n?.cmsURL\n ],\n senderId: \"\"\n};\nlet t = null;\nconst r = Symbol(\"Communicator\"), m = (e = { postMessage: () => null }) => t || (t = l({\n ...o,\n ...e,\n senderId: a()\n}), t), g = (e, s = { postMessage: () => null }) => {\n const c = m(s);\n e.provide(r, c);\n}, C = () => {\n try {\n return u(r, o);\n } catch {\n return console.warn(\n \"useCommunicator: inject can only be used in setup(). Returning default communicator.\"\n ), {\n postMessage: () => null,\n senderId: \"\"\n };\n }\n};\nexport {\n m as createCommunicator,\n g as installCommunicator,\n C as useCommunicator\n};\n"],"mappings":";;;;;;;AAGA,MAAM,EAAE,QAAQ,MAAMA,iCAAG,IAAI;CAC3B,mBAAmB;CACnB,gBAAgB;EACd,GAAG;EACH,GAAG;EACH,GAAG;EACJ;CACD,UAAU;CACX;AACD,IAAI,IAAI;AACR,MAAM,IAAI,OAAO,eAAe,EAAE,KAAK,IAAI,EAAE,mBAAmB,MAAM,KAAK,MAAM,4CAAM;CACrF,GAAG;CACH,GAAG;CACH,UAAUC,oBAAG;CACd,CAAC,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,mBAAmB,MAAM,KAAK;CAClD,MAAM,IAAI,EAAE,EAAE;AACd,GAAE,QAAQ,GAAG,EAAE;GACd,UAAU;AACX,KAAI;AACF,+CAAS,GAAG,EAAE;SACR;AACN,SAAO,QAAQ,KACb,uFACD,EAAE;GACD,mBAAmB;GACnB,UAAU;GACX"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../vue-intlayer/dist/esm/editor/createSharedComposable.mjs
|
|
4
|
-
function u(t) {
|
|
5
|
-
return (0, require_index.vue_exports.getCurrentScope)() ? ((0, require_index.vue_exports.onScopeDispose)(t), !0) : !1;
|
|
6
|
-
}
|
|
7
|
-
const a = (t) => {
|
|
8
|
-
let r = 0, o, e;
|
|
9
|
-
const s = () => {
|
|
10
|
-
r -= 1, e && r <= 0 && (e.stop(), o = void 0, e = void 0);
|
|
11
|
-
};
|
|
12
|
-
return ((...n) => (r += 1, e || (e = (0, require_index.vue_exports.effectScope)(!0), o = e.run(() => t(...n))), u(s), o));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
exports.a = a;
|
|
17
|
-
//# sourceMappingURL=createSharedComposable.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSharedComposable.cjs","names":[],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/createSharedComposable.mjs"],"sourcesContent":["import { effectScope as p, getCurrentScope as c, onScopeDispose as i } from \"vue\";\nfunction u(t) {\n return c() ? (i(t), !0) : !1;\n}\nconst a = (t) => {\n let r = 0, o, e;\n const s = () => {\n r -= 1, e && r <= 0 && (e.stop(), o = void 0, e = void 0);\n };\n return ((...n) => (r += 1, e || (e = p(!0), o = e.run(() => t(...n))), u(s), o));\n};\nexport {\n a as createSharedComposable,\n u as tryOnScopeDispose\n};\n"],"mappings":";;;AACA,SAAS,EAAE,GAAG;AACZ,wDAAU,kDAAM,EAAE,EAAE,CAAC,KAAK,CAAC;;AAE7B,MAAM,KAAK,MAAM;CACf,IAAI,IAAI,GAAG,GAAG;CACd,MAAM,UAAU;AACd,OAAK,GAAG,KAAK,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,KAAK,GAAG,IAAI,KAAK;;AAEzD,UAAS,GAAG,OAAO,KAAK,GAAG,MAAM,+CAAM,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
2
|
-
const require_messagesKeys = require('../../../../@intlayer/editor/dist/esm/messagesKeys.cjs');
|
|
3
|
-
const require_index$1 = require('../../../../@intlayer/dictionaries-entry/dist/esm/index.cjs');
|
|
4
|
-
const require_createSharedComposable = require('./createSharedComposable.cjs');
|
|
5
|
-
const require_useCrossFrameState = require('./useCrossFrameState.cjs');
|
|
6
|
-
|
|
7
|
-
//#region ../vue-intlayer/dist/esm/editor/dictionariesRecord.mjs
|
|
8
|
-
let t = null;
|
|
9
|
-
const r = Symbol("intlayerDictionariesRecord"), u = () => {
|
|
10
|
-
if (t) return t;
|
|
11
|
-
const e = (0, require_index.vue_exports.ref)(require_index$1.getDictionaries());
|
|
12
|
-
return t = {
|
|
13
|
-
localeDictionaries: (0, require_index.vue_exports.readonly)(e),
|
|
14
|
-
setLocaleDictionaries: (o) => {
|
|
15
|
-
e.value = o ?? {};
|
|
16
|
-
},
|
|
17
|
-
setLocaleDictionary(o) {
|
|
18
|
-
e.value = {
|
|
19
|
-
...e.value,
|
|
20
|
-
[o.key]: o
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}, t;
|
|
24
|
-
}, L = (i) => {
|
|
25
|
-
const e = u();
|
|
26
|
-
i.provide(r, e);
|
|
27
|
-
}, _ = require_createSharedComposable.a(() => {
|
|
28
|
-
const i = (0, require_index.vue_exports.inject)(r);
|
|
29
|
-
if (!i) throw new Error("DictionariesRecord state not found");
|
|
30
|
-
const [e, o] = require_useCrossFrameState.I(require_messagesKeys.MessageKey.INTLAYER_LOCALE_DICTIONARIES_CHANGED, void 0);
|
|
31
|
-
(0, require_index.vue_exports.watch)(i.localeDictionaries, (c) => {
|
|
32
|
-
o(c);
|
|
33
|
-
}, { immediate: !0 });
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
exports.L = L;
|
|
38
|
-
//# sourceMappingURL=dictionariesRecord.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.cjs","names":["n","d","R","a"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/dictionariesRecord.mjs"],"sourcesContent":["import { getDictionaries as n } from \"@intlayer/dictionaries-entry\";\nimport { MessageKey as a } from \"@intlayer/editor\";\nimport { ref as s, readonly as l, inject as D, watch as m } from \"vue\";\nimport { createSharedComposable as d } from \"./createSharedComposable.mjs\";\nimport { useCrossFrameState as R } from \"./useCrossFrameState.mjs\";\nlet t = null;\nconst r = Symbol(\n \"intlayerDictionariesRecord\"\n), u = () => {\n if (t) return t;\n const i = n(), e = s(i);\n return t = {\n localeDictionaries: l(e),\n setLocaleDictionaries: (o) => {\n e.value = o ?? {};\n },\n setLocaleDictionary(o) {\n e.value = {\n ...e.value,\n [o.key]: o\n };\n }\n }, t;\n}, L = (i) => {\n const e = u();\n i.provide(r, e);\n}, _ = d(() => {\n const i = D(\n r\n );\n if (!i)\n throw new Error(\"DictionariesRecord state not found\");\n const [e, o] = R(\n a.INTLAYER_LOCALE_DICTIONARIES_CHANGED,\n void 0\n );\n m(\n i.localeDictionaries,\n (c) => {\n o(c);\n },\n { immediate: !0 }\n );\n});\nexport {\n u as createDictionaryRecordClient,\n L as installDictionariesRecord,\n _ as useDictionariesRecord\n};\n"],"mappings":";;;;;;;AAKA,IAAI,IAAI;AACR,MAAM,IAAI,OACR,6BACD,EAAE,UAAU;AACX,KAAI,EAAG,QAAO;CACd,MAAe,uCAALA,iCAAG,CAAU;AACvB,QAAO,IAAI;EACT,4DAAsB,EAAE;EACxB,wBAAwB,MAAM;AAC5B,KAAE,QAAQ,KAAK,EAAE;;EAEnB,oBAAoB,GAAG;AACrB,KAAE,QAAQ;IACR,GAAG,EAAE;KACJ,EAAE,MAAM;IACV;;EAEJ,EAAE;GACF,KAAK,MAAM;CACZ,MAAM,IAAI,GAAG;AACb,GAAE,QAAQ,GAAG,EAAE;GACd,IAAIC,uCAAQ;CACb,MAAM,0CACJ,EACD;AACD,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,qCAAqC;CACvD,MAAM,CAAC,GAAG,KAAKC,6BACbC,gCAAE,sCACF,KAAK,EACN;AACD,sCACE,EAAE,qBACD,MAAM;AACL,IAAE,EAAE;IAEN,EAAE,WAAW,CAAC,GAAG,CAClB;EACD"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
3
|
-
const require_messagesKeys = require('../../../../@intlayer/editor/dist/esm/messagesKeys.cjs');
|
|
4
|
-
const require_createSharedComposable = require('./createSharedComposable.cjs');
|
|
5
|
-
const require_useCrossFrameState = require('./useCrossFrameState.cjs');
|
|
6
|
-
let __intlayer_core = require("@intlayer/core");
|
|
7
|
-
__intlayer_core = require_rolldown_runtime.__toESM(__intlayer_core);
|
|
8
|
-
|
|
9
|
-
//#region ../vue-intlayer/dist/esm/editor/editedContent.mjs
|
|
10
|
-
let i = null;
|
|
11
|
-
const u = Symbol("EditedContent"), T = () => {
|
|
12
|
-
if (i) return i;
|
|
13
|
-
const t = (0, require_index.vue_exports.ref)({});
|
|
14
|
-
return i = {
|
|
15
|
-
editedContent: (0, require_index.vue_exports.readonly)(t),
|
|
16
|
-
getEditedContentValue: (e, r) => {
|
|
17
|
-
const n = t.value;
|
|
18
|
-
if (!n) return;
|
|
19
|
-
if (e.includes(":local:") || e.includes(":remote:")) return (0, __intlayer_core.getContentNodeByKeyPath)(n?.[e]?.content ?? {}, r);
|
|
20
|
-
const a$1 = Object.keys(n).filter((o) => o.startsWith(`${e}:`));
|
|
21
|
-
for (const o of a$1) {
|
|
22
|
-
const s = (0, __intlayer_core.getContentNodeByKeyPath)(n?.[o]?.content ?? {}, r);
|
|
23
|
-
if (s) return s;
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setEditedContent: (e) => {
|
|
27
|
-
t.value = e;
|
|
28
|
-
}
|
|
29
|
-
}, i;
|
|
30
|
-
}, S = (t) => {
|
|
31
|
-
const e = T();
|
|
32
|
-
t.provide(u, e);
|
|
33
|
-
}, b = require_createSharedComposable.a(() => {
|
|
34
|
-
const t = (0, require_index.vue_exports.inject)(u);
|
|
35
|
-
if (!t) throw new Error("EditedContent state not found");
|
|
36
|
-
const [e, r] = require_useCrossFrameState.I(require_messagesKeys.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED, {});
|
|
37
|
-
return (0, require_index.vue_exports.watch)(e, (n) => {
|
|
38
|
-
t.editedContent.value = n ?? {};
|
|
39
|
-
}), (0, require_index.vue_exports.watch)(t, (n) => {
|
|
40
|
-
r(n.editedContent.value);
|
|
41
|
-
}), t;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
exports.S = S;
|
|
46
|
-
//# sourceMappingURL=editedContent.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editedContent.cjs","names":["a","N","p","l"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/editedContent.mjs"],"sourcesContent":["import { getContentNodeByKeyPath as c } from \"@intlayer/core\";\nimport { MessageKey as l } from \"@intlayer/editor\";\nimport { ref as E, readonly as f, inject as m, watch as C } from \"vue\";\nimport { createSharedComposable as N } from \"./createSharedComposable.mjs\";\nimport { useCrossFrameState as p } from \"./useCrossFrameState.mjs\";\nlet i = null;\nconst u = Symbol(\"EditedContent\"), T = () => {\n if (i) return i;\n const t = E({});\n return i = {\n editedContent: f(t),\n getEditedContentValue: (e, r) => {\n const n = t.value;\n if (!n) return;\n if (e.includes(\":local:\") || e.includes(\":remote:\")) {\n const o = n?.[e]?.content ?? {};\n return c(o, r);\n }\n const a = Object.keys(n).filter(\n (o) => o.startsWith(`${e}:`)\n );\n for (const o of a) {\n const d = n?.[o]?.content ?? {}, s = c(d, r);\n if (s) return s;\n }\n },\n setEditedContent: (e) => {\n t.value = e;\n }\n }, i;\n}, S = (t) => {\n const e = T();\n t.provide(u, e);\n}, b = N(() => {\n const t = m(u);\n if (!t)\n throw new Error(\"EditedContent state not found\");\n const [e, r] = p(\n l.INTLAYER_EDITED_CONTENT_CHANGED,\n {}\n );\n return C(e, (n) => {\n t.editedContent.value = n ?? {};\n }), C(t, (n) => {\n r(n.editedContent.value);\n }), t;\n});\nexport {\n T as createEditedContentClient,\n S as installEditedContent,\n b as useEditedContent\n};\n"],"mappings":";;;;;;;;;AAKA,IAAI,IAAI;AACR,MAAM,IAAI,OAAO,gBAAgB,EAAE,UAAU;AAC3C,KAAI,EAAG,QAAO;CACd,MAAM,uCAAM,EAAE,CAAC;AACf,QAAO,IAAI;EACT,uDAAiB,EAAE;EACnB,wBAAwB,GAAG,MAAM;GAC/B,MAAM,IAAI,EAAE;AACZ,OAAI,CAAC,EAAG;AACR,OAAI,EAAE,SAAS,UAAU,IAAI,EAAE,SAAS,WAAW,CAEjD,qDADU,IAAI,IAAI,WAAW,EAAE,EACnB,EAAE;GAEhB,MAAMA,MAAI,OAAO,KAAK,EAAE,CAAC,QACtB,MAAM,EAAE,WAAW,GAAG,EAAE,GAAG,CAC7B;AACD,QAAK,MAAM,KAAKA,KAAG;IACjB,MAAiC,iDAAvB,IAAI,IAAI,WAAW,EAAE,EAAW,EAAE;AAC5C,QAAI,EAAG,QAAO;;;EAGlB,mBAAmB,MAAM;AACvB,KAAE,QAAQ;;EAEb,EAAE;GACF,KAAK,MAAM;CACZ,MAAM,IAAI,GAAG;AACb,GAAE,QAAQ,GAAG,EAAE;GACd,IAAIC,uCAAQ;CACb,MAAM,0CAAM,EAAE;AACd,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,gCAAgC;CAClD,MAAM,CAAC,GAAG,KAAKC,6BACbC,gCAAE,iCACF,EAAE,CACH;AACD,6CAAS,IAAI,MAAM;AACjB,IAAE,cAAc,QAAQ,KAAK,EAAE;GAC/B,uCAAI,IAAI,MAAM;AACd,IAAE,EAAE,cAAc,MAAM;GACxB,EAAE;EACJ"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
3
|
-
const require_messagesKeys = require('../../../../@intlayer/editor/dist/esm/messagesKeys.cjs');
|
|
4
|
-
const require_createSharedComposable = require('./createSharedComposable.cjs');
|
|
5
|
-
const require_useCrossFrameMessageListener = require('./useCrossFrameMessageListener.cjs');
|
|
6
|
-
let __intlayer_config_built = require("@intlayer/config/built");
|
|
7
|
-
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
8
|
-
|
|
9
|
-
//#region ../vue-intlayer/dist/esm/editor/editorEnabled.mjs
|
|
10
|
-
let r = null;
|
|
11
|
-
const s = Symbol("EditorEnabled"), l = () => typeof window > "u" ? !1 : window.self !== window.top, b = () => {
|
|
12
|
-
if (r) return r;
|
|
13
|
-
const e = (0, require_index.vue_exports.ref)(__intlayer_config_built.default.editor.enabled), n = (0, require_index.vue_exports.ref)(!1), t = (0, require_index.vue_exports.ref)(!1);
|
|
14
|
-
return r = {
|
|
15
|
-
settingEnabled: e,
|
|
16
|
-
wrapperEnabled: n,
|
|
17
|
-
isInIframe: t,
|
|
18
|
-
enabled: (0, require_index.vue_exports.computed)(() => e.value && n.value && t.value)
|
|
19
|
-
}, r;
|
|
20
|
-
}, T = (e) => {
|
|
21
|
-
const n = b();
|
|
22
|
-
typeof window < "u" && (n.isInIframe.value = l()), e.provide(s, n);
|
|
23
|
-
}, A = require_createSharedComposable.a(() => {
|
|
24
|
-
const e = (0, require_index.vue_exports.inject)(s);
|
|
25
|
-
if (!e) throw new Error("EditorEnabled state not found");
|
|
26
|
-
require_useCrossFrameMessageListener.L(`${require_messagesKeys.MessageKey.INTLAYER_EDITOR_ENABLED}/post`, (t) => {
|
|
27
|
-
e.wrapperEnabled.value = t;
|
|
28
|
-
});
|
|
29
|
-
const n = require_useCrossFrameMessageListener.L(`${require_messagesKeys.MessageKey.INTLAYER_EDITOR_ENABLED}/get`, (t) => {
|
|
30
|
-
e.wrapperEnabled.value = t;
|
|
31
|
-
});
|
|
32
|
-
return (0, require_index.vue_exports.watch)(() => e.isInIframe.value && e.settingEnabled.value, (t) => {
|
|
33
|
-
n();
|
|
34
|
-
}, { immediate: !0 }), (0, require_index.vue_exports.onMounted)(() => {
|
|
35
|
-
(0, require_index.vue_exports.nextTick)(() => {
|
|
36
|
-
const t = l();
|
|
37
|
-
e.isInIframe.value = t;
|
|
38
|
-
});
|
|
39
|
-
}), e;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
exports.T = T;
|
|
44
|
-
//# sourceMappingURL=editorEnabled.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editorEnabled.cjs","names":["E","I","a","i"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/editorEnabled.mjs"],"sourcesContent":["import E from \"@intlayer/config/built\";\nimport { MessageKey as a } from \"@intlayer/editor\";\nimport { inject as f, watch as u, onMounted as c, nextTick as m, ref as o, computed as p } from \"vue\";\nimport { createSharedComposable as I } from \"./createSharedComposable.mjs\";\nimport { useCrossFrameMessageListener as i } from \"./useCrossFrameMessageListener.mjs\";\nlet r = null;\nconst s = Symbol(\"EditorEnabled\"), l = () => typeof window > \"u\" ? !1 : window.self !== window.top, b = () => {\n if (r) return r;\n const e = o(E.editor.enabled), n = o(!1), t = o(!1), d = p(\n () => e.value && n.value && t.value\n );\n return r = {\n settingEnabled: e,\n wrapperEnabled: n,\n isInIframe: t,\n enabled: d\n }, r;\n}, T = (e) => {\n const n = b();\n typeof window < \"u\" && (n.isInIframe.value = l()), e.provide(s, n);\n}, A = I(() => {\n const e = f(\n s\n );\n if (!e)\n throw new Error(\"EditorEnabled state not found\");\n i(\n `${a.INTLAYER_EDITOR_ENABLED}/post`,\n (t) => {\n e.wrapperEnabled.value = t;\n }\n );\n const n = i(\n `${a.INTLAYER_EDITOR_ENABLED}/get`,\n (t) => {\n e.wrapperEnabled.value = t;\n }\n );\n return u(\n () => e.isInIframe.value && e.settingEnabled.value,\n (t) => {\n n();\n },\n { immediate: !0 }\n ), c(() => {\n m(() => {\n const t = l();\n e.isInIframe.value = t;\n });\n }), e;\n});\nexport {\n b as createEditorEnabledClient,\n T as installEditorEnabled,\n A as useEditorEnabled\n};\n"],"mappings":";;;;;;;;;AAKA,IAAI,IAAI;AACR,MAAM,IAAI,OAAO,gBAAgB,EAAE,UAAU,OAAO,SAAS,MAAM,CAAC,IAAI,OAAO,SAAS,OAAO,KAAK,UAAU;AAC5G,KAAI,EAAG,QAAO;CACd,MAAM,uCAAMA,gCAAE,OAAO,QAAQ,EAAE,uCAAM,CAAC,EAAE,EAAE,uCAAM,CAAC,EAAE;AAGnD,QAAO,IAAI;EACT,gBAAgB;EAChB,gBAAgB;EAChB,YAAY;EACZ,uDANM,EAAE,SAAS,EAAE,SAAS,EAAE,MAC/B;EAMA,EAAE;GACF,KAAK,MAAM;CACZ,MAAM,IAAI,GAAG;AACb,QAAO,SAAS,QAAQ,EAAE,WAAW,QAAQ,GAAG,GAAG,EAAE,QAAQ,GAAG,EAAE;GACjE,IAAIC,uCAAQ;CACb,MAAM,0CACJ,EACD;AACD,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,gCAAgC;AAClD,wCACE,GAAGC,gCAAE,wBAAwB,SAC5B,MAAM;AACL,IAAE,eAAe,QAAQ;GAE5B;CACD,MAAM,IAAIC,uCACR,GAAGD,gCAAE,wBAAwB,QAC5B,MAAM;AACL,IAAE,eAAe,QAAQ;GAE5B;AACD,mDACQ,EAAE,WAAW,SAAS,EAAE,eAAe,QAC5C,MAAM;AACL,KAAG;IAEL,EAAE,WAAW,CAAC,GAAG,CAClB,iDAAU;AACT,gDAAQ;GACN,MAAM,IAAI,GAAG;AACb,KAAE,WAAW,QAAQ;IACrB;GACF,EAAE;EACJ"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
2
|
-
const require_messagesKeys = require('../../../../@intlayer/editor/dist/esm/messagesKeys.cjs');
|
|
3
|
-
const require_createSharedComposable = require('./createSharedComposable.cjs');
|
|
4
|
-
const require_useCrossFrameState = require('./useCrossFrameState.cjs');
|
|
5
|
-
|
|
6
|
-
//#region ../vue-intlayer/dist/esm/editor/focusDictionary.mjs
|
|
7
|
-
let n = null;
|
|
8
|
-
const c = Symbol("FocusDictionary"), d = () => {
|
|
9
|
-
if (n) return n;
|
|
10
|
-
const t = (0, require_index.vue_exports.ref)(null), e = (o) => {
|
|
11
|
-
t.value = o;
|
|
12
|
-
}, s = (o) => {
|
|
13
|
-
t.value && e({
|
|
14
|
-
...t.value,
|
|
15
|
-
keyPath: o
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
return n = {
|
|
19
|
-
focusedContent: (0, require_index.vue_exports.readonly)(t),
|
|
20
|
-
setFocusedContent: e,
|
|
21
|
-
setFocusedContentKeyPath: s
|
|
22
|
-
}, n;
|
|
23
|
-
}, S = (t) => {
|
|
24
|
-
const e = d();
|
|
25
|
-
t.provide(c, e);
|
|
26
|
-
}, O = require_createSharedComposable.a(() => {
|
|
27
|
-
const t = (0, require_index.vue_exports.inject)(c), [e, s] = require_useCrossFrameState.I(require_messagesKeys.MessageKey.INTLAYER_FOCUSED_CONTENT_CHANGED);
|
|
28
|
-
if (!t) throw new Error("FocusDictionary state not found");
|
|
29
|
-
return (0, require_index.vue_exports.watch)(t.focusedContent, (o) => {
|
|
30
|
-
JSON.stringify(o) !== JSON.stringify(e.value) && s(o);
|
|
31
|
-
}), (0, require_index.vue_exports.watch)(e, (o) => {
|
|
32
|
-
JSON.stringify(o) !== JSON.stringify(t.focusedContent.value) && t.setFocusedContent(o ?? null);
|
|
33
|
-
}), t;
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
exports.S = S;
|
|
38
|
-
//# sourceMappingURL=focusDictionary.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focusDictionary.cjs","names":["l","C","i"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/focusDictionary.mjs"],"sourcesContent":["import { MessageKey as i } from \"@intlayer/editor\";\nimport { ref as u, readonly as a, inject as f, watch as r } from \"vue\";\nimport { createSharedComposable as l } from \"./createSharedComposable.mjs\";\nimport { useCrossFrameState as C } from \"./useCrossFrameState.mjs\";\nlet n = null;\nconst c = Symbol(\"FocusDictionary\"), d = () => {\n if (n) return n;\n const t = u(null), e = (o) => {\n t.value = o;\n }, s = (o) => {\n t.value && e({ ...t.value, keyPath: o });\n };\n return n = {\n focusedContent: a(t),\n setFocusedContent: e,\n setFocusedContentKeyPath: s\n }, n;\n}, S = (t) => {\n const e = d();\n t.provide(c, e);\n}, O = l(() => {\n const t = f(\n c\n ), [e, s] = C(\n i.INTLAYER_FOCUSED_CONTENT_CHANGED\n );\n if (!t)\n throw new Error(\"FocusDictionary state not found\");\n return r(t.focusedContent, (o) => {\n JSON.stringify(o) !== JSON.stringify(e.value) && s(o);\n }), r(e, (o) => {\n JSON.stringify(o) !== JSON.stringify(t.focusedContent.value) && t.setFocusedContent(o ?? null);\n }), t;\n});\nexport {\n d as createFocusDictionaryClient,\n S as installFocusDictionary,\n O as useFocusDictionary\n};\n"],"mappings":";;;;;;AAIA,IAAI,IAAI;AACR,MAAM,IAAI,OAAO,kBAAkB,EAAE,UAAU;AAC7C,KAAI,EAAG,QAAO;CACd,MAAM,uCAAM,KAAK,EAAE,KAAK,MAAM;AAC5B,IAAE,QAAQ;IACT,KAAK,MAAM;AACZ,IAAE,SAAS,EAAE;GAAE,GAAG,EAAE;GAAO,SAAS;GAAG,CAAC;;AAE1C,QAAO,IAAI;EACT,wDAAkB,EAAE;EACpB,mBAAmB;EACnB,0BAA0B;EAC3B,EAAE;GACF,KAAK,MAAM;CACZ,MAAM,IAAI,GAAG;AACb,GAAE,QAAQ,GAAG,EAAE;GACd,IAAIA,uCAAQ;CACb,MAAM,0CACJ,EACD,EAAE,CAAC,GAAG,KAAKC,6BACVC,gCAAE,iCACH;AACD,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,kCAAkC;AACpD,6CAAS,EAAE,iBAAiB,MAAM;AAChC,OAAK,UAAU,EAAE,KAAK,KAAK,UAAU,EAAE,MAAM,IAAI,EAAE,EAAE;GACrD,uCAAI,IAAI,MAAM;AACd,OAAK,UAAU,EAAE,KAAK,KAAK,UAAU,EAAE,eAAe,MAAM,IAAI,EAAE,kBAAkB,KAAK,KAAK;GAC9F,EAAE;EACJ"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_communicator = require('./communicator.cjs');
|
|
3
|
-
const require_dictionariesRecord = require('./dictionariesRecord.cjs');
|
|
4
|
-
const require_editedContent = require('./editedContent.cjs');
|
|
5
|
-
const require_editorEnabled = require('./editorEnabled.cjs');
|
|
6
|
-
const require_focusDictionary = require('./focusDictionary.cjs');
|
|
7
|
-
let __intlayer_config_built = require("@intlayer/config/built");
|
|
8
|
-
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
9
|
-
|
|
10
|
-
//#region ../vue-intlayer/dist/esm/editor/installIntlayerEditor.mjs
|
|
11
|
-
const { editor: o } = __intlayer_config_built.default, { applicationURL: a, editorURL: m, cmsURL: c } = o ?? {}, d = (i) => {
|
|
12
|
-
typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && window.postMessage(i, o.applicationURL), o.editorURL.length > 0 && window.parent.postMessage(i, o.editorURL), o.cmsURL.length > 0 && window.parent.postMessage(i, o.cmsURL));
|
|
13
|
-
}, u = (i) => {
|
|
14
|
-
require_communicator.g(i, {
|
|
15
|
-
postMessage: d,
|
|
16
|
-
allowedOrigins: [
|
|
17
|
-
a,
|
|
18
|
-
m,
|
|
19
|
-
c
|
|
20
|
-
]
|
|
21
|
-
}), require_editorEnabled.T(i), require_dictionariesRecord.L(i), require_editedContent.S(i), require_focusDictionary.S(i);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
exports.u = u;
|
|
26
|
-
//# sourceMappingURL=installIntlayerEditor.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayerEditor.cjs","names":["t","s","r","e","l"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/installIntlayerEditor.mjs"],"sourcesContent":["import t from \"@intlayer/config/built\";\nimport { installCommunicator as n } from \"./communicator.mjs\";\nimport { installDictionariesRecord as r } from \"./dictionariesRecord.mjs\";\nimport { installEditedContent as e } from \"./editedContent.mjs\";\nimport { installEditorEnabled as s } from \"./editorEnabled.mjs\";\nimport { installFocusDictionary as l } from \"./focusDictionary.mjs\";\nconst { editor: o } = t, { applicationURL: a, editorURL: m, cmsURL: c } = o ?? {}, d = (i) => {\n typeof window > \"u\" || !(window.self !== window.top) || (o.applicationURL.length > 0 && window.postMessage(i, o.applicationURL), o.editorURL.length > 0 && window.parent.postMessage(i, o.editorURL), o.cmsURL.length > 0 && window.parent.postMessage(i, o.cmsURL));\n}, u = (i) => {\n n(i, {\n postMessage: d,\n allowedOrigins: [a, m, c]\n }), s(i), r(i), e(i), l(i);\n};\nexport {\n u as installIntlayerEditor\n};\n"],"mappings":";;;;;;;;;;AAMA,MAAM,EAAE,QAAQ,MAAMA,iCAAG,EAAE,gBAAgB,GAAG,WAAW,GAAG,QAAQ,MAAM,KAAK,EAAE,EAAE,KAAK,MAAM;AAC5F,QAAO,SAAS,OAAO,EAAE,OAAO,SAAS,OAAO,SAAS,EAAE,eAAe,SAAS,KAAK,OAAO,YAAY,GAAG,EAAE,eAAe,EAAE,EAAE,UAAU,SAAS,KAAK,OAAO,OAAO,YAAY,GAAG,EAAE,UAAU,EAAE,EAAE,OAAO,SAAS,KAAK,OAAO,OAAO,YAAY,GAAG,EAAE,OAAO;GAClQ,KAAK,MAAM;AACZ,wBAAE,GAAG;EACH,aAAa;EACb,gBAAgB;GAAC;GAAG;GAAG;GAAE;EAC1B,CAAC,EAAEC,wBAAE,EAAE,EAAEC,6BAAE,EAAE,EAAEC,wBAAE,EAAE,EAAEC,0BAAE,EAAE"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
2
|
-
const require_compareUrls = require('../../../../@intlayer/editor/dist/esm/compareUrls.cjs');
|
|
3
|
-
const require_communicator = require('./communicator.cjs');
|
|
4
|
-
|
|
5
|
-
//#region ../vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.mjs
|
|
6
|
-
const o = /* @__PURE__ */ new Map();
|
|
7
|
-
let c = !1;
|
|
8
|
-
function m(e, t) {
|
|
9
|
-
let s = o.get(e);
|
|
10
|
-
s || (s = /* @__PURE__ */ new Set(), o.set(e, s)), s.add(t);
|
|
11
|
-
}
|
|
12
|
-
function l(e, t) {
|
|
13
|
-
const s = o.get(e);
|
|
14
|
-
s && (s.delete(t), s.size === 0 && o.delete(e));
|
|
15
|
-
}
|
|
16
|
-
function w(e, t) {
|
|
17
|
-
c || window && (window.addEventListener("message", (s) => {
|
|
18
|
-
const { type: n, data: i, senderId: a } = s.data ?? {};
|
|
19
|
-
n && a !== t && (!e || e.includes("*") || e.some((r) => require_compareUrls.compareUrls(r, s.origin))) && o.get(n)?.forEach((r) => r(i));
|
|
20
|
-
}), c = !0);
|
|
21
|
-
}
|
|
22
|
-
const L = (e, t) => {
|
|
23
|
-
const { allowedOrigins: s, postMessage: n, senderId: i } = require_communicator.C();
|
|
24
|
-
return w(s, i), t ? (m(e, t), (0, require_index.vue_exports.onScopeDispose)(() => l(e, t))) : (0, require_index.vue_exports.getCurrentInstance)() || console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."), (r) => {
|
|
25
|
-
n({
|
|
26
|
-
type: e,
|
|
27
|
-
data: r,
|
|
28
|
-
senderId: i
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
|
-
exports.L = L;
|
|
35
|
-
//# sourceMappingURL=useCrossFrameMessageListener.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameMessageListener.cjs","names":["u","p"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.mjs"],"sourcesContent":["import { compareUrls as u } from \"@intlayer/editor\";\nimport { onScopeDispose as f, getCurrentInstance as d } from \"vue\";\nimport { useCommunicator as p } from \"./communicator.mjs\";\nconst o = /* @__PURE__ */ new Map();\nlet c = !1;\nfunction m(e, t) {\n let s = o.get(e);\n s || (s = /* @__PURE__ */ new Set(), o.set(e, s)), s.add(t);\n}\nfunction l(e, t) {\n const s = o.get(e);\n s && (s.delete(t), s.size === 0 && o.delete(e));\n}\nfunction w(e, t) {\n c || window && (window.addEventListener(\"message\", (s) => {\n const { type: n, data: i, senderId: a } = s.data ?? {};\n n && a !== t && (!e || e.includes(\"*\") || e.some((r) => u(r, s.origin))) && o.get(n)?.forEach((r) => r(i));\n }), c = !0);\n}\nconst L = (e, t) => {\n const { allowedOrigins: s, postMessage: n, senderId: i } = p();\n return w(s, i), t ? (m(e, t), f(() => l(e, t))) : d() || console.warn(\n \"useCrossFrameMessageListener called outside a component without a callback; nothing to listen for.\"\n ), (r) => {\n n({ type: e, data: r, senderId: i });\n };\n};\nexport {\n L as useCrossFrameMessageListener\n};\n"],"mappings":";;;;;AAGA,MAAM,oBAAoB,IAAI,KAAK;AACnC,IAAI,IAAI,CAAC;AACT,SAAS,EAAE,GAAG,GAAG;CACf,IAAI,IAAI,EAAE,IAAI,EAAE;AAChB,OAAM,oBAAoB,IAAI,KAAK,EAAE,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE;;AAE7D,SAAS,EAAE,GAAG,GAAG;CACf,MAAM,IAAI,EAAE,IAAI,EAAE;AAClB,OAAM,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,KAAK,EAAE,OAAO,EAAE;;AAEhD,SAAS,EAAE,GAAG,GAAG;AACf,MAAK,WAAW,OAAO,iBAAiB,YAAY,MAAM;EACxD,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,MAAM,EAAE,QAAQ,EAAE;AACtD,OAAK,MAAM,MAAM,CAAC,KAAK,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,MAAMA,gCAAE,GAAG,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC;GAC1G,EAAE,IAAI,CAAC;;AAEX,MAAM,KAAK,GAAG,MAAM;CAClB,MAAM,EAAE,gBAAgB,GAAG,aAAa,GAAG,UAAU,MAAMC,wBAAG;AAC9D,QAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,sDAAU,EAAE,GAAG,EAAE,CAAC,uDAAO,IAAI,QAAQ,KAC/D,qGACD,GAAG,MAAM;AACR,IAAE;GAAE,MAAM;GAAG,MAAM;GAAG,UAAU;GAAG,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const require_index = require('../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/index2.cjs');
|
|
2
|
-
const require_communicator = require('./communicator.cjs');
|
|
3
|
-
const require_useCrossFrameMessageListener = require('./useCrossFrameMessageListener.cjs');
|
|
4
|
-
|
|
5
|
-
//#region ../vue-intlayer/dist/esm/editor/useCrossFrameState.mjs
|
|
6
|
-
const f = /* @__PURE__ */ new Map(), S = (t, i) => typeof t == "function" ? t(i) : t, F = (t) => t == null ? t : JSON.parse(JSON.stringify(t)), I = (t, i, v = {
|
|
7
|
-
emit: !0,
|
|
8
|
-
receive: !0
|
|
9
|
-
}) => {
|
|
10
|
-
if (f.has(t)) {
|
|
11
|
-
const { state: s, setState: r, postState: a } = f.get(t);
|
|
12
|
-
return [
|
|
13
|
-
s,
|
|
14
|
-
r,
|
|
15
|
-
a
|
|
16
|
-
];
|
|
17
|
-
}
|
|
18
|
-
(0, require_index.vue_exports.getCurrentInstance)() || console.warn("useCrossFrameState called outside a component setup function - reactivity may be limited");
|
|
19
|
-
const { emit: u = !0, receive: p = !0 } = v, e = (0, require_index.vue_exports.ref)(S(i)), { postMessage: n, senderId: o } = require_communicator.C(), c = (s) => {
|
|
20
|
-
!u || typeof n != "function" || typeof s > "u" || n({
|
|
21
|
-
type: `${t}/post`,
|
|
22
|
-
data: s,
|
|
23
|
-
senderId: o
|
|
24
|
-
});
|
|
25
|
-
}, d = (s) => {
|
|
26
|
-
const a = F(S(s, e.value));
|
|
27
|
-
e.value = a, c(a);
|
|
28
|
-
}, l = () => {
|
|
29
|
-
typeof n == "function" && n({
|
|
30
|
-
type: `${t}/post`,
|
|
31
|
-
data: e.value,
|
|
32
|
-
senderId: o
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
c(e.value), p && typeof n == "function" && typeof e.value > "u" && n({
|
|
36
|
-
type: `${t}/get`,
|
|
37
|
-
senderId: o
|
|
38
|
-
}), require_useCrossFrameMessageListener.L(`${t}/post`, p ? (s) => {
|
|
39
|
-
e.value = s;
|
|
40
|
-
} : void 0);
|
|
41
|
-
const g = (s, r) => {
|
|
42
|
-
u && r !== o && c(e.value);
|
|
43
|
-
};
|
|
44
|
-
return require_useCrossFrameMessageListener.L(`${t}/get`, u ? g : void 0), f.set(t, {
|
|
45
|
-
state: e,
|
|
46
|
-
setState: d,
|
|
47
|
-
postState: l
|
|
48
|
-
}), [
|
|
49
|
-
e,
|
|
50
|
-
d,
|
|
51
|
-
l
|
|
52
|
-
];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.I = I;
|
|
57
|
-
//# sourceMappingURL=useCrossFrameState.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameState.cjs","names":["$","m"],"sources":["../../../../../../../../vue-intlayer/dist/esm/editor/useCrossFrameState.mjs"],"sourcesContent":["import { getCurrentInstance as C, ref as y } from \"vue\";\nimport { useCommunicator as $ } from \"./communicator.mjs\";\nimport { useCrossFrameMessageListener as m } from \"./useCrossFrameMessageListener.mjs\";\nconst f = /* @__PURE__ */ new Map(), S = (t, i) => typeof t == \"function\" ? t(i) : t, F = (t) => t == null ? t : JSON.parse(JSON.stringify(t)), I = (t, i, v = { emit: !0, receive: !0 }) => {\n if (f.has(t)) {\n const { state: s, setState: r, postState: a } = f.get(t);\n return [s, r, a];\n }\n C() || console.warn(\n \"useCrossFrameState called outside a component setup function - reactivity may be limited\"\n );\n const { emit: u = !0, receive: p = !0 } = v, e = y(S(i)), { postMessage: n, senderId: o } = $(), c = (s) => {\n !u || typeof n != \"function\" || typeof s > \"u\" || n({\n type: `${t}/post`,\n data: s,\n senderId: o\n });\n }, d = (s) => {\n const r = S(s, e.value), a = F(r);\n e.value = a, c(a);\n }, l = () => {\n typeof n == \"function\" && n({\n type: `${t}/post`,\n data: e.value,\n senderId: o\n });\n };\n c(e.value), p && typeof n == \"function\" && typeof e.value > \"u\" && n({ type: `${t}/get`, senderId: o }), m(\n `${t}/post`,\n p ? (s) => {\n e.value = s;\n } : void 0\n );\n const g = (s, r) => {\n u && r !== o && c(e.value);\n };\n return m(\n `${t}/get`,\n u ? g : void 0\n ), f.set(t, { state: e, setState: d, postState: l }), [e, d, l];\n};\nexport {\n I as useCrossFrameState\n};\n"],"mappings":";;;;;AAGA,MAAM,oBAAoB,IAAI,KAAK,EAAE,KAAK,GAAG,MAAM,OAAO,KAAK,aAAa,EAAE,EAAE,GAAG,GAAG,KAAK,MAAM,KAAK,OAAO,IAAI,KAAK,MAAM,KAAK,UAAU,EAAE,CAAC,EAAE,KAAK,GAAG,GAAG,IAAI;CAAE,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,KAAK;AAC3L,KAAI,EAAE,IAAI,EAAE,EAAE;EACZ,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,WAAW,MAAM,EAAE,IAAI,EAAE;AACxD,SAAO;GAAC;GAAG;GAAG;GAAE;;AAElB,oDAAG,IAAI,QAAQ,KACb,2FACD;CACD,MAAM,EAAE,MAAM,IAAI,CAAC,GAAG,SAAS,IAAI,CAAC,MAAM,GAAG,uCAAM,EAAE,EAAE,CAAC,EAAE,EAAE,aAAa,GAAG,UAAU,MAAMA,wBAAG,EAAE,KAAK,MAAM;AAC1G,GAAC,KAAK,OAAO,KAAK,cAAc,OAAO,IAAI,OAAO,EAAE;GAClD,MAAM,GAAG,EAAE;GACX,MAAM;GACN,UAAU;GACX,CAAC;IACD,KAAK,MAAM;EACZ,MAAyB,IAAI,EAAnB,EAAE,GAAG,EAAE,MAAM,CAAU;AACjC,IAAE,QAAQ,GAAG,EAAE,EAAE;IAChB,UAAU;AACX,SAAO,KAAK,cAAc,EAAE;GAC1B,MAAM,GAAG,EAAE;GACX,MAAM,EAAE;GACR,UAAU;GACX,CAAC;;AAEJ,GAAE,EAAE,MAAM,EAAE,KAAK,OAAO,KAAK,cAAc,OAAO,EAAE,QAAQ,OAAO,EAAE;EAAE,MAAM,GAAG,EAAE;EAAO,UAAU;EAAG,CAAC,EAAEC,uCACvG,GAAG,EAAE,QACL,KAAK,MAAM;AACT,IAAE,QAAQ;KACR,KAAK,EACV;CACD,MAAM,KAAK,GAAG,MAAM;AAClB,OAAK,MAAM,KAAK,EAAE,EAAE,MAAM;;AAE5B,QAAOA,uCACL,GAAG,EAAE,OACL,IAAI,IAAI,KAAK,EACd,EAAE,EAAE,IAAI,GAAG;EAAE,OAAO;EAAG,UAAU;EAAG,WAAW;EAAG,CAAC,EAAE;EAAC;EAAG;EAAG;EAAE"}
|