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
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJS = (cb, mod) => function() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __export = (all) => {
|
|
14
|
-
let target = {};
|
|
15
|
-
for (var name in all) __defProp(target, name, {
|
|
16
|
-
get: all[name],
|
|
17
|
-
enumerable: true
|
|
18
|
-
});
|
|
19
|
-
return target;
|
|
20
|
-
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
23
|
-
key = keys[i];
|
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
25
|
-
get: ((k) => from[k]).bind(null, key),
|
|
26
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return to;
|
|
30
|
-
};
|
|
31
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
32
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
33
|
-
value: mod,
|
|
34
|
-
enumerable: true
|
|
35
|
-
}) : target, mod));
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
export { __commonJS, __export, __reExport, __toESM };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import { ESMxCJSRequire, clearModuleCache } from "@intlayer/config";
|
|
3
|
-
import a from "@intlayer/config/built";
|
|
4
|
-
import { existsSync } from "node:fs";
|
|
5
|
-
|
|
6
|
-
//#region ../@intlayer/dictionaries-entry/dist/esm/index.mjs
|
|
7
|
-
const getDictionaries = (configuration = a) => {
|
|
8
|
-
const { content, build } = configuration;
|
|
9
|
-
const dictionariesPath = join(content.mainDir, `dictionaries.cjs`);
|
|
10
|
-
let dictionaries = {};
|
|
11
|
-
if (existsSync(dictionariesPath)) {
|
|
12
|
-
clearModuleCache(dictionariesPath);
|
|
13
|
-
dictionaries = (build.require ?? ESMxCJSRequire)(dictionariesPath);
|
|
14
|
-
}
|
|
15
|
-
return dictionaries ?? {};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { getDictionaries };
|
|
20
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["config"],"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,MAAW;CACnD,MAAM,EAAE,SAAS,UAAU;CAC3B,MAAM,mBAAmB,KAAK,QAAQ,SAAS,mBAAmB;CAClE,IAAI,eAAe,EAAE;AACrB,KAAI,WAAW,iBAAiB,EAAE;AACjC,mBAAiB,iBAAiB;AAClC,kBAAgB,MAAM,WAAW,gBAAgB,iBAAiB;;AAEnE,QAAO,gBAAgB,EAAE"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
//#region ../@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
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
|
-
export { compareUrls };
|
|
35
|
-
//# sourceMappingURL=compareUrls.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareUrls.mjs","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,18 +0,0 @@
|
|
|
1
|
-
//#region ../@intlayer/editor/dist/esm/messagesKeys.mjs
|
|
2
|
-
let MessageKey = /* @__PURE__ */ function(MessageKey$1) {
|
|
3
|
-
MessageKey$1["INTLAYER_CONFIGURATION"] = "INTLAYER_CONFIGURATION";
|
|
4
|
-
MessageKey$1["INTLAYER_CURRENT_LOCALE"] = "INTLAYER_CURRENT_LOCALE";
|
|
5
|
-
MessageKey$1["INTLAYER_EDITOR_ENABLED"] = "INTLAYER_EDITOR_ENABLED";
|
|
6
|
-
MessageKey$1["INTLAYER_URL_CHANGE"] = "INTLAYER_URL_CHANGE";
|
|
7
|
-
MessageKey$1["INTLAYER_HOVERED_CONTENT_CHANGED"] = "INTLAYER_HOVERED_CONTENT_CHANGED";
|
|
8
|
-
MessageKey$1["INTLAYER_FOCUSED_CONTENT_CHANGED"] = "INTLAYER_FOCUSED_CONTENT_CHANGED";
|
|
9
|
-
MessageKey$1["INTLAYER_LOCALE_DICTIONARIES_CHANGED"] = "INTLAYER_LOCALE_DICTIONARIES_CHANGED";
|
|
10
|
-
MessageKey$1["INTLAYER_DISTANT_DICTIONARIES_CHANGED"] = "INTLAYER_DISTANT_DICTIONARIES_CHANGED";
|
|
11
|
-
MessageKey$1["INTLAYER_EDITED_CONTENT_CHANGED"] = "INTLAYER_EDITED_CONTENT_CHANGED";
|
|
12
|
-
MessageKey$1["INTLAYER_IFRAME_CLICKED"] = "INTLAYER_IFRAME_CLICKED";
|
|
13
|
-
return MessageKey$1;
|
|
14
|
-
}({});
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { MessageKey };
|
|
18
|
-
//# sourceMappingURL=messagesKeys.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messagesKeys.mjs","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,28 +0,0 @@
|
|
|
1
|
-
import { readonly, ref } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
3
|
-
import { u } from "../editor/installIntlayerEditor.mjs";
|
|
4
|
-
import "@intlayer/core";
|
|
5
|
-
import a from "@intlayer/config/built";
|
|
6
|
-
import "@intlayer/types";
|
|
7
|
-
|
|
8
|
-
//#region ../vue-intlayer/dist/esm/client/installIntlayer.mjs
|
|
9
|
-
const p = Symbol("intlayer");
|
|
10
|
-
let r = null;
|
|
11
|
-
const u$1 = (t, e = !0) => {
|
|
12
|
-
if (r) return r;
|
|
13
|
-
const { defaultLocale: n } = a.internationalization ?? {}, o = ref(t ?? n), i = (l) => {
|
|
14
|
-
o.value = l;
|
|
15
|
-
};
|
|
16
|
-
return r = {
|
|
17
|
-
locale: readonly(o),
|
|
18
|
-
setLocale: i,
|
|
19
|
-
isCookieEnabled: e
|
|
20
|
-
}, r;
|
|
21
|
-
}, Y = (t, e, n = !0) => {
|
|
22
|
-
const o = u$1(e, n);
|
|
23
|
-
t.provide(p, o), u(t);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
export { Y, u$1 as u };
|
|
28
|
-
//# sourceMappingURL=installIntlayer.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayer.mjs","names":["u","c","m","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,MAAM,EAAE,wBAAwB,EAAE,EAAE,IAAIC,IAAE,KAAK,EAAE,EAAE,KAAK,MAAM;AACnF,IAAE,QAAQ;;AAEZ,QAAO,IAAI;EACT,QAAQC,SAAE,EAAE;EACZ,WAAW;EACX,iBAAiB;EAClB,EAAE;GACF,KAAK,GAAG,GAAG,IAAI,CAAC,MAAM;CACvB,MAAM,IAAIF,IAAE,GAAG,EAAE;AACjB,GAAE,QAAQ,GAAG,EAAE,EAAEG,EAAE,EAAE"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { reactive } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { inject } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import v4_default from "../../../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/v4.mjs";
|
|
5
|
-
import a from "@intlayer/config/built";
|
|
6
|
-
|
|
7
|
-
//#region ../vue-intlayer/dist/esm/editor/communicator.mjs
|
|
8
|
-
const { editor: n } = a, 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 = reactive({
|
|
19
|
-
...o,
|
|
20
|
-
...e,
|
|
21
|
-
senderId: 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 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
|
-
export { C, g };
|
|
38
|
-
//# sourceMappingURL=communicator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"communicator.mjs","names":["i","l","a","u"],"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,GAAG,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,IAAIC,SAAE;CACrF,GAAG;CACH,GAAG;CACH,UAAUC,YAAG;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,SAAOC,OAAE,GAAG,EAAE;SACR;AACN,SAAO,QAAQ,KACb,uFACD,EAAE;GACD,mBAAmB;GACnB,UAAU;GACX"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { effectScope, getCurrentScope, onScopeDispose } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../vue-intlayer/dist/esm/editor/createSharedComposable.mjs
|
|
5
|
-
function u(t) {
|
|
6
|
-
return getCurrentScope() ? (onScopeDispose(t), !0) : !1;
|
|
7
|
-
}
|
|
8
|
-
const a = (t) => {
|
|
9
|
-
let r = 0, o, e;
|
|
10
|
-
const s = () => {
|
|
11
|
-
r -= 1, e && r <= 0 && (e.stop(), o = void 0, e = void 0);
|
|
12
|
-
};
|
|
13
|
-
return ((...n) => (r += 1, e || (e = effectScope(!0), o = e.run(() => t(...n))), u(s), o));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { a };
|
|
18
|
-
//# sourceMappingURL=createSharedComposable.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSharedComposable.mjs","names":["c","i","p"],"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,QAAOA,iBAAG,IAAIC,eAAE,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,IAAIC,YAAE,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { readonly, ref } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { inject, watch } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import { MessageKey } from "../../../../@intlayer/editor/dist/esm/messagesKeys.mjs";
|
|
5
|
-
import { getDictionaries } from "../../../../@intlayer/dictionaries-entry/dist/esm/index.mjs";
|
|
6
|
-
import { a } from "./createSharedComposable.mjs";
|
|
7
|
-
import { I } from "./useCrossFrameState.mjs";
|
|
8
|
-
|
|
9
|
-
//#region ../vue-intlayer/dist/esm/editor/dictionariesRecord.mjs
|
|
10
|
-
let t = null;
|
|
11
|
-
const r = Symbol("intlayerDictionariesRecord"), u = () => {
|
|
12
|
-
if (t) return t;
|
|
13
|
-
const e = ref(getDictionaries());
|
|
14
|
-
return t = {
|
|
15
|
-
localeDictionaries: readonly(e),
|
|
16
|
-
setLocaleDictionaries: (o) => {
|
|
17
|
-
e.value = o ?? {};
|
|
18
|
-
},
|
|
19
|
-
setLocaleDictionary(o) {
|
|
20
|
-
e.value = {
|
|
21
|
-
...e.value,
|
|
22
|
-
[o.key]: o
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}, t;
|
|
26
|
-
}, L = (i) => {
|
|
27
|
-
const e = u();
|
|
28
|
-
i.provide(r, e);
|
|
29
|
-
}, _ = a(() => {
|
|
30
|
-
const i = inject(r);
|
|
31
|
-
if (!i) throw new Error("DictionariesRecord state not found");
|
|
32
|
-
const [e, o] = I(MessageKey.INTLAYER_LOCALE_DICTIONARIES_CHANGED, void 0);
|
|
33
|
-
watch(i.localeDictionaries, (c) => {
|
|
34
|
-
o(c);
|
|
35
|
-
}, { immediate: !0 });
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { L };
|
|
40
|
-
//# sourceMappingURL=dictionariesRecord.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.mjs","names":["s","n","l","d","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,IAAIA,IAATC,iBAAG,CAAU;AACvB,QAAO,IAAI;EACT,oBAAoBC,SAAE,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,QAAQ;CACb,MAAM,IAAIC,OACR,EACD;AACD,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,qCAAqC;CACvD,MAAM,CAAC,GAAG,KAAKC,EACbC,WAAE,sCACF,KAAK,EACN;AACD,OACE,EAAE,qBACD,MAAM;AACL,IAAE,EAAE;IAEN,EAAE,WAAW,CAAC,GAAG,CAClB;EACD"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { readonly, ref } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { inject, watch } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import { MessageKey } from "../../../../@intlayer/editor/dist/esm/messagesKeys.mjs";
|
|
5
|
-
import { a } from "./createSharedComposable.mjs";
|
|
6
|
-
import { I } from "./useCrossFrameState.mjs";
|
|
7
|
-
import { getContentNodeByKeyPath } from "@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 = ref({});
|
|
14
|
-
return i = {
|
|
15
|
-
editedContent: readonly(t),
|
|
16
|
-
getEditedContentValue: (e, r) => {
|
|
17
|
-
const n = t.value;
|
|
18
|
-
if (!n) return;
|
|
19
|
-
if (e.includes(":local:") || e.includes(":remote:")) return 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 = 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 = a(() => {
|
|
34
|
-
const t = inject(u);
|
|
35
|
-
if (!t) throw new Error("EditedContent state not found");
|
|
36
|
-
const [e, r] = I(MessageKey.INTLAYER_EDITED_CONTENT_CHANGED, {});
|
|
37
|
-
return watch(e, (n) => {
|
|
38
|
-
t.editedContent.value = n ?? {};
|
|
39
|
-
}), watch(t, (n) => {
|
|
40
|
-
r(n.editedContent.value);
|
|
41
|
-
}), t;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
export { S };
|
|
46
|
-
//# sourceMappingURL=editedContent.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editedContent.mjs","names":["E","f","c","a","N","m","p","l","C"],"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,IAAIA,IAAE,EAAE,CAAC;AACf,QAAO,IAAI;EACT,eAAeC,SAAE,EAAE;EACnB,wBAAwB,GAAG,MAAM;GAC/B,MAAM,IAAI,EAAE;AACZ,OAAI,CAAC,EAAG;AACR,OAAI,EAAE,SAAS,UAAU,IAAI,EAAE,SAAS,WAAW,CAEjD,QAAOC,wBADG,IAAI,IAAI,WAAW,EAAE,EACnB,EAAE;GAEhB,MAAMC,MAAI,OAAO,KAAK,EAAE,CAAC,QACtB,MAAM,EAAE,WAAW,GAAG,EAAE,GAAG,CAC7B;AACD,QAAK,MAAM,KAAKA,KAAG;IACjB,MAAiC,IAAID,wBAA3B,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,IAAIE,QAAQ;CACb,MAAM,IAAIC,OAAE,EAAE;AACd,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,gCAAgC;CAClD,MAAM,CAAC,GAAG,KAAKC,EACbC,WAAE,iCACF,EAAE,CACH;AACD,QAAOC,MAAE,IAAI,MAAM;AACjB,IAAE,cAAc,QAAQ,KAAK,EAAE;GAC/B,EAAEA,MAAE,IAAI,MAAM;AACd,IAAE,EAAE,cAAc,MAAM;GACxB,EAAE;EACJ"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ref } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { computed, inject, nextTick, onMounted, watch } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import { MessageKey } from "../../../../@intlayer/editor/dist/esm/messagesKeys.mjs";
|
|
5
|
-
import { a as a$1 } from "./createSharedComposable.mjs";
|
|
6
|
-
import { L } from "./useCrossFrameMessageListener.mjs";
|
|
7
|
-
import a from "@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 = ref(a.editor.enabled), n = ref(!1), t = ref(!1);
|
|
14
|
-
return r = {
|
|
15
|
-
settingEnabled: e,
|
|
16
|
-
wrapperEnabled: n,
|
|
17
|
-
isInIframe: t,
|
|
18
|
-
enabled: 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 = a$1(() => {
|
|
24
|
-
const e = inject(s);
|
|
25
|
-
if (!e) throw new Error("EditorEnabled state not found");
|
|
26
|
-
L(`${MessageKey.INTLAYER_EDITOR_ENABLED}/post`, (t) => {
|
|
27
|
-
e.wrapperEnabled.value = t;
|
|
28
|
-
});
|
|
29
|
-
const n = L(`${MessageKey.INTLAYER_EDITOR_ENABLED}/get`, (t) => {
|
|
30
|
-
e.wrapperEnabled.value = t;
|
|
31
|
-
});
|
|
32
|
-
return watch(() => e.isInIframe.value && e.settingEnabled.value, (t) => {
|
|
33
|
-
n();
|
|
34
|
-
}, { immediate: !0 }), onMounted(() => {
|
|
35
|
-
nextTick(() => {
|
|
36
|
-
const t = l();
|
|
37
|
-
e.isInIframe.value = t;
|
|
38
|
-
});
|
|
39
|
-
}), e;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { T };
|
|
44
|
-
//# sourceMappingURL=editorEnabled.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editorEnabled.mjs","names":["o","E","p","I","f","a","i","u","c"],"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,IAAIA,IAAEC,EAAE,OAAO,QAAQ,EAAE,IAAID,IAAE,CAAC,EAAE,EAAE,IAAIA,IAAE,CAAC,EAAE;AAGnD,QAAO,IAAI;EACT,gBAAgB;EAChB,gBAAgB;EAChB,YAAY;EACZ,SAPuDE,eACjD,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,UAAQ;CACb,MAAM,IAAIC,OACR,EACD;AACD,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,gCAAgC;AAClD,GACE,GAAGC,WAAE,wBAAwB,SAC5B,MAAM;AACL,IAAE,eAAe,QAAQ;GAE5B;CACD,MAAM,IAAIC,EACR,GAAGD,WAAE,wBAAwB,QAC5B,MAAM;AACL,IAAE,eAAe,QAAQ;GAE5B;AACD,QAAOE,YACC,EAAE,WAAW,SAAS,EAAE,eAAe,QAC5C,MAAM;AACL,KAAG;IAEL,EAAE,WAAW,CAAC,GAAG,CAClB,EAAEC,gBAAQ;AACT,iBAAQ;GACN,MAAM,IAAI,GAAG;AACb,KAAE,WAAW,QAAQ;IACrB;GACF,EAAE;EACJ"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { readonly, ref } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { inject, watch } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import { MessageKey } from "../../../../@intlayer/editor/dist/esm/messagesKeys.mjs";
|
|
5
|
-
import { a } from "./createSharedComposable.mjs";
|
|
6
|
-
import { I } from "./useCrossFrameState.mjs";
|
|
7
|
-
|
|
8
|
-
//#region ../vue-intlayer/dist/esm/editor/focusDictionary.mjs
|
|
9
|
-
let n = null;
|
|
10
|
-
const c = Symbol("FocusDictionary"), d = () => {
|
|
11
|
-
if (n) return n;
|
|
12
|
-
const t = ref(null), e = (o) => {
|
|
13
|
-
t.value = o;
|
|
14
|
-
}, s = (o) => {
|
|
15
|
-
t.value && e({
|
|
16
|
-
...t.value,
|
|
17
|
-
keyPath: o
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
return n = {
|
|
21
|
-
focusedContent: readonly(t),
|
|
22
|
-
setFocusedContent: e,
|
|
23
|
-
setFocusedContentKeyPath: s
|
|
24
|
-
}, n;
|
|
25
|
-
}, S = (t) => {
|
|
26
|
-
const e = d();
|
|
27
|
-
t.provide(c, e);
|
|
28
|
-
}, O = a(() => {
|
|
29
|
-
const t = inject(c), [e, s] = I(MessageKey.INTLAYER_FOCUSED_CONTENT_CHANGED);
|
|
30
|
-
if (!t) throw new Error("FocusDictionary state not found");
|
|
31
|
-
return watch(t.focusedContent, (o) => {
|
|
32
|
-
JSON.stringify(o) !== JSON.stringify(e.value) && s(o);
|
|
33
|
-
}), watch(e, (o) => {
|
|
34
|
-
JSON.stringify(o) !== JSON.stringify(t.focusedContent.value) && t.setFocusedContent(o ?? null);
|
|
35
|
-
}), t;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { S };
|
|
40
|
-
//# sourceMappingURL=focusDictionary.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focusDictionary.mjs","names":["u","a","l","f","C","i","r"],"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,IAAIA,IAAE,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,gBAAgBC,SAAE,EAAE;EACpB,mBAAmB;EACnB,0BAA0B;EAC3B,EAAE;GACF,KAAK,MAAM;CACZ,MAAM,IAAI,GAAG;AACb,GAAE,QAAQ,GAAG,EAAE;GACd,IAAIC,QAAQ;CACb,MAAM,IAAIC,OACR,EACD,EAAE,CAAC,GAAG,KAAKC,EACVC,WAAE,iCACH;AACD,KAAI,CAAC,EACH,OAAM,IAAI,MAAM,kCAAkC;AACpD,QAAOC,MAAE,EAAE,iBAAiB,MAAM;AAChC,OAAK,UAAU,EAAE,KAAK,KAAK,UAAU,EAAE,MAAM,IAAI,EAAE,EAAE;GACrD,EAAEA,MAAE,IAAI,MAAM;AACd,OAAK,UAAU,EAAE,KAAK,KAAK,UAAU,EAAE,eAAe,MAAM,IAAI,EAAE,kBAAkB,KAAK,KAAK;GAC9F,EAAE;EACJ"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { g } from "./communicator.mjs";
|
|
2
|
-
import { L } from "./dictionariesRecord.mjs";
|
|
3
|
-
import { S } from "./editedContent.mjs";
|
|
4
|
-
import { T } from "./editorEnabled.mjs";
|
|
5
|
-
import { S as S$1 } from "./focusDictionary.mjs";
|
|
6
|
-
import a from "@intlayer/config/built";
|
|
7
|
-
|
|
8
|
-
//#region ../vue-intlayer/dist/esm/editor/installIntlayerEditor.mjs
|
|
9
|
-
const { editor: o } = a, { applicationURL: a$1, editorURL: m, cmsURL: c } = o ?? {}, d = (i) => {
|
|
10
|
-
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));
|
|
11
|
-
}, u = (i) => {
|
|
12
|
-
g(i, {
|
|
13
|
-
postMessage: d,
|
|
14
|
-
allowedOrigins: [
|
|
15
|
-
a$1,
|
|
16
|
-
m,
|
|
17
|
-
c
|
|
18
|
-
]
|
|
19
|
-
}), T(i), L(i), S(i), S$1(i);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { u };
|
|
24
|
-
//# sourceMappingURL=installIntlayerEditor.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayerEditor.mjs","names":["t","a","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,GAAG,EAAE,gBAAgBC,KAAG,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,GAAE,GAAG;EACH,aAAa;EACb,gBAAgB;GAACA;GAAG;GAAG;GAAE;EAC1B,CAAC,EAAEC,EAAE,EAAE,EAAEC,EAAE,EAAE,EAAEC,EAAE,EAAE,EAAEC,IAAE,EAAE"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { onScopeDispose } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { getCurrentInstance } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import { compareUrls } from "../../../../@intlayer/editor/dist/esm/compareUrls.mjs";
|
|
5
|
-
import { C } from "./communicator.mjs";
|
|
6
|
-
|
|
7
|
-
//#region ../vue-intlayer/dist/esm/editor/useCrossFrameMessageListener.mjs
|
|
8
|
-
const o = /* @__PURE__ */ new Map();
|
|
9
|
-
let c = !1;
|
|
10
|
-
function m(e, t) {
|
|
11
|
-
let s = o.get(e);
|
|
12
|
-
s || (s = /* @__PURE__ */ new Set(), o.set(e, s)), s.add(t);
|
|
13
|
-
}
|
|
14
|
-
function l(e, t) {
|
|
15
|
-
const s = o.get(e);
|
|
16
|
-
s && (s.delete(t), s.size === 0 && o.delete(e));
|
|
17
|
-
}
|
|
18
|
-
function w(e, t) {
|
|
19
|
-
c || window && (window.addEventListener("message", (s) => {
|
|
20
|
-
const { type: n, data: i, senderId: a } = s.data ?? {};
|
|
21
|
-
n && a !== t && (!e || e.includes("*") || e.some((r) => compareUrls(r, s.origin))) && o.get(n)?.forEach((r) => r(i));
|
|
22
|
-
}), c = !0);
|
|
23
|
-
}
|
|
24
|
-
const L = (e, t) => {
|
|
25
|
-
const { allowedOrigins: s, postMessage: n, senderId: i } = C();
|
|
26
|
-
return w(s, i), t ? (m(e, t), onScopeDispose(() => l(e, t))) : getCurrentInstance() || console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."), (r) => {
|
|
27
|
-
n({
|
|
28
|
-
type: e,
|
|
29
|
-
data: r,
|
|
30
|
-
senderId: i
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { L };
|
|
37
|
-
//# sourceMappingURL=useCrossFrameMessageListener.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameMessageListener.mjs","names":["u","p","f","d"],"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,YAAE,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,GAAG;AAC9D,QAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAEC,qBAAQ,EAAE,GAAG,EAAE,CAAC,IAAIC,oBAAG,IAAI,QAAQ,KAC/D,qGACD,GAAG,MAAM;AACR,IAAE;GAAE,MAAM;GAAG,MAAM;GAAG,UAAU;GAAG,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ref } from "../../../../../node_modules/.bun/@vue_reactivity@3.5.22/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
|
|
2
|
-
import { getCurrentInstance } from "../../../../../node_modules/.bun/@vue_runtime-core@3.5.22/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
|
|
3
|
-
import "../../../../../node_modules/.bun/vue@3.5.22_e72aefb0f8d0b841/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
|
|
4
|
-
import { C } from "./communicator.mjs";
|
|
5
|
-
import { L } from "./useCrossFrameMessageListener.mjs";
|
|
6
|
-
|
|
7
|
-
//#region ../vue-intlayer/dist/esm/editor/useCrossFrameState.mjs
|
|
8
|
-
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 = {
|
|
9
|
-
emit: !0,
|
|
10
|
-
receive: !0
|
|
11
|
-
}) => {
|
|
12
|
-
if (f.has(t)) {
|
|
13
|
-
const { state: s, setState: r, postState: a } = f.get(t);
|
|
14
|
-
return [
|
|
15
|
-
s,
|
|
16
|
-
r,
|
|
17
|
-
a
|
|
18
|
-
];
|
|
19
|
-
}
|
|
20
|
-
getCurrentInstance() || console.warn("useCrossFrameState called outside a component setup function - reactivity may be limited");
|
|
21
|
-
const { emit: u = !0, receive: p = !0 } = v, e = ref(S(i)), { postMessage: n, senderId: o } = C(), c = (s) => {
|
|
22
|
-
!u || typeof n != "function" || typeof s > "u" || n({
|
|
23
|
-
type: `${t}/post`,
|
|
24
|
-
data: s,
|
|
25
|
-
senderId: o
|
|
26
|
-
});
|
|
27
|
-
}, d = (s) => {
|
|
28
|
-
const a = F(S(s, e.value));
|
|
29
|
-
e.value = a, c(a);
|
|
30
|
-
}, l = () => {
|
|
31
|
-
typeof n == "function" && n({
|
|
32
|
-
type: `${t}/post`,
|
|
33
|
-
data: e.value,
|
|
34
|
-
senderId: o
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
c(e.value), p && typeof n == "function" && typeof e.value > "u" && n({
|
|
38
|
-
type: `${t}/get`,
|
|
39
|
-
senderId: o
|
|
40
|
-
}), L(`${t}/post`, p ? (s) => {
|
|
41
|
-
e.value = s;
|
|
42
|
-
} : void 0);
|
|
43
|
-
const g = (s, r) => {
|
|
44
|
-
u && r !== o && c(e.value);
|
|
45
|
-
};
|
|
46
|
-
return L(`${t}/get`, u ? g : void 0), f.set(t, {
|
|
47
|
-
state: e,
|
|
48
|
-
setState: d,
|
|
49
|
-
postState: l
|
|
50
|
-
}), [
|
|
51
|
-
e,
|
|
52
|
-
d,
|
|
53
|
-
l
|
|
54
|
-
];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { I };
|
|
59
|
-
//# sourceMappingURL=useCrossFrameState.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameState.mjs","names":["y","$","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,qBAAG,IAAI,QAAQ,KACb,2FACD;CACD,MAAM,EAAE,MAAM,IAAI,CAAC,GAAG,SAAS,IAAI,CAAC,MAAM,GAAG,IAAIA,IAAE,EAAE,EAAE,CAAC,EAAE,EAAE,aAAa,GAAG,UAAU,MAAMC,GAAG,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,EACvG,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,EACL,GAAG,EAAE,OACL,IAAI,IAAI,KAAK,EACd,EAAE,EAAE,IAAI,GAAG;EAAE,OAAO;EAAG,UAAU;EAAG,WAAW;EAAG,CAAC,EAAE;EAAC;EAAG;EAAG;EAAE"}
|