angular-intlayer 8.3.3 → 8.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +14 -9
- package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +1 -1
- package/dist/cjs/editor/EditedContentRenderer.component.cjs +1 -1
- package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +1 -1
- package/dist/cjs/editor/communicator.cjs +1 -1
- package/dist/cjs/editor/communicator.cjs.map +1 -1
- package/dist/cjs/editor/configuration.cjs +1 -1
- package/dist/cjs/editor/configuration.cjs.map +1 -1
- package/dist/cjs/editor/dictionariesRecord.cjs +1 -1
- package/dist/cjs/editor/dictionariesRecord.cjs.map +1 -1
- package/dist/cjs/editor/editedContent.cjs +1 -1
- package/dist/cjs/editor/editedContent.cjs.map +1 -1
- package/dist/cjs/editor/editorEnabled.cjs +1 -1
- package/dist/cjs/editor/editorEnabled.cjs.map +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs.map +1 -1
- package/dist/cjs/editor/focusDictionary.cjs +1 -1
- package/dist/cjs/editor/focusDictionary.cjs.map +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/installIntlayerEditor.cjs +1 -1
- package/dist/cjs/editor/installIntlayerEditor.cjs.map +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -1
- package/dist/cjs/editor/useCrossFrameState.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs +1 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs.map +1 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs +1 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.component.mjs +14 -9
- package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +1 -1
- package/dist/esm/editor/EditedContentRenderer.component.mjs +1 -1
- package/dist/esm/editor/EditedContentRenderer.component.mjs.map +1 -1
- package/dist/esm/editor/communicator.mjs +1 -1
- package/dist/esm/editor/communicator.mjs.map +1 -1
- package/dist/esm/editor/configuration.mjs +1 -1
- package/dist/esm/editor/configuration.mjs.map +1 -1
- package/dist/esm/editor/dictionariesRecord.mjs +1 -1
- package/dist/esm/editor/dictionariesRecord.mjs.map +1 -1
- package/dist/esm/editor/editedContent.mjs +1 -1
- package/dist/esm/editor/editedContent.mjs.map +1 -1
- package/dist/esm/editor/editorEnabled.mjs +1 -1
- package/dist/esm/editor/editorEnabled.mjs.map +1 -1
- package/dist/esm/editor/editorLocale.mjs +1 -1
- package/dist/esm/editor/editorLocale.mjs.map +1 -1
- package/dist/esm/editor/focusDictionary.mjs +1 -1
- package/dist/esm/editor/focusDictionary.mjs.map +1 -1
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/editor/installIntlayerEditor.mjs +1 -1
- package/dist/esm/editor/installIntlayerEditor.mjs.map +1 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +1 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +1 -1
- package/dist/esm/editor/useCrossFrameState.mjs +1 -1
- package/dist/esm/editor/useCrossFrameState.mjs.map +1 -1
- package/dist/esm/editor/useCrossURLPathState.mjs +1 -1
- package/dist/esm/editor/useCrossURLPathState.mjs.map +1 -1
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs.map +1 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs +1 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs.map +1 -1
- package/dist/types/editor/ContentSelectorWrapper.component.d.ts +9 -12
- package/dist/types/editor/ContentSelectorWrapper.component.d.ts.map +1 -1
- package/dist/types/editor/communicator.d.ts +3 -27
- package/dist/types/editor/communicator.d.ts.map +1 -1
- package/dist/types/editor/configuration.d.ts +4 -1
- package/dist/types/editor/configuration.d.ts.map +1 -1
- package/dist/types/editor/dictionariesRecord.d.ts +6 -12
- package/dist/types/editor/dictionariesRecord.d.ts.map +1 -1
- package/dist/types/editor/editedContent.d.ts +27 -16
- package/dist/types/editor/editedContent.d.ts.map +1 -1
- package/dist/types/editor/editorEnabled.d.ts +4 -15
- package/dist/types/editor/editorEnabled.d.ts.map +1 -1
- package/dist/types/editor/editorLocale.d.ts.map +1 -1
- package/dist/types/editor/focusDictionary.d.ts +6 -20
- package/dist/types/editor/focusDictionary.d.ts.map +1 -1
- package/dist/types/editor/index.d.ts +13 -2
- package/dist/types/editor/installIntlayerEditor.d.ts +4 -17
- package/dist/types/editor/installIntlayerEditor.d.ts.map +1 -1
- package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -8
- package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -1
- package/dist/types/editor/useCrossFrameState.d.ts +2 -16
- package/dist/types/editor/useCrossFrameState.d.ts.map +1 -1
- package/dist/types/editor/useCrossURLPathState.d.ts +2 -17
- package/dist/types/editor/useCrossURLPathState.d.ts.map +1 -1
- package/dist/types/editor/useEditor.d.ts.map +1 -1
- package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -8
- package/dist/types/editor/useIframeClickInterceptor.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,11 +1,16 @@
|
|
|
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`),
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./installIntlayerEditor.cjs`),t=require(`./editorEnabled.cjs`),n=require(`./focusDictionary.cjs`),r=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.cjs`),i=require(`../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.cjs`);let a=require(`@intlayer/types/nodeType`),o=require(`@angular/common`),s=require(`@angular/core`),c=require(`@intlayer/core/utils`),l=require(`@intlayer/editor`),u=class{dictionaryKey;keyPath;focusDictionary=n.useFocusDictionary();editorEnabled=t.useEditorEnabled();manager=e.getEditorStateManager();ngOnInit(){(0,l.defineIntlayerElements)()}get filteredKeyPath(){return this.keyPath.filter(e=>e.type!==a.NodeType.Translation)}isSelected=(0,s.computed)(()=>{let e=this.focusDictionary.focusedContent();return e?.dictionaryKey===this.dictionaryKey&&(e.keyPath?.length??0)>0&&(0,c.isSameKeyPath)(e.keyPath??[],this.filteredKeyPath)});enabled=(0,s.computed)(()=>this.editorEnabled.enabled());handlePress(){this.focusDictionary.setFocusedContent?.({dictionaryKey:this.dictionaryKey,keyPath:this.filteredKeyPath})}handleHover(){this.manager?.messenger.send(`${l.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,{dictionaryKey:this.dictionaryKey,keyPath:this.filteredKeyPath})}handleUnhover(){this.manager?.messenger.send(`${l.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,null)}};i.__decorate([(0,s.Input)(),r.__decorateMetadata(`design:type`,String)],u.prototype,`dictionaryKey`,void 0),i.__decorate([(0,s.Input)(),r.__decorateMetadata(`design:type`,Array)],u.prototype,`keyPath`,void 0),u=i.__decorate([(0,s.Component)({selector:`app-content-selector-wrapper`,standalone:!0,imports:[o.CommonModule],schemas:[o.CUSTOM_ELEMENTS_SCHEMA],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>
|
|
7
13
|
<ng-content></ng-content>
|
|
8
|
-
</
|
|
9
|
-
|
|
10
|
-
`}),e.__decorateMetadata(`design:paramtypes`,[])],u),Object.defineProperty(exports,`ContentSelectorWrapperComponent`,{enumerable:!0,get:function(){return u}});
|
|
14
|
+
</ng-template>
|
|
15
|
+
`})],u),Object.defineProperty(exports,`ContentSelectorWrapperComponent`,{enumerable:!0,get:function(){return u}});
|
|
11
16
|
//# sourceMappingURL=ContentSelectorWrapper.component.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.component.cjs","names":["useFocusDictionary","useEditorEnabled","NodeType","CommonModule","
|
|
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 +1,2 @@
|
|
|
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},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}});
|
|
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
2
|
//# sourceMappingURL=EditedContentRenderer.component.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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 { getContent } from '@intlayer/core/interpreter';\nimport type {
|
|
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,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
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
2
|
//# sourceMappingURL=communicator.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communicator.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
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
2
|
//# sourceMappingURL=configuration.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=dictionariesRecord.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=editedContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editedContent.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=editorEnabled.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorEnabled.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=editorLocale.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorLocale.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=focusDictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusDictionary.cjs","names":["
|
|
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 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./ContentSelectorWrapper.component.cjs`),
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`)
|
|
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
2
|
//# sourceMappingURL=installIntlayerEditor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayerEditor.cjs","names":["configuration"],"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport {
|
|
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 +1,2 @@
|
|
|
1
|
-
|
|
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
2
|
//# sourceMappingURL=useCrossFrameMessageListener.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameMessageListener.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=useCrossFrameState.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameState.cjs","names":["
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=()=>{},t=()=>{};exports.useCrossURLPathSetter=e,exports.useCrossURLPathState=t;
|
|
2
2
|
//# sourceMappingURL=useCrossURLPathState.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossURLPathState.cjs","names":[
|
|
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 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./editorEnabled.cjs`),t=require(`./focusDictionary.cjs`),n=require(`./dictionariesRecord.cjs`),r=require(`./editorLocale.cjs`),i=require(`./useIframeClickInterceptor.cjs`),a=()=>{e.useEditorEnabled(),t.useFocusDictionary(),i.useIframeClickMerger(),r.useEditorLocale(),n.useDictionariesRecord()};exports.useEditor=a;
|
|
2
2
|
//# sourceMappingURL=useEditor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.cjs","names":[
|
|
1
|
+
{"version":3,"file":"useEditor.cjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import { useConfiguration } from './configuration';\nimport { useDictionariesRecord } from './dictionariesRecord';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useEditorLocale } from './editorLocale';\nimport { useFocusDictionary } from './focusDictionary';\nimport { useIframeClickMerger } from './useIframeClickInterceptor';\n\nexport const useEditor = () => {\n useEditorEnabled();\n useFocusDictionary();\n useIframeClickMerger();\n useEditorLocale();\n useDictionariesRecord();\n};\n"],"mappings":"gQAOa,MAAkB,CAC7B,EAAA,kBAAkB,CAClB,EAAA,oBAAoB,CACpB,EAAA,sBAAsB,CACtB,EAAA,iBAAiB,CACjB,EAAA,uBAAuB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./
|
|
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
2
|
//# sourceMappingURL=useIframeClickInterceptor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIframeClickInterceptor.cjs","names":["
|
|
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,11 +1,16 @@
|
|
|
1
|
-
import{
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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>
|
|
7
13
|
<ng-content></ng-content>
|
|
8
|
-
</
|
|
9
|
-
|
|
10
|
-
`}),e(`design:paramtypes`,[])],f);export{f as ContentSelectorWrapperComponent};
|
|
14
|
+
</ng-template>
|
|
15
|
+
`})],m);export{m as ContentSelectorWrapperComponent};
|
|
11
16
|
//# sourceMappingURL=ContentSelectorWrapper.component.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.component.mjs","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input } from '@angular/core';\nimport type { NodeProps } from '@intlayer/core/interpreter';\nimport { isSameKeyPath } from '@intlayer/core/utils';\nimport {
|
|
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 +1,2 @@
|
|
|
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{getContent as
|
|
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
2
|
//# sourceMappingURL=EditedContentRenderer.component.mjs.map
|