angular-intlayer 8.3.2 → 8.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +14 -9
  2. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +1 -1
  3. package/dist/cjs/editor/EditedContentRenderer.component.cjs +1 -1
  4. package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +1 -1
  5. package/dist/cjs/editor/communicator.cjs +1 -1
  6. package/dist/cjs/editor/communicator.cjs.map +1 -1
  7. package/dist/cjs/editor/configuration.cjs +1 -1
  8. package/dist/cjs/editor/configuration.cjs.map +1 -1
  9. package/dist/cjs/editor/dictionariesRecord.cjs +1 -1
  10. package/dist/cjs/editor/dictionariesRecord.cjs.map +1 -1
  11. package/dist/cjs/editor/editedContent.cjs +1 -1
  12. package/dist/cjs/editor/editedContent.cjs.map +1 -1
  13. package/dist/cjs/editor/editorEnabled.cjs +1 -1
  14. package/dist/cjs/editor/editorEnabled.cjs.map +1 -1
  15. package/dist/cjs/editor/editorLocale.cjs +1 -1
  16. package/dist/cjs/editor/editorLocale.cjs.map +1 -1
  17. package/dist/cjs/editor/focusDictionary.cjs +1 -1
  18. package/dist/cjs/editor/focusDictionary.cjs.map +1 -1
  19. package/dist/cjs/editor/index.cjs +1 -1
  20. package/dist/cjs/editor/installIntlayerEditor.cjs +1 -1
  21. package/dist/cjs/editor/installIntlayerEditor.cjs.map +1 -1
  22. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
  23. package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -1
  24. package/dist/cjs/editor/useCrossFrameState.cjs +1 -1
  25. package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -1
  26. package/dist/cjs/editor/useCrossURLPathState.cjs +1 -1
  27. package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -1
  28. package/dist/cjs/editor/useEditor.cjs +1 -1
  29. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  30. package/dist/cjs/editor/useIframeClickInterceptor.cjs +1 -1
  31. package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -1
  32. package/dist/esm/editor/ContentSelectorWrapper.component.mjs +14 -9
  33. package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +1 -1
  34. package/dist/esm/editor/EditedContentRenderer.component.mjs +1 -1
  35. package/dist/esm/editor/EditedContentRenderer.component.mjs.map +1 -1
  36. package/dist/esm/editor/communicator.mjs +1 -1
  37. package/dist/esm/editor/communicator.mjs.map +1 -1
  38. package/dist/esm/editor/configuration.mjs +1 -1
  39. package/dist/esm/editor/configuration.mjs.map +1 -1
  40. package/dist/esm/editor/dictionariesRecord.mjs +1 -1
  41. package/dist/esm/editor/dictionariesRecord.mjs.map +1 -1
  42. package/dist/esm/editor/editedContent.mjs +1 -1
  43. package/dist/esm/editor/editedContent.mjs.map +1 -1
  44. package/dist/esm/editor/editorEnabled.mjs +1 -1
  45. package/dist/esm/editor/editorEnabled.mjs.map +1 -1
  46. package/dist/esm/editor/editorLocale.mjs +1 -1
  47. package/dist/esm/editor/editorLocale.mjs.map +1 -1
  48. package/dist/esm/editor/focusDictionary.mjs +1 -1
  49. package/dist/esm/editor/focusDictionary.mjs.map +1 -1
  50. package/dist/esm/editor/index.mjs +1 -1
  51. package/dist/esm/editor/installIntlayerEditor.mjs +1 -1
  52. package/dist/esm/editor/installIntlayerEditor.mjs.map +1 -1
  53. package/dist/esm/editor/useCrossFrameMessageListener.mjs +1 -1
  54. package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -1
  55. package/dist/esm/editor/useCrossFrameState.mjs +1 -1
  56. package/dist/esm/editor/useCrossFrameState.mjs.map +1 -1
  57. package/dist/esm/editor/useCrossURLPathState.mjs +1 -1
  58. package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -1
  59. package/dist/esm/editor/useEditor.mjs +1 -1
  60. package/dist/esm/editor/useEditor.mjs.map +1 -1
  61. package/dist/esm/editor/useIframeClickInterceptor.mjs +1 -1
  62. package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -1
  63. package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
  64. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  65. package/dist/types/client/useLocale.d.ts +3 -3
  66. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  67. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  68. package/dist/types/editor/ContentSelectorWrapper.component.d.ts +9 -12
  69. package/dist/types/editor/ContentSelectorWrapper.component.d.ts.map +1 -1
  70. package/dist/types/editor/communicator.d.ts +3 -27
  71. package/dist/types/editor/communicator.d.ts.map +1 -1
  72. package/dist/types/editor/configuration.d.ts +4 -1
  73. package/dist/types/editor/configuration.d.ts.map +1 -1
  74. package/dist/types/editor/dictionariesRecord.d.ts +6 -12
  75. package/dist/types/editor/dictionariesRecord.d.ts.map +1 -1
  76. package/dist/types/editor/editedContent.d.ts +27 -16
  77. package/dist/types/editor/editedContent.d.ts.map +1 -1
  78. package/dist/types/editor/editorEnabled.d.ts +4 -15
  79. package/dist/types/editor/editorEnabled.d.ts.map +1 -1
  80. package/dist/types/editor/editorLocale.d.ts.map +1 -1
  81. package/dist/types/editor/focusDictionary.d.ts +6 -20
  82. package/dist/types/editor/focusDictionary.d.ts.map +1 -1
  83. package/dist/types/editor/index.d.ts +13 -2
  84. package/dist/types/editor/installIntlayerEditor.d.ts +4 -17
  85. package/dist/types/editor/installIntlayerEditor.d.ts.map +1 -1
  86. package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -8
  87. package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -1
  88. package/dist/types/editor/useCrossFrameState.d.ts +2 -16
  89. package/dist/types/editor/useCrossFrameState.d.ts.map +1 -1
  90. package/dist/types/editor/useCrossURLPathState.d.ts +2 -17
  91. package/dist/types/editor/useCrossURLPathState.d.ts.map +1 -1
  92. package/dist/types/editor/useEditor.d.ts.map +1 -1
  93. package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -8
  94. package/dist/types/editor/useIframeClickInterceptor.d.ts.map +1 -1
  95. package/dist/types/intlayer/dist/types/index.d.ts +3 -0
  96. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"EditedContentRenderer.component.mjs","names":[],"sources":["../../../src/editor/EditedContentRenderer.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input, signal } from '@angular/core';\nimport { getContent } from '@intlayer/core/interpreter';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { useEditedContentRenderer } from './useEditedContentRenderer';\n\nexport interface EditedContentRendererProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n locale?: Locale;\n}\n\n@Component({\n selector: 'app-edited-content-renderer',\n standalone: true,\n imports: [CommonModule],\n template: ` <span [innerHTML]=\"renderedContent()\"></span> `,\n})\nexport class EditedContentRendererComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: KeyPath[];\n @Input() locale?: Locale;\n\n private fallback = signal('');\n\n private rawContent = computed(() => {\n return useEditedContentRenderer(\n this.dictionaryKey,\n this.keyPath,\n this.fallback\n );\n });\n\n /**\n * Object → getContent → string, same as the React version.\n */\n renderedContent = computed(() => {\n const rawContentValue = this.rawContent();\n\n if (typeof rawContentValue === 'object' && rawContentValue !== null) {\n const transformed = getContent(\n rawContentValue as ContentNode,\n {\n dictionaryKey: this.dictionaryKey,\n keyPath: this.keyPath,\n },\n this.locale\n );\n\n if (typeof transformed !== 'string') {\n console.error(\n `Incorrect edited content format. Content type: ${typeof transformed}. Expected string. Value ${JSON.stringify(\n transformed\n )}`\n );\n return this.fallback();\n }\n return transformed;\n }\n\n return rawContentValue() as string;\n });\n}\n"],"mappings":"wcAoBO,IAAA,EAAA,KAAqC,CAC1C,cACA,QACA,OAEA,SAAmB,EAAO,GAAG,CAE7B,WAAqB,MACZ,EACL,KAAK,cACL,KAAK,QACL,KAAK,SACN,CACD,CAKF,gBAAkB,MAAe,CAC/B,IAAM,EAAkB,KAAK,YAAY,CAEzC,GAAI,OAAO,GAAoB,UAAY,EAA0B,CACnE,IAAM,EAAc,EAClB,EACA,CACE,cAAe,KAAK,cACpB,QAAS,KAAK,QACf,CACD,KAAK,OACN,CAUD,OARI,OAAO,GAAgB,SAQpB,GAPL,QAAQ,MACN,kDAAkD,OAAO,EAAY,2BAA2B,KAAK,UACnG,EACD,GACF,CACM,KAAK,UAAU,EAK1B,OAAO,GAAiB,EACxB,KA1CD,GAAO,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,gBAAA,IAAA,GAAA,IACP,GAAO,CAAA,EAAA,cAAA,MAAA,CAAA,CAAA,EAAA,UAAA,UAAA,IAAA,GAAA,IACP,GAAO,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,SAAA,IAAA,GAAA,MATT,EAAU,CACT,SAAU,8BACV,WAAY,GACZ,QAAS,CAAC,EAAa,CACvB,SAAU,kDACX,CAAC,CAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"EditedContentRenderer.component.mjs","names":[],"sources":["../../../src/editor/EditedContentRenderer.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input, signal } from '@angular/core';\nimport { getBasePlugins, getContent } from '@intlayer/core/interpreter';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { useEditedContentRenderer } from './useEditedContentRenderer';\n\nexport interface EditedContentRendererProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n locale?: Locale;\n}\n\n@Component({\n selector: 'app-edited-content-renderer',\n standalone: true,\n imports: [CommonModule],\n template: ` <span [innerHTML]=\"renderedContent()\"></span> `,\n})\nexport class EditedContentRendererComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: KeyPath[];\n @Input() locale?: Locale;\n\n private fallback = signal('');\n\n private rawContent = computed(() => {\n return useEditedContentRenderer(\n this.dictionaryKey,\n this.keyPath,\n this.fallback\n );\n });\n\n /**\n * Object → getContent → string, same as the React version.\n */\n renderedContent = computed(() => {\n const rawContentValue = this.rawContent();\n\n if (typeof rawContentValue === 'object' && rawContentValue !== null) {\n const transformed = getContent(\n rawContentValue as ContentNode,\n {\n dictionaryKey: this.dictionaryKey,\n keyPath: this.keyPath,\n locale: this.locale,\n },\n getBasePlugins(this.locale)\n );\n\n if (typeof transformed !== 'string') {\n console.error(\n `Incorrect edited content format. Content type: ${typeof transformed}. Expected string. Value ${JSON.stringify(\n transformed\n )}`\n );\n return this.fallback();\n }\n return transformed;\n }\n\n return rawContentValue() as string;\n });\n}\n"],"mappings":"4dAoBO,IAAA,EAAA,KAAqC,CAC1C,cACA,QACA,OAEA,SAAmB,EAAO,GAAG,CAE7B,WAAqB,MACZ,EACL,KAAK,cACL,KAAK,QACL,KAAK,SACN,CACD,CAKF,gBAAkB,MAAe,CAC/B,IAAM,EAAkB,KAAK,YAAY,CAEzC,GAAI,OAAO,GAAoB,UAAY,EAA0B,CACnE,IAAM,EAAc,EAClB,EACA,CACE,cAAe,KAAK,cACpB,QAAS,KAAK,QACd,OAAQ,KAAK,OACd,CACD,EAAe,KAAK,OAAO,CAC5B,CAUD,OARI,OAAO,GAAgB,SAQpB,GAPL,QAAQ,MACN,kDAAkD,OAAO,EAAY,2BAA2B,KAAK,UACnG,EACD,GACF,CACM,KAAK,UAAU,EAK1B,OAAO,GAAiB,EACxB,KA3CD,GAAO,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,gBAAA,IAAA,GAAA,IACP,GAAO,CAAA,EAAA,cAAA,MAAA,CAAA,CAAA,EAAA,UAAA,UAAA,IAAA,GAAA,IACP,GAAO,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,SAAA,IAAA,GAAA,MATT,EAAU,CACT,SAAU,8BACV,WAAY,GACZ,QAAS,CAAC,EAAa,CACvB,SAAU,kDACX,CAAC,CAAA,CAAA,EAAA"}
@@ -1,2 +1,2 @@
1
- import e from"@intlayer/config/built";const t=()=>Math.random().toString(36).slice(2),{editor:n}=e,r={postMessage:()=>null,allowedOrigins:[n?.applicationURL,n?.editorURL,n?.cmsURL],senderId:``};let i=null;const a=(e={postMessage:()=>null})=>i||(i={...r,...e,senderId:t()},i),o=(e,t={postMessage:()=>null})=>{a(t)},s=()=>{try{return a()||r}catch{return console.warn(`useCommunicator: Error accessing communicator. Returning default communicator.`),{postMessage:()=>null,senderId:``}}};export{a as createCommunicator,o as installCommunicator,s as useCommunicator};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";const t=()=>{let t=e();return t?{postMessage:e=>t.messenger.send(e.type,e.data),senderId:t.messenger.senderId}:null};export{t as useCommunicator};
2
2
  //# sourceMappingURL=communicator.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"communicator.mjs","names":[],"sources":["../../../src/editor/communicator.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\n\nconst randomUUID = () => Math.random().toString(36).slice(2);\n\n/**\n * Interface defining a cross-frame communicator\n */\nexport type Communicator = {\n postMessage: typeof window.postMessage;\n allowedOrigins?: string[];\n senderId: string;\n};\n\n/**\n * Configuration options for the communicator\n */\nexport type CommunicatorOptions = Omit<Communicator, 'senderId'>;\n\nconst { editor } = configuration;\n\n/**\n * Default values for the communicator\n */\nconst defaultValue: Communicator = {\n postMessage: () => null,\n allowedOrigins: [\n editor?.applicationURL,\n editor?.editorURL,\n editor?.cmsURL,\n ] as string[],\n senderId: '',\n};\n\n/**\n * Singleton instance\n */\nlet instance: Communicator | null = null;\n\nconst _INTLAYER_COMMUNICATOR_SYMBOL = Symbol('Communicator');\n\n/**\n * Creates a communicator client\n * @param options - Options for configuring the communicator\n */\nexport const createCommunicator = (\n options: CommunicatorOptions = { postMessage: () => null }\n) => {\n if (instance) return instance;\n\n instance = {\n ...defaultValue,\n ...options,\n senderId: randomUUID(),\n };\n\n return instance;\n};\n\n/**\n * Helper to install the Intlayer communicator into the injector\n */\nexport const installCommunicator = (\n _injector: Injector,\n options: CommunicatorOptions = { postMessage: () => null }\n) => {\n const _client = createCommunicator(options);\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createCommunicator\n};\n\n/**\n * Hook to access the communicator\n * @returns The communicator instance\n */\nexport const useCommunicator = (): Communicator => {\n try {\n const communicator = createCommunicator();\n return communicator || defaultValue;\n } catch (_error) {\n console.warn(\n 'useCommunicator: Error accessing communicator. Returning default communicator.'\n );\n return {\n postMessage: () => null,\n senderId: '',\n };\n }\n};\n"],"mappings":"sCAGA,MAAM,MAAmB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,CAgBtD,CAAE,UAAW,EAKb,EAA6B,CACjC,gBAAmB,KACnB,eAAgB,CACd,GAAQ,eACR,GAAQ,UACR,GAAQ,OACT,CACD,SAAU,GACX,CAKD,IAAI,EAAgC,KAQpC,MAAa,GACX,EAA+B,CAAE,gBAAmB,KAAM,GAEtD,IAEJ,EAAW,CACT,GAAG,EACH,GAAG,EACH,SAAU,GAAY,CACvB,CAEM,GAMI,GACX,EACA,EAA+B,CAAE,gBAAmB,KAAM,GACvD,CACa,EAAmB,EAAQ,EAUhC,MAAsC,CACjD,GAAI,CAEF,OADqB,GAAoB,EAClB,OACR,CAIf,OAHA,QAAQ,KACN,iFACD,CACM,CACL,gBAAmB,KACnB,SAAU,GACX"}
1
+ {"version":3,"file":"communicator.mjs","names":[],"sources":["../../../src/editor/communicator.ts"],"sourcesContent":["import { getEditorStateManager } from './installIntlayerEditor';\n\nexport const useCommunicator = () => {\n const manager = getEditorStateManager();\n if (!manager) return null;\n return {\n postMessage: (data: any) => manager.messenger.send(data.type, data.data),\n senderId: manager.messenger.senderId,\n };\n};\n"],"mappings":"oEAEA,MAAa,MAAwB,CACnC,IAAM,EAAU,GAAuB,CAEvC,OADK,EACE,CACL,YAAc,GAAc,EAAQ,UAAU,KAAK,EAAK,KAAM,EAAK,KAAK,CACxE,SAAU,EAAQ,UAAU,SAC7B,CAJoB"}
@@ -1,2 +1,2 @@
1
- import{useCrossFrameState as e}from"./useCrossFrameState.mjs";import t from"@intlayer/config/built";import{DestroyRef as n,inject as r}from"@angular/core";import{MessageKey as i}from"@intlayer/editor";const a=()=>{let[a,o]=e(i.INTLAYER_CONFIGURATION);try{r(n,{optional:!0})&&(a()||o(t))}catch{console.warn(`useConfiguration called outside injection context; configuration may not be synchronized.`)}};export{a as useConfiguration};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n,signal as r}from"@angular/core";const i=()=>{let i=e(),a=r(i?.configuration.value);if(i){let e=e=>a.set(e.detail);i.configuration.addEventListener(`change`,e);try{n(t,{optional:!0})?.onDestroy(()=>i.configuration.removeEventListener(`change`,e))}catch{}}return a.asReadonly()};export{i as useConfiguration};
2
2
  //# sourceMappingURL=configuration.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.mjs","names":[],"sources":["../../../src/editor/configuration.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport { MessageKey } from '@intlayer/editor';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport const useConfiguration = () => {\n const [pushedConfiguration, setConfiguration] =\n useCrossFrameState<IntlayerConfig>(MessageKey.INTLAYER_CONFIGURATION);\n\n // Use Angular's injection context instead of Vue's onMounted\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef) {\n // Execute immediately since Angular doesn't have the same lifecycle hooks\n if (!pushedConfiguration()) {\n setConfiguration(configuration);\n }\n }\n } catch {\n console.warn(\n 'useConfiguration called outside injection context; ' +\n 'configuration may not be synchronized.'\n );\n }\n};\n"],"mappings":"yMAMA,MAAa,MAAyB,CACpC,GAAM,CAAC,EAAqB,GAC1B,EAAmC,EAAW,uBAAuB,CAGvE,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,GAIlD,GAAqB,EACxB,EAAiB,EAAc,OAG7B,CACN,QAAQ,KACN,4FAED"}
1
+ {"version":3,"file":"configuration.mjs","names":[],"sources":["../../../src/editor/configuration.ts"],"sourcesContent":["import { DestroyRef, inject, signal } from '@angular/core';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport const useConfiguration = () => {\n const manager = getEditorStateManager();\n const config = signal<IntlayerConfig | undefined>(\n manager?.configuration.value\n );\n\n if (manager) {\n const handler = (e: Event) =>\n config.set((e as CustomEvent<IntlayerConfig>).detail);\n manager.configuration.addEventListener('change', handler);\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(() =>\n manager.configuration.removeEventListener('change', handler)\n );\n } catch {}\n }\n\n return config.asReadonly();\n};\n"],"mappings":"uIAIA,MAAa,MAAyB,CACpC,IAAM,EAAU,GAAuB,CACjC,EAAS,EACb,GAAS,cAAc,MACxB,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAO,IAAK,EAAkC,OAAO,CACvD,EAAQ,cAAc,iBAAiB,SAAU,EAAQ,CAEzD,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,cAAc,oBAAoB,SAAU,EAAQ,CAC7D,MACK,GAGV,OAAO,EAAO,YAAY"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameState as t}from"./useCrossFrameState.mjs";import{effect as n,signal as r}from"@angular/core";import{MessageKey as i}from"@intlayer/editor";let a=null;const o=()=>{if(a)return a;let e=r(void 0);return a={localeDictionaries:e.asReadonly(),setLocaleDictionaries:t=>{e.set(t??{})},setLocaleDictionary(t){let n=e();e.set({...n,[t.localId]:t})}},a},s=e=>{o()},c=e(()=>{let e=o();if(!e)throw Error(`DictionariesRecord state not found`);let[r,a]=t(i.INTLAYER_LOCALE_DICTIONARIES_CHANGED,void 0);n(()=>{a(e.localeDictionaries())})});export{o as createDictionaryRecordClient,s as installDictionariesRecord,c as useDictionariesRecord};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n,signal as r}from"@angular/core";const i=()=>{let i=e(),a=r(i?.localeDictionaries.value??{});if(i){let e=e=>a.set(e.detail??{});i.localeDictionaries.addEventListener(`change`,e);try{n(t,{optional:!0})?.onDestroy(()=>i.localeDictionaries.removeEventListener(`change`,e))}catch{}}return{localeDictionaries:a.asReadonly(),setLocaleDictionaries:e=>i?.localeDictionaries.set(e),setLocaleDictionary:e=>i?.setLocaleDictionary(e)}};export{i as useDictionariesRecord};
2
2
  //# sourceMappingURL=dictionariesRecord.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dictionariesRecord.mjs","names":[],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\n/**\n * Singleton instance\n */\nlet instance: DictionariesRecordClient | null = null;\n\nexport type DictionaryContent = Record<Dictionary['key'], Dictionary>;\n\ntype DictionariesRecordClient = {\n localeDictionaries: Signal<DictionaryContent>;\n setLocaleDictionaries: (newValue: DictionaryContent) => void;\n setLocaleDictionary: (dictionary: Dictionary) => void;\n};\n\nexport const createDictionaryRecordClient = () => {\n if (instance) return instance;\n\n const localeDictionariesSignal = signal<DictionaryContent | undefined>(\n undefined\n );\n\n instance = {\n localeDictionaries:\n localeDictionariesSignal.asReadonly() as Signal<DictionaryContent>,\n\n setLocaleDictionaries: (newValue) => {\n localeDictionariesSignal.set(newValue ?? {});\n },\n\n setLocaleDictionary(dictionary) {\n const current = localeDictionariesSignal();\n localeDictionariesSignal.set({\n ...current,\n [dictionary.localId!]: dictionary,\n });\n },\n };\n\n return instance;\n};\n\n/**\n * Helper to install the provider into the injector\n */\nexport const installDictionariesRecord = (_injector: Injector) => {\n const _client = createDictionaryRecordClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createDictionaryRecordClient\n};\n\nexport const useDictionariesRecord = createSharedComposable(() => {\n const client = createDictionaryRecordClient();\n\n if (!client) {\n throw new Error('DictionariesRecord state not found');\n }\n\n const [_dictionariesRecord, setDictionariesRecord] =\n useCrossFrameState<DictionaryContent>(\n MessageKey.INTLAYER_LOCALE_DICTIONARIES_CHANGED,\n undefined\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = client.localeDictionaries();\n setDictionariesRecord(newValue); // its undefined but shouldnt\n });\n});\n"],"mappings":"qOASA,IAAI,EAA4C,KAUhD,MAAa,MAAqC,CAChD,GAAI,EAAU,OAAO,EAErB,IAAM,EAA2B,EAC/B,IAAA,GACD,CAmBD,MAjBA,GAAW,CACT,mBACE,EAAyB,YAAY,CAEvC,sBAAwB,GAAa,CACnC,EAAyB,IAAI,GAAY,EAAE,CAAC,EAG9C,oBAAoB,EAAY,CAC9B,IAAM,EAAU,GAA0B,CAC1C,EAAyB,IAAI,CAC3B,GAAG,GACF,EAAW,SAAW,EACxB,CAAC,EAEL,CAEM,GAMI,EAA6B,GAAwB,CAChD,GAA8B,EAMnC,EAAwB,MAA6B,CAChE,IAAM,EAAS,GAA8B,CAE7C,GAAI,CAAC,EACH,MAAU,MAAM,qCAAqC,CAGvD,GAAM,CAAC,EAAqB,GAC1B,EACE,EAAW,qCACX,IAAA,GACD,CAGH,MAAa,CAEX,EADiB,EAAO,oBAAoB,CACb,EAC/B,EACF"}
1
+ {"version":3,"file":"dictionariesRecord.mjs","names":[],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":["import { DestroyRef, inject, signal } from '@angular/core';\nimport type { DictionaryContent } from '@intlayer/editor';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport type { DictionaryContent };\n\nexport const useDictionariesRecord = () => {\n const manager = getEditorStateManager();\n const localeDictionaries = signal<DictionaryContent>(\n manager?.localeDictionaries.value ?? {}\n );\n\n if (manager) {\n const handler = (e: Event) =>\n localeDictionaries.set(\n (e as CustomEvent<DictionaryContent>).detail ?? {}\n );\n manager.localeDictionaries.addEventListener('change', handler);\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(() =>\n manager.localeDictionaries.removeEventListener('change', handler)\n );\n } catch {}\n }\n\n return {\n localeDictionaries: localeDictionaries.asReadonly(),\n setLocaleDictionaries: (value: DictionaryContent) =>\n manager?.localeDictionaries.set(value),\n setLocaleDictionary: (dictionary: Dictionary) =>\n manager?.setLocaleDictionary(dictionary),\n };\n};\n"],"mappings":"uIAOA,MAAa,MAA8B,CACzC,IAAM,EAAU,GAAuB,CACjC,EAAqB,EACzB,GAAS,mBAAmB,OAAS,EAAE,CACxC,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAmB,IAChB,EAAqC,QAAU,EAAE,CACnD,CACH,EAAQ,mBAAmB,iBAAiB,SAAU,EAAQ,CAE9D,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,mBAAmB,oBAAoB,SAAU,EAAQ,CAClE,MACK,GAGV,MAAO,CACL,mBAAoB,EAAmB,YAAY,CACnD,sBAAwB,GACtB,GAAS,mBAAmB,IAAI,EAAM,CACxC,oBAAsB,GACpB,GAAS,oBAAoB,EAAW,CAC3C"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameState as t}from"./useCrossFrameState.mjs";import{effect as n,signal as r}from"@angular/core";import{MessageKey as i}from"@intlayer/editor";import{getContentNodeByKeyPath as a}from"@intlayer/core/dictionaryManipulator";let o=null;const s=()=>{if(o)return o;let e=r({});return o={editedContent:e.asReadonly(),getEditedContentValue:(t,n)=>{let r=e();if(!r)return;if(t.includes(`:local:`)||t.includes(`:remote:`))return a(r?.[t]?.content??{},n);let i=Object.keys(r).filter(e=>e.startsWith(`${t}:`));for(let e of i){let t=a(r?.[e]?.content??{},n);if(t)return t}},setEditedContent:t=>{e.set(t)}},o},c=e=>{s()},l=e(()=>{let e=s();if(!e)throw Error(`EditedContent state not found`);let[r,a]=t(i.INTLAYER_EDITED_CONTENT_CHANGED,{});return n(()=>{let t=r();e.setEditedContent(t??{})}),n(()=>{a(e.editedContent())}),e});export{s as createEditedContentClient,c as installEditedContent,l as useEditedContent};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n,signal as r}from"@angular/core";const i=()=>{let i=e(),a=r(i?.editedContent.value);if(i){let e=e=>a.set(e.detail);i.editedContent.addEventListener(`change`,e);try{n(t,{optional:!0})?.onDestroy(()=>i.editedContent.removeEventListener(`change`,e))}catch{}}return{editedContent:a.asReadonly(),setEditedContentState:e=>i?.editedContent.set(e),setEditedDictionary:e=>i?.setEditedDictionary(e),setEditedContent:(e,t)=>i?.setEditedContent(e,t),addEditedContent:(e,t,n,r)=>i?.addContent(e,t,n,r),renameEditedContent:(e,t,n)=>i?.renameContent(e,t,n),removeEditedContent:(e,t)=>i?.removeContent(e,t),restoreEditedContent:e=>i?.restoreContent(e),clearEditedDictionaryContent:e=>i?.clearContent(e),clearEditedContent:()=>i?.clearAllContent(),getEditedContentValue:(e,t)=>i?.getContentValue(e,t)}},a=()=>{let{editedContent:e,...t}=i();return t};export{i as useEditedContent,a as useEditedContentActions};
2
2
  //# sourceMappingURL=editedContent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"editedContent.mjs","names":[],"sources":["../../../src/editor/editedContent.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { getContentNodeByKeyPath } from '@intlayer/core/dictionaryManipulator';\nimport { MessageKey } from '@intlayer/editor';\nimport type { ContentNode, Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport type EditedContent = Record<Dictionary['key'], Dictionary>;\n\ntype EditedContentClient = {\n editedContent: Signal<EditedContent>;\n setEditedContent: (editedContent: EditedContent) => void;\n getEditedContentValue: (\n localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string,\n keyPath: KeyPath[]\n ) => ContentNode | undefined;\n};\n\n/**\n * Singleton instance\n */\nlet instance: EditedContentClient | null = null;\n\nconst _INTLAYER_EDITED_CONTENT_SYMBOL = Symbol('EditedContent');\n\n/**\n * Creates an edited content client\n */\nexport const createEditedContentClient = () => {\n if (instance) return instance;\n\n const editedContentSignal = signal<EditedContent>({});\n\n instance = {\n editedContent: editedContentSignal.asReadonly(),\n getEditedContentValue: (\n localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string,\n keyPath: KeyPath[]\n ): ContentNode | undefined => {\n const editedContent = editedContentSignal();\n\n if (!editedContent) return undefined;\n\n const isDictionaryId =\n localDictionaryIdOrKey.includes(':local:') ||\n localDictionaryIdOrKey.includes(':remote:');\n\n if (isDictionaryId) {\n const currentContent =\n editedContent?.[localDictionaryIdOrKey as LocalDictionaryId]\n ?.content ?? {};\n\n const contentNode = getContentNodeByKeyPath(currentContent, keyPath);\n\n return contentNode;\n }\n\n const filteredDictionariesLocalId = Object.keys(editedContent).filter(\n (key) => key.startsWith(`${localDictionaryIdOrKey}:`)\n );\n\n for (const localDictionaryId of filteredDictionariesLocalId) {\n const currentContent =\n editedContent?.[localDictionaryId as LocalDictionaryId]?.content ??\n {};\n const contentNode = getContentNodeByKeyPath(currentContent, keyPath);\n\n if (contentNode) return contentNode;\n }\n\n return undefined;\n },\n setEditedContent: (editedContent: EditedContent) => {\n editedContentSignal.set(editedContent);\n },\n };\n\n return instance;\n};\n\n/**\n * Helper to install the edited content into the injector\n */\nexport const installEditedContent = (_injector: Injector) => {\n const _client = createEditedContentClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createEditedContentClient\n};\n\nexport const useEditedContent = createSharedComposable(() => {\n const client = createEditedContentClient();\n\n if (!client) {\n throw new Error('EditedContent state not found');\n }\n\n const [edited, setEdited] = useCrossFrameState<EditedContent>(\n MessageKey.INTLAYER_EDITED_CONTENT_CHANGED,\n {}\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = edited();\n client.setEditedContent(newValue ?? {});\n });\n\n effect(() => {\n const newValue = client.editedContent();\n setEdited(newValue);\n });\n\n return client;\n});\n"],"mappings":"oTAsBA,IAAI,EAAuC,KAO3C,MAAa,MAAkC,CAC7C,GAAI,EAAU,OAAO,EAErB,IAAM,EAAsB,EAAsB,EAAE,CAAC,CA8CrD,MA5CA,GAAW,CACT,cAAe,EAAoB,YAAY,CAC/C,uBACE,EACA,IAC4B,CAC5B,IAAM,EAAgB,GAAqB,CAE3C,GAAI,CAAC,EAAe,OAMpB,GAHE,EAAuB,SAAS,UAAU,EAC1C,EAAuB,SAAS,WAAW,CAS3C,OAFoB,EAHlB,IAAgB,IACZ,SAAW,EAAE,CAEyC,EAAQ,CAKtE,IAAM,EAA8B,OAAO,KAAK,EAAc,CAAC,OAC5D,GAAQ,EAAI,WAAW,GAAG,EAAuB,GAAG,CACtD,CAED,IAAK,IAAM,KAAqB,EAA6B,CAI3D,IAAM,EAAc,EAFlB,IAAgB,IAAyC,SACzD,EAAE,CACwD,EAAQ,CAEpE,GAAI,EAAa,OAAO,IAK5B,iBAAmB,GAAiC,CAClD,EAAoB,IAAI,EAAc,EAEzC,CAEM,GAMI,EAAwB,GAAwB,CAC3C,GAA2B,EAMhC,EAAmB,MAA6B,CAC3D,IAAM,EAAS,GAA2B,CAE1C,GAAI,CAAC,EACH,MAAU,MAAM,gCAAgC,CAGlD,GAAM,CAAC,EAAQ,GAAa,EAC1B,EAAW,gCACX,EAAE,CACH,CAaD,OAVA,MAAa,CACX,IAAM,EAAW,GAAQ,CACzB,EAAO,iBAAiB,GAAY,EAAE,CAAC,EACvC,CAEF,MAAa,CAEX,EADiB,EAAO,eAAe,CACpB,EACnB,CAEK,GACP"}
1
+ {"version":3,"file":"editedContent.mjs","names":[],"sources":["../../../src/editor/editedContent.ts"],"sourcesContent":["import { DestroyRef, inject, signal } from '@angular/core';\nimport type { DictionaryContent } from '@intlayer/editor';\nimport type {\n ContentNode,\n Dictionary,\n LocalDictionaryId,\n} from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport const useEditedContent = () => {\n const manager = getEditorStateManager();\n const editedContent = signal<DictionaryContent | undefined>(\n manager?.editedContent.value\n );\n\n if (manager) {\n const handler = (e: Event) =>\n editedContent.set((e as CustomEvent<DictionaryContent>).detail);\n manager.editedContent.addEventListener('change', handler);\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(() =>\n manager.editedContent.removeEventListener('change', handler)\n );\n } catch {}\n }\n\n return {\n editedContent: editedContent.asReadonly(),\n setEditedContentState: (value: DictionaryContent) =>\n manager?.editedContent.set(value),\n setEditedDictionary: (dict: Dictionary) =>\n manager?.setEditedDictionary(dict),\n setEditedContent: (\n localId: LocalDictionaryId,\n value: Dictionary['content']\n ) => manager?.setEditedContent(localId, value),\n addEditedContent: (\n localId: LocalDictionaryId,\n value: ContentNode,\n keyPath?: KeyPath[],\n overwrite?: boolean\n ) => manager?.addContent(localId, value, keyPath, overwrite),\n renameEditedContent: (\n localId: LocalDictionaryId,\n newKey: KeyPath['key'],\n keyPath?: KeyPath[]\n ) => manager?.renameContent(localId, newKey, keyPath),\n removeEditedContent: (localId: LocalDictionaryId, keyPath: KeyPath[]) =>\n manager?.removeContent(localId, keyPath),\n restoreEditedContent: (localId: LocalDictionaryId) =>\n manager?.restoreContent(localId),\n clearEditedDictionaryContent: (localId: LocalDictionaryId) =>\n manager?.clearContent(localId),\n clearEditedContent: () => manager?.clearAllContent(),\n getEditedContentValue: (\n localIdOrKey: LocalDictionaryId | string,\n keyPath: KeyPath[]\n ): ContentNode | undefined =>\n manager?.getContentValue(localIdOrKey, keyPath),\n };\n};\n\nexport const useEditedContentActions = () => {\n const actions = useEditedContent();\n const { editedContent, ...rest } = actions;\n return rest;\n};\n"],"mappings":"uIAUA,MAAa,MAAyB,CACpC,IAAM,EAAU,GAAuB,CACjC,EAAgB,EACpB,GAAS,cAAc,MACxB,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAc,IAAK,EAAqC,OAAO,CACjE,EAAQ,cAAc,iBAAiB,SAAU,EAAQ,CAEzD,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,cAAc,oBAAoB,SAAU,EAAQ,CAC7D,MACK,GAGV,MAAO,CACL,cAAe,EAAc,YAAY,CACzC,sBAAwB,GACtB,GAAS,cAAc,IAAI,EAAM,CACnC,oBAAsB,GACpB,GAAS,oBAAoB,EAAK,CACpC,kBACE,EACA,IACG,GAAS,iBAAiB,EAAS,EAAM,CAC9C,kBACE,EACA,EACA,EACA,IACG,GAAS,WAAW,EAAS,EAAO,EAAS,EAAU,CAC5D,qBACE,EACA,EACA,IACG,GAAS,cAAc,EAAS,EAAQ,EAAQ,CACrD,qBAAsB,EAA4B,IAChD,GAAS,cAAc,EAAS,EAAQ,CAC1C,qBAAuB,GACrB,GAAS,eAAe,EAAQ,CAClC,6BAA+B,GAC7B,GAAS,aAAa,EAAQ,CAChC,uBAA0B,GAAS,iBAAiB,CACpD,uBACE,EACA,IAEA,GAAS,gBAAgB,EAAc,EAAQ,CAClD,EAGU,MAAgC,CAE3C,GAAM,CAAE,gBAAe,GAAG,GADV,GAAkB,CAElC,OAAO"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameMessageListener as t}from"./useCrossFrameMessageListener.mjs";import{computed as n,effect as r,signal as i}from"@angular/core";import{MessageKey as a}from"@intlayer/editor";let o=null;const s=()=>{if(o)return o;let e=i(!1),t=i(!1),r=n(()=>e()&&t());return o={wrapperEnabled:e.asReadonly(),isInIframe:t.asReadonly(),enabled:r},o},c=e=>{s()},l=e(()=>{let e=s();if(!e)throw Error(`EditorEnabled state not found`);return t(`${a.INTLAYER_EDITOR_ENABLED}/post`,t=>{e.wrapperEnabled.set(t)}),r(()=>{typeof window<`u`&&e.isInIframe.set(window.self!==window.top)},{allowSignalWrites:!0}),e});export{s as createEditorEnabledClient,c as installEditorEnabled,l as useEditorEnabled};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n,signal as r}from"@angular/core";const i=()=>{let i=e(),a=r(i?.editorEnabled.value??!1);if(i){let e=e=>a.set(e.detail);i.editorEnabled.addEventListener(`change`,e);try{n(t,{optional:!0})?.onDestroy(()=>i.editorEnabled.removeEventListener(`change`,e))}catch{}}return{enabled:a.asReadonly()}};export{i as useEditorEnabled};
2
2
  //# sourceMappingURL=editorEnabled.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"editorEnabled.mjs","names":[],"sources":["../../../src/editor/editorEnabled.ts"],"sourcesContent":["import {\n computed,\n effect,\n type Injector,\n type Signal,\n signal,\n} from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\n/* ------------------------------------------------------------------ */\n/* public type – identical to the React version */\n/* ------------------------------------------------------------------ */\nexport type EditorEnabledStateProps = {\n wrapperEnabled: Signal<boolean>;\n isInIframe: Signal<boolean>;\n enabled: Signal<boolean>;\n};\n\n/**\n * Singleton instance\n */\nlet instance: EditorEnabledStateProps | null = null;\n\nconst _INTLAYER_EDITOR_ENABLED_SYMBOL = Symbol('EditorEnabled');\n\n/**\n * Creates an editor wrapperEnabled client\n */\nexport const createEditorEnabledClient = () => {\n if (instance) return instance;\n\n const wrapperEnabledSignal = signal(false);\n const isInIframeSignal = signal(false);\n const enabledSignal = computed(\n () => wrapperEnabledSignal() && isInIframeSignal()\n );\n\n instance = {\n wrapperEnabled: wrapperEnabledSignal.asReadonly(),\n isInIframe: isInIframeSignal.asReadonly(),\n enabled: enabledSignal,\n };\n\n return instance;\n};\n\n/**\n * Helper to install the editor wrapperEnabled state into the injector\n */\nexport const installEditorEnabled = (_injector: Injector) => {\n const _client = createEditorEnabledClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createEditorEnabledClient\n};\n\nexport const useEditorEnabled = createSharedComposable(() => {\n const client = createEditorEnabledClient();\n\n if (!client) {\n throw new Error('EditorEnabled state not found');\n }\n\n // Listen for the iframe parent if the editor send a message `INTLAYER_EDITOR_ENABLED`\n useCrossFrameMessageListener<boolean>(\n `${MessageKey.INTLAYER_EDITOR_ENABLED}/post`,\n (data) => {\n (client.wrapperEnabled as any).set(data);\n }\n );\n\n // Use effect to set up the iframe check immediately\n effect(\n () => {\n if (typeof window !== 'undefined') {\n (client.isInIframe as any).set(window.self !== window.top);\n }\n },\n { allowSignalWrites: true }\n );\n\n return client;\n});\n"],"mappings":"uQAuBA,IAAI,EAA2C,KAO/C,MAAa,MAAkC,CAC7C,GAAI,EAAU,OAAO,EAErB,IAAM,EAAuB,EAAO,GAAM,CACpC,EAAmB,EAAO,GAAM,CAChC,EAAgB,MACd,GAAsB,EAAI,GAAkB,CACnD,CAQD,MANA,GAAW,CACT,eAAgB,EAAqB,YAAY,CACjD,WAAY,EAAiB,YAAY,CACzC,QAAS,EACV,CAEM,GAMI,EAAwB,GAAwB,CAC3C,GAA2B,EAMhC,EAAmB,MAA6B,CAC3D,IAAM,EAAS,GAA2B,CAE1C,GAAI,CAAC,EACH,MAAU,MAAM,gCAAgC,CAqBlD,OAjBA,EACE,GAAG,EAAW,wBAAwB,OACrC,GAAS,CACP,EAAO,eAAuB,IAAI,EAAK,EAE3C,CAGD,MACQ,CACA,OAAO,OAAW,KACnB,EAAO,WAAmB,IAAI,OAAO,OAAS,OAAO,IAAI,EAG9D,CAAE,kBAAmB,GAAM,CAC5B,CAEM,GACP"}
1
+ {"version":3,"file":"editorEnabled.mjs","names":[],"sources":["../../../src/editor/editorEnabled.ts"],"sourcesContent":["import { DestroyRef, inject, signal } from '@angular/core';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport const useEditorEnabled = () => {\n const manager = getEditorStateManager();\n const enabled = signal<boolean>(manager?.editorEnabled.value ?? false);\n\n if (manager) {\n const handler = (e: Event) =>\n enabled.set((e as CustomEvent<boolean>).detail);\n manager.editorEnabled.addEventListener('change', handler);\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(() =>\n manager.editorEnabled.removeEventListener('change', handler)\n );\n } catch {}\n }\n\n return { enabled: enabled.asReadonly() };\n};\n"],"mappings":"uIAGA,MAAa,MAAyB,CACpC,IAAM,EAAU,GAAuB,CACjC,EAAU,EAAgB,GAAS,cAAc,OAAS,GAAM,CAEtE,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAQ,IAAK,EAA2B,OAAO,CACjD,EAAQ,cAAc,iBAAiB,SAAU,EAAQ,CAEzD,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,cAAc,oBAAoB,SAAU,EAAQ,CAC7D,MACK,GAGV,MAAO,CAAE,QAAS,EAAQ,YAAY,CAAE"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameState as t}from"./useCrossFrameState.mjs";import{INTLAYER_TOKEN as n}from"../client/installIntlayer.mjs";import{effect as r,inject as i}from"@angular/core";import{MessageKey as a}from"@intlayer/editor";const o=e(()=>{let e=i(n);if(!e)throw Error(`IntlayerEditor state not found`);let[o,s]=t(a.INTLAYER_CURRENT_LOCALE);return r(()=>{s(e.locale())}),e});export{o as useEditorLocale};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{INTLAYER_TOKEN as t}from"../client/installIntlayer.mjs";import{effect as n,inject as r}from"@angular/core";const i=()=>{let i=e(),a=r(t,{optional:!0});return a&&i&&n(()=>{let e=a.locale();i.currentLocale.set(e)}),a};export{i as useEditorLocale};
2
2
  //# sourceMappingURL=editorLocale.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"editorLocale.mjs","names":[],"sources":["../../../src/editor/editorLocale.ts"],"sourcesContent":["import { effect, inject } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from '../client';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport const useEditorLocale = createSharedComposable(() => {\n const client = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n if (!client) {\n throw new Error('IntlayerEditor state not found');\n }\n\n const [_data, setData] = useCrossFrameState<LocalesValues>(\n MessageKey.INTLAYER_CURRENT_LOCALE\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = client.locale();\n setData(newValue as Locale);\n });\n\n return client;\n});\n"],"mappings":"oSAQA,MAAa,EAAkB,MAA6B,CAC1D,IAAM,EAAS,EAAyB,EAAe,CAEvD,GAAI,CAAC,EACH,MAAU,MAAM,iCAAiC,CAGnD,GAAM,CAAC,EAAO,GAAW,EACvB,EAAW,wBACZ,CAQD,OALA,MAAa,CAEX,EADiB,EAAO,QAAQ,CACL,EAC3B,CAEK,GACP"}
1
+ {"version":3,"file":"editorLocale.mjs","names":[],"sources":["../../../src/editor/editorLocale.ts"],"sourcesContent":["import { effect, inject } from '@angular/core';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from '../client';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport const useEditorLocale = () => {\n const manager = getEditorStateManager();\n const client = inject<IntlayerProvider>(INTLAYER_TOKEN, {\n optional: true,\n } as any);\n\n if (client && manager) {\n effect(() => {\n const locale = client.locale();\n manager.currentLocale.set(locale as Locale);\n });\n }\n\n return client;\n};\n"],"mappings":"sLAKA,MAAa,MAAwB,CACnC,IAAM,EAAU,GAAuB,CACjC,EAAS,EAAyB,EAAgB,CACtD,SAAU,GACX,CAAQ,CAST,OAPI,GAAU,GACZ,MAAa,CACX,IAAM,EAAS,EAAO,QAAQ,CAC9B,EAAQ,cAAc,IAAI,EAAiB,EAC3C,CAGG"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameState as t}from"./useCrossFrameState.mjs";import{effect as n,signal as r}from"@angular/core";import{MessageKey as i}from"@intlayer/editor";let a=null;const o=()=>{if(a)return a;let e=r(null),t=t=>{e.set(t)};return a={focusedContent:e.asReadonly(),setFocusedContent:t,setFocusedContentKeyPath:n=>{let r=e();r&&t({...r,keyPath:n})}},a},s=e=>{o()},c=e(()=>{let e=o(),[r,a]=t(i.INTLAYER_FOCUSED_CONTENT_CHANGED);if(!e)throw Error(`FocusDictionary state not found`);return n(()=>{let t=e.focusedContent();JSON.stringify(t)!==JSON.stringify(r())&&a(t)}),n(()=>{let t=r();JSON.stringify(t)!==JSON.stringify(e.focusedContent())&&e.setFocusedContent(t??null)}),e});export{o as createFocusDictionaryClient,s as installFocusDictionary,c as useFocusDictionary};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n,signal as r}from"@angular/core";const i=()=>{let i=e(),a=r(i?.focusedContent.value??null);if(i){let e=e=>a.set(e.detail);i.focusedContent.addEventListener(`change`,e);try{n(t,{optional:!0})?.onDestroy(()=>i.focusedContent.removeEventListener(`change`,e))}catch{}}return{focusedContent:a.asReadonly(),setFocusedContent:e=>i?.focusedContent.set(e),setFocusedContentKeyPath:e=>i?.setFocusedContentKeyPath(e)}};export{i as useFocusDictionary};
2
2
  //# sourceMappingURL=focusDictionary.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusDictionary.mjs","names":[],"sources":["../../../src/editor/focusDictionary.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport type FileContent = {\n dictionaryKey: string;\n keyPath?: KeyPath[];\n dictionaryPath?: string;\n};\n\ntype FocusDictionaryClient = {\n focusedContent: Signal<FileContent | null>;\n setFocusedContent: (focussedContent: FileContent | null) => void;\n setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;\n};\n\n/**\n * Singleton instance\n */\nlet instance: FocusDictionaryClient | null = null;\n\n/**\n * Creates a focus dictionary client\n */\nexport const createFocusDictionaryClient = () => {\n if (instance) return instance;\n\n const focusedContentSignal = signal<FileContent | null>(null);\n\n const setFocusedContent = (focussedContent: FileContent | null) => {\n focusedContentSignal.set(focussedContent);\n };\n\n const setFocusedContentKeyPath = (keyPath: KeyPath[]) => {\n const current = focusedContentSignal();\n if (!current) return;\n setFocusedContent({ ...current, keyPath });\n };\n\n instance = {\n focusedContent: focusedContentSignal.asReadonly(),\n setFocusedContent,\n setFocusedContentKeyPath,\n } as FocusDictionaryClient;\n\n return instance;\n};\n\n/**\n * Helper to install the focus dictionary into the injector\n */\nexport const installFocusDictionary = (_injector: Injector) => {\n const _client = createFocusDictionaryClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createFocusDictionaryClient\n};\n\n/** consumer */\nexport const useFocusDictionary = createSharedComposable(() => {\n const client = createFocusDictionaryClient();\n const [focusedContent, setFocusedContent] =\n useCrossFrameState<FileContent | null>(\n MessageKey.INTLAYER_FOCUSED_CONTENT_CHANGED\n );\n\n if (!client) {\n throw new Error('FocusDictionary state not found');\n }\n\n // Use Angular effects instead of Vue watchers\n // Watch local (client) and update cross-frame\n effect(() => {\n const newValue = client.focusedContent();\n if (JSON.stringify(newValue) !== JSON.stringify(focusedContent())) {\n setFocusedContent(newValue);\n }\n });\n\n // Watch cross-frame and update local\n effect(() => {\n const newValue = focusedContent();\n if (JSON.stringify(newValue) !== JSON.stringify(client.focusedContent())) {\n client.setFocusedContent(newValue ?? null);\n }\n });\n\n return client;\n});\n"],"mappings":"qOAqBA,IAAI,EAAyC,KAK7C,MAAa,MAAoC,CAC/C,GAAI,EAAU,OAAO,EAErB,IAAM,EAAuB,EAA2B,KAAK,CAEvD,EAAqB,GAAwC,CACjE,EAAqB,IAAI,EAAgB,EAe3C,MANA,GAAW,CACT,eAAgB,EAAqB,YAAY,CACjD,oBACA,yBATgC,GAAuB,CACvD,IAAM,EAAU,GAAsB,CACjC,GACL,EAAkB,CAAE,GAAG,EAAS,UAAS,CAAC,EAO3C,CAEM,GAMI,EAA0B,GAAwB,CAC7C,GAA6B,EAOlC,EAAqB,MAA6B,CAC7D,IAAM,EAAS,GAA6B,CACtC,CAAC,EAAgB,GACrB,EACE,EAAW,iCACZ,CAEH,GAAI,CAAC,EACH,MAAU,MAAM,kCAAkC,CAoBpD,OAfA,MAAa,CACX,IAAM,EAAW,EAAO,gBAAgB,CACpC,KAAK,UAAU,EAAS,GAAK,KAAK,UAAU,GAAgB,CAAC,EAC/D,EAAkB,EAAS,EAE7B,CAGF,MAAa,CACX,IAAM,EAAW,GAAgB,CAC7B,KAAK,UAAU,EAAS,GAAK,KAAK,UAAU,EAAO,gBAAgB,CAAC,EACtE,EAAO,kBAAkB,GAAY,KAAK,EAE5C,CAEK,GACP"}
1
+ {"version":3,"file":"focusDictionary.mjs","names":[],"sources":["../../../src/editor/focusDictionary.ts"],"sourcesContent":["import { DestroyRef, inject, signal } from '@angular/core';\nimport type { FileContent } from '@intlayer/editor';\nimport type { KeyPath } from '@intlayer/types/keyPath';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport type { FileContent };\n\nexport const useFocusDictionary = () => {\n const manager = getEditorStateManager();\n const focusedContent = signal<FileContent | null>(\n manager?.focusedContent.value ?? null\n );\n\n if (manager) {\n const handler = (e: Event) =>\n focusedContent.set((e as CustomEvent<FileContent | null>).detail);\n manager.focusedContent.addEventListener('change', handler);\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(() =>\n manager.focusedContent.removeEventListener('change', handler)\n );\n } catch {}\n }\n\n return {\n focusedContent: focusedContent.asReadonly(),\n setFocusedContent: (value: FileContent | null) =>\n manager?.focusedContent.set(value),\n setFocusedContentKeyPath: (keyPath: KeyPath[]) =>\n manager?.setFocusedContentKeyPath(keyPath),\n };\n};\n"],"mappings":"uIAOA,MAAa,MAA2B,CACtC,IAAM,EAAU,GAAuB,CACjC,EAAiB,EACrB,GAAS,eAAe,OAAS,KAClC,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAe,IAAK,EAAsC,OAAO,CACnE,EAAQ,eAAe,iBAAiB,SAAU,EAAQ,CAE1D,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,eAAe,oBAAoB,SAAU,EAAQ,CAC9D,MACK,GAGV,MAAO,CACL,eAAgB,EAAe,YAAY,CAC3C,kBAAoB,GAClB,GAAS,eAAe,IAAI,EAAM,CACpC,yBAA2B,GACzB,GAAS,yBAAyB,EAAQ,CAC7C"}
@@ -1 +1 @@
1
- import{ContentSelectorWrapperComponent as e}from"./ContentSelectorWrapper.component.mjs";import{EditedContentRendererComponent as t}from"./EditedContentRenderer.component.mjs";import{EditorSelectorRendererComponent as n}from"./EditorSelectorRenderer.component.mjs";import{installIntlayerEditor as r}from"./installIntlayerEditor.mjs";export{e as ContentSelectorWrapperComponent,t as EditedContentRendererComponent,n as EditorSelectorRendererComponent,r as installIntlayerEditor};
1
+ import{getEditorStateManager as e,installIntlayerEditor as t}from"./installIntlayerEditor.mjs";import{useEditorEnabled as n}from"./editorEnabled.mjs";import{useFocusDictionary as r}from"./focusDictionary.mjs";import{ContentSelectorWrapperComponent as i}from"./ContentSelectorWrapper.component.mjs";import{useCommunicator as a}from"./communicator.mjs";import{useConfiguration as o}from"./configuration.mjs";import{useDictionariesRecord as s}from"./dictionariesRecord.mjs";import{EditedContentRendererComponent as c}from"./EditedContentRenderer.component.mjs";import{EditorSelectorRendererComponent as l}from"./EditorSelectorRenderer.component.mjs";import{useEditedContent as u,useEditedContentActions as d}from"./editedContent.mjs";import{useEditorLocale as f}from"./editorLocale.mjs";import{useCrossFrameMessageListener as p}from"./useCrossFrameMessageListener.mjs";import{useCrossFrameState as m}from"./useCrossFrameState.mjs";import{useIframeClickInterceptor as h,useIframeClickMerger as g}from"./useIframeClickInterceptor.mjs";import{useEditor as _}from"./useEditor.mjs";export{i as ContentSelectorWrapperComponent,c as EditedContentRendererComponent,l as EditorSelectorRendererComponent,e as getEditorStateManager,t as installIntlayerEditor,a as useCommunicator,o as useConfiguration,p as useCrossFrameMessageListener,m as useCrossFrameState,s as useDictionariesRecord,u as useEditedContent,d as useEditedContentActions,_ as useEditor,n as useEditorEnabled,f as useEditorLocale,r as useFocusDictionary,h as useIframeClickInterceptor,g as useIframeClickMerger};
@@ -1,2 +1,2 @@
1
- import{installCommunicator as e}from"./communicator.mjs";import{installEditorEnabled as t}from"./editorEnabled.mjs";import{installFocusDictionary as n}from"./focusDictionary.mjs";import{installDictionariesRecord as r}from"./dictionariesRecord.mjs";import{installEditedContent as i}from"./editedContent.mjs";import a from"@intlayer/config/built";const{editor:o}=a,{applicationURL:s,editorURL:c,cmsURL:l}=o??{},u=e=>{typeof window>`u`||window.self!==window.top&&(o.applicationURL.length>0&&window.postMessage(e,o.applicationURL),o.editorURL.length>0&&window.parent.postMessage(e,o.editorURL),o.cmsURL.length>0&&window.parent.postMessage(e,o.cmsURL))},d=a=>{e(a,{postMessage:u,allowedOrigins:[s,c,l]}),t(a),r(a),i(a),n(a)};export{d as installIntlayerEditor};
1
+ import e from"@intlayer/config/built";import{EditorStateManager as t,defineIntlayerElements as n}from"@intlayer/editor";const{editor:r}=e??{},i=()=>({allowedOrigins:[r?.applicationURL,r?.editorURL,r?.cmsURL].filter(Boolean),postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&(window.parent?.postMessage(e,t),window.postMessage(e,t))}});let a=null;const o=r=>{if(a)return;let o=new t({mode:`client`,messenger:i(),configuration:e});a=o,n(),o.start()},s=()=>a;export{s as getEditorStateManager,o as installIntlayerEditor};
2
2
  //# sourceMappingURL=installIntlayerEditor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayerEditor.mjs","names":[],"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport { installCommunicator } from './communicator';\nimport { installDictionariesRecord } from './dictionariesRecord';\nimport { installEditedContent } from './editedContent';\nimport { installEditorEnabled } from './editorEnabled';\nimport { installFocusDictionary } from './focusDictionary';\n\nconst { editor } = configuration;\nconst { applicationURL, editorURL, cmsURL } = editor ?? {};\n\nconst postMessage = (data: any) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n\n if (editor.applicationURL.length > 0) {\n window.postMessage(data, editor.applicationURL);\n }\n\n if (editor.editorURL.length > 0) {\n window.parent.postMessage(data, editor.editorURL);\n }\n\n if (editor.cmsURL.length > 0) {\n window.parent.postMessage(data, editor.cmsURL);\n }\n};\n\n/**\n * Angular-side replacement for the former <IntlayerEditorProvider> React component.\n *\n * Call **once** in your Angular application's bootstrap function or main module:\n *\n * ```typescript\n * import { bootstrapApplication } from '@angular/platform-browser';\n * import { AppComponent } from './app/app.component';\n * import { installIntlayerEditor } from 'angular-intlayer';\n *\n * bootstrapApplication(AppComponent).then(appRef => {\n * installIntlayerEditor(appRef.injector);\n * });\n * ```\n */\nexport const installIntlayerEditor = (injector: Injector): void => {\n /* ---------------------------------------------------------------------\n * 1. Base providers – always on\n * -------------------------------------------------------------------*/\n\n installCommunicator(injector, {\n postMessage,\n allowedOrigins: [applicationURL, editorURL, cmsURL] as string[],\n });\n installEditorEnabled(injector);\n installDictionariesRecord(injector);\n installEditedContent(injector);\n installFocusDictionary(injector);\n};\n"],"mappings":"yVAQA,KAAM,CAAE,UAAW,EACb,CAAE,iBAAgB,YAAW,UAAW,GAAU,EAAE,CAEpD,EAAe,GAAc,CAC7B,OAAO,OAAW,KAEH,OAAO,OAAS,OAAO,MAItC,EAAO,eAAe,OAAS,GACjC,OAAO,YAAY,EAAM,EAAO,eAAe,CAG7C,EAAO,UAAU,OAAS,GAC5B,OAAO,OAAO,YAAY,EAAM,EAAO,UAAU,CAG/C,EAAO,OAAO,OAAS,GACzB,OAAO,OAAO,YAAY,EAAM,EAAO,OAAO,GAmBrC,EAAyB,GAA6B,CAKjE,EAAoB,EAAU,CAC5B,cACA,eAAgB,CAAC,EAAgB,EAAW,EAAO,CACpD,CAAC,CACF,EAAqB,EAAS,CAC9B,EAA0B,EAAS,CACnC,EAAqB,EAAS,CAC9B,EAAuB,EAAS"}
1
+ {"version":3,"file":"installIntlayerEditor.mjs","names":[],"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport {\n defineIntlayerElements,\n EditorStateManager,\n type MessengerConfig,\n} from '@intlayer/editor';\n\nconst { editor } = configuration ?? {};\n\nconst buildDefaultMessengerConfig = (): MessengerConfig => ({\n allowedOrigins: [\n editor?.applicationURL,\n editor?.editorURL,\n editor?.cmsURL,\n ].filter(Boolean) as string[],\n postMessageFn: (payload, origin) => {\n if (typeof window === 'undefined') return;\n const isInIframe = window.self !== window.top;\n if (!isInIframe) return;\n window.parent?.postMessage(payload, origin);\n window.postMessage(payload, origin);\n },\n});\n\nlet globalManager: EditorStateManager | null = null;\n\nexport const installIntlayerEditor = (_injector: Injector): void => {\n if (globalManager) return;\n\n const manager = new EditorStateManager({\n mode: 'client',\n messenger: buildDefaultMessengerConfig(),\n configuration,\n });\n\n globalManager = manager;\n defineIntlayerElements();\n manager.start();\n};\n\nexport const getEditorStateManager = (): EditorStateManager | null =>\n globalManager;\n"],"mappings":"wHAQA,KAAM,CAAE,UAAW,GAAiB,EAAE,CAEhC,OAAsD,CAC1D,eAAgB,CACd,GAAQ,eACR,GAAQ,UACR,GAAQ,OACT,CAAC,OAAO,QAAQ,CACjB,eAAgB,EAAS,IAAW,CAC9B,OAAO,OAAW,KACH,OAAO,OAAS,OAAO,MAE1C,OAAO,QAAQ,YAAY,EAAS,EAAO,CAC3C,OAAO,YAAY,EAAS,EAAO,GAEtC,EAED,IAAI,EAA2C,KAE/C,MAAa,EAAyB,GAA8B,CAClE,GAAI,EAAe,OAEnB,IAAM,EAAU,IAAI,EAAmB,CACrC,KAAM,SACN,UAAW,GAA6B,CACxC,gBACD,CAAC,CAEF,EAAgB,EAChB,GAAwB,CACxB,EAAQ,OAAO,EAGJ,MACX"}
@@ -1,2 +1,2 @@
1
- "use client";import{useCommunicator as e}from"./communicator.mjs";import{DestroyRef as t,inject as n}from"@angular/core";import{compareUrls as r}from"@intlayer/editor";const i=new Map;let a=!1;const o=(e,t)=>{let n=i.get(e);n||(n=new Set,i.set(e,n)),n.add(t)},s=(e,t)=>{let n=i.get(e);n&&(n.delete(t),n.size===0&&i.delete(e))},c=(e,t)=>{a||=(window.addEventListener(`message`,n=>{let{type:a,data:o,senderId:s}=n.data??{};a&&s!==t&&(!e||e.includes(`*`)||e.some(e=>r(e,n.origin)))&&i.get(a)?.forEach(e=>{e(o)})}),!0)},l=(r,i)=>{let{allowedOrigins:a,postMessage:l,senderId:u}=e();if(c(a,u),i){o(r,i);try{let e=n(t,{optional:!0});e&&e.onDestroy(()=>s(r,i))}catch{console.warn(`useCrossFrameMessageListener called outside injection context; cleanup may not be available.`)}}return e=>{l({type:r,data:e,senderId:u})}};export{l as useCrossFrameMessageListener};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n}from"@angular/core";const r=(r,i)=>{let a=e();if(i&&a){let e=a.messenger.subscribe(r,i);try{n(t,{optional:!0})?.onDestroy(e)}catch{}}return e=>a?.messenger.send(r,e)};export{r as useCrossFrameMessageListener};
2
2
  //# sourceMappingURL=useCrossFrameMessageListener.mjs.map
@@ -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 */\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":"wKAUA,MAAM,EAAc,IAAI,IAGxB,IAAI,EAAyB,GAG7B,MAAM,GAAiB,EAAa,IAAc,CAChD,IAAI,EAAM,EAAY,IAAI,EAAI,CACzB,IACH,EAAM,IAAI,IACV,EAAY,IAAI,EAAK,EAAI,EAE3B,EAAI,IAAI,EAAG,EAGP,GAAoB,EAAa,IAAc,CACnD,IAAM,EAAM,EAAY,IAAI,EAAI,CAC3B,IACL,EAAI,OAAO,EAAG,CACV,EAAI,OAAS,GAAG,EAAY,OAAO,EAAI,GAIvC,GACJ,EACA,IACG,CACC,AAkBJ,KAjBA,OAAO,iBAAiB,UAAY,GAAU,CAC5C,GAAM,CAAE,OAAM,OAAM,YAAa,EAAM,MAAQ,EAAE,CAC5C,GACD,IAAa,IAIf,CAAC,GACD,EAAe,SAAS,IAAI,EAC5B,EAAe,KAAM,GAAM,EAAY,EAAG,EAAM,OAAO,CAAC,GAGxD,EAAY,IAAI,EAAK,EAAE,QAAS,GAAO,CACrC,EAAG,EAAK,EACR,EAEJ,CACuB,KAYd,GACX,EACA,IACG,CAEH,GAAM,CAAE,iBAAgB,cAAa,YAAa,GAAiB,CAMnE,GAHA,EAAqB,EAAgB,EAAS,CAG1C,EAAkB,CACpB,EAAc,EAAK,EAA0B,CAG7C,GAAI,CACF,IAAM,EAAa,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,CACrD,GACF,EAAW,cACT,EAAiB,EAAK,EAA0B,CACjD,MAEG,CAEN,QAAQ,KACN,+FAED,EASL,MAJ4B,IAAa,CACvC,EAAY,CAAE,KAAM,EAAK,OAAM,WAAU,CAAC"}
1
+ {"version":3,"file":"useCrossFrameMessageListener.mjs","names":[],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport type { MessageKey } from '@intlayer/editor';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport const useCrossFrameMessageListener = <S>(\n key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`,\n onEventTriggered?: (data: S) => void\n) => {\n const manager = getEditorStateManager();\n\n if (onEventTriggered && manager) {\n const unsub = manager.messenger.subscribe(\n key,\n onEventTriggered as (data: unknown) => void\n );\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(unsub);\n } catch {}\n }\n\n return (data?: S) => manager?.messenger.send(key, data);\n};\n"],"mappings":"2HAIA,MAAa,GACX,EACA,IACG,CACH,IAAM,EAAU,GAAuB,CAEvC,GAAI,GAAoB,EAAS,CAC/B,IAAM,EAAQ,EAAQ,UAAU,UAC9B,EACA,EACD,CAED,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,UAAU,EAAM,MACtB,GAGV,MAAQ,IAAa,GAAS,UAAU,KAAK,EAAK,EAAK"}
@@ -1,2 +1,2 @@
1
- import{useCommunicator as e}from"./communicator.mjs";import{useCrossFrameMessageListener as t}from"./useCrossFrameMessageListener.mjs";import{signal as n}from"@angular/core";const r=new Map,i=(e,t)=>typeof e==`function`?e(t):e,a=e=>e==null?e:JSON.parse(JSON.stringify(e)),o=(o,s,c={emit:!0,receive:!0})=>{if(r.has(o)){let{state:e,setState:t,postState:n}=r.get(o);return[e,t,n]}let{emit:l=!0,receive:u=!0}=c,d=n(i(s)),{postMessage:f,senderId:p}=e()??{},m=e=>{!l||typeof f!=`function`||e===void 0||f({type:`${o}/post`,data:e,senderId:p})},h=e=>{let t=a(i(e,d()));d.set(t),m(t)},g=()=>{typeof f==`function`&&f({type:`${o}/post`,data:d(),senderId:p})};return m(d()),u&&typeof f==`function`&&d()===void 0&&f({type:`${o}/get`,senderId:p}),t(`${o}/post`,u?e=>{d.set(e)}:void 0),t(`${o}/get`,l?(e,t)=>{l&&t!==p&&m(d())}:void 0),r.set(o,{state:d,setState:h,postState:g}),[d,h,g]};export{o as useCrossFrameState};
1
+ import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{DestroyRef as t,inject as n,signal as r}from"@angular/core";import{CrossFrameStateManager as i}from"@intlayer/editor";const a=(a,o,s={emit:!0,receive:!0})=>{let c=e(),{emit:l=!0,receive:u=!0}=s,d=r(o);if(c){let e=new i(a,c.messenger,{emit:l,receive:u,initialValue:o});e.start();let r=e=>{d.set(e.detail)};e.addEventListener(`change`,r);try{n(t,{optional:!0})?.onDestroy(()=>{e.removeEventListener(`change`,r),e.stop()})}catch{}return[d.asReadonly(),t=>e.set(t),()=>e.postCurrentValue()]}return[d.asReadonly(),e=>d.set(e),()=>{}]};export{a as useCrossFrameState};
2
2
  //# sourceMappingURL=useCrossFrameState.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameState.mjs","names":[],"sources":["../../../src/editor/useCrossFrameState.ts"],"sourcesContent":["import { type Signal, signal } from '@angular/core';\nimport type { MessageKey } from '@intlayer/editor';\nimport { useCommunicator } from './communicator';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport type CrossFrameStateOptions = {\n /** Whether to broadcast state changes to other instances (default: true) */\n emit?: boolean;\n /** Whether to listen for state updates from other instances (default: true) */\n receive?: boolean;\n};\n\nconst crossFrameStateCache = new Map<\n string,\n {\n state: Signal<any>;\n setState: (v: any | ((prev: any) => any)) => void;\n postState: () => void;\n }\n>();\n\n/**\n * Utility to resolve either a value or an updater function (mirrors React's `setState`).\n */\nconst resolveState = <S>(\n state: S | ((prev?: S) => S) | undefined,\n prevState?: S\n): S | undefined => {\n if (typeof state === 'function') {\n return (state as (prev?: S) => S)(prevState);\n }\n return state as S;\n};\n\n/**\n * Creates a plain object copy that can be safely serialized\n * for postMessage communication\n */\nconst toSerializable = <T>(obj: T): T => {\n if (obj === null || obj === undefined) return obj;\n // Using parse/stringify for a quick deep clone to remove reactivity\n return JSON.parse(JSON.stringify(obj));\n};\n\n/**\n * Angular replacement for Vue's cross-frame state composable.\n * It synchronises a reactive value across frames/windows via the `postMessage` API.\n *\n * @template S The type of the state being synchronised.\n * @param key Unique key identifying this state channel.\n * @param initialState Initial value (or lazy factory) for the state.\n * @param options Control flags for emitting/receiving updates.\n *\n * @returns `[stateSignal, setState, postState]`\n * - `stateSignal` – Angular `Signal<S | undefined>` holding the current state.\n * - `setState` – Setter with the same API as React's `setState`.\n * - `postState` – Manually broadcast the current state (useful after mutations outside `setState`).\n */\nexport const useCrossFrameState = <S>(\n key: `${MessageKey}`,\n initialState?: S | (() => S),\n options: CrossFrameStateOptions = { emit: true, receive: true }\n): [\n Signal<S | undefined>,\n (v: S | ((prev: S | undefined) => S)) => void,\n () => void,\n] => {\n if (crossFrameStateCache.has(key)) {\n // Return the existing instance\n const { state, setState, postState } = crossFrameStateCache.get(key)!;\n return [state, setState, postState];\n }\n\n const { emit = true, receive = true } = options;\n\n /**\n * Internal reactive state using Angular signals.\n * We resolve the initial value here to avoid one extra render (same idea as in the React version).\n */\n const stateSignal = signal<S | undefined>(resolveState<S>(initialState));\n\n // Get communicator within injection context\n const { postMessage, senderId } = useCommunicator() ?? {};\n\n /**\n * Broadcast the given value if emitting is allowed and the communicator is ready.\n */\n const broadcastState = (value: S | undefined) => {\n if (\n !emit ||\n typeof postMessage !== 'function' ||\n typeof value === 'undefined'\n )\n return;\n postMessage({\n type: `${key}/post`,\n data: value,\n senderId,\n });\n };\n\n /**\n * Setter that mirrors React's `setState` signature (supports value or updater fn).\n */\n const setState = (valueOrUpdater: S | ((prev: S | undefined) => S)) => {\n const next = resolveState<S>(valueOrUpdater as any, stateSignal());\n const serialised = toSerializable(next);\n stateSignal.set(serialised);\n broadcastState(serialised);\n };\n\n /**\n * Manually broadcast the current state to peers.\n */\n const postState = () => {\n if (typeof postMessage !== 'function') return;\n postMessage({\n type: `${key}/post`,\n data: stateSignal(),\n senderId,\n });\n };\n\n // Emit the initial state (if any) right away so that peers can pick it up.\n broadcastState(stateSignal());\n\n // If we are in receive mode but have no state yet, ask peers for theirs.\n if (\n receive &&\n typeof postMessage === 'function' &&\n typeof stateSignal() === 'undefined'\n ) {\n postMessage({ type: `${key}/get`, senderId });\n }\n\n /* ───────────────────── Incoming messages ───────────────────── */\n\n // 1. Updates posted by other frames\n useCrossFrameMessageListener<S>(\n `${key}/post`,\n receive\n ? (data) => {\n stateSignal.set(data);\n }\n : undefined\n );\n\n // 2. Requests from peers asking for our current value\n const handleGetMessage = (_: unknown, originSenderId?: string) => {\n if (!emit) return;\n if (originSenderId === senderId) return; // Don't respond to our own request\n broadcastState(stateSignal());\n };\n\n useCrossFrameMessageListener(\n `${key}/get`,\n emit ? handleGetMessage : undefined\n );\n\n // Cache this instance\n crossFrameStateCache.set(key, { state: stateSignal, setState, postState });\n\n return [stateSignal as Signal<S | undefined>, setState, postState];\n};\n"],"mappings":"8KAYA,MAAM,EAAuB,IAAI,IAY3B,GACJ,EACA,IAEI,OAAO,GAAU,WACX,EAA0B,EAAU,CAEvC,EAOH,EAAqB,GACrB,GAAQ,KAAkC,EAEvC,KAAK,MAAM,KAAK,UAAU,EAAI,CAAC,CAiB3B,GACX,EACA,EACA,EAAkC,CAAE,KAAM,GAAM,QAAS,GAAM,GAK5D,CACH,GAAI,EAAqB,IAAI,EAAI,CAAE,CAEjC,GAAM,CAAE,QAAO,WAAU,aAAc,EAAqB,IAAI,EAAI,CACpE,MAAO,CAAC,EAAO,EAAU,EAAU,CAGrC,GAAM,CAAE,OAAO,GAAM,UAAU,IAAS,EAMlC,EAAc,EAAsB,EAAgB,EAAa,CAAC,CAGlE,CAAE,cAAa,YAAa,GAAiB,EAAI,EAAE,CAKnD,EAAkB,GAAyB,CAE7C,CAAC,GACD,OAAO,GAAgB,YAChB,IAAU,QAGnB,EAAY,CACV,KAAM,GAAG,EAAI,OACb,KAAM,EACN,WACD,CAAC,EAME,EAAY,GAAqD,CAErE,IAAM,EAAa,EADN,EAAgB,EAAuB,GAAa,CAAC,CAC3B,CACvC,EAAY,IAAI,EAAW,CAC3B,EAAe,EAAW,EAMtB,MAAkB,CAClB,OAAO,GAAgB,YAC3B,EAAY,CACV,KAAM,GAAG,EAAI,OACb,KAAM,GAAa,CACnB,WACD,CAAC,EA0CJ,OAtCA,EAAe,GAAa,CAAC,CAI3B,GACA,OAAO,GAAgB,YAChB,GAAa,GAAK,QAEzB,EAAY,CAAE,KAAM,GAAG,EAAI,MAAO,WAAU,CAAC,CAM/C,EACE,GAAG,EAAI,OACP,EACK,GAAS,CACR,EAAY,IAAI,EAAK,EAEvB,IAAA,GACL,CASD,EACE,GAAG,EAAI,MACP,GARwB,EAAY,IAA4B,CAC3D,GACD,IAAmB,GACvB,EAAe,GAAa,CAAC,EAKH,IAAA,GAC3B,CAGD,EAAqB,IAAI,EAAK,CAAE,MAAO,EAAa,WAAU,YAAW,CAAC,CAEnE,CAAC,EAAsC,EAAU,EAAU"}
1
+ {"version":3,"file":"useCrossFrameState.mjs","names":[],"sources":["../../../src/editor/useCrossFrameState.ts"],"sourcesContent":["import { DestroyRef, inject, type Signal, signal } from '@angular/core';\nimport { CrossFrameStateManager, type MessageKey } from '@intlayer/editor';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\nexport type CrossFrameStateOptions = {\n emit?: boolean;\n receive?: boolean;\n};\n\nexport const useCrossFrameState = <S>(\n key: `${MessageKey}`,\n initialState?: S,\n options: CrossFrameStateOptions = { emit: true, receive: true }\n): [Signal<S | undefined>, (value: S) => void, () => void] => {\n const manager = getEditorStateManager();\n const { emit = true, receive = true } = options;\n const stateSignal = signal<S | undefined>(initialState);\n\n if (manager) {\n const stateManager = new CrossFrameStateManager<S>(key, manager.messenger, {\n emit,\n receive,\n initialValue: initialState,\n });\n stateManager.start();\n\n const handler = (e: Event) => {\n stateSignal.set((e as CustomEvent<S>).detail);\n };\n stateManager.addEventListener('change', handler);\n\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n destroyRef?.onDestroy(() => {\n stateManager.removeEventListener('change', handler);\n stateManager.stop();\n });\n } catch {}\n\n const setState = (value: S) => stateManager.set(value);\n const postState = () => stateManager.postCurrentValue();\n\n return [stateSignal.asReadonly(), setState, postState];\n }\n\n return [\n stateSignal.asReadonly(),\n (value: S) => stateSignal.set(value),\n () => {},\n ];\n};\n"],"mappings":"iMASA,MAAa,GACX,EACA,EACA,EAAkC,CAAE,KAAM,GAAM,QAAS,GAAM,GACH,CAC5D,IAAM,EAAU,GAAuB,CACjC,CAAE,OAAO,GAAM,UAAU,IAAS,EAClC,EAAc,EAAsB,EAAa,CAEvD,GAAI,EAAS,CACX,IAAM,EAAe,IAAI,EAA0B,EAAK,EAAQ,UAAW,CACzE,OACA,UACA,aAAc,EACf,CAAC,CACF,EAAa,OAAO,CAEpB,IAAM,EAAW,GAAa,CAC5B,EAAY,IAAK,EAAqB,OAAO,EAE/C,EAAa,iBAAiB,SAAU,EAAQ,CAEhD,GAAI,CACiB,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cAAgB,CAC1B,EAAa,oBAAoB,SAAU,EAAQ,CACnD,EAAa,MAAM,EACnB,MACI,EAKR,MAAO,CAAC,EAAY,YAAY,CAHd,GAAa,EAAa,IAAI,EAAM,KAC9B,EAAa,kBAAkB,CAED,CAGxD,MAAO,CACL,EAAY,YAAY,CACvB,GAAa,EAAY,IAAI,EAAM,KAC9B,GACP"}
@@ -1,2 +1,2 @@
1
- import{useCrossFrameState as e}from"./useCrossFrameState.mjs";import{DestroyRef as t,inject as n}from"@angular/core";import{MessageKey as r}from"@intlayer/editor";const i=(t,n)=>e(r.INTLAYER_URL_CHANGE,t,n),a=e=>{let[r,a]=i(e,{emit:!0,receive:!1}),o,s,c=()=>a(window.location.pathname);try{let e=n(t,{optional:!0});if(e&&typeof window<`u`){o=history.pushState,s=history.replaceState;let t=e=>(...t)=>{e.apply(history,t),window.dispatchEvent(new Event(`locationchange`))};history.pushState=t(o),history.replaceState=t(s),window.addEventListener(`locationchange`,c),window.addEventListener(`popstate`,c),window.addEventListener(`hashchange`,c),c(),e.onDestroy(()=>{window.removeEventListener(`locationchange`,c),window.removeEventListener(`popstate`,c),window.removeEventListener(`hashchange`,c),o&&(history.pushState=o),s&&(history.replaceState=s)})}}catch{console.warn(`useCrossURLPathSetter called outside injection context; URL path synchronization may not be available.`)}return[r,a]};export{a as useCrossURLPathSetter,i as useCrossURLPathState};
1
+ const e=()=>{},t=()=>{};export{e as useCrossURLPathSetter,t as useCrossURLPathState};
2
2
  //# sourceMappingURL=useCrossURLPathState.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossURLPathState.mjs","names":[],"sources":["../../../src/editor/useCrossURLPathState.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport { useCrossFrameState } from './useCrossFrameState';\n\n/**\n * Hook to create and manage a cross-frame synchronized URL path state\n * @param initial - The initial URL path\n * @param opts - Options for controlling emit and receive behavior\n * @returns A tuple containing [state signal, setState function, forceSync function]\n */\nexport const useCrossURLPathState = (\n initial?: string,\n opts?: Parameters<typeof useCrossFrameState>[2]\n) => useCrossFrameState<string>(MessageKey.INTLAYER_URL_CHANGE, initial, opts);\n\n/**\n * Hook for host applications to push URL path changes into the shared state\n * This also monkey patches history methods to capture navigation events\n * @param initial - The initial URL path\n * @returns A tuple containing [state signal, setState function]\n */\nexport const useCrossURLPathSetter = (initial?: string) => {\n const [state, setState] = useCrossURLPathState(initial, {\n emit: true,\n receive: false,\n });\n\n // Original history methods\n let originalPushState: typeof history.pushState;\n let originalReplaceState: typeof history.replaceState;\n\n // Function to update state with current pathname\n const update = () => setState(window.location.pathname);\n\n // Use Angular's DestroyRef for cleanup instead of Vue lifecycle hooks\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef && typeof window !== 'undefined') {\n // Save original methods\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n\n /**\n * Wraps a history function to dispatch a custom event when called\n * @param fn - The history function to wrap\n * @returns The wrapped function\n */\n const wrap =\n (fn: typeof history.pushState) =>\n (...args: Parameters<typeof history.pushState>) => {\n fn.apply(history, args);\n window.dispatchEvent(new Event('locationchange'));\n };\n\n // Patch history methods\n history.pushState = wrap(originalPushState);\n history.replaceState = wrap(originalReplaceState);\n\n // Add event listeners\n window.addEventListener('locationchange', update);\n window.addEventListener('popstate', update);\n window.addEventListener('hashchange', update);\n\n // Initialize immediately\n update();\n\n // Clean up on destroy\n destroyRef.onDestroy(() => {\n window.removeEventListener('locationchange', update);\n window.removeEventListener('popstate', update);\n window.removeEventListener('hashchange', update);\n\n // Restore original history methods\n if (originalPushState) history.pushState = originalPushState;\n if (originalReplaceState) history.replaceState = originalReplaceState;\n });\n }\n } catch {\n console.warn(\n 'useCrossURLPathSetter called outside injection context; ' +\n 'URL path synchronization may not be available.'\n );\n }\n\n return [state, setState] as const;\n};\n"],"mappings":"mKAUA,MAAa,GACX,EACA,IACG,EAA2B,EAAW,oBAAqB,EAAS,EAAK,CAQjE,EAAyB,GAAqB,CACzD,GAAM,CAAC,EAAO,GAAY,EAAqB,EAAS,CACtD,KAAM,GACN,QAAS,GACV,CAAC,CAGE,EACA,EAGE,MAAe,EAAS,OAAO,SAAS,SAAS,CAGvD,GAAI,CACF,IAAM,EAAa,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,CAEzD,GAAI,GAAc,OAAO,OAAW,IAAa,CAE/C,EAAoB,QAAQ,UAC5B,EAAuB,QAAQ,aAO/B,IAAM,EACH,IACA,GAAG,IAA+C,CACjD,EAAG,MAAM,QAAS,EAAK,CACvB,OAAO,cAAc,IAAI,MAAM,iBAAiB,CAAC,EAIrD,QAAQ,UAAY,EAAK,EAAkB,CAC3C,QAAQ,aAAe,EAAK,EAAqB,CAGjD,OAAO,iBAAiB,iBAAkB,EAAO,CACjD,OAAO,iBAAiB,WAAY,EAAO,CAC3C,OAAO,iBAAiB,aAAc,EAAO,CAG7C,GAAQ,CAGR,EAAW,cAAgB,CACzB,OAAO,oBAAoB,iBAAkB,EAAO,CACpD,OAAO,oBAAoB,WAAY,EAAO,CAC9C,OAAO,oBAAoB,aAAc,EAAO,CAG5C,IAAmB,QAAQ,UAAY,GACvC,IAAsB,QAAQ,aAAe,IACjD,OAEE,CACN,QAAQ,KACN,yGAED,CAGH,MAAO,CAAC,EAAO,EAAS"}
1
+ {"version":3,"file":"useCrossURLPathState.mjs","names":[],"sources":["../../../src/editor/useCrossURLPathState.ts"],"sourcesContent":["// UrlStateManager is started by EditorStateManager.start() in client mode.\n// Nothing extra needed here.\nexport const useCrossURLPathSetter = () => {\n // No-op: managed by EditorStateManager\n};\n\nexport const useCrossURLPathState = () => {\n // No-op: managed by EditorStateManager\n};\n"],"mappings":"AAEA,MAAa,MAA8B,GAI9B,MAA6B"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useEditorEnabled as t}from"./editorEnabled.mjs";import{useFocusDictionary as n}from"./focusDictionary.mjs";import{useConfiguration as r}from"./configuration.mjs";import{useDictionariesRecord as i}from"./dictionariesRecord.mjs";import{useEditorLocale as a}from"./editorLocale.mjs";import{useCrossURLPathSetter as o}from"./useCrossURLPathState.mjs";import{useIframeClickMerger as s}from"./useIframeClickInterceptor.mjs";const c=e(()=>{r(),t(),n(),s(),o(),a(),i(),a()});export{c as useEditor};
1
+ import{useEditorEnabled as e}from"./editorEnabled.mjs";import{useFocusDictionary as t}from"./focusDictionary.mjs";import{useDictionariesRecord as n}from"./dictionariesRecord.mjs";import{useEditorLocale as r}from"./editorLocale.mjs";import{useIframeClickMerger as i}from"./useIframeClickInterceptor.mjs";const a=()=>{e(),t(),i(),r(),n()};export{a as useEditor};
2
2
  //# sourceMappingURL=useEditor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import { useConfiguration } from './configuration';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useDictionariesRecord } from './dictionariesRecord';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useEditorLocale } from './editorLocale';\nimport { useFocusDictionary } from './focusDictionary';\nimport { useCrossURLPathSetter } from './useCrossURLPathState';\nimport { useIframeClickMerger } from './useIframeClickInterceptor';\n\nexport const useEditor = createSharedComposable(() => {\n useConfiguration();\n useEditorEnabled();\n useFocusDictionary();\n useIframeClickMerger();\n useCrossURLPathSetter();\n useEditorLocale();\n useDictionariesRecord();\n useEditorLocale();\n});\n"],"mappings":"+eASA,MAAa,EAAY,MAA6B,CACpD,GAAkB,CAClB,GAAkB,CAClB,GAAoB,CACpB,GAAsB,CACtB,GAAuB,CACvB,GAAiB,CACjB,GAAuB,CACvB,GAAiB,EACjB"}
1
+ {"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import { useConfiguration } from './configuration';\nimport { useDictionariesRecord } from './dictionariesRecord';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useEditorLocale } from './editorLocale';\nimport { useFocusDictionary } from './focusDictionary';\nimport { useIframeClickMerger } from './useIframeClickInterceptor';\n\nexport const useEditor = () => {\n useEditorEnabled();\n useFocusDictionary();\n useIframeClickMerger();\n useEditorLocale();\n useDictionariesRecord();\n};\n"],"mappings":"+SAOA,MAAa,MAAkB,CAC7B,GAAkB,CAClB,GAAoB,CACpB,GAAsB,CACtB,GAAiB,CACjB,GAAuB"}
@@ -1,2 +1,2 @@
1
- import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameMessageListener as t}from"./useCrossFrameMessageListener.mjs";import{DestroyRef as n,inject as r}from"@angular/core";import{MessageKey as i,mergeIframeClick as a}from"@intlayer/editor";const o=e(()=>{let e=t(i.INTLAYER_IFRAME_CLICKED),a=()=>{e()};try{let e=r(n,{optional:!0});e&&typeof window<`u`&&(window.addEventListener(`mousedown`,a),e.onDestroy(()=>window.removeEventListener(`mousedown`,a)))}catch{console.warn(`useIframeClickInterceptor called outside injection context; event listener setup may not be available.`)}}),s=e(()=>{o(),t(i.INTLAYER_IFRAME_CLICKED,a)});export{o as useIframeClickInterceptor,s as useIframeClickMerger};
1
+ import{useCrossFrameMessageListener as e}from"./useCrossFrameMessageListener.mjs";import{MessageKey as t,mergeIframeClick as n}from"@intlayer/editor";const r=()=>{e(t.INTLAYER_IFRAME_CLICKED)},i=()=>{e(t.INTLAYER_IFRAME_CLICKED,n)};export{r as useIframeClickInterceptor,i as useIframeClickMerger};
2
2
  //# sourceMappingURL=useIframeClickInterceptor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIframeClickInterceptor.mjs","names":[],"sources":["../../../src/editor/useIframeClickInterceptor.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { MessageKey, mergeIframeClick } from '@intlayer/editor';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\n/* ─────────────────────────────────────────────\n 1. \"Interceptor\" – send a postMessage when\n the editor iframe itself is clicked.\n────────────────────────────────────────────── */\n/**\n * Hook that intercepts clicks in the iframe and sends them to the parent window\n * This allows the parent window to know when the iframe is clicked\n */\nexport const useIframeClickInterceptor = createSharedComposable(() => {\n const postMessage = useCrossFrameMessageListener<undefined>(\n MessageKey.INTLAYER_IFRAME_CLICKED\n );\n\n const handler = () => {\n postMessage();\n };\n\n // Use Angular's DestroyRef for cleanup instead of Vue's lifecycle hooks\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef && typeof window !== 'undefined') {\n // Set up event listener immediately\n window.addEventListener('mousedown', handler);\n\n // Clean up on destroy\n destroyRef.onDestroy(() =>\n window.removeEventListener('mousedown', handler)\n );\n }\n } catch {\n console.warn(\n 'useIframeClickInterceptor called outside injection context; ' +\n 'event listener setup may not be available.'\n );\n }\n});\n\n/**\n * Hook for the parent window to listen for iframe clicks and merge them\n * This makes iframe clicks behave as if they happened in the parent window\n */\nexport const useIframeClickMerger = createSharedComposable(() => {\n useIframeClickInterceptor();\n\n useCrossFrameMessageListener<MessageEvent>(\n MessageKey.INTLAYER_IFRAME_CLICKED,\n mergeIframeClick\n );\n});\n"],"mappings":"mRAaA,MAAa,EAA4B,MAA6B,CACpE,IAAM,EAAc,EAClB,EAAW,wBACZ,CAEK,MAAgB,CACpB,GAAa,EAIf,GAAI,CACF,IAAM,EAAa,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,CAErD,GAAc,OAAO,OAAW,MAElC,OAAO,iBAAiB,YAAa,EAAQ,CAG7C,EAAW,cACT,OAAO,oBAAoB,YAAa,EAAQ,CACjD,OAEG,CACN,QAAQ,KACN,yGAED,GAEH,CAMW,EAAuB,MAA6B,CAC/D,GAA2B,CAE3B,EACE,EAAW,wBACX,EACD,EACD"}
1
+ {"version":3,"file":"useIframeClickInterceptor.mjs","names":[],"sources":["../../../src/editor/useIframeClickInterceptor.ts"],"sourcesContent":["import { MessageKey, mergeIframeClick } from '@intlayer/editor';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport const useIframeClickInterceptor = () => {\n useCrossFrameMessageListener<undefined>(MessageKey.INTLAYER_IFRAME_CLICKED);\n};\n\nexport const useIframeClickMerger = () => {\n useCrossFrameMessageListener<MessageEvent>(\n MessageKey.INTLAYER_IFRAME_CLICKED,\n mergeIframeClick\n );\n};\n"],"mappings":"sJAGA,MAAa,MAAkC,CAC7C,EAAwC,EAAW,wBAAwB,EAGhE,MAA6B,CACxC,EACE,EAAW,wBACX,EACD"}
@@ -1,9 +1,9 @@
1
1
  import { IInterpreterPluginState as IInterpreterPluginState$1 } from "../plugins.js";
2
+ import { Locale } from "../intlayer/dist/types/index.js";
2
3
  import * as _angular_core0 from "@angular/core";
3
4
  import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
4
5
  import { Dictionary } from "@intlayer/types/dictionary";
5
6
  import * as _intlayer_core_interpreter0 from "@intlayer/core/interpreter";
6
- import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
7
7
 
8
8
  //#region src/client/useDictionaryDynamic.d.ts
9
9
  /**
@@ -11,7 +11,7 @@ import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
11
11
  *
12
12
  * If the locale is not provided, it will use the locale from the client context
13
13
  */
14
- declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _angular_core0.Signal<_intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, _intlayer_types_allLocales0.Locale>>;
14
+ declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => _angular_core0.Signal<_intlayer_core_interpreter0.DeepTransformContent<T["content"], IInterpreterPluginState$1, Locale>>;
15
15
  //#endregion
16
16
  export { useDictionaryDynamic };
17
17
  //# sourceMappingURL=useDictionaryDynamic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;;;;cAea,oBAAA,aACD,UAAA,YACA,cAAA,EAEV,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,aAAA,KAAa,cAAA,CAAA,MAAA,CAAA,2BAAA,CAAA,oBAAA,CAAA,CAAA,aAAA,yBAAA,EAAA,2BAAA,CAAA,MAAA"}
1
+ {"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../../src/client/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;;;;cAea,oBAAA,aACD,UAAA,YACA,cAAA,EAEV,iBAAA,EAAmB,mBAAA,OAA0B,OAAA,CAAQ,CAAA,IACrD,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,aAAA,KAAa,cAAA,CAAA,MAAA,CAAA,2BAAA,CAAA,oBAAA,CAAA,CAAA,aAAA,yBAAA,EAAA,MAAA"}
@@ -1,6 +1,6 @@
1
+ import { Locale } from "../intlayer/dist/types/index.js";
1
2
  import * as _angular_core0 from "@angular/core";
2
3
  import { LocalesValues } from "@intlayer/types/module_augmentation";
3
- import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
4
4
 
5
5
  //#region src/client/useLocale.d.ts
6
6
  type useLocaleProps = {
@@ -39,8 +39,8 @@ declare const useLocale: ({
39
39
  onLocaleChange
40
40
  }?: useLocaleProps) => {
41
41
  locale: _angular_core0.Signal<"af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is" | "is-IS" | "id" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA" | (string & {})>;
42
- defaultLocale: _intlayer_types_allLocales0.Locale;
43
- availableLocales: _intlayer_types_allLocales0.Locale[];
42
+ defaultLocale: Locale;
43
+ availableLocales: Locale[];
44
44
  setLocale: (newLocale: LocalesValues) => void;
45
45
  };
46
46
  //#endregion
@@ -1,5 +1,5 @@
1
+ import { Locale } from "../intlayer/dist/types/index.js";
1
2
  import { LocalesValues } from "@intlayer/types/module_augmentation";
2
- import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
3
3
 
4
4
  //#region src/client/useLocaleStorage.d.ts
5
5
  /**
@@ -8,13 +8,13 @@ import * as _intlayer_types_allLocales0 from "@intlayer/types/allLocales";
8
8
  /**
9
9
  * Get the locale cookie
10
10
  */
11
- declare const localeInStorage: _intlayer_types_allLocales0.Locale;
11
+ declare const localeInStorage: Locale;
12
12
  /**
13
13
  * @deprecated Use localeInStorage instead
14
14
  *
15
15
  * Get the locale cookie
16
16
  */
17
- declare const localeCookie: _intlayer_types_allLocales0.Locale;
17
+ declare const localeCookie: Locale;
18
18
  /**
19
19
  * Set the locale cookie
20
20
  */
@@ -29,7 +29,7 @@ declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: boolean)
29
29
  * Hook that provides the locale storage and a function to set it
30
30
  */
31
31
  declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
32
- getLocale: () => _intlayer_types_allLocales0.Locale;
32
+ getLocale: () => Locale;
33
33
  setLocale: (locale: LocalesValues) => void;
34
34
  };
35
35
  /**
@@ -40,7 +40,7 @@ declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
40
40
  * Hook that provides the locale cookie and a function to set it
41
41
  */
42
42
  declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
43
- localeCookie: _intlayer_types_allLocales0.Locale;
43
+ localeCookie: Locale;
44
44
  setLocaleCookie: (locale: LocalesValues) => void;
45
45
  };
46
46
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":";;;;;;;AAcA;;;AAAA,cAAa,eAAA,EAA4D,2BAAA,CAA7C,MAAA;;AAM5B;;;;cAAa,YAAA,EAA8B,2BAAA,CAAlB,MAAA;AAKzB;;;AAAA,cAAa,kBAAA,GACX,MAAA,EAAQ,aAAA,EACR,eAAA;;;;;;cAYW,eAAA,GAAe,MAAA,EAblB,aAAA,EAAa,eAAA;;;;cAkBV,gBAAA,GAAoB,eAAA;mBAI7B,2BAAA,CAAA,MAAA;sBAAA,aAAA;AAAA;;AAJJ;;;;;;cAaa,eAAA,GAAmB,eAAA;gBAO/B,2BAAA,CAAA,MAAA;4BAAA,aAAA;AAAA"}
1
+ {"version":3,"file":"useLocaleStorage.d.ts","names":[],"sources":["../../../src/client/useLocaleStorage.ts"],"mappings":";;;;;;;AAcA;;;AAAA,cAAa,eAAA,EAA4D,MAAA;;AAMzE;;;;cAAa,YAAA,EAA8B,MAAA;AAK3C;;;AAAA,cAAa,kBAAA,GACX,MAAA,EAAQ,aAAA,EACR,eAAA;;;;;;cAYW,eAAA,GAAe,MAAA,EAblB,aAAA,EAAa,eAAA;;;;cAkBV,gBAAA,GAAoB,eAAA;mBAI7B,MAAA;sBAAA,aAAA;AAAA;;AAJJ;;;;;;cAaa,eAAA,GAAmB,eAAA;gBAO/B,MAAA;4BAAA,aAAA;AAAA"}
@@ -1,24 +1,21 @@
1
1
  import * as _angular_core0 from "@angular/core";
2
- import { NodeProps } from "@intlayer/core/interpreter";
2
+ import { OnInit } from "@angular/core";
3
3
 
4
4
  //#region src/editor/ContentSelectorWrapper.component.d.ts
5
- /**
6
- * Combine your NodeProps (which include dictionaryKey & keyPath)
7
- * with any other div-like attributes.
8
- */
9
- interface ContentSelectorWrapperProps extends NodeProps {
10
- [key: string]: any;
11
- }
12
- declare class ContentSelectorWrapperComponent {
5
+ declare class ContentSelectorWrapperComponent implements OnInit {
13
6
  dictionaryKey: string;
14
7
  keyPath: any[];
15
8
  private focusDictionary;
16
9
  private editorEnabled;
17
- constructor();
10
+ private manager;
11
+ ngOnInit(): void;
12
+ get filteredKeyPath(): any[];
18
13
  isSelected: _angular_core0.Signal<boolean>;
19
14
  enabled: _angular_core0.Signal<boolean>;
20
- handleSelect(): void;
15
+ handlePress(): void;
16
+ handleHover(): void;
17
+ handleUnhover(): void;
21
18
  }
22
19
  //#endregion
23
- export { ContentSelectorWrapperComponent, ContentSelectorWrapperProps };
20
+ export { ContentSelectorWrapperComponent };
24
21
  //# sourceMappingURL=ContentSelectorWrapper.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelectorWrapper.component.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"mappings":";;;;;;;AAcA;UAAiB,2BAAA,SAAoC,SAAA;EAAA,CAClD,GAAA;AAAA;AAAA,cAkBU,+BAAA;EACF,aAAA;EACA,OAAA;EAAA,QAGD,eAAA;EAAA,QACA,aAAA;;EAOR,UAAA,EAb0C,cAAA,CAahC,MAAA;EASV,OAAA,EATU,cAAA,CASH,MAAA;EAGP,YAAA,CAAA;AAAA"}
1
+ {"version":3,"file":"ContentSelectorWrapper.component.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"mappings":";;;;cA+Ba,+BAAA,YAA2C,MAAA;EAC7C,aAAA;EACA,OAAA;EAAA,QAED,eAAA;EAAA,QACA,aAAA;EAAA,QACA,OAAA;EAER,QAAA,CAAA;EAAA,IAII,eAAA,CAAA;EAIJ,UAAA,EAhB2C,cAAA,CAgBjC,MAAA;EASV,OAAA,EATU,cAAA,CASH,MAAA;EAEP,WAAA,CAAA;EAOA,WAAA,CAAA;EAOA,aAAA,CAAA;AAAA"}
@@ -1,32 +1,8 @@
1
- import { Injector } from "@angular/core";
2
-
3
1
  //#region src/editor/communicator.d.ts
4
- /**
5
- * Interface defining a cross-frame communicator
6
- */
7
- type Communicator = {
8
- postMessage: typeof window.postMessage;
9
- allowedOrigins?: string[];
2
+ declare const useCommunicator: () => {
3
+ postMessage: (data: any) => void;
10
4
  senderId: string;
11
5
  };
12
- /**
13
- * Configuration options for the communicator
14
- */
15
- type CommunicatorOptions = Omit<Communicator, 'senderId'>;
16
- /**
17
- * Creates a communicator client
18
- * @param options - Options for configuring the communicator
19
- */
20
- declare const createCommunicator: (options?: CommunicatorOptions) => Communicator;
21
- /**
22
- * Helper to install the Intlayer communicator into the injector
23
- */
24
- declare const installCommunicator: (_injector: Injector, options?: CommunicatorOptions) => void;
25
- /**
26
- * Hook to access the communicator
27
- * @returns The communicator instance
28
- */
29
- declare const useCommunicator: () => Communicator;
30
6
  //#endregion
31
- export { Communicator, CommunicatorOptions, createCommunicator, installCommunicator, useCommunicator };
7
+ export { useCommunicator };
32
8
  //# sourceMappingURL=communicator.d.ts.map