angular-intlayer 7.1.8-canary.0 → 7.1.8

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.
@@ -12,31 +12,33 @@ const subscribers = /* @__PURE__ */ new Map();
12
12
  /** True once we've attached the single window listener */
13
13
  let windowListenerAttached = false;
14
14
  /** Helper to add/remove a callback for a key */
15
- function addSubscriber(key, cb) {
15
+ const addSubscriber = (key, cb) => {
16
16
  let set = subscribers.get(key);
17
17
  if (!set) {
18
18
  set = /* @__PURE__ */ new Set();
19
19
  subscribers.set(key, set);
20
20
  }
21
21
  set.add(cb);
22
- }
23
- function removeSubscriber(key, cb) {
22
+ };
23
+ const removeSubscriber = (key, cb) => {
24
24
  const set = subscribers.get(key);
25
25
  if (!set) return;
26
26
  set.delete(cb);
27
27
  if (set.size === 0) subscribers.delete(key);
28
- }
28
+ };
29
29
  /** The one global window listener */
30
- function ensureGlobalListener(allowedOrigins, selfId) {
30
+ const ensureGlobalListener = (allowedOrigins, selfId) => {
31
31
  if (windowListenerAttached) return;
32
32
  window.addEventListener("message", (event) => {
33
33
  const { type, data, senderId } = event.data ?? {};
34
34
  if (!type) return;
35
35
  if (senderId === selfId) return;
36
- if (!allowedOrigins || allowedOrigins.includes("*") || allowedOrigins.some((o) => (0, __intlayer_editor.compareUrls)(o, event.origin))) subscribers.get(type)?.forEach((cb) => cb(data));
36
+ if (!allowedOrigins || allowedOrigins.includes("*") || allowedOrigins.some((o) => (0, __intlayer_editor.compareUrls)(o, event.origin))) subscribers.get(type)?.forEach((cb) => {
37
+ cb(data);
38
+ });
37
39
  });
38
40
  windowListenerAttached = true;
39
- }
41
+ };
40
42
  /**
41
43
  * useCrossFrameMessageListener
42
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameMessageListener.cjs","names":["useCommunicator","DestroyRef"],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":["'use client';\n\nimport { DestroyRef, inject } from '@angular/core';\nimport { compareUrls, type MessageKey } from '@intlayer/editor';\nimport { useCommunicator } from './communicator';\n\n// ---------- module-level singletons ----------\ntype AnyFn = (data: unknown) => void;\n\n/** Map<key, Set<callback>> */\nconst subscribers = new Map<string, Set<AnyFn>>();\n\n/** True once we've attached the single window listener */\nlet windowListenerAttached = false;\n\n/** Helper to add/remove a callback for a key */\nfunction addSubscriber(key: string, cb: AnyFn) {\n let set = subscribers.get(key);\n if (!set) {\n set = new Set();\n subscribers.set(key, set);\n }\n set.add(cb);\n}\n\nfunction removeSubscriber(key: string, cb: AnyFn) {\n const set = subscribers.get(key);\n if (!set) return;\n set.delete(cb);\n if (set.size === 0) subscribers.delete(key);\n}\n\n/** The one global window listener */\nfunction ensureGlobalListener(\n allowedOrigins: string[] | undefined,\n selfId: string\n) {\n if (windowListenerAttached) return;\n window.addEventListener('message', (event) => {\n const { type, data, senderId } = event.data ?? {};\n if (!type) return; // guard malformed messages\n if (senderId === selfId) return; // ignore my own\n\n // origin check\n if (\n !allowedOrigins ||\n allowedOrigins.includes('*') ||\n allowedOrigins.some((o) => compareUrls(o, event.origin))\n ) {\n // broadcast to everyone interested in this key\n subscribers.get(type)?.forEach((cb) => cb(data));\n }\n });\n windowListenerAttached = true;\n}\n// ---------- end module-level code ----------\n\n/**\n * useCrossFrameMessageListener\n *\n * @template S - type of the message payload\n * @param key message type we care about\n * @param onEventTriggered optional callback when a matching message arrives\n * @returns postMessage(data?) helper scoped to this key\n */\nexport const useCrossFrameMessageListener = <S>(\n key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`,\n onEventTriggered?: (data: S) => void\n) => {\n // Communicator is the same for everyone, so it's fine to call every time.\n const { allowedOrigins, postMessage, senderId } = useCommunicator();\n\n // --- 1. make sure the global listener exists ----\n ensureGlobalListener(allowedOrigins, senderId);\n\n // --- 2. register this caller's callback (if any) ---\n if (onEventTriggered) {\n addSubscriber(key, onEventTriggered as AnyFn);\n\n // Use Angular's DestroyRef for cleanup instead of Vue's onScopeDispose\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n if (destroyRef) {\n destroyRef.onDestroy(() =>\n removeSubscriber(key, onEventTriggered as AnyFn)\n );\n }\n } catch {\n // If called outside injection context, no cleanup available\n console.warn(\n 'useCrossFrameMessageListener called outside injection context; ' +\n 'cleanup may not be available.'\n );\n }\n }\n\n // --- 3. return a wrapper that tags outgoing messages with our key ---\n const postMessageWrapper = (data?: S) => {\n postMessage({ type: key, data, senderId });\n };\n\n return postMessageWrapper;\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAM,8BAAc,IAAI,KAAyB;;AAGjD,IAAI,yBAAyB;;AAG7B,SAAS,cAAc,KAAa,IAAW;CAC7C,IAAI,MAAM,YAAY,IAAI,IAAI;AAC9B,KAAI,CAAC,KAAK;AACR,wBAAM,IAAI,KAAK;AACf,cAAY,IAAI,KAAK,IAAI;;AAE3B,KAAI,IAAI,GAAG;;AAGb,SAAS,iBAAiB,KAAa,IAAW;CAChD,MAAM,MAAM,YAAY,IAAI,IAAI;AAChC,KAAI,CAAC,IAAK;AACV,KAAI,OAAO,GAAG;AACd,KAAI,IAAI,SAAS,EAAG,aAAY,OAAO,IAAI;;;AAI7C,SAAS,qBACP,gBACA,QACA;AACA,KAAI,uBAAwB;AAC5B,QAAO,iBAAiB,YAAY,UAAU;EAC5C,MAAM,EAAE,MAAM,MAAM,aAAa,MAAM,QAAQ,EAAE;AACjD,MAAI,CAAC,KAAM;AACX,MAAI,aAAa,OAAQ;AAGzB,MACE,CAAC,kBACD,eAAe,SAAS,IAAI,IAC5B,eAAe,MAAM,yCAAkB,GAAG,MAAM,OAAO,CAAC,CAGxD,aAAY,IAAI,KAAK,EAAE,SAAS,OAAO,GAAG,KAAK,CAAC;GAElD;AACF,0BAAyB;;;;;;;;;;AAY3B,MAAa,gCACX,KACA,qBACG;CAEH,MAAM,EAAE,gBAAgB,aAAa,aAAaA,6CAAiB;AAGnE,sBAAqB,gBAAgB,SAAS;AAG9C,KAAI,kBAAkB;AACpB,gBAAc,KAAK,iBAA0B;AAG7C,MAAI;GACF,MAAM,wCAAoBC,2BAAY,EAAE,UAAU,MAAM,CAAC;AACzD,OAAI,WACF,YAAW,gBACT,iBAAiB,KAAK,iBAA0B,CACjD;UAEG;AAEN,WAAQ,KACN,+FAED;;;CAKL,MAAM,sBAAsB,SAAa;AACvC,cAAY;GAAE,MAAM;GAAK;GAAM;GAAU,CAAC;;AAG5C,QAAO"}
1
+ {"version":3,"file":"useCrossFrameMessageListener.cjs","names":["useCommunicator","DestroyRef"],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":["'use client';\n\nimport { DestroyRef, inject } from '@angular/core';\nimport { compareUrls, type MessageKey } from '@intlayer/editor';\nimport { useCommunicator } from './communicator';\n\n// ---------- module-level singletons ----------\ntype AnyFn = (data: unknown) => void;\n\n/** Map<key, Set<callback>> */\nconst subscribers = new Map<string, Set<AnyFn>>();\n\n/** True once we've attached the single window listener */\nlet windowListenerAttached = false;\n\n/** Helper to add/remove a callback for a key */\nconst addSubscriber = (key: string, cb: AnyFn) => {\n let set = subscribers.get(key);\n if (!set) {\n set = new Set();\n subscribers.set(key, set);\n }\n set.add(cb);\n};\n\nconst removeSubscriber = (key: string, cb: AnyFn) => {\n const set = subscribers.get(key);\n if (!set) return;\n set.delete(cb);\n if (set.size === 0) subscribers.delete(key);\n};\n\n/** The one global window listener */\nconst ensureGlobalListener = (\n allowedOrigins: string[] | undefined,\n selfId: string\n) => {\n if (windowListenerAttached) return;\n window.addEventListener('message', (event) => {\n const { type, data, senderId } = event.data ?? {};\n if (!type) return; // guard malformed messages\n if (senderId === selfId) return; // ignore my own\n\n // origin check\n if (\n !allowedOrigins ||\n allowedOrigins.includes('*') ||\n allowedOrigins.some((o) => compareUrls(o, event.origin))\n ) {\n // broadcast to everyone interested in this key\n subscribers.get(type)?.forEach((cb) => {\n cb(data);\n });\n }\n });\n windowListenerAttached = true;\n};\n// ---------- end module-level code ----------\n\n/**\n * useCrossFrameMessageListener\n *\n * @template S - type of the message payload\n * @param key message type we care about\n * @param onEventTriggered optional callback when a matching message arrives\n * @returns postMessage(data?) helper scoped to this key\n */\nexport const useCrossFrameMessageListener = <S>(\n key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`,\n onEventTriggered?: (data: S) => void\n) => {\n // Communicator is the same for everyone, so it's fine to call every time.\n const { allowedOrigins, postMessage, senderId } = useCommunicator();\n\n // --- 1. make sure the global listener exists ----\n ensureGlobalListener(allowedOrigins, senderId);\n\n // --- 2. register this caller's callback (if any) ---\n if (onEventTriggered) {\n addSubscriber(key, onEventTriggered as AnyFn);\n\n // Use Angular's DestroyRef for cleanup instead of Vue's onScopeDispose\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n if (destroyRef) {\n destroyRef.onDestroy(() =>\n removeSubscriber(key, onEventTriggered as AnyFn)\n );\n }\n } catch {\n // If called outside injection context, no cleanup available\n console.warn(\n 'useCrossFrameMessageListener called outside injection context; ' +\n 'cleanup may not be available.'\n );\n }\n }\n\n // --- 3. return a wrapper that tags outgoing messages with our key ---\n const postMessageWrapper = (data?: S) => {\n postMessage({ type: key, data, senderId });\n };\n\n return postMessageWrapper;\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAM,8BAAc,IAAI,KAAyB;;AAGjD,IAAI,yBAAyB;;AAG7B,MAAM,iBAAiB,KAAa,OAAc;CAChD,IAAI,MAAM,YAAY,IAAI,IAAI;AAC9B,KAAI,CAAC,KAAK;AACR,wBAAM,IAAI,KAAK;AACf,cAAY,IAAI,KAAK,IAAI;;AAE3B,KAAI,IAAI,GAAG;;AAGb,MAAM,oBAAoB,KAAa,OAAc;CACnD,MAAM,MAAM,YAAY,IAAI,IAAI;AAChC,KAAI,CAAC,IAAK;AACV,KAAI,OAAO,GAAG;AACd,KAAI,IAAI,SAAS,EAAG,aAAY,OAAO,IAAI;;;AAI7C,MAAM,wBACJ,gBACA,WACG;AACH,KAAI,uBAAwB;AAC5B,QAAO,iBAAiB,YAAY,UAAU;EAC5C,MAAM,EAAE,MAAM,MAAM,aAAa,MAAM,QAAQ,EAAE;AACjD,MAAI,CAAC,KAAM;AACX,MAAI,aAAa,OAAQ;AAGzB,MACE,CAAC,kBACD,eAAe,SAAS,IAAI,IAC5B,eAAe,MAAM,yCAAkB,GAAG,MAAM,OAAO,CAAC,CAGxD,aAAY,IAAI,KAAK,EAAE,SAAS,OAAO;AACrC,MAAG,KAAK;IACR;GAEJ;AACF,0BAAyB;;;;;;;;;;AAY3B,MAAa,gCACX,KACA,qBACG;CAEH,MAAM,EAAE,gBAAgB,aAAa,aAAaA,6CAAiB;AAGnE,sBAAqB,gBAAgB,SAAS;AAG9C,KAAI,kBAAkB;AACpB,gBAAc,KAAK,iBAA0B;AAG7C,MAAI;GACF,MAAM,wCAAoBC,2BAAY,EAAE,UAAU,MAAM,CAAC;AACzD,OAAI,WACF,YAAW,gBACT,iBAAiB,KAAK,iBAA0B,CACjD;UAEG;AAEN,WAAQ,KACN,+FAED;;;CAKL,MAAM,sBAAsB,SAAa;AACvC,cAAY;GAAE,MAAM;GAAK;GAAM;GAAU,CAAC;;AAG5C,QAAO"}
@@ -11,31 +11,33 @@ const subscribers = /* @__PURE__ */ new Map();
11
11
  /** True once we've attached the single window listener */
12
12
  let windowListenerAttached = false;
13
13
  /** Helper to add/remove a callback for a key */
14
- function addSubscriber(key, cb) {
14
+ const addSubscriber = (key, cb) => {
15
15
  let set = subscribers.get(key);
16
16
  if (!set) {
17
17
  set = /* @__PURE__ */ new Set();
18
18
  subscribers.set(key, set);
19
19
  }
20
20
  set.add(cb);
21
- }
22
- function removeSubscriber(key, cb) {
21
+ };
22
+ const removeSubscriber = (key, cb) => {
23
23
  const set = subscribers.get(key);
24
24
  if (!set) return;
25
25
  set.delete(cb);
26
26
  if (set.size === 0) subscribers.delete(key);
27
- }
27
+ };
28
28
  /** The one global window listener */
29
- function ensureGlobalListener(allowedOrigins, selfId) {
29
+ const ensureGlobalListener = (allowedOrigins, selfId) => {
30
30
  if (windowListenerAttached) return;
31
31
  window.addEventListener("message", (event) => {
32
32
  const { type, data, senderId } = event.data ?? {};
33
33
  if (!type) return;
34
34
  if (senderId === selfId) return;
35
- if (!allowedOrigins || allowedOrigins.includes("*") || allowedOrigins.some((o) => compareUrls(o, event.origin))) subscribers.get(type)?.forEach((cb) => cb(data));
35
+ if (!allowedOrigins || allowedOrigins.includes("*") || allowedOrigins.some((o) => compareUrls(o, event.origin))) subscribers.get(type)?.forEach((cb) => {
36
+ cb(data);
37
+ });
36
38
  });
37
39
  windowListenerAttached = true;
38
- }
40
+ };
39
41
  /**
40
42
  * useCrossFrameMessageListener
41
43
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameMessageListener.mjs","names":[],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":["'use client';\n\nimport { DestroyRef, inject } from '@angular/core';\nimport { compareUrls, type MessageKey } from '@intlayer/editor';\nimport { useCommunicator } from './communicator';\n\n// ---------- module-level singletons ----------\ntype AnyFn = (data: unknown) => void;\n\n/** Map<key, Set<callback>> */\nconst subscribers = new Map<string, Set<AnyFn>>();\n\n/** True once we've attached the single window listener */\nlet windowListenerAttached = false;\n\n/** Helper to add/remove a callback for a key */\nfunction addSubscriber(key: string, cb: AnyFn) {\n let set = subscribers.get(key);\n if (!set) {\n set = new Set();\n subscribers.set(key, set);\n }\n set.add(cb);\n}\n\nfunction removeSubscriber(key: string, cb: AnyFn) {\n const set = subscribers.get(key);\n if (!set) return;\n set.delete(cb);\n if (set.size === 0) subscribers.delete(key);\n}\n\n/** The one global window listener */\nfunction ensureGlobalListener(\n allowedOrigins: string[] | undefined,\n selfId: string\n) {\n if (windowListenerAttached) return;\n window.addEventListener('message', (event) => {\n const { type, data, senderId } = event.data ?? {};\n if (!type) return; // guard malformed messages\n if (senderId === selfId) return; // ignore my own\n\n // origin check\n if (\n !allowedOrigins ||\n allowedOrigins.includes('*') ||\n allowedOrigins.some((o) => compareUrls(o, event.origin))\n ) {\n // broadcast to everyone interested in this key\n subscribers.get(type)?.forEach((cb) => cb(data));\n }\n });\n windowListenerAttached = true;\n}\n// ---------- end module-level code ----------\n\n/**\n * useCrossFrameMessageListener\n *\n * @template S - type of the message payload\n * @param key message type we care about\n * @param onEventTriggered optional callback when a matching message arrives\n * @returns postMessage(data?) helper scoped to this key\n */\nexport const useCrossFrameMessageListener = <S>(\n key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`,\n onEventTriggered?: (data: S) => void\n) => {\n // Communicator is the same for everyone, so it's fine to call every time.\n const { allowedOrigins, postMessage, senderId } = useCommunicator();\n\n // --- 1. make sure the global listener exists ----\n ensureGlobalListener(allowedOrigins, senderId);\n\n // --- 2. register this caller's callback (if any) ---\n if (onEventTriggered) {\n addSubscriber(key, onEventTriggered as AnyFn);\n\n // Use Angular's DestroyRef for cleanup instead of Vue's onScopeDispose\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n if (destroyRef) {\n destroyRef.onDestroy(() =>\n removeSubscriber(key, onEventTriggered as AnyFn)\n );\n }\n } catch {\n // If called outside injection context, no cleanup available\n console.warn(\n 'useCrossFrameMessageListener called outside injection context; ' +\n 'cleanup may not be available.'\n );\n }\n }\n\n // --- 3. return a wrapper that tags outgoing messages with our key ---\n const postMessageWrapper = (data?: S) => {\n postMessage({ type: key, data, senderId });\n };\n\n return postMessageWrapper;\n};\n"],"mappings":";;;;;;;;;AAUA,MAAM,8BAAc,IAAI,KAAyB;;AAGjD,IAAI,yBAAyB;;AAG7B,SAAS,cAAc,KAAa,IAAW;CAC7C,IAAI,MAAM,YAAY,IAAI,IAAI;AAC9B,KAAI,CAAC,KAAK;AACR,wBAAM,IAAI,KAAK;AACf,cAAY,IAAI,KAAK,IAAI;;AAE3B,KAAI,IAAI,GAAG;;AAGb,SAAS,iBAAiB,KAAa,IAAW;CAChD,MAAM,MAAM,YAAY,IAAI,IAAI;AAChC,KAAI,CAAC,IAAK;AACV,KAAI,OAAO,GAAG;AACd,KAAI,IAAI,SAAS,EAAG,aAAY,OAAO,IAAI;;;AAI7C,SAAS,qBACP,gBACA,QACA;AACA,KAAI,uBAAwB;AAC5B,QAAO,iBAAiB,YAAY,UAAU;EAC5C,MAAM,EAAE,MAAM,MAAM,aAAa,MAAM,QAAQ,EAAE;AACjD,MAAI,CAAC,KAAM;AACX,MAAI,aAAa,OAAQ;AAGzB,MACE,CAAC,kBACD,eAAe,SAAS,IAAI,IAC5B,eAAe,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,CAGxD,aAAY,IAAI,KAAK,EAAE,SAAS,OAAO,GAAG,KAAK,CAAC;GAElD;AACF,0BAAyB;;;;;;;;;;AAY3B,MAAa,gCACX,KACA,qBACG;CAEH,MAAM,EAAE,gBAAgB,aAAa,aAAa,iBAAiB;AAGnE,sBAAqB,gBAAgB,SAAS;AAG9C,KAAI,kBAAkB;AACpB,gBAAc,KAAK,iBAA0B;AAG7C,MAAI;GACF,MAAM,aAAa,OAAO,YAAY,EAAE,UAAU,MAAM,CAAC;AACzD,OAAI,WACF,YAAW,gBACT,iBAAiB,KAAK,iBAA0B,CACjD;UAEG;AAEN,WAAQ,KACN,+FAED;;;CAKL,MAAM,sBAAsB,SAAa;AACvC,cAAY;GAAE,MAAM;GAAK;GAAM;GAAU,CAAC;;AAG5C,QAAO"}
1
+ {"version":3,"file":"useCrossFrameMessageListener.mjs","names":[],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":["'use client';\n\nimport { DestroyRef, inject } from '@angular/core';\nimport { compareUrls, type MessageKey } from '@intlayer/editor';\nimport { useCommunicator } from './communicator';\n\n// ---------- module-level singletons ----------\ntype AnyFn = (data: unknown) => void;\n\n/** Map<key, Set<callback>> */\nconst subscribers = new Map<string, Set<AnyFn>>();\n\n/** True once we've attached the single window listener */\nlet windowListenerAttached = false;\n\n/** Helper to add/remove a callback for a key */\nconst addSubscriber = (key: string, cb: AnyFn) => {\n let set = subscribers.get(key);\n if (!set) {\n set = new Set();\n subscribers.set(key, set);\n }\n set.add(cb);\n};\n\nconst removeSubscriber = (key: string, cb: AnyFn) => {\n const set = subscribers.get(key);\n if (!set) return;\n set.delete(cb);\n if (set.size === 0) subscribers.delete(key);\n};\n\n/** The one global window listener */\nconst ensureGlobalListener = (\n allowedOrigins: string[] | undefined,\n selfId: string\n) => {\n if (windowListenerAttached) return;\n window.addEventListener('message', (event) => {\n const { type, data, senderId } = event.data ?? {};\n if (!type) return; // guard malformed messages\n if (senderId === selfId) return; // ignore my own\n\n // origin check\n if (\n !allowedOrigins ||\n allowedOrigins.includes('*') ||\n allowedOrigins.some((o) => compareUrls(o, event.origin))\n ) {\n // broadcast to everyone interested in this key\n subscribers.get(type)?.forEach((cb) => {\n cb(data);\n });\n }\n });\n windowListenerAttached = true;\n};\n// ---------- end module-level code ----------\n\n/**\n * useCrossFrameMessageListener\n *\n * @template S - type of the message payload\n * @param key message type we care about\n * @param onEventTriggered optional callback when a matching message arrives\n * @returns postMessage(data?) helper scoped to this key\n */\nexport const useCrossFrameMessageListener = <S>(\n key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`,\n onEventTriggered?: (data: S) => void\n) => {\n // Communicator is the same for everyone, so it's fine to call every time.\n const { allowedOrigins, postMessage, senderId } = useCommunicator();\n\n // --- 1. make sure the global listener exists ----\n ensureGlobalListener(allowedOrigins, senderId);\n\n // --- 2. register this caller's callback (if any) ---\n if (onEventTriggered) {\n addSubscriber(key, onEventTriggered as AnyFn);\n\n // Use Angular's DestroyRef for cleanup instead of Vue's onScopeDispose\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n if (destroyRef) {\n destroyRef.onDestroy(() =>\n removeSubscriber(key, onEventTriggered as AnyFn)\n );\n }\n } catch {\n // If called outside injection context, no cleanup available\n console.warn(\n 'useCrossFrameMessageListener called outside injection context; ' +\n 'cleanup may not be available.'\n );\n }\n }\n\n // --- 3. return a wrapper that tags outgoing messages with our key ---\n const postMessageWrapper = (data?: S) => {\n postMessage({ type: key, data, senderId });\n };\n\n return postMessageWrapper;\n};\n"],"mappings":";;;;;;;;;AAUA,MAAM,8BAAc,IAAI,KAAyB;;AAGjD,IAAI,yBAAyB;;AAG7B,MAAM,iBAAiB,KAAa,OAAc;CAChD,IAAI,MAAM,YAAY,IAAI,IAAI;AAC9B,KAAI,CAAC,KAAK;AACR,wBAAM,IAAI,KAAK;AACf,cAAY,IAAI,KAAK,IAAI;;AAE3B,KAAI,IAAI,GAAG;;AAGb,MAAM,oBAAoB,KAAa,OAAc;CACnD,MAAM,MAAM,YAAY,IAAI,IAAI;AAChC,KAAI,CAAC,IAAK;AACV,KAAI,OAAO,GAAG;AACd,KAAI,IAAI,SAAS,EAAG,aAAY,OAAO,IAAI;;;AAI7C,MAAM,wBACJ,gBACA,WACG;AACH,KAAI,uBAAwB;AAC5B,QAAO,iBAAiB,YAAY,UAAU;EAC5C,MAAM,EAAE,MAAM,MAAM,aAAa,MAAM,QAAQ,EAAE;AACjD,MAAI,CAAC,KAAM;AACX,MAAI,aAAa,OAAQ;AAGzB,MACE,CAAC,kBACD,eAAe,SAAS,IAAI,IAC5B,eAAe,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,CAGxD,aAAY,IAAI,KAAK,EAAE,SAAS,OAAO;AACrC,MAAG,KAAK;IACR;GAEJ;AACF,0BAAyB;;;;;;;;;;AAY3B,MAAa,gCACX,KACA,qBACG;CAEH,MAAM,EAAE,gBAAgB,aAAa,aAAa,iBAAiB;AAGnE,sBAAqB,gBAAgB,SAAS;AAG9C,KAAI,kBAAkB;AACpB,gBAAc,KAAK,iBAA0B;AAG7C,MAAI;GACF,MAAM,aAAa,OAAO,YAAY,EAAE,UAAU,MAAM,CAAC;AACzD,OAAI,WACF,YAAW,gBACT,iBAAiB,KAAK,iBAA0B,CACjD;UAEG;AAEN,WAAQ,KACN,+FAED;;;CAKL,MAAM,sBAAsB,SAAa;AACvC,cAAY;GAAE,MAAM;GAAK;GAAM;GAAU,CAAC;;AAG5C,QAAO"}
@@ -1,11 +1,11 @@
1
- import * as _angular_core5 from "@angular/core";
1
+ import * as _angular_core1 from "@angular/core";
2
2
  import { InjectionToken, Signal } from "@angular/core";
3
3
  import { LocalesValues } from "@intlayer/types";
4
4
 
5
5
  //#region src/client/installIntlayer.d.ts
6
6
  declare const INTLAYER_TOKEN: InjectionToken<IntlayerProvider>;
7
7
  declare class IntlayerProvider {
8
- isCookieEnabled: _angular_core5.WritableSignal<boolean>;
8
+ isCookieEnabled: _angular_core1.WritableSignal<boolean>;
9
9
  private _locale;
10
10
  readonly locale: Signal<LocalesValues>;
11
11
  setLocale: (locale: LocalesValues) => void;
@@ -2,7 +2,7 @@ import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins
2
2
  import "../index.js";
3
3
  import * as _intlayer_types0 from "@intlayer/types";
4
4
  import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types";
5
- import * as _intlayer_core0 from "@intlayer/core";
5
+ import * as _intlayer_core1 from "@intlayer/core";
6
6
 
7
7
  //#region src/client/useDictionaryDynamic.d.ts
8
8
  /**
@@ -10,7 +10,7 @@ import * as _intlayer_core0 from "@intlayer/core";
10
10
  *
11
11
  * If the locale is not provided, it will use the locale from the client context
12
12
  */
13
- declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _intlayer_core0.DeepTransformContent<T["content"], IInterpreterPluginState$1, _intlayer_types0.Locale>;
13
+ declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _intlayer_core1.DeepTransformContent<T["content"], IInterpreterPluginState$1, _intlayer_types0.Locale>;
14
14
  //#endregion
15
15
  export { useDictionaryDynamic };
16
16
  //# sourceMappingURL=useDictionaryDynamic.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core0 from "@angular/core";
2
- import * as _intlayer_types0 from "@intlayer/types";
2
+ import * as _intlayer_types4 from "@intlayer/types";
3
3
  import { LocalesValues } from "@intlayer/types";
4
4
 
5
5
  //#region src/client/useLocale.d.ts
@@ -15,8 +15,8 @@ declare const useLocale: ({
15
15
  onLocaleChange
16
16
  }?: useLocaleProps) => {
17
17
  locale: _angular_core0.Signal<"af" | "af-ZA" | "ar" | "ar-AE" | "ar-BH" | "ar-DZ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MA" | "ar-OM" | "ar-QA" | "ar-SA" | "ar-SY" | "ar-TN" | "ar-YE" | "az" | "az-AZ" | "be" | "be-BY" | "bg" | "bg-BG" | "bs" | "bs-BA" | "ca" | "ca-ES" | "cs" | "cs-CZ" | "cy" | "cy-GB" | "da" | "da-DK" | "de" | "de-AT" | "de-CH" | "de-DE" | "de-LI" | "de-LU" | "dv" | "dv-MV" | "el" | "el-GR" | "en" | "en-AU" | "en-BZ" | "en-CA" | "en-CB" | "en-GB" | "en-IE" | "en-JM" | "en-NZ" | "en-PH" | "en-TT" | "en-US" | "en-ZA" | "en-ZW" | "eo" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-DO" | "es-EC" | "es-ES" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PE" | "es-PR" | "es-PY" | "es-SV" | "es-UY" | "es-VE" | "et" | "et-EE" | "eu" | "eu-ES" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fo" | "fo-FO" | "fr" | "fr-BE" | "fr-CA" | "fr-CH" | "fr-FR" | "fr-LU" | "fr-MC" | "gl" | "gl-ES" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hr" | "hr-BA" | "hr-HR" | "hu" | "hu-HU" | "hy" | "hy-AM" | "id" | "id-ID" | "is" | "is-IS" | "it" | "it-CH" | "it-IT" | "ja" | "ja-JP" | "ka" | "ka-GE" | "kk" | "kk-KZ" | "kn" | "kn-IN" | "ko" | "ko-KR" | "kok" | "kok-IN" | "ky" | "ky-KG" | "lt" | "lt-LT" | "lv" | "lv-LV" | "mi" | "mi-NZ" | "mk" | "mk-MK" | "mn" | "mn-MN" | "mr" | "mr-IN" | "ms" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "nb" | "nb-NO" | "nl" | "nl-BE" | "nl-NL" | "nn-NO" | "ns" | "ns-ZA" | "pa" | "pa-IN" | "pl" | "pl-PL" | "ps" | "ps-AR" | "pt" | "pt-BR" | "pt-PT" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-RO" | "ru" | "ru-RU" | "sa" | "sa-IN" | "se" | "se-FI" | "se-NO" | "se-SE" | "sk" | "sk-SK" | "sl" | "sl-SI" | "sq" | "sq-AL" | "sr" | "sr-BA" | "sr-SP" | "sv" | "sv-FI" | "sv-SE" | "sw" | "sw-KE" | "syr" | "syr-SY" | "ta" | "ta-IN" | "te" | "te-IN" | "th" | "th-TH" | "tl" | "tl-PH" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "tt" | "tt-RU" | "ts" | "uk" | "uk-UA" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "vi" | "vi-VN" | "xh" | "xh-ZA" | "zh" | "zh-Hans" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-SG" | "zh-Hant" | "zu" | "zu-ZA" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "my" | "my-MM" | "km" | "km-KH" | "lo" | "lo-LA" | "yo" | "yo-NG" | "am" | "am-ET" | "ne" | "ne-NP" | "si" | "si-LK" | "sr-Cyrl" | "sr-RS" | "en-IN" | "en-SG" | "en-HK" | "en-NG" | "en-PK" | "en-MY" | "en-BW" | "en-KE" | "en-TZ" | "en-GH" | "en-UG" | "es-CU" | "es-US" | "pt-GW" | "pt-MZ" | "pt-ST" | "pt-CV" | "pt-TL" | "pt-MO" | "zh-TW" | "ar-MR" | "ar-PS" | "ar-SD" | "ar-DJ" | "ar-SO" | "ar-TD" | "ar-KM" | (string & {})>;
18
- defaultLocale: _intlayer_types0.Locale;
19
- availableLocales: _intlayer_types0.Locale[];
18
+ defaultLocale: _intlayer_types4.Locale;
19
+ availableLocales: _intlayer_types4.Locale[];
20
20
  setLocale: (newLocale: LocalesValues) => void;
21
21
  };
22
22
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as _intlayer_types2 from "@intlayer/types";
1
+ import * as _intlayer_types0 from "@intlayer/types";
2
2
  import { LocalesValues } from "@intlayer/types";
3
3
 
4
4
  //#region src/client/useLocaleStorage.d.ts
@@ -9,13 +9,13 @@ import { LocalesValues } from "@intlayer/types";
9
9
  /**
10
10
  * Get the locale cookie
11
11
  */
12
- declare const localeInStorage: _intlayer_types2.Locale;
12
+ declare const localeInStorage: _intlayer_types0.Locale;
13
13
  /**
14
14
  * @deprecated Use localeInStorage instead
15
15
  *
16
16
  * Get the locale cookie
17
17
  */
18
- declare const localeCookie: _intlayer_types2.Locale;
18
+ declare const localeCookie: _intlayer_types0.Locale;
19
19
  /**
20
20
  * Set the locale cookie
21
21
  */
@@ -30,7 +30,7 @@ declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean)
30
30
  * Hook that provides the locale storage and a function to set it
31
31
  */
32
32
  declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
33
- getLocale: () => _intlayer_types2.Locale;
33
+ getLocale: () => _intlayer_types0.Locale;
34
34
  setLocale: (locale: LocalesValues) => void;
35
35
  };
36
36
  /**
@@ -41,7 +41,7 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
41
41
  * Hook that provides the locale cookie and a function to set it
42
42
  */
43
43
  declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
44
- localeCookie: _intlayer_types2.Locale;
44
+ localeCookie: _intlayer_types0.Locale;
45
45
  setLocaleCookie: (locale: LocalesValues) => void;
46
46
  };
47
47
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as _angular_core3 from "@angular/core";
1
+ import * as _angular_core2 from "@angular/core";
2
2
  import { NodeProps } from "@intlayer/core";
3
3
 
4
4
  //#region src/editor/ContentSelectorWrapper.component.d.ts
@@ -16,8 +16,8 @@ declare class ContentSelectorWrapperComponent {
16
16
  private focusDictionary;
17
17
  private editorEnabled;
18
18
  constructor();
19
- isSelected: _angular_core3.Signal<boolean>;
20
- enabled: _angular_core3.Signal<boolean>;
19
+ isSelected: _angular_core2.Signal<boolean>;
20
+ enabled: _angular_core2.Signal<boolean>;
21
21
  handleSelect(): void;
22
22
  }
23
23
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameMessageListener.d.ts","names":[],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":[],"mappings":";;;;;;AAiEA;;;;;;AAgCsC,cAhCzB,4BAgCyB,EAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,GA/B5B,UA+B4B,EAAA,GAAA,GA/BV,UA+BU,OAAA,GAAA,GA/Ba,UA+Bb,MAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,IAAA,EA9BV,CA8BU,EAAA,GAAA,IAAA,EAAA,GAAA,CAAA,IAAA,CAAA,EAAD,CAAC,EAAA,GAAA,IAAA"}
1
+ {"version":3,"file":"useCrossFrameMessageListener.d.ts","names":[],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":[],"mappings":";;;;;;AAmEA;;;;;;AAgCsC,cAhCzB,4BAgCyB,EAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAA,GA/B5B,UA+B4B,EAAA,GAAA,GA/BV,UA+BU,OAAA,GAAA,GA/Ba,UA+Bb,MAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,IAAA,EA9BV,CA8BU,EAAA,GAAA,IAAA,EAAA,GAAA,CAAA,IAAA,CAAA,EAAD,CAAC,EAAA,GAAA,IAAA"}
@@ -1,5 +1,5 @@
1
1
  import { useCrossFrameState } from "./useCrossFrameState.js";
2
- import * as _angular_core1 from "@angular/core";
2
+ import * as _angular_core4 from "@angular/core";
3
3
 
4
4
  //#region src/editor/useCrossURLPathState.d.ts
5
5
 
@@ -9,14 +9,14 @@ import * as _angular_core1 from "@angular/core";
9
9
  * @param opts - Options for controlling emit and receive behavior
10
10
  * @returns A tuple containing [state signal, setState function, forceSync function]
11
11
  */
12
- declare const useCrossURLPathState: (initial?: string, opts?: Parameters<typeof useCrossFrameState>[2]) => [_angular_core1.Signal<string>, (v: string | ((prev: string) => string)) => void, () => void];
12
+ declare const useCrossURLPathState: (initial?: string, opts?: Parameters<typeof useCrossFrameState>[2]) => [_angular_core4.Signal<string>, (v: string | ((prev: string) => string)) => void, () => void];
13
13
  /**
14
14
  * Hook for host applications to push URL path changes into the shared state
15
15
  * This also monkey patches history methods to capture navigation events
16
16
  * @param initial - The initial URL path
17
17
  * @returns A tuple containing [state signal, setState function]
18
18
  */
19
- declare const useCrossURLPathSetter: (initial?: string) => readonly [_angular_core1.Signal<string>, (v: string | ((prev: string) => string)) => void];
19
+ declare const useCrossURLPathSetter: (initial?: string) => readonly [_angular_core4.Signal<string>, (v: string | ((prev: string) => string)) => void];
20
20
  //#endregion
21
21
  export { useCrossURLPathSetter, useCrossURLPathState };
22
22
  //# sourceMappingURL=useCrossURLPathState.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-intlayer",
3
- "version": "7.1.8-canary.0",
3
+ "version": "7.1.8",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -84,13 +84,13 @@
84
84
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
85
85
  },
86
86
  "dependencies": {
87
- "@intlayer/chokidar": "7.1.8-canary.0",
88
- "@intlayer/config": "7.1.8-canary.0",
89
- "@intlayer/core": "7.1.8-canary.0",
90
- "@intlayer/dictionaries-entry": "7.1.8-canary.0",
91
- "@intlayer/editor": "7.1.8-canary.0",
92
- "@intlayer/types": "7.1.8-canary.0",
93
- "@intlayer/webpack": "7.1.8-canary.0",
87
+ "@intlayer/chokidar": "7.1.8",
88
+ "@intlayer/config": "7.1.8",
89
+ "@intlayer/core": "7.1.8",
90
+ "@intlayer/dictionaries-entry": "7.1.8",
91
+ "@intlayer/editor": "7.1.8",
92
+ "@intlayer/types": "7.1.8",
93
+ "@intlayer/webpack": "7.1.8",
94
94
  "deepmerge": "4.3.1"
95
95
  },
96
96
  "devDependencies": {