angular-intlayer 8.3.4 → 8.4.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/cjs/client/useDictionary.cjs +1 -1
  2. package/dist/cjs/client/useIntlayer.cjs +1 -1
  3. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  4. package/dist/cjs/editor/ContentSelector.component.cjs +9 -0
  5. package/dist/cjs/editor/ContentSelector.component.cjs.map +1 -0
  6. package/dist/cjs/editor/useEditor.cjs +1 -1
  7. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  8. package/dist/cjs/index.cjs +1 -1
  9. package/dist/cjs/plugins.cjs +1 -1
  10. package/dist/cjs/plugins.cjs.map +1 -1
  11. package/dist/esm/client/useDictionary.mjs +1 -1
  12. package/dist/esm/client/useIntlayer.mjs +1 -1
  13. package/dist/esm/client/useLocaleStorage.mjs +1 -1
  14. package/dist/esm/editor/ContentSelector.component.mjs +9 -0
  15. package/dist/esm/editor/ContentSelector.component.mjs.map +1 -0
  16. package/dist/esm/editor/useEditor.mjs +1 -1
  17. package/dist/esm/editor/useEditor.mjs.map +1 -1
  18. package/dist/esm/index.mjs +1 -1
  19. package/dist/esm/plugins.mjs +1 -1
  20. package/dist/esm/plugins.mjs.map +1 -1
  21. package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
  22. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  23. package/dist/types/client/useLocale.d.ts +3 -3
  24. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  25. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  26. package/dist/types/editor/ContentSelector.component.d.ts +9 -0
  27. package/dist/types/editor/ContentSelector.component.d.ts.map +1 -0
  28. package/dist/types/editor/useEditor.d.ts.map +1 -1
  29. package/package.json +8 -8
  30. package/dist/cjs/UI/ContentSelector.component.cjs +0 -20
  31. package/dist/cjs/UI/ContentSelector.component.cjs.map +0 -1
  32. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +0 -16
  33. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +0 -1
  34. package/dist/cjs/editor/EditedContentRenderer.component.cjs +0 -2
  35. package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +0 -1
  36. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs +0 -14
  37. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs.map +0 -1
  38. package/dist/cjs/editor/communicator.cjs +0 -2
  39. package/dist/cjs/editor/communicator.cjs.map +0 -1
  40. package/dist/cjs/editor/configuration.cjs +0 -2
  41. package/dist/cjs/editor/configuration.cjs.map +0 -1
  42. package/dist/cjs/editor/createSharedComposable.cjs +0 -2
  43. package/dist/cjs/editor/createSharedComposable.cjs.map +0 -1
  44. package/dist/cjs/editor/dictionariesRecord.cjs +0 -2
  45. package/dist/cjs/editor/dictionariesRecord.cjs.map +0 -1
  46. package/dist/cjs/editor/editedContent.cjs +0 -2
  47. package/dist/cjs/editor/editedContent.cjs.map +0 -1
  48. package/dist/cjs/editor/editorEnabled.cjs +0 -2
  49. package/dist/cjs/editor/editorEnabled.cjs.map +0 -1
  50. package/dist/cjs/editor/editorLocale.cjs +0 -2
  51. package/dist/cjs/editor/editorLocale.cjs.map +0 -1
  52. package/dist/cjs/editor/focusDictionary.cjs +0 -2
  53. package/dist/cjs/editor/focusDictionary.cjs.map +0 -1
  54. package/dist/cjs/editor/index.cjs +0 -1
  55. package/dist/cjs/editor/installIntlayerEditor.cjs +0 -2
  56. package/dist/cjs/editor/installIntlayerEditor.cjs.map +0 -1
  57. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +0 -2
  58. package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +0 -1
  59. package/dist/cjs/editor/useCrossFrameState.cjs +0 -2
  60. package/dist/cjs/editor/useCrossFrameState.cjs.map +0 -1
  61. package/dist/cjs/editor/useCrossURLPathState.cjs +0 -2
  62. package/dist/cjs/editor/useCrossURLPathState.cjs.map +0 -1
  63. package/dist/cjs/editor/useEditedContentRenderer.cjs +0 -2
  64. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +0 -1
  65. package/dist/cjs/editor/useIframeClickInterceptor.cjs +0 -2
  66. package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +0 -1
  67. package/dist/esm/UI/ContentSelector.component.mjs +0 -20
  68. package/dist/esm/UI/ContentSelector.component.mjs.map +0 -1
  69. package/dist/esm/editor/ContentSelectorWrapper.component.mjs +0 -16
  70. package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +0 -1
  71. package/dist/esm/editor/EditedContentRenderer.component.mjs +0 -2
  72. package/dist/esm/editor/EditedContentRenderer.component.mjs.map +0 -1
  73. package/dist/esm/editor/EditorSelectorRenderer.component.mjs +0 -14
  74. package/dist/esm/editor/EditorSelectorRenderer.component.mjs.map +0 -1
  75. package/dist/esm/editor/communicator.mjs +0 -2
  76. package/dist/esm/editor/communicator.mjs.map +0 -1
  77. package/dist/esm/editor/configuration.mjs +0 -2
  78. package/dist/esm/editor/configuration.mjs.map +0 -1
  79. package/dist/esm/editor/createSharedComposable.mjs +0 -2
  80. package/dist/esm/editor/createSharedComposable.mjs.map +0 -1
  81. package/dist/esm/editor/dictionariesRecord.mjs +0 -2
  82. package/dist/esm/editor/dictionariesRecord.mjs.map +0 -1
  83. package/dist/esm/editor/editedContent.mjs +0 -2
  84. package/dist/esm/editor/editedContent.mjs.map +0 -1
  85. package/dist/esm/editor/editorEnabled.mjs +0 -2
  86. package/dist/esm/editor/editorEnabled.mjs.map +0 -1
  87. package/dist/esm/editor/editorLocale.mjs +0 -2
  88. package/dist/esm/editor/editorLocale.mjs.map +0 -1
  89. package/dist/esm/editor/focusDictionary.mjs +0 -2
  90. package/dist/esm/editor/focusDictionary.mjs.map +0 -1
  91. package/dist/esm/editor/index.mjs +0 -1
  92. package/dist/esm/editor/installIntlayerEditor.mjs +0 -2
  93. package/dist/esm/editor/installIntlayerEditor.mjs.map +0 -1
  94. package/dist/esm/editor/useCrossFrameMessageListener.mjs +0 -2
  95. package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +0 -1
  96. package/dist/esm/editor/useCrossFrameState.mjs +0 -2
  97. package/dist/esm/editor/useCrossFrameState.mjs.map +0 -1
  98. package/dist/esm/editor/useCrossURLPathState.mjs +0 -2
  99. package/dist/esm/editor/useCrossURLPathState.mjs.map +0 -1
  100. package/dist/esm/editor/useEditedContentRenderer.mjs +0 -2
  101. package/dist/esm/editor/useEditedContentRenderer.mjs.map +0 -1
  102. package/dist/esm/editor/useIframeClickInterceptor.mjs +0 -2
  103. package/dist/esm/editor/useIframeClickInterceptor.mjs.map +0 -1
  104. package/dist/types/UI/ContentSelector.component.d.ts +0 -34
  105. package/dist/types/UI/ContentSelector.component.d.ts.map +0 -1
  106. package/dist/types/editor/ContentSelectorWrapper.component.d.ts +0 -21
  107. package/dist/types/editor/ContentSelectorWrapper.component.d.ts.map +0 -1
  108. package/dist/types/editor/EditedContentRenderer.component.d.ts +0 -24
  109. package/dist/types/editor/EditedContentRenderer.component.d.ts.map +0 -1
  110. package/dist/types/editor/EditorSelectorRenderer.component.d.ts +0 -17
  111. package/dist/types/editor/EditorSelectorRenderer.component.d.ts.map +0 -1
  112. package/dist/types/editor/communicator.d.ts +0 -8
  113. package/dist/types/editor/communicator.d.ts.map +0 -1
  114. package/dist/types/editor/configuration.d.ts +0 -8
  115. package/dist/types/editor/configuration.d.ts.map +0 -1
  116. package/dist/types/editor/createSharedComposable.d.ts +0 -16
  117. package/dist/types/editor/createSharedComposable.d.ts.map +0 -1
  118. package/dist/types/editor/dictionariesRecord.d.ts +0 -13
  119. package/dist/types/editor/dictionariesRecord.d.ts.map +0 -1
  120. package/dist/types/editor/editedContent.d.ts +0 -34
  121. package/dist/types/editor/editedContent.d.ts.map +0 -1
  122. package/dist/types/editor/editorEnabled.d.ts +0 -9
  123. package/dist/types/editor/editorEnabled.d.ts.map +0 -1
  124. package/dist/types/editor/editorLocale.d.ts +0 -6
  125. package/dist/types/editor/editorLocale.d.ts.map +0 -1
  126. package/dist/types/editor/focusDictionary.d.ts +0 -13
  127. package/dist/types/editor/focusDictionary.d.ts.map +0 -1
  128. package/dist/types/editor/index.d.ts +0 -16
  129. package/dist/types/editor/installIntlayerEditor.d.ts +0 -9
  130. package/dist/types/editor/installIntlayerEditor.d.ts.map +0 -1
  131. package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -7
  132. package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +0 -1
  133. package/dist/types/editor/useCrossFrameState.d.ts +0 -12
  134. package/dist/types/editor/useCrossFrameState.d.ts.map +0 -1
  135. package/dist/types/editor/useCrossURLPathState.d.ts +0 -6
  136. package/dist/types/editor/useCrossURLPathState.d.ts.map +0 -1
  137. package/dist/types/editor/useEditedContentRenderer.d.ts +0 -21
  138. package/dist/types/editor/useEditedContentRenderer.d.ts.map +0 -1
  139. package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -6
  140. package/dist/types/editor/useIframeClickInterceptor.d.ts.map +0 -1
  141. package/dist/types/intlayer/dist/types/index.d.ts +0 -3
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentSelectorWrapper.component.cjs","names":["useFocusDictionary","useEditorEnabled","getEditorStateManager","NodeType","MessageKey","CommonModule","CUSTOM_ELEMENTS_SCHEMA"],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/common';\nimport { Component, computed, Input, type OnInit } from '@angular/core';\nimport type { NodeProps } from '@intlayer/core/interpreter';\nimport { isSameKeyPath } from '@intlayer/core/utils';\nimport { defineIntlayerElements, MessageKey } from '@intlayer/editor';\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useFocusDictionary } from './focusDictionary';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\n@Component({\n selector: 'app-content-selector-wrapper',\n standalone: true,\n imports: [CommonModule],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ng-container *ngIf=\"enabled(); else plainContent\">\n <intlayer-content-selector\n [attr.is-selecting]=\"isSelected() || null\"\n (intlayer:press)=\"handlePress()\"\n (intlayer:hover)=\"handleHover()\"\n (intlayer:unhover)=\"handleUnhover()\"\n >\n <ng-content></ng-content>\n </intlayer-content-selector>\n </ng-container>\n <ng-template #plainContent>\n <ng-content></ng-content>\n </ng-template>\n `,\n})\nexport class ContentSelectorWrapperComponent implements OnInit {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n\n private focusDictionary = useFocusDictionary();\n private editorEnabled = useEditorEnabled();\n private manager = getEditorStateManager();\n\n ngOnInit() {\n defineIntlayerElements();\n }\n\n get filteredKeyPath() {\n return this.keyPath.filter((key) => key.type !== NodeType.Translation);\n }\n\n isSelected = computed(() => {\n const focused = this.focusDictionary.focusedContent();\n return (\n focused?.dictionaryKey === this.dictionaryKey &&\n (focused.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(focused.keyPath ?? [], this.filteredKeyPath)\n );\n });\n\n enabled = computed(() => this.editorEnabled.enabled());\n\n handlePress() {\n this.focusDictionary.setFocusedContent?.({\n dictionaryKey: this.dictionaryKey,\n keyPath: this.filteredKeyPath,\n });\n }\n\n handleHover() {\n this.manager?.messenger.send(\n `${MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,\n { dictionaryKey: this.dictionaryKey, keyPath: this.filteredKeyPath }\n );\n }\n\n handleUnhover() {\n this.manager?.messenger.send(\n `${MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,\n null\n );\n }\n}\n"],"mappings":"qiBA+BO,EAAA,KAAwD,CAC7D,cACA,QAEA,gBAA0BA,EAAAA,oBAAoB,CAC9C,cAAwBC,EAAAA,kBAAkB,CAC1C,QAAkBC,EAAAA,uBAAuB,CAEzC,UAAW,EACT,EAAA,EAAA,yBAAwB,CAG1B,IAAI,iBAAkB,CACpB,OAAO,KAAK,QAAQ,OAAQ,GAAQ,EAAI,OAASC,EAAAA,SAAS,YAAY,CAGxE,YAAA,EAAA,EAAA,cAA4B,CAC1B,IAAM,EAAU,KAAK,gBAAgB,gBAAgB,CACrD,OACE,GAAS,gBAAkB,KAAK,gBAC/B,EAAQ,SAAS,QAAU,GAAK,IAAA,EAAA,EAAA,eACnB,EAAQ,SAAW,EAAE,CAAE,KAAK,gBAAgB,EAE5D,CAEF,SAAA,EAAA,EAAA,cAAyB,KAAK,cAAc,SAAS,CAAC,CAEtD,aAAc,CACZ,KAAK,gBAAgB,oBAAoB,CACvC,cAAe,KAAK,cACpB,QAAS,KAAK,gBACf,CAAC,CAGJ,aAAc,CACZ,KAAK,SAAS,UAAU,KACtB,GAAGC,EAAAA,WAAW,iCAAiC,OAC/C,CAAE,cAAe,KAAK,cAAe,QAAS,KAAK,gBAAiB,CACrE,CAGH,eAAgB,CACd,KAAK,SAAS,UAAU,KACtB,GAAGA,EAAAA,WAAW,iCAAiC,OAC/C,KACD,8BA5CK,CAAA,EAAA,mBAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,gBAAA,IAAA,GAAA,4BACA,CAAA,EAAA,mBAAA,cAAA,MAAA,CAAA,CAAA,EAAA,UAAA,UAAA,IAAA,GAAA,iCAvBC,CACT,SAAU,+BACV,WAAY,GACZ,QAAS,CAACC,EAAAA,aAAa,CACvB,QAAS,CAACC,EAAAA,uBAAuB,CACjC,SAAU;;;;;;;;;;;;;;IAeX,CAAC,CAAA,CAAA,EAAA"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.cjs`),t=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs`),n=require(`./useEditedContentRenderer.cjs`);let r=require(`@intlayer/core/interpreter`),i=require(`@angular/common`),a=require(`@angular/core`),o=class{dictionaryKey;keyPath;locale;fallback=(0,a.signal)(``);rawContent=(0,a.computed)(()=>n.useEditedContentRenderer(this.dictionaryKey,this.keyPath,this.fallback));renderedContent=(0,a.computed)(()=>{let e=this.rawContent();if(typeof e==`object`&&e){let t=(0,r.getContent)(e,{dictionaryKey:this.dictionaryKey,keyPath:this.keyPath,locale:this.locale},(0,r.getBasePlugins)(this.locale));return typeof t==`string`?t:(console.error(`Incorrect edited content format. Content type: ${typeof t}. Expected string. Value ${JSON.stringify(t)}`),this.fallback())}return e()})};t.__decorate([(0,a.Input)(),e.__decorateMetadata(`design:type`,String)],o.prototype,`dictionaryKey`,void 0),t.__decorate([(0,a.Input)(),e.__decorateMetadata(`design:type`,Array)],o.prototype,`keyPath`,void 0),t.__decorate([(0,a.Input)(),e.__decorateMetadata(`design:type`,Object)],o.prototype,`locale`,void 0),o=t.__decorate([(0,a.Component)({selector:`app-edited-content-renderer`,standalone:!0,imports:[i.CommonModule],template:` <span [innerHTML]="renderedContent()"></span> `})],o),Object.defineProperty(exports,`EditedContentRendererComponent`,{enumerable:!0,get:function(){return o}});
2
- //# sourceMappingURL=EditedContentRenderer.component.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditedContentRenderer.component.cjs","names":["useEditedContentRenderer","CommonModule"],"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":"saAoBO,EAAA,KAAqC,CAC1C,cACA,QACA,OAEA,UAAQ,EAAA,EAAA,QAAkB,GAAG,CAE7B,YAAQ,EAAA,EAAA,cACCA,EAAAA,yBACL,KAAK,cACL,KAAK,QACL,KAAK,SACN,CACD,CAKF,iBAAA,EAAA,EAAA,cAAiC,CAC/B,IAAM,EAAkB,KAAK,YAAY,CAEzC,GAAI,OAAO,GAAoB,UAAY,EAA0B,CACnE,IAAM,GAAA,EAAA,EAAA,YACJ,EACA,CACE,cAAe,KAAK,cACpB,QAAS,KAAK,QACd,OAAQ,KAAK,OACd,EAAA,EAAA,EAAA,gBACc,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,6BA3CM,CAAA,EAAA,mBAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,gBAAA,IAAA,GAAA,4BACA,CAAA,EAAA,mBAAA,cAAA,MAAA,CAAA,CAAA,EAAA,UAAA,UAAA,IAAA,GAAA,4BACA,CAAA,EAAA,mBAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,SAAA,IAAA,GAAA,iCATC,CACT,SAAU,8BACV,WAAY,GACZ,QAAS,CAACC,EAAAA,aAAa,CACvB,SAAU,kDACX,CAAC,CAAA,CAAA,EAAA"}
@@ -1,14 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.cjs`),t=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs`),n=require(`./ContentSelectorWrapper.component.cjs`),r=require(`./EditedContentRenderer.component.cjs`);let i=require(`@angular/common`),a=require(`@angular/core`),o=class{dictionaryKey;keyPath};t.__decorate([(0,a.Input)(),e.__decorateMetadata(`design:type`,String)],o.prototype,`dictionaryKey`,void 0),t.__decorate([(0,a.Input)(),e.__decorateMetadata(`design:type`,Array)],o.prototype,`keyPath`,void 0),o=t.__decorate([(0,a.Component)({selector:`app-editor-selector-renderer`,standalone:!0,imports:[i.CommonModule,n.ContentSelectorWrapperComponent,r.EditedContentRendererComponent],template:`
2
- <app-content-selector-wrapper
3
- [dictionaryKey]="dictionaryKey"
4
- [keyPath]="keyPath"
5
- >
6
- <app-edited-content-renderer
7
- [dictionaryKey]="dictionaryKey"
8
- [keyPath]="keyPath"
9
- >
10
- <ng-content></ng-content>
11
- </app-edited-content-renderer>
12
- </app-content-selector-wrapper>
13
- `})],o),Object.defineProperty(exports,`EditorSelectorRendererComponent`,{enumerable:!0,get:function(){return o}});
14
- //# sourceMappingURL=EditorSelectorRenderer.component.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorSelectorRenderer.component.cjs","names":["CommonModule","ContentSelectorWrapperComponent","EditedContentRendererComponent"],"sources":["../../../src/editor/EditorSelectorRenderer.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport type { NodeProps } from '@intlayer/core/interpreter';\nimport { ContentSelectorWrapperComponent } from './ContentSelectorWrapper.component';\nimport { EditedContentRendererComponent } from './EditedContentRenderer.component';\n\n/**\n * Combine your NodeProps (which include dictionaryKey & keyPath)\n * with any other div-like attributes.\n */\nexport interface EditorSelectorRendererProps extends NodeProps {\n [key: string]: any;\n}\n\n@Component({\n selector: 'app-editor-selector-renderer',\n standalone: true,\n imports: [\n CommonModule,\n ContentSelectorWrapperComponent,\n EditedContentRendererComponent,\n ],\n template: `\n <app-content-selector-wrapper\n [dictionaryKey]=\"dictionaryKey\"\n [keyPath]=\"keyPath\"\n >\n <app-edited-content-renderer\n [dictionaryKey]=\"dictionaryKey\"\n [keyPath]=\"keyPath\"\n >\n <ng-content></ng-content>\n </app-edited-content-renderer>\n </app-content-selector-wrapper>\n `,\n})\nexport class EditorSelectorRendererComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n}\n"],"mappings":"ybAoCO,EAAA,KAAsC,CAC3C,cACA,oCADQ,CAAA,EAAA,mBAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,gBAAA,IAAA,GAAA,4BACA,CAAA,EAAA,mBAAA,cAAA,MAAA,CAAA,CAAA,EAAA,UAAA,UAAA,IAAA,GAAA,iCAxBC,CACT,SAAU,+BACV,WAAY,GACZ,QAAS,CACPA,EAAAA,aACAC,EAAAA,gCACAC,EAAAA,+BACD,CACD,SAAU;;;;;;;;;;;;IAaX,CAAC,CAAA,CAAA,EAAA"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./installIntlayerEditor.cjs`),t=()=>{let t=e.getEditorStateManager();return t?{postMessage:e=>t.messenger.send(e.type,e.data),senderId:t.messenger.senderId}:null};exports.useCommunicator=t;
2
- //# sourceMappingURL=communicator.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"communicator.cjs","names":["getEditorStateManager"],"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":"kHAEa,MAAwB,CACnC,IAAM,EAAUA,EAAAA,uBAAuB,CAEvC,OADK,EACE,CACL,YAAc,GAAc,EAAQ,UAAU,KAAK,EAAK,KAAM,EAAK,KAAK,CACxE,SAAU,EAAQ,UAAU,SAC7B,CAJoB"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`);const n=()=>{let n=e.getEditorStateManager(),r=(0,t.signal)(n?.configuration.value);if(n){let e=e=>r.set(e.detail);n.configuration.addEventListener(`change`,e);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(()=>n.configuration.removeEventListener(`change`,e))}catch{}}return r.asReadonly()};exports.useConfiguration=n;
2
- //# sourceMappingURL=configuration.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configuration.cjs","names":["getEditorStateManager","DestroyRef"],"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":"8LAIA,MAAa,MAAyB,CACpC,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,GAAA,EAAA,EAAA,QACJ,GAAS,cAAc,MACxB,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAO,IAAK,EAAkC,OAAO,CACvD,EAAQ,cAAc,iBAAiB,SAAU,EAAQ,CAEzD,GAAI,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,cAAc,oBAAoB,SAAU,EAAQ,CAC7D,MACK,GAGV,OAAO,EAAO,YAAY"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@angular/core`);function t(t){try{let n=(0,e.inject)(e.DestroyRef,{optional:!0});return n?(n.onDestroy(t),!0):!1}catch{return!1}}const n=e=>{let n=0,r,i,a=()=>{--n,i&&n<=0&&(i(),r=void 0,i=void 0)};return((...o)=>(n+=1,r?t(a):(r=e(...o),t(a)&&(i=a)),r))};exports.createSharedComposable=n,exports.tryOnScopeDispose=t;
2
- //# sourceMappingURL=createSharedComposable.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createSharedComposable.cjs","names":["DestroyRef"],"sources":["../../../src/editor/createSharedComposable.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\n\ntype AnyFn = (...args: any[]) => any;\n\nexport type SharedComposableReturn<T extends AnyFn = AnyFn> = T;\n\n/**\n * Angular replacement for Vue's tryOnScopeDispose\n * Uses Angular's DestroyRef to handle cleanup when the injection context is destroyed\n */\nexport function tryOnScopeDispose(fn: () => void) {\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n if (destroyRef) {\n destroyRef.onDestroy(fn);\n return true;\n }\n return false;\n } catch {\n // If called outside injection context, return false\n return false;\n }\n}\n\n/**\n * Angular equivalent of Vue's createSharedComposable\n * Creates a singleton pattern for services/composables\n */\nexport const createSharedComposable = <Fn extends AnyFn>(\n composable: Fn\n): SharedComposableReturn<Fn> => {\n let subscribers = 0;\n let state: ReturnType<Fn> | undefined;\n let cleanupFn: (() => void) | undefined;\n\n const dispose = () => {\n subscribers -= 1;\n if (cleanupFn && subscribers <= 0) {\n cleanupFn();\n state = undefined;\n cleanupFn = undefined;\n }\n };\n\n return <Fn>((...args) => {\n subscribers += 1;\n if (!state) {\n state = composable(...args);\n // Set up cleanup when the first subscriber is destroyed\n if (tryOnScopeDispose(dispose)) {\n cleanupFn = dispose;\n }\n } else {\n // For additional subscribers, just set up their individual cleanup\n tryOnScopeDispose(dispose);\n }\n return state;\n });\n};\n"],"mappings":"+IAUA,SAAgB,EAAkB,EAAgB,CAChD,GAAI,CACF,IAAM,GAAA,EAAA,EAAA,QAAoBA,EAAAA,WAAY,CAAE,SAAU,GAAM,CAAC,CAKzD,OAJI,GACF,EAAW,UAAU,EAAG,CACjB,IAEF,QACD,CAEN,MAAO,IAQX,MAAa,EACX,GAC+B,CAC/B,IAAI,EAAc,EACd,EACA,EAEE,MAAgB,CACpB,IACI,GAAa,GAAe,IAC9B,GAAW,CACX,EAAQ,IAAA,GACR,EAAY,IAAA,KAIhB,QAAa,GAAG,KACd,GAAe,EACV,EAQH,EAAkB,EAAQ,EAP1B,EAAQ,EAAW,GAAG,EAAK,CAEvB,EAAkB,EAAQ,GAC5B,EAAY,IAMT"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`);const n=()=>{let n=e.getEditorStateManager(),r=(0,t.signal)(n?.localeDictionaries.value??{});if(n){let e=e=>r.set(e.detail??{});n.localeDictionaries.addEventListener(`change`,e);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(()=>n.localeDictionaries.removeEventListener(`change`,e))}catch{}}return{localeDictionaries:r.asReadonly(),setLocaleDictionaries:e=>n?.localeDictionaries.set(e),setLocaleDictionary:e=>n?.setLocaleDictionary(e)}};exports.useDictionariesRecord=n;
2
- //# sourceMappingURL=dictionariesRecord.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dictionariesRecord.cjs","names":["getEditorStateManager","DestroyRef"],"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":"8LAOA,MAAa,MAA8B,CACzC,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,GAAA,EAAA,EAAA,QACJ,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,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,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 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`);const n=()=>{let n=e.getEditorStateManager(),r=(0,t.signal)(n?.editedContent.value);if(n){let e=e=>r.set(e.detail);n.editedContent.addEventListener(`change`,e);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(()=>n.editedContent.removeEventListener(`change`,e))}catch{}}return{editedContent:r.asReadonly(),setEditedContentState:e=>n?.editedContent.set(e),setEditedDictionary:e=>n?.setEditedDictionary(e),setEditedContent:(e,t)=>n?.setEditedContent(e,t),addEditedContent:(e,t,r,i)=>n?.addContent(e,t,r,i),renameEditedContent:(e,t,r)=>n?.renameContent(e,t,r),removeEditedContent:(e,t)=>n?.removeContent(e,t),restoreEditedContent:e=>n?.restoreContent(e),clearEditedDictionaryContent:e=>n?.clearContent(e),clearEditedContent:()=>n?.clearAllContent(),getEditedContentValue:(e,t)=>n?.getContentValue(e,t)}},r=()=>{let{editedContent:e,...t}=n();return t};exports.useEditedContent=n,exports.useEditedContentActions=r;
2
- //# sourceMappingURL=editedContent.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editedContent.cjs","names":["getEditorStateManager","DestroyRef"],"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":"8LAUA,MAAa,MAAyB,CACpC,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,GAAA,EAAA,EAAA,QACJ,GAAS,cAAc,MACxB,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAc,IAAK,EAAqC,OAAO,CACjE,EAAQ,cAAc,iBAAiB,SAAU,EAAQ,CAEzD,GAAI,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,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 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`);const n=()=>{let n=e.getEditorStateManager(),r=(0,t.signal)(n?.editorEnabled.value??!1);if(n){let e=e=>r.set(e.detail);n.editorEnabled.addEventListener(`change`,e);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(()=>n.editorEnabled.removeEventListener(`change`,e))}catch{}}return{enabled:r.asReadonly()}};exports.useEditorEnabled=n;
2
- //# sourceMappingURL=editorEnabled.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editorEnabled.cjs","names":["getEditorStateManager","DestroyRef"],"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":"8LAGA,MAAa,MAAyB,CACpC,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,GAAA,EAAA,EAAA,QAA0B,GAAS,cAAc,OAAS,GAAM,CAEtE,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAQ,IAAK,EAA2B,OAAO,CACjD,EAAQ,cAAc,iBAAiB,SAAU,EAAQ,CAEzD,GAAI,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,cACV,EAAQ,cAAc,oBAAoB,SAAU,EAAQ,CAC7D,MACK,GAGV,MAAO,CAAE,QAAS,EAAQ,YAAY,CAAE"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`),t=require(`../client/installIntlayer.cjs`);let n=require(`@angular/core`);const r=()=>{let r=e.getEditorStateManager(),i=(0,n.inject)(t.INTLAYER_TOKEN,{optional:!0});return i&&r&&(0,n.effect)(()=>{let e=i.locale();r.currentLocale.set(e)}),i};exports.useEditorLocale=r;
2
- //# sourceMappingURL=editorLocale.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editorLocale.cjs","names":["getEditorStateManager","INTLAYER_TOKEN"],"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":"yOAKA,MAAa,MAAwB,CACnC,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,GAAA,EAAA,EAAA,QAAkCC,EAAAA,eAAgB,CACtD,SAAU,GACX,CAAQ,CAST,OAPI,GAAU,IACZ,EAAA,EAAA,YAAa,CACX,IAAM,EAAS,EAAO,QAAQ,CAC9B,EAAQ,cAAc,IAAI,EAAiB,EAC3C,CAGG"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`);const n=()=>{let n=e.getEditorStateManager(),r=(0,t.signal)(n?.focusedContent.value??null);if(n){let e=e=>r.set(e.detail);n.focusedContent.addEventListener(`change`,e);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(()=>n.focusedContent.removeEventListener(`change`,e))}catch{}}return{focusedContent:r.asReadonly(),setFocusedContent:e=>n?.focusedContent.set(e),setFocusedContentKeyPath:e=>n?.setFocusedContentKeyPath(e)}};exports.useFocusDictionary=n;
2
- //# sourceMappingURL=focusDictionary.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"focusDictionary.cjs","names":["getEditorStateManager","DestroyRef"],"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":"8LAOA,MAAa,MAA2B,CACtC,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,GAAA,EAAA,EAAA,QACJ,GAAS,eAAe,OAAS,KAClC,CAED,GAAI,EAAS,CACX,IAAM,EAAW,GACf,EAAe,IAAK,EAAsC,OAAO,CACnE,EAAQ,eAAe,iBAAiB,SAAU,EAAQ,CAE1D,GAAI,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,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 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./installIntlayerEditor.cjs`),t=require(`./editorEnabled.cjs`),n=require(`./focusDictionary.cjs`),r=require(`./ContentSelectorWrapper.component.cjs`),i=require(`./communicator.cjs`),a=require(`./configuration.cjs`),o=require(`./dictionariesRecord.cjs`),s=require(`./EditedContentRenderer.component.cjs`),c=require(`./EditorSelectorRenderer.component.cjs`),l=require(`./editedContent.cjs`),u=require(`./editorLocale.cjs`),d=require(`./useCrossFrameMessageListener.cjs`),f=require(`./useCrossFrameState.cjs`),p=require(`./useIframeClickInterceptor.cjs`),m=require(`./useEditor.cjs`);Object.defineProperty(exports,`ContentSelectorWrapperComponent`,{enumerable:!0,get:function(){return r.ContentSelectorWrapperComponent}}),Object.defineProperty(exports,`EditedContentRendererComponent`,{enumerable:!0,get:function(){return s.EditedContentRendererComponent}}),Object.defineProperty(exports,`EditorSelectorRendererComponent`,{enumerable:!0,get:function(){return c.EditorSelectorRendererComponent}}),exports.getEditorStateManager=e.getEditorStateManager,exports.installIntlayerEditor=e.installIntlayerEditor,exports.useCommunicator=i.useCommunicator,exports.useConfiguration=a.useConfiguration,exports.useCrossFrameMessageListener=d.useCrossFrameMessageListener,exports.useCrossFrameState=f.useCrossFrameState,exports.useDictionariesRecord=o.useDictionariesRecord,exports.useEditedContent=l.useEditedContent,exports.useEditedContentActions=l.useEditedContentActions,exports.useEditor=m.useEditor,exports.useEditorEnabled=t.useEditorEnabled,exports.useEditorLocale=u.useEditorLocale,exports.useFocusDictionary=n.useFocusDictionary,exports.useIframeClickInterceptor=p.useIframeClickInterceptor,exports.useIframeClickMerger=p.useIframeClickMerger;
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@intlayer/config/built`);t=e.__toESM(t);let n=require(`@intlayer/editor`);const{editor:r}=t.default??{},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=e=>{if(a)return;let r=new n.EditorStateManager({mode:`client`,messenger:i(),configuration:t.default});a=r,(0,n.defineIntlayerElements)(),r.start()},s=()=>a;exports.getEditorStateManager=s,exports.installIntlayerEditor=o;
2
- //# sourceMappingURL=installIntlayerEditor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"installIntlayerEditor.cjs","names":["configuration","EditorStateManager"],"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":"iNAQA,KAAM,CAAE,UAAWA,EAAAA,SAAiB,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,IAAIC,EAAAA,mBAAmB,CACrC,KAAM,SACN,UAAW,GAA6B,CACxC,cAAA,EAAA,QACD,CAAC,CAEF,EAAgB,GAChB,EAAA,EAAA,yBAAwB,CACxB,EAAQ,OAAO,EAGJ,MACX"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`);const n=(n,r)=>{let i=e.getEditorStateManager();if(r&&i){let e=i.messenger.subscribe(n,r);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(e)}catch{}}return e=>i?.messenger.send(n,e)};exports.useCrossFrameMessageListener=n;
2
- //# sourceMappingURL=useCrossFrameMessageListener.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCrossFrameMessageListener.cjs","names":["getEditorStateManager","DestroyRef"],"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":"8LAIA,MAAa,GACX,EACA,IACG,CACH,IAAM,EAAUA,EAAAA,uBAAuB,CAEvC,GAAI,GAAoB,EAAS,CAC/B,IAAM,EAAQ,EAAQ,UAAU,UAC9B,EACA,EACD,CAED,GAAI,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,CAAE,SAAU,GAAM,CAAC,EAC7C,UAAU,EAAM,MACtB,GAGV,MAAQ,IAAa,GAAS,UAAU,KAAK,EAAK,EAAK"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`);let t=require(`@angular/core`),n=require(`@intlayer/editor`);const r=(r,i,a={emit:!0,receive:!0})=>{let o=e.getEditorStateManager(),{emit:s=!0,receive:c=!0}=a,l=(0,t.signal)(i);if(o){let e=new n.CrossFrameStateManager(r,o.messenger,{emit:s,receive:c,initialValue:i});e.start();let a=e=>{l.set(e.detail)};e.addEventListener(`change`,a);try{(0,t.inject)(t.DestroyRef,{optional:!0})?.onDestroy(()=>{e.removeEventListener(`change`,a),e.stop()})}catch{}return[l.asReadonly(),t=>e.set(t),()=>e.postCurrentValue()]}return[l.asReadonly(),e=>l.set(e),()=>{}]};exports.useCrossFrameState=r;
2
- //# sourceMappingURL=useCrossFrameState.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCrossFrameState.cjs","names":["getEditorStateManager","CrossFrameStateManager","DestroyRef"],"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":"4NASA,MAAa,GACX,EACA,EACA,EAAkC,CAAE,KAAM,GAAM,QAAS,GAAM,GACH,CAC5D,IAAM,EAAUA,EAAAA,uBAAuB,CACjC,CAAE,OAAO,GAAM,UAAU,IAAS,EAClC,GAAA,EAAA,EAAA,QAAoC,EAAa,CAEvD,GAAI,EAAS,CACX,IAAM,EAAe,IAAIC,EAAAA,uBAA0B,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,EAEF,EAAA,EAAA,QAD0BC,EAAAA,WAAY,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 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=()=>{},t=()=>{};exports.useCrossURLPathSetter=e,exports.useCrossURLPathState=t;
2
- //# sourceMappingURL=useCrossURLPathState.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCrossURLPathState.cjs","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":"mEAEA,MAAa,MAA8B,GAI9B,MAA6B"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs`);let t=require(`@angular/core`);const n=new t.InjectionToken(`editedContentActions`);let r=class{useEditedContentRenderer(e,r,i){let a=(0,t.inject)(n,{optional:!0});return(0,t.computed)(()=>a?.getEditedContentValue(e,r)??i)}};r=e.__decorate([(0,t.Injectable)({providedIn:`root`})],r);const i=(e,n,i)=>(0,t.inject)(r).useEditedContentRenderer(e,n,i);exports.EDITED_CONTENT_ACTIONS_TOKEN=n,Object.defineProperty(exports,`EditedContentRendererService`,{enumerable:!0,get:function(){return r}}),exports.useEditedContentRenderer=i;
2
- //# sourceMappingURL=useEditedContentRenderer.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditedContentRenderer.cjs","names":["InjectionToken"],"sources":["../../../src/editor/useEditedContentRenderer.ts"],"sourcesContent":["import {\n computed,\n Injectable,\n InjectionToken,\n inject,\n type Signal,\n} from '@angular/core';\nimport type { KeyPath } from '@intlayer/types/keyPath';\n\nexport interface EditedContentActions {\n getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;\n}\n\nexport const EDITED_CONTENT_ACTIONS_TOKEN =\n new InjectionToken<EditedContentActions | null>('editedContentActions');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EditedContentRendererService {\n /**\n * Mirrors the React hook one-for-one.\n */\n useEditedContentRenderer(\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n ): Signal<unknown> {\n const editedContentContext = inject(EDITED_CONTENT_ACTIONS_TOKEN, {\n optional: true,\n });\n\n return computed(() => {\n const edited = editedContentContext?.getEditedContentValue(\n dictionaryKey,\n keyPath\n ) as string | undefined;\n\n return edited ?? fallback;\n });\n }\n}\n\n/**\n * Standalone function that can be used like the Vue composable\n */\nexport const useEditedContentRenderer = (\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n): Signal<unknown> => {\n const service = inject(EditedContentRendererService);\n return service.useEditedContentRenderer(dictionaryKey, keyPath, fallback);\n};\n"],"mappings":"iOAaA,MAAa,EACX,IAAIA,EAAAA,eAA4C,uBAAuB,CAKlE,IAAA,EAAA,KAAmC,CAIxC,yBACE,EACA,EACA,EACiB,CACjB,IAAM,GAAA,EAAA,EAAA,QAA8B,EAA8B,CAChE,SAAU,GACX,CAAC,CAEF,OAAA,EAAA,EAAA,cACiB,GAAsB,sBACnC,EACA,EACD,EAEgB,EACjB,oCAvBM,CACV,WAAY,OACb,CAAC,CAAA,CAAA,EAAA,CA4BF,MAAa,GACX,EACA,EACA,KAGA,EAAA,EAAA,QADuB,EAA6B,CACrC,yBAAyB,EAAe,EAAS,EAAS"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./useCrossFrameMessageListener.cjs`);let t=require(`@intlayer/editor`);const n=()=>{e.useCrossFrameMessageListener(t.MessageKey.INTLAYER_IFRAME_CLICKED)},r=()=>{e.useCrossFrameMessageListener(t.MessageKey.INTLAYER_IFRAME_CLICKED,t.mergeIframeClick)};exports.useIframeClickInterceptor=n,exports.useIframeClickMerger=r;
2
- //# sourceMappingURL=useIframeClickInterceptor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIframeClickInterceptor.cjs","names":["MessageKey","mergeIframeClick"],"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":"wMAGA,MAAa,MAAkC,CAC7C,EAAA,6BAAwCA,EAAAA,WAAW,wBAAwB,EAGhE,MAA6B,CACxC,EAAA,6BACEA,EAAAA,WAAW,wBACXC,EAAAA,iBACD"}
@@ -1,20 +0,0 @@
1
- import{__decorateMetadata as e}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.mjs";import{__decorate as t}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{CommonModule as n}from"@angular/common";import{Component as r,EventEmitter as i,HostListener as a,Input as o,Output as s,ViewChild as c,computed as l,signal as u}from"@angular/core";var d;let f=class{onClickOutside;pressDuration;isSelecting;click=new i;press=new i;containerRef;isHovered=u(!1);isSelectingState=u(!1);pressTimerRef=null;isSelectingComputed=l(()=>this.isSelecting??this.isSelectingState());isStringSlot=l(()=>!0);ngOnInit(){this.isSelectingState.set(this.isSelecting??!1)}ngOnDestroy(){this.clearPressTimer()}onDocumentMouseDown(e){this.handleClickOutside(e)}handleOnLongPress(){this.isSelectingState.set(!0),this.press.emit()}startPressTimer(){this.pressTimerRef=setTimeout(()=>{this.handleOnLongPress()},this.pressDuration??250)}clearPressTimer(){this.pressTimerRef&&=(clearTimeout(this.pressTimerRef),null)}handleMouseDown(){this.clearPressTimer(),this.startPressTimer()}handleMouseUp(){this.isHovered.set(!1),this.clearPressTimer()}handleClickOutside(e){this.containerRef?.nativeElement&&!this.containerRef.nativeElement.contains(e.target)&&(this.isSelectingState.set(!1),this.onClickOutside?.())}handleClick(e){this.isSelectingComputed()&&(e.preventDefault(),e.stopPropagation()),this.click.emit(e)}handleBlur(){this.isSelectingState.set(!1)}onMouseEnter(){this.isHovered.set(!0)}getContainerStyle(){return{display:this.isStringSlot()?`inline`:`inline-block`,cursor:`pointer`,userSelect:`none`,borderRadius:`0.375rem`,outlineWidth:`2px`,outlineOffset:`4px`,outlineStyle:`solid`,outlineColor:this.isSelectingComputed()||this.isHovered()?`inherit`:`transparent`,transition:`all 100ms 50ms ease-in-out`}}};t([o(),e(`design:type`,Function)],f.prototype,`onClickOutside`,void 0),t([o(),e(`design:type`,Number)],f.prototype,`pressDuration`,void 0),t([o(),e(`design:type`,Boolean)],f.prototype,`isSelecting`,void 0),t([s(),e(`design:type`,Object)],f.prototype,`click`,void 0),t([s(),e(`design:type`,Object)],f.prototype,`press`,void 0),t([c(`containerRef`,{static:!0}),e(`design:type`,Object)],f.prototype,`containerRef`,void 0),t([a(`document:mousedown`,[`$event`]),e(`design:type`,Function),e(`design:paramtypes`,[typeof(d=typeof MouseEvent<`u`&&MouseEvent)==`function`?d:Object]),e(`design:returntype`,void 0)],f.prototype,`onDocumentMouseDown`,null),f=t([r({selector:`app-content-selector`,template:`
2
- <span
3
- #containerRef
4
- role="button"
5
- tabindex="0"
6
- (click)="handleClick($event)"
7
- (mousedown)="handleMouseDown()"
8
- (mouseup)="handleMouseUp()"
9
- (mouseleave)="handleMouseUp()"
10
- (touchstart)="handleMouseDown()"
11
- (touchend)="handleMouseUp()"
12
- (touchcancel)="handleMouseUp()"
13
- (blur)="handleBlur()"
14
- (mouseenter)="onMouseEnter()"
15
- [ngStyle]="getContainerStyle()"
16
- >
17
- <ng-content></ng-content>
18
- </span>
19
- `,standalone:!0,imports:[n]})],f);export{f as ContentSelectorComponent};
20
- //# sourceMappingURL=ContentSelector.component.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentSelector.component.mjs","names":[],"sources":["../../../src/UI/ContentSelector.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n Component,\n computed,\n type ElementRef,\n EventEmitter,\n HostListener,\n Input,\n type OnDestroy,\n type OnInit,\n Output,\n signal,\n ViewChild,\n} from '@angular/core';\n\nconst DEFAULT_PRESS_DETECT_DURATION = 250;\n\n@Component({\n selector: 'app-content-selector',\n template: `\n <span\n #containerRef\n role=\"button\"\n tabindex=\"0\"\n (click)=\"handleClick($event)\"\n (mousedown)=\"handleMouseDown()\"\n (mouseup)=\"handleMouseUp()\"\n (mouseleave)=\"handleMouseUp()\"\n (touchstart)=\"handleMouseDown()\"\n (touchend)=\"handleMouseUp()\"\n (touchcancel)=\"handleMouseUp()\"\n (blur)=\"handleBlur()\"\n (mouseenter)=\"onMouseEnter()\"\n [ngStyle]=\"getContainerStyle()\"\n >\n <ng-content></ng-content>\n </span>\n `,\n standalone: true,\n imports: [CommonModule],\n})\nexport class ContentSelectorComponent implements OnInit, OnDestroy {\n @Input() onClickOutside?: () => void;\n @Input() pressDuration?: number;\n @Input() isSelecting?: boolean;\n\n @Output() click = new EventEmitter<MouseEvent>();\n @Output() press = new EventEmitter<void>();\n\n @ViewChild('containerRef', { static: true })\n containerRef!: ElementRef<HTMLSpanElement>;\n\n private isHovered = signal(false);\n private isSelectingState = signal(false);\n private pressTimerRef: ReturnType<typeof setTimeout> | null = null;\n\n private readonly isSelectingComputed = computed(\n () => this.isSelecting ?? this.isSelectingState()\n );\n\n private readonly isStringSlot = computed(() => {\n // In Angular, we can't easily detect if content is just text\n // This would need to be determined differently or simplified\n return true; // Simplified for now\n });\n\n ngOnInit(): void {\n this.isSelectingState.set(this.isSelecting ?? false);\n }\n\n ngOnDestroy(): void {\n this.clearPressTimer();\n }\n\n @HostListener('document:mousedown', ['$event'])\n onDocumentMouseDown(event: MouseEvent): void {\n this.handleClickOutside(event);\n }\n\n private handleOnLongPress(): void {\n this.isSelectingState.set(true);\n this.press.emit();\n }\n\n private startPressTimer(): void {\n this.pressTimerRef = setTimeout(() => {\n this.handleOnLongPress();\n }, this.pressDuration ?? DEFAULT_PRESS_DETECT_DURATION);\n }\n\n private clearPressTimer(): void {\n if (this.pressTimerRef) {\n clearTimeout(this.pressTimerRef);\n this.pressTimerRef = null;\n }\n }\n\n handleMouseDown(): void {\n this.clearPressTimer();\n this.startPressTimer();\n }\n\n handleMouseUp(): void {\n this.isHovered.set(false);\n this.clearPressTimer();\n }\n\n private handleClickOutside(event: MouseEvent): void {\n if (\n this.containerRef?.nativeElement &&\n !this.containerRef.nativeElement.contains(event.target as Node)\n ) {\n this.isSelectingState.set(false);\n this.onClickOutside?.();\n }\n }\n\n handleClick(e: MouseEvent): void {\n if (this.isSelectingComputed()) {\n e.preventDefault();\n e.stopPropagation();\n }\n this.click.emit(e);\n }\n\n handleBlur(): void {\n this.isSelectingState.set(false);\n }\n\n onMouseEnter(): void {\n this.isHovered.set(true);\n }\n\n getContainerStyle(): { [key: string]: any } {\n return {\n display: this.isStringSlot() ? 'inline' : 'inline-block',\n cursor: 'pointer',\n userSelect: 'none',\n borderRadius: '0.375rem',\n outlineWidth: '2px',\n outlineOffset: '4px',\n outlineStyle: 'solid',\n outlineColor:\n this.isSelectingComputed() || this.isHovered()\n ? 'inherit'\n : 'transparent',\n transition: 'all 100ms 50ms ease-in-out',\n };\n }\n}\n"],"mappings":"2YAyCO,IAAA,EAAA,KAA4D,CACjE,eACA,cACA,YAEA,MAAkB,IAAI,EACtB,MAAkB,IAAI,EAEtB,aAGA,UAAoB,EAAO,GAAM,CACjC,iBAA2B,EAAO,GAAM,CACxC,cAA8D,KAE9D,oBAAuC,MAC/B,KAAK,aAAe,KAAK,kBAAkB,CAClD,CAED,aAAgC,MAGvB,GACP,CAEF,UAAiB,CACf,KAAK,iBAAiB,IAAI,KAAK,aAAe,GAAM,CAGtD,aAAoB,CAClB,KAAK,iBAAiB,CAGxB,oBACoB,EAAyB,CAC3C,KAAK,mBAAmB,EAAM,CAGhC,mBAAkC,CAChC,KAAK,iBAAiB,IAAI,GAAK,CAC/B,KAAK,MAAM,MAAM,CAGnB,iBAAgC,CAC9B,KAAK,cAAgB,eAAiB,CACpC,KAAK,mBAAmB,EACvB,KAAK,eAAiB,IAA8B,CAGzD,iBAAgC,CAC9B,AAEE,KAAK,iBADL,aAAa,KAAK,cAAc,CACX,MAIzB,iBAAwB,CACtB,KAAK,iBAAiB,CACtB,KAAK,iBAAiB,CAGxB,eAAsB,CACpB,KAAK,UAAU,IAAI,GAAM,CACzB,KAAK,iBAAiB,CAGxB,mBAA2B,EAAyB,CAEhD,KAAK,cAAc,eACnB,CAAC,KAAK,aAAa,cAAc,SAAS,EAAM,OAAe,GAE/D,KAAK,iBAAiB,IAAI,GAAM,CAChC,KAAK,kBAAkB,EAI3B,YAAY,EAAqB,CAC3B,KAAK,qBAAqB,GAC5B,EAAE,gBAAgB,CAClB,EAAE,iBAAiB,EAErB,KAAK,MAAM,KAAK,EAAE,CAGpB,YAAmB,CACjB,KAAK,iBAAiB,IAAI,GAAM,CAGlC,cAAqB,CACnB,KAAK,UAAU,IAAI,GAAK,CAG1B,mBAA4C,CAC1C,MAAO,CACL,QAAS,KAAK,cAAc,CAAG,SAAW,eAC1C,OAAQ,UACR,WAAY,OACZ,aAAc,WACd,aAAc,MACd,cAAe,MACf,aAAc,QACd,aACE,KAAK,qBAAqB,EAAI,KAAK,WAAW,CAC1C,UACA,cACN,WAAY,6BACb,MAzGF,GAAO,CAAA,EAAA,cAAA,SAAA,CAAA,CAAA,EAAA,UAAA,iBAAA,IAAA,GAAA,IACP,GAAO,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,gBAAA,IAAA,GAAA,IACP,GAAO,CAAA,EAAA,cAAA,QAAA,CAAA,CAAA,EAAA,UAAA,cAAA,IAAA,GAAA,IAEP,GAAQ,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,QAAA,IAAA,GAAA,IACR,GAAQ,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,QAAA,IAAA,GAAA,IAER,EAAU,eAAgB,CAAE,OAAQ,GAAM,CAAC,CAAA,EAAA,cAAA,OAAA,CAAA,CAAA,EAAA,UAAA,eAAA,IAAA,GAAA,IAyB3C,EAAa,qBAAsB,CAAC,SAAS,CAAC,iMAzDhD,EAAU,CACT,SAAU,uBACV,SAAU;;;;;;;;;;;;;;;;;;IAmBV,WAAY,GACZ,QAAS,CAAC,EAAa,CACxB,CAAC,CAAA,CAAA,EAAA"}
@@ -1,16 +0,0 @@
1
- import{getEditorStateManager as e}from"./installIntlayerEditor.mjs";import{useEditorEnabled as t}from"./editorEnabled.mjs";import{useFocusDictionary as n}from"./focusDictionary.mjs";import{__decorateMetadata as r}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.mjs";import{__decorate as i}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{NodeType as a}from"@intlayer/types/nodeType";import{CUSTOM_ELEMENTS_SCHEMA as o,CommonModule as s}from"@angular/common";import{Component as c,Input as l,computed as u}from"@angular/core";import{isSameKeyPath as d}from"@intlayer/core/utils";import{MessageKey as f,defineIntlayerElements as p}from"@intlayer/editor";let m=class{dictionaryKey;keyPath;focusDictionary=n();editorEnabled=t();manager=e();ngOnInit(){p()}get filteredKeyPath(){return this.keyPath.filter(e=>e.type!==a.Translation)}isSelected=u(()=>{let e=this.focusDictionary.focusedContent();return e?.dictionaryKey===this.dictionaryKey&&(e.keyPath?.length??0)>0&&d(e.keyPath??[],this.filteredKeyPath)});enabled=u(()=>this.editorEnabled.enabled());handlePress(){this.focusDictionary.setFocusedContent?.({dictionaryKey:this.dictionaryKey,keyPath:this.filteredKeyPath})}handleHover(){this.manager?.messenger.send(`${f.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,{dictionaryKey:this.dictionaryKey,keyPath:this.filteredKeyPath})}handleUnhover(){this.manager?.messenger.send(`${f.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,null)}};i([l(),r(`design:type`,String)],m.prototype,`dictionaryKey`,void 0),i([l(),r(`design:type`,Array)],m.prototype,`keyPath`,void 0),m=i([c({selector:`app-content-selector-wrapper`,standalone:!0,imports:[s],schemas:[o],template:`
2
- <ng-container *ngIf="enabled(); else plainContent">
3
- <intlayer-content-selector
4
- [attr.is-selecting]="isSelected() || null"
5
- (intlayer:press)="handlePress()"
6
- (intlayer:hover)="handleHover()"
7
- (intlayer:unhover)="handleUnhover()"
8
- >
9
- <ng-content></ng-content>
10
- </intlayer-content-selector>
11
- </ng-container>
12
- <ng-template #plainContent>
13
- <ng-content></ng-content>
14
- </ng-template>
15
- `})],m);export{m as ContentSelectorWrapperComponent};
16
- //# sourceMappingURL=ContentSelectorWrapper.component.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentSelectorWrapper.component.mjs","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/common';\nimport { Component, computed, Input, type OnInit } from '@angular/core';\nimport type { NodeProps } from '@intlayer/core/interpreter';\nimport { isSameKeyPath } from '@intlayer/core/utils';\nimport { defineIntlayerElements, MessageKey } from '@intlayer/editor';\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useFocusDictionary } from './focusDictionary';\nimport { getEditorStateManager } from './installIntlayerEditor';\n\n@Component({\n selector: 'app-content-selector-wrapper',\n standalone: true,\n imports: [CommonModule],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ng-container *ngIf=\"enabled(); else plainContent\">\n <intlayer-content-selector\n [attr.is-selecting]=\"isSelected() || null\"\n (intlayer:press)=\"handlePress()\"\n (intlayer:hover)=\"handleHover()\"\n (intlayer:unhover)=\"handleUnhover()\"\n >\n <ng-content></ng-content>\n </intlayer-content-selector>\n </ng-container>\n <ng-template #plainContent>\n <ng-content></ng-content>\n </ng-template>\n `,\n})\nexport class ContentSelectorWrapperComponent implements OnInit {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n\n private focusDictionary = useFocusDictionary();\n private editorEnabled = useEditorEnabled();\n private manager = getEditorStateManager();\n\n ngOnInit() {\n defineIntlayerElements();\n }\n\n get filteredKeyPath() {\n return this.keyPath.filter((key) => key.type !== NodeType.Translation);\n }\n\n isSelected = computed(() => {\n const focused = this.focusDictionary.focusedContent();\n return (\n focused?.dictionaryKey === this.dictionaryKey &&\n (focused.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(focused.keyPath ?? [], this.filteredKeyPath)\n );\n });\n\n enabled = computed(() => this.editorEnabled.enabled());\n\n handlePress() {\n this.focusDictionary.setFocusedContent?.({\n dictionaryKey: this.dictionaryKey,\n keyPath: this.filteredKeyPath,\n });\n }\n\n handleHover() {\n this.manager?.messenger.send(\n `${MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,\n { dictionaryKey: this.dictionaryKey, keyPath: this.filteredKeyPath }\n );\n }\n\n handleUnhover() {\n this.manager?.messenger.send(\n `${MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,\n null\n );\n }\n}\n"],"mappings":"+rBA+BO,IAAA,EAAA,KAAwD,CAC7D,cACA,QAEA,gBAA0B,GAAoB,CAC9C,cAAwB,GAAkB,CAC1C,QAAkB,GAAuB,CAEzC,UAAW,CACT,GAAwB,CAG1B,IAAI,iBAAkB,CACpB,OAAO,KAAK,QAAQ,OAAQ,GAAQ,EAAI,OAAS,EAAS,YAAY,CAGxE,WAAa,MAAe,CAC1B,IAAM,EAAU,KAAK,gBAAgB,gBAAgB,CACrD,OACE,GAAS,gBAAkB,KAAK,gBAC/B,EAAQ,SAAS,QAAU,GAAK,GACjC,EAAc,EAAQ,SAAW,EAAE,CAAE,KAAK,gBAAgB,EAE5D,CAEF,QAAU,MAAe,KAAK,cAAc,SAAS,CAAC,CAEtD,aAAc,CACZ,KAAK,gBAAgB,oBAAoB,CACvC,cAAe,KAAK,cACpB,QAAS,KAAK,gBACf,CAAC,CAGJ,aAAc,CACZ,KAAK,SAAS,UAAU,KACtB,GAAG,EAAW,iCAAiC,OAC/C,CAAE,cAAe,KAAK,cAAe,QAAS,KAAK,gBAAiB,CACrE,CAGH,eAAgB,CACd,KAAK,SAAS,UAAU,KACtB,GAAG,EAAW,iCAAiC,OAC/C,KACD,MA5CF,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,MAvBT,EAAU,CACT,SAAU,+BACV,WAAY,GACZ,QAAS,CAAC,EAAa,CACvB,QAAS,CAAC,EAAuB,CACjC,SAAU;;;;;;;;;;;;;;IAeX,CAAC,CAAA,CAAA,EAAA"}
@@ -1,2 +0,0 @@
1
- import{__decorateMetadata as e}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.mjs";import{__decorate as t}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{useEditedContentRenderer as n}from"./useEditedContentRenderer.mjs";import{getBasePlugins as r,getContent as i}from"@intlayer/core/interpreter";import{CommonModule as a}from"@angular/common";import{Component as o,Input as s,computed as c,signal as l}from"@angular/core";let u=class{dictionaryKey;keyPath;locale;fallback=l(``);rawContent=c(()=>n(this.dictionaryKey,this.keyPath,this.fallback));renderedContent=c(()=>{let e=this.rawContent();if(typeof e==`object`&&e){let t=i(e,{dictionaryKey:this.dictionaryKey,keyPath:this.keyPath,locale:this.locale},r(this.locale));return typeof t==`string`?t:(console.error(`Incorrect edited content format. Content type: ${typeof t}. Expected string. Value ${JSON.stringify(t)}`),this.fallback())}return e()})};t([s(),e(`design:type`,String)],u.prototype,`dictionaryKey`,void 0),t([s(),e(`design:type`,Array)],u.prototype,`keyPath`,void 0),t([s(),e(`design:type`,Object)],u.prototype,`locale`,void 0),u=t([o({selector:`app-edited-content-renderer`,standalone:!0,imports:[a],template:` <span [innerHTML]="renderedContent()"></span> `})],u);export{u as EditedContentRendererComponent};
2
- //# sourceMappingURL=EditedContentRenderer.component.mjs.map
@@ -1 +0,0 @@
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,14 +0,0 @@
1
- import{__decorateMetadata as e}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.mjs";import{__decorate as t}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{ContentSelectorWrapperComponent as n}from"./ContentSelectorWrapper.component.mjs";import{EditedContentRendererComponent as r}from"./EditedContentRenderer.component.mjs";import{CommonModule as i}from"@angular/common";import{Component as a,Input as o}from"@angular/core";let s=class{dictionaryKey;keyPath};t([o(),e(`design:type`,String)],s.prototype,`dictionaryKey`,void 0),t([o(),e(`design:type`,Array)],s.prototype,`keyPath`,void 0),s=t([a({selector:`app-editor-selector-renderer`,standalone:!0,imports:[i,n,r],template:`
2
- <app-content-selector-wrapper
3
- [dictionaryKey]="dictionaryKey"
4
- [keyPath]="keyPath"
5
- >
6
- <app-edited-content-renderer
7
- [dictionaryKey]="dictionaryKey"
8
- [keyPath]="keyPath"
9
- >
10
- <ng-content></ng-content>
11
- </app-edited-content-renderer>
12
- </app-content-selector-wrapper>
13
- `})],s);export{s as EditorSelectorRendererComponent};
14
- //# sourceMappingURL=EditorSelectorRenderer.component.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorSelectorRenderer.component.mjs","names":[],"sources":["../../../src/editor/EditorSelectorRenderer.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport type { NodeProps } from '@intlayer/core/interpreter';\nimport { ContentSelectorWrapperComponent } from './ContentSelectorWrapper.component';\nimport { EditedContentRendererComponent } from './EditedContentRenderer.component';\n\n/**\n * Combine your NodeProps (which include dictionaryKey & keyPath)\n * with any other div-like attributes.\n */\nexport interface EditorSelectorRendererProps extends NodeProps {\n [key: string]: any;\n}\n\n@Component({\n selector: 'app-editor-selector-renderer',\n standalone: true,\n imports: [\n CommonModule,\n ContentSelectorWrapperComponent,\n EditedContentRendererComponent,\n ],\n template: `\n <app-content-selector-wrapper\n [dictionaryKey]=\"dictionaryKey\"\n [keyPath]=\"keyPath\"\n >\n <app-edited-content-renderer\n [dictionaryKey]=\"dictionaryKey\"\n [keyPath]=\"keyPath\"\n >\n <ng-content></ng-content>\n </app-edited-content-renderer>\n </app-content-selector-wrapper>\n `,\n})\nexport class EditorSelectorRendererComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n}\n"],"mappings":"4dAoCO,IAAA,EAAA,KAAsC,CAC3C,cACA,YADC,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,MAxBT,EAAU,CACT,SAAU,+BACV,WAAY,GACZ,QAAS,CACP,EACA,EACA,EACD,CACD,SAAU;;;;;;;;;;;;IAaX,CAAC,CAAA,CAAA,EAAA"}
@@ -1,2 +0,0 @@
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
- //# sourceMappingURL=communicator.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=configuration.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import{DestroyRef as e,inject as t}from"@angular/core";function n(n){try{let r=t(e,{optional:!0});return r?(r.onDestroy(n),!0):!1}catch{return!1}}const r=e=>{let t=0,r,i,a=()=>{--t,i&&t<=0&&(i(),r=void 0,i=void 0)};return((...o)=>(t+=1,r?n(a):(r=e(...o),n(a)&&(i=a)),r))};export{r as createSharedComposable,n as tryOnScopeDispose};
2
- //# sourceMappingURL=createSharedComposable.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createSharedComposable.mjs","names":[],"sources":["../../../src/editor/createSharedComposable.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\n\ntype AnyFn = (...args: any[]) => any;\n\nexport type SharedComposableReturn<T extends AnyFn = AnyFn> = T;\n\n/**\n * Angular replacement for Vue's tryOnScopeDispose\n * Uses Angular's DestroyRef to handle cleanup when the injection context is destroyed\n */\nexport function tryOnScopeDispose(fn: () => void) {\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n if (destroyRef) {\n destroyRef.onDestroy(fn);\n return true;\n }\n return false;\n } catch {\n // If called outside injection context, return false\n return false;\n }\n}\n\n/**\n * Angular equivalent of Vue's createSharedComposable\n * Creates a singleton pattern for services/composables\n */\nexport const createSharedComposable = <Fn extends AnyFn>(\n composable: Fn\n): SharedComposableReturn<Fn> => {\n let subscribers = 0;\n let state: ReturnType<Fn> | undefined;\n let cleanupFn: (() => void) | undefined;\n\n const dispose = () => {\n subscribers -= 1;\n if (cleanupFn && subscribers <= 0) {\n cleanupFn();\n state = undefined;\n cleanupFn = undefined;\n }\n };\n\n return <Fn>((...args) => {\n subscribers += 1;\n if (!state) {\n state = composable(...args);\n // Set up cleanup when the first subscriber is destroyed\n if (tryOnScopeDispose(dispose)) {\n cleanupFn = dispose;\n }\n } else {\n // For additional subscribers, just set up their individual cleanup\n tryOnScopeDispose(dispose);\n }\n return state;\n });\n};\n"],"mappings":"uDAUA,SAAgB,EAAkB,EAAgB,CAChD,GAAI,CACF,IAAM,EAAa,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,CAKzD,OAJI,GACF,EAAW,UAAU,EAAG,CACjB,IAEF,QACD,CAEN,MAAO,IAQX,MAAa,EACX,GAC+B,CAC/B,IAAI,EAAc,EACd,EACA,EAEE,MAAgB,CACpB,IACI,GAAa,GAAe,IAC9B,GAAW,CACX,EAAQ,IAAA,GACR,EAAY,IAAA,KAIhB,QAAa,GAAG,KACd,GAAe,EACV,EAQH,EAAkB,EAAQ,EAP1B,EAAQ,EAAW,GAAG,EAAK,CAEvB,EAAkB,EAAQ,GAC5B,EAAY,IAMT"}
@@ -1,2 +0,0 @@
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
- //# sourceMappingURL=dictionariesRecord.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=editedContent.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=editorEnabled.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=editorLocale.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=focusDictionary.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=installIntlayerEditor.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=useCrossFrameMessageListener.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=useCrossFrameState.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- const e=()=>{},t=()=>{};export{e as useCrossURLPathSetter,t as useCrossURLPathState};
2
- //# sourceMappingURL=useCrossURLPathState.mjs.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import{__decorate as e}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{Injectable as t,InjectionToken as n,computed as r,inject as i}from"@angular/core";const a=new n(`editedContentActions`);let o=class{useEditedContentRenderer(e,t,n){let o=i(a,{optional:!0});return r(()=>o?.getEditedContentValue(e,t)??n)}};o=e([t({providedIn:`root`})],o);const s=(e,t,n)=>i(o).useEditedContentRenderer(e,t,n);export{a as EDITED_CONTENT_ACTIONS_TOKEN,o as EditedContentRendererService,s as useEditedContentRenderer};
2
- //# sourceMappingURL=useEditedContentRenderer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditedContentRenderer.mjs","names":[],"sources":["../../../src/editor/useEditedContentRenderer.ts"],"sourcesContent":["import {\n computed,\n Injectable,\n InjectionToken,\n inject,\n type Signal,\n} from '@angular/core';\nimport type { KeyPath } from '@intlayer/types/keyPath';\n\nexport interface EditedContentActions {\n getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;\n}\n\nexport const EDITED_CONTENT_ACTIONS_TOKEN =\n new InjectionToken<EditedContentActions | null>('editedContentActions');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EditedContentRendererService {\n /**\n * Mirrors the React hook one-for-one.\n */\n useEditedContentRenderer(\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n ): Signal<unknown> {\n const editedContentContext = inject(EDITED_CONTENT_ACTIONS_TOKEN, {\n optional: true,\n });\n\n return computed(() => {\n const edited = editedContentContext?.getEditedContentValue(\n dictionaryKey,\n keyPath\n ) as string | undefined;\n\n return edited ?? fallback;\n });\n }\n}\n\n/**\n * Standalone function that can be used like the Vue composable\n */\nexport const useEditedContentRenderer = (\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n): Signal<unknown> => {\n const service = inject(EditedContentRendererService);\n return service.useEditedContentRenderer(dictionaryKey, keyPath, fallback);\n};\n"],"mappings":"qLAaA,MAAa,EACX,IAAI,EAA4C,uBAAuB,CAKlE,IAAA,EAAA,KAAmC,CAIxC,yBACE,EACA,EACA,EACiB,CACjB,IAAM,EAAuB,EAAO,EAA8B,CAChE,SAAU,GACX,CAAC,CAEF,OAAO,MACU,GAAsB,sBACnC,EACA,EACD,EAEgB,EACjB,QAvBL,EAAW,CACV,WAAY,OACb,CAAC,CAAA,CAAA,EAAA,CA4BF,MAAa,GACX,EACA,EACA,IAEgB,EAAO,EAA6B,CACrC,yBAAyB,EAAe,EAAS,EAAS"}
@@ -1,2 +0,0 @@
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
- //# sourceMappingURL=useIframeClickInterceptor.mjs.map
@@ -1 +0,0 @@
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,34 +0,0 @@
1
- import { ElementRef, EventEmitter, OnDestroy, OnInit } from "@angular/core";
2
-
3
- //#region src/UI/ContentSelector.component.d.ts
4
- declare class ContentSelectorComponent implements OnInit, OnDestroy {
5
- onClickOutside?: () => void;
6
- pressDuration?: number;
7
- isSelecting?: boolean;
8
- click: EventEmitter<MouseEvent>;
9
- press: EventEmitter<void>;
10
- containerRef: ElementRef<HTMLSpanElement>;
11
- private isHovered;
12
- private isSelectingState;
13
- private pressTimerRef;
14
- private readonly isSelectingComputed;
15
- private readonly isStringSlot;
16
- ngOnInit(): void;
17
- ngOnDestroy(): void;
18
- onDocumentMouseDown(event: MouseEvent): void;
19
- private handleOnLongPress;
20
- private startPressTimer;
21
- private clearPressTimer;
22
- handleMouseDown(): void;
23
- handleMouseUp(): void;
24
- private handleClickOutside;
25
- handleClick(e: MouseEvent): void;
26
- handleBlur(): void;
27
- onMouseEnter(): void;
28
- getContainerStyle(): {
29
- [key: string]: any;
30
- };
31
- }
32
- //#endregion
33
- export { ContentSelectorComponent };
34
- //# sourceMappingURL=ContentSelector.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContentSelector.component.d.ts","names":[],"sources":["../../../src/UI/ContentSelector.component.ts"],"mappings":";;;cAyCa,wBAAA,YAAoC,MAAA,EAAQ,SAAA;EAC9C,cAAA;EACA,aAAA;EACA,WAAA;EAEC,KAAA,EAAK,YAAA,CAAA,UAAA;EACL,KAAA,EAAK,YAAA;EAGf,YAAA,EAAe,UAAA,CAAW,eAAA;EAAA,QAElB,SAAA;EAAA,QACA,gBAAA;EAAA,QACA,aAAA;EAAA,iBAES,mBAAA;EAAA,iBAIA,YAAA;EAMjB,QAAA,CAAA;EAIA,WAAA,CAAA;EAKA,mBAAA,CAAoB,KAAA,EAAO,UAAA;EAAA,QAInB,iBAAA;EAAA,QAKA,eAAA;EAAA,QAMA,eAAA;EAOR,eAAA,CAAA;EAKA,aAAA,CAAA;EAAA,QAKQ,kBAAA;EAUR,WAAA,CAAY,CAAA,EAAG,UAAA;EAQf,UAAA,CAAA;EAIA,YAAA,CAAA;EAIA,iBAAA,CAAA;IAAA,CAAwB,GAAA;EAAA;AAAA"}