angular-intlayer 8.0.2 → 8.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/cjs/UI/ContentSelector.component.cjs +4 -3
  2. package/dist/cjs/UI/ContentSelector.component.cjs.map +1 -1
  3. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.110.0 → _@oxc-project_runtime@0.112.0}/helpers/decorate.cjs +1 -1
  4. package/dist/cjs/_virtual/{_@oxc-project_runtime@0.110.0 → _@oxc-project_runtime@0.112.0}/helpers/decorateMetadata.cjs +1 -1
  5. package/dist/cjs/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
  6. package/dist/cjs/client/index.cjs +1 -0
  7. package/dist/cjs/client/installIntlayer.cjs +4 -3
  8. package/dist/cjs/client/installIntlayer.cjs.map +1 -1
  9. package/dist/cjs/client/useDictionary.cjs +2 -1
  10. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  11. package/dist/cjs/client/useDictionaryAsync.cjs +3 -2
  12. package/dist/cjs/client/useDictionaryAsync.cjs.map +1 -1
  13. package/dist/cjs/client/useDictionaryDynamic.cjs +3 -2
  14. package/dist/cjs/client/useDictionaryDynamic.cjs.map +1 -1
  15. package/dist/cjs/client/useIntl.cjs +2 -1
  16. package/dist/cjs/client/useIntl.cjs.map +1 -1
  17. package/dist/cjs/client/useIntlayer.cjs +2 -1
  18. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  19. package/dist/cjs/client/useLoadDynamic.cjs +2 -1
  20. package/dist/cjs/client/useLoadDynamic.cjs.map +1 -1
  21. package/dist/cjs/client/useLocale.cjs +3 -2
  22. package/dist/cjs/client/useLocale.cjs.map +1 -1
  23. package/dist/cjs/client/useLocaleStorage.cjs +2 -1
  24. package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
  25. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +4 -3
  26. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +1 -1
  27. package/dist/cjs/editor/EditedContentRenderer.component.cjs +4 -3
  28. package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +1 -1
  29. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs +4 -3
  30. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs.map +1 -1
  31. package/dist/cjs/editor/communicator.cjs +3 -2
  32. package/dist/cjs/editor/communicator.cjs.map +1 -1
  33. package/dist/cjs/editor/configuration.cjs +3 -2
  34. package/dist/cjs/editor/configuration.cjs.map +1 -1
  35. package/dist/cjs/editor/createSharedComposable.cjs +2 -1
  36. package/dist/cjs/editor/createSharedComposable.cjs.map +1 -1
  37. package/dist/cjs/editor/dictionariesRecord.cjs +2 -1
  38. package/dist/cjs/editor/dictionariesRecord.cjs.map +1 -1
  39. package/dist/cjs/editor/editedContent.cjs +2 -1
  40. package/dist/cjs/editor/editedContent.cjs.map +1 -1
  41. package/dist/cjs/editor/editorEnabled.cjs +2 -1
  42. package/dist/cjs/editor/editorEnabled.cjs.map +1 -1
  43. package/dist/cjs/editor/editorLocale.cjs +2 -1
  44. package/dist/cjs/editor/editorLocale.cjs.map +1 -1
  45. package/dist/cjs/editor/focusDictionary.cjs +2 -1
  46. package/dist/cjs/editor/focusDictionary.cjs.map +1 -1
  47. package/dist/cjs/editor/index.cjs +1 -0
  48. package/dist/cjs/editor/installIntlayerEditor.cjs +3 -2
  49. package/dist/cjs/editor/installIntlayerEditor.cjs.map +1 -1
  50. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +2 -1
  51. package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +1 -1
  52. package/dist/cjs/editor/useCrossFrameState.cjs +2 -1
  53. package/dist/cjs/editor/useCrossFrameState.cjs.map +1 -1
  54. package/dist/cjs/editor/useCrossURLPathState.cjs +2 -1
  55. package/dist/cjs/editor/useCrossURLPathState.cjs.map +1 -1
  56. package/dist/cjs/editor/useEditedContentRenderer.cjs +3 -2
  57. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -1
  58. package/dist/cjs/editor/useEditor.cjs +1 -0
  59. package/dist/cjs/editor/useEditor.cjs.map +1 -1
  60. package/dist/cjs/editor/useIframeClickInterceptor.cjs +2 -1
  61. package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +1 -1
  62. package/dist/cjs/getDictionary.cjs +2 -1
  63. package/dist/cjs/getDictionary.cjs.map +1 -1
  64. package/dist/cjs/getIntlayer.cjs +2 -1
  65. package/dist/cjs/getIntlayer.cjs.map +1 -1
  66. package/dist/cjs/index.cjs +1 -0
  67. package/dist/cjs/markdown/index.cjs +1 -0
  68. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +3 -2
  69. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -1
  70. package/dist/cjs/plugins.cjs +3 -2
  71. package/dist/cjs/plugins.cjs.map +1 -1
  72. package/dist/cjs/renderIntlayerNode.cjs +1 -0
  73. package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
  74. package/dist/cjs/webpack/index.cjs +1 -0
  75. package/dist/cjs/webpack/mergeConfig.cjs +2 -1
  76. package/dist/cjs/webpack/mergeConfig.cjs.map +1 -1
  77. package/dist/esm/UI/ContentSelector.component.mjs +2 -2
  78. package/dist/esm/_virtual/{_@oxc-project_runtime@0.110.0 → _@oxc-project_runtime@0.112.0}/helpers/decorate.mjs +1 -1
  79. package/dist/esm/_virtual/{_@oxc-project_runtime@0.110.0 → _@oxc-project_runtime@0.112.0}/helpers/decorateMetadata.mjs +1 -1
  80. package/dist/esm/client/installIntlayer.mjs +1 -1
  81. package/dist/esm/editor/ContentSelectorWrapper.component.mjs +2 -2
  82. package/dist/esm/editor/EditedContentRenderer.component.mjs +2 -2
  83. package/dist/esm/editor/EditorSelectorRenderer.component.mjs +2 -2
  84. package/dist/esm/editor/useEditedContentRenderer.mjs +1 -1
  85. package/dist/esm/markdown/installIntlayerMarkdown.mjs +1 -1
  86. package/dist/esm/plugins.mjs +1 -1
  87. package/dist/esm/plugins.mjs.map +1 -1
  88. package/dist/types/client/installIntlayer.d.ts +2 -2
  89. package/dist/types/client/useDictionaryAsync.d.ts +2 -2
  90. package/dist/types/client/useDictionaryDynamic.d.ts +3 -3
  91. package/dist/types/client/useIntl.d.ts +2 -2
  92. package/dist/types/client/useLocale.d.ts +2 -2
  93. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  94. package/dist/types/editor/EditedContentRenderer.component.d.ts +2 -2
  95. package/dist/types/editor/useCrossURLPathState.d.ts +3 -3
  96. package/package.json +12 -12
@@ -1,6 +1,7 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.cjs');
4
5
  let _angular_common = require("@angular/common");
5
6
  let _angular_core = require("@angular/core");
6
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelector.component.cjs","names":["EventEmitter","CommonModule"],"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":";;;;;;;;AAeA,MAAM,gCAAgC;AA0B/B,qCAAM,yBAAsD;CACjE,AAAS;CACT,AAAS;CACT,AAAS;CAET,AAAU,QAAQ,IAAIA,4BAA0B;CAChD,AAAU,QAAQ,IAAIA,4BAAoB;CAE1C,AACA;CAEA,AAAQ,sCAAmB,MAAM;CACjC,AAAQ,6CAA0B,MAAM;CACxC,AAAQ,gBAAsD;CAE9D,AAAiB,wDACT,KAAK,eAAe,KAAK,kBAAkB,CAClD;CAED,AAAiB,iDAA8B;AAG7C,SAAO;GACP;CAEF,WAAiB;AACf,OAAK,iBAAiB,IAAI,KAAK,eAAe,MAAM;;CAGtD,cAAoB;AAClB,OAAK,iBAAiB;;CAGxB,AACA,oBAAoB,OAAyB;AAC3C,OAAK,mBAAmB,MAAM;;CAGhC,AAAQ,oBAA0B;AAChC,OAAK,iBAAiB,IAAI,KAAK;AAC/B,OAAK,MAAM,MAAM;;CAGnB,AAAQ,kBAAwB;AAC9B,OAAK,gBAAgB,iBAAiB;AACpC,QAAK,mBAAmB;KACvB,KAAK,iBAAiB,8BAA8B;;CAGzD,AAAQ,kBAAwB;AAC9B,MAAI,KAAK,eAAe;AACtB,gBAAa,KAAK,cAAc;AAChC,QAAK,gBAAgB;;;CAIzB,kBAAwB;AACtB,OAAK,iBAAiB;AACtB,OAAK,iBAAiB;;CAGxB,gBAAsB;AACpB,OAAK,UAAU,IAAI,MAAM;AACzB,OAAK,iBAAiB;;CAGxB,AAAQ,mBAAmB,OAAyB;AAClD,MACE,KAAK,cAAc,iBACnB,CAAC,KAAK,aAAa,cAAc,SAAS,MAAM,OAAe,EAC/D;AACA,QAAK,iBAAiB,IAAI,MAAM;AAChC,QAAK,kBAAkB;;;CAI3B,YAAY,GAAqB;AAC/B,MAAI,KAAK,qBAAqB,EAAE;AAC9B,KAAE,gBAAgB;AAClB,KAAE,iBAAiB;;AAErB,OAAK,MAAM,KAAK,EAAE;;CAGpB,aAAmB;AACjB,OAAK,iBAAiB,IAAI,MAAM;;CAGlC,eAAqB;AACnB,OAAK,UAAU,IAAI,KAAK;;CAG1B,oBAA4C;AAC1C,SAAO;GACL,SAAS,KAAK,cAAc,GAAG,WAAW;GAC1C,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,cAAc;GACd,eAAe;GACf,cAAc;GACd,cACE,KAAK,qBAAqB,IAAI,KAAK,WAAW,GAC1C,YACA;GACN,YAAY;GACb;;;uDAzGK;uDACA;uDACA;wDAEC;wDACA;0DAEE,gBAAgB,EAAE,QAAQ,MAAM,CAAC;;iCAyB9B,sBAAsB,CAAC,SAAS,CAAC;;;;;qFAzDtC;CACT,UAAU;CACV,UAAU;;;;;;;;;;;;;;;;;;;CAmBV,YAAY;CACZ,SAAS,CAACC,6BAAa;CACxB,CAAC"}
1
+ {"version":3,"file":"ContentSelector.component.cjs","names":["EventEmitter","CommonModule"],"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":";;;;;;;;;AAeA,MAAM,gCAAgC;AA0B/B,qCAAM,yBAAsD;CACjE,AAAS;CACT,AAAS;CACT,AAAS;CAET,AAAU,QAAQ,IAAIA,4BAA0B;CAChD,AAAU,QAAQ,IAAIA,4BAAoB;CAE1C,AACA;CAEA,AAAQ,sCAAmB,MAAM;CACjC,AAAQ,6CAA0B,MAAM;CACxC,AAAQ,gBAAsD;CAE9D,AAAiB,wDACT,KAAK,eAAe,KAAK,kBAAkB,CAClD;CAED,AAAiB,iDAA8B;AAG7C,SAAO;GACP;CAEF,WAAiB;AACf,OAAK,iBAAiB,IAAI,KAAK,eAAe,MAAM;;CAGtD,cAAoB;AAClB,OAAK,iBAAiB;;CAGxB,AACA,oBAAoB,OAAyB;AAC3C,OAAK,mBAAmB,MAAM;;CAGhC,AAAQ,oBAA0B;AAChC,OAAK,iBAAiB,IAAI,KAAK;AAC/B,OAAK,MAAM,MAAM;;CAGnB,AAAQ,kBAAwB;AAC9B,OAAK,gBAAgB,iBAAiB;AACpC,QAAK,mBAAmB;KACvB,KAAK,iBAAiB,8BAA8B;;CAGzD,AAAQ,kBAAwB;AAC9B,MAAI,KAAK,eAAe;AACtB,gBAAa,KAAK,cAAc;AAChC,QAAK,gBAAgB;;;CAIzB,kBAAwB;AACtB,OAAK,iBAAiB;AACtB,OAAK,iBAAiB;;CAGxB,gBAAsB;AACpB,OAAK,UAAU,IAAI,MAAM;AACzB,OAAK,iBAAiB;;CAGxB,AAAQ,mBAAmB,OAAyB;AAClD,MACE,KAAK,cAAc,iBACnB,CAAC,KAAK,aAAa,cAAc,SAAS,MAAM,OAAe,EAC/D;AACA,QAAK,iBAAiB,IAAI,MAAM;AAChC,QAAK,kBAAkB;;;CAI3B,YAAY,GAAqB;AAC/B,MAAI,KAAK,qBAAqB,EAAE;AAC9B,KAAE,gBAAgB;AAClB,KAAE,iBAAiB;;AAErB,OAAK,MAAM,KAAK,EAAE;;CAGpB,aAAmB;AACjB,OAAK,iBAAiB,IAAI,MAAM;;CAGlC,eAAqB;AACnB,OAAK,UAAU,IAAI,KAAK;;CAG1B,oBAA4C;AAC1C,SAAO;GACL,SAAS,KAAK,cAAc,GAAG,WAAW;GAC1C,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,cAAc;GACd,eAAe;GACf,cAAc;GACd,cACE,KAAK,qBAAqB,IAAI,KAAK,WAAW,GAC1C,YACA;GACN,YAAY;GACb;;;uDAzGK;uDACA;uDACA;wDAEC;wDACA;0DAEE,gBAAgB,EAAE,QAAQ,MAAM,CAAC;;iCAyB9B,sBAAsB,CAAC,SAAS,CAAC;;;;;qFAzDtC;CACT,UAAU;CACV,UAAU;;;;;;;;;;;;;;;;;;;CAmBV,YAAY;CACZ,SAAS,CAACC,6BAAa;CACxB,CAAC"}
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.110.0/helpers/decorate.js
2
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorate.js
3
3
  function __decorate(decorators, target, key, desc) {
4
4
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
5
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.110.0/helpers/decorateMetadata.js
2
+ //#region \0@oxc-project+runtime@0.112.0/helpers/decorateMetadata.js
3
3
  function __decorateMetadata(k, v) {
4
4
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
5
5
  }
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_client_installIntlayer = require('./installIntlayer.cjs');
2
3
  const require_client_useDictionary = require('./useDictionary.cjs');
3
4
  const require_client_useDictionaryAsync = require('./useDictionaryAsync.cjs');
@@ -1,8 +1,9 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_config_built = require("@intlayer/config/built");
5
- _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
6
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
6
7
 
7
8
  //#region src/client/installIntlayer.ts
8
9
  const INTLAYER_TOKEN = new _angular_core.InjectionToken("intlayer");
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayer.cjs","names":["InjectionToken","configuration"],"sources":["../../../src/client/installIntlayer.ts"],"sourcesContent":["import { Injectable, InjectionToken, type Signal, signal } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\n\nexport const INTLAYER_TOKEN = new InjectionToken<IntlayerProvider>('intlayer');\n\n/**\n * Singleton instance\n */\nlet instance: IntlayerProvider | null = null;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerProvider {\n isCookieEnabled = signal(true);\n private _locale = signal<LocalesValues>(\n configuration.internationalization?.defaultLocale as LocalesValues\n );\n\n readonly locale: Signal<LocalesValues> = this._locale.asReadonly();\n\n setLocale = (locale: LocalesValues) => {\n this._locale.set(locale);\n };\n}\n\n/**\n * Create and return a single IntlayerProvider instance\n */\nexport const createIntlayerClient = (\n locale?: LocalesValues,\n isCookieEnabled = true\n): IntlayerProvider => {\n if (instance) return instance;\n\n instance = new IntlayerProvider();\n\n if (locale) {\n instance.setLocale(locale);\n }\n instance.isCookieEnabled.set(isCookieEnabled);\n\n return instance;\n};\n\n/**\n * Provides Intlayer to your Angular application.\n *\n * This function should be used in your application's provider list (e.g., in `app.config.ts`)\n * to initialize the Intlayer service.\n *\n * @param locale - Initial locale to use.\n * @param isCookieEnabled - Whether to store the locale in cookies.\n * @returns A provider configuration for Intlayer.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { ApplicationConfig } from '@angular/core';\n * import { provideIntlayer } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideIntlayer({ locale: 'en' }),\n * ],\n * };\n * ```\n */\nexport const provideIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => ({\n provide: INTLAYER_TOKEN,\n useValue: installIntlayer(locale, isCookieEnabled),\n});\n\n/**\n * Helper to install the Intlayer provider.\n */\nexport const installIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => {\n const client = createIntlayerClient(locale, isCookieEnabled);\n\n // Note: Angular editor installation will be handled differently\n // installIntlayerEditor();\n\n return client;\n};\n"],"mappings":";;;;;;;AAIA,MAAa,iBAAiB,IAAIA,6BAAiC,WAAW;;;;AAK9E,IAAI,WAAoC;AAKjC,6BAAM,iBAAiB;CAC5B,4CAAyB,KAAK;CAC9B,AAAQ,oCACNC,+BAAc,sBAAsB,cACrC;CAED,AAAS,SAAgC,KAAK,QAAQ,YAAY;CAElE,aAAa,WAA0B;AACrC,OAAK,QAAQ,IAAI,OAAO;;;8EAZhB,EACV,YAAY,QACb,CAAC;;;;AAiBF,MAAa,wBACX,QACA,kBAAkB,SACG;AACrB,KAAI,SAAU,QAAO;AAErB,YAAW,IAAI,kBAAkB;AAEjC,KAAI,OACF,UAAS,UAAU,OAAO;AAE5B,UAAS,gBAAgB,IAAI,gBAAgB;AAE7C,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,MAAa,mBACX,QACA,kBAAkB,UACd;CACJ,SAAS;CACT,UAAU,gBAAgB,QAAQ,gBAAgB;CACnD;;;;AAKD,MAAa,mBACX,QACA,kBAAkB,SACf;AAMH,QALe,qBAAqB,QAAQ,gBAAgB"}
1
+ {"version":3,"file":"installIntlayer.cjs","names":["InjectionToken","configuration"],"sources":["../../../src/client/installIntlayer.ts"],"sourcesContent":["import { Injectable, InjectionToken, type Signal, signal } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\n\nexport const INTLAYER_TOKEN = new InjectionToken<IntlayerProvider>('intlayer');\n\n/**\n * Singleton instance\n */\nlet instance: IntlayerProvider | null = null;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class IntlayerProvider {\n isCookieEnabled = signal(true);\n private _locale = signal<LocalesValues>(\n configuration.internationalization?.defaultLocale as LocalesValues\n );\n\n readonly locale: Signal<LocalesValues> = this._locale.asReadonly();\n\n setLocale = (locale: LocalesValues) => {\n this._locale.set(locale);\n };\n}\n\n/**\n * Create and return a single IntlayerProvider instance\n */\nexport const createIntlayerClient = (\n locale?: LocalesValues,\n isCookieEnabled = true\n): IntlayerProvider => {\n if (instance) return instance;\n\n instance = new IntlayerProvider();\n\n if (locale) {\n instance.setLocale(locale);\n }\n instance.isCookieEnabled.set(isCookieEnabled);\n\n return instance;\n};\n\n/**\n * Provides Intlayer to your Angular application.\n *\n * This function should be used in your application's provider list (e.g., in `app.config.ts`)\n * to initialize the Intlayer service.\n *\n * @param locale - Initial locale to use.\n * @param isCookieEnabled - Whether to store the locale in cookies.\n * @returns A provider configuration for Intlayer.\n *\n * @example\n * ```ts\n * // app.config.ts\n * import { ApplicationConfig } from '@angular/core';\n * import { provideIntlayer } from 'angular-intlayer';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideIntlayer({ locale: 'en' }),\n * ],\n * };\n * ```\n */\nexport const provideIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => ({\n provide: INTLAYER_TOKEN,\n useValue: installIntlayer(locale, isCookieEnabled),\n});\n\n/**\n * Helper to install the Intlayer provider.\n */\nexport const installIntlayer = (\n locale?: LocalesValues,\n isCookieEnabled = true\n) => {\n const client = createIntlayerClient(locale, isCookieEnabled);\n\n // Note: Angular editor installation will be handled differently\n // installIntlayerEditor();\n\n return client;\n};\n"],"mappings":";;;;;;;;AAIA,MAAa,iBAAiB,IAAIA,6BAAiC,WAAW;;;;AAK9E,IAAI,WAAoC;AAKjC,6BAAM,iBAAiB;CAC5B,4CAAyB,KAAK;CAC9B,AAAQ,oCACNC,+BAAc,sBAAsB,cACrC;CAED,AAAS,SAAgC,KAAK,QAAQ,YAAY;CAElE,aAAa,WAA0B;AACrC,OAAK,QAAQ,IAAI,OAAO;;;8EAZhB,EACV,YAAY,QACb,CAAC;;;;AAiBF,MAAa,wBACX,QACA,kBAAkB,SACG;AACrB,KAAI,SAAU,QAAO;AAErB,YAAW,IAAI,kBAAkB;AAEjC,KAAI,OACF,UAAS,UAAU,OAAO;AAE5B,UAAS,gBAAgB,IAAI,gBAAgB;AAE7C,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,MAAa,mBACX,QACA,kBAAkB,UACd;CACJ,SAAS;CACT,UAAU,gBAAgB,QAAQ,gBAAgB;CACnD;;;;AAKD,MAAa,mBACX,QACA,kBAAkB,SACf;AAMH,QALe,qBAAqB,QAAQ,gBAAgB"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_installIntlayer = require('./installIntlayer.cjs');
3
4
  const require_getDictionary = require('../getDictionary.cjs');
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { Dictionary, LocalesValues } from '@intlayer/types';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\nexport const useDictionary = <T extends Dictionary>(\n dictionary: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<T['content']>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(() => locale ?? intlayer?.locale());\n\n /** a *stable* reactive dictionary object */\n const content = computed(() =>\n getDictionary<T, LocalesValues>(dictionary, localeTarget())\n );\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;AAMA,MAAa,iBACX,YACA,WAC+C;CAC/C,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAA8B,UAAU,UAAU,QAAQ,CAAC;AAOjE,0CAHEC,oCAAgC,YAAY,cAAc,CAAC,CAC5D"}
1
+ {"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type { Dictionary, LocalesValues } from '@intlayer/types';\nimport { getDictionary } from '../getDictionary';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\nexport const useDictionary = <T extends Dictionary>(\n dictionary: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<T['content']>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(() => locale ?? intlayer?.locale());\n\n /** a *stable* reactive dictionary object */\n const content = computed(() =>\n getDictionary<T, LocalesValues>(dictionary, localeTarget())\n );\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;AAMA,MAAa,iBACX,YACA,WAC+C;CAC/C,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAA8B,UAAU,UAAU,QAAQ,CAAC;AAOjE,0CAHEC,oCAAgC,YAAY,cAAc,CAAC,CAC5D"}
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
 
3
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
4
5
  const require_client_installIntlayer = require('./installIntlayer.cjs');
5
6
  const require_client_useDictionary = require('./useDictionary.cjs');
6
7
  let _angular_core = require("@angular/core");
7
8
  let _intlayer_config_built = require("@intlayer/config/built");
8
- _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
9
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
9
10
 
10
11
  //#region src/client/useDictionaryAsync.ts
11
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryAsync.cjs","names":["INTLAYER_TOKEN","configuration","useDictionary"],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type {\n Dictionary,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () =>\n locale ??\n intlayer?.locale() ??\n configuration?.internationalization.defaultLocale\n );\n\n const dictionary = await dictionaryPromise[localeTarget()]?.();\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,qBAAqB,OAChC,mBACA,WACG;CACH,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAEF,UACA,UAAU,QAAQ,IAClBC,gCAAe,qBAAqB,cACvC;AAID,QAAOC,2CAFY,MAAM,kBAAkB,cAAc,KAAK,EAE7B,cAAc,CAAQ"}
1
+ {"version":3,"file":"useDictionaryAsync.cjs","names":["INTLAYER_TOKEN","configuration","useDictionary"],"sources":["../../../src/client/useDictionaryAsync.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type {\n Dictionary,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryAsync = async <T extends Dictionary>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () =>\n locale ??\n intlayer?.locale() ??\n configuration?.internationalization.defaultLocale\n );\n\n const dictionary = await dictionaryPromise[localeTarget()]?.();\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAa,qBAAqB,OAChC,mBACA,WACG;CACH,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAEF,UACA,UAAU,QAAQ,IAClBC,gCAAe,qBAAqB,cACvC;AAID,QAAOC,2CAFY,MAAM,kBAAkB,cAAc,KAAK,EAE7B,cAAc,CAAQ"}
@@ -1,12 +1,13 @@
1
1
  'use client';
2
2
 
3
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
4
5
  const require_client_installIntlayer = require('./installIntlayer.cjs');
5
6
  const require_client_useDictionary = require('./useDictionary.cjs');
6
7
  const require_client_useLoadDynamic = require('./useLoadDynamic.cjs');
7
8
  let _angular_core = require("@angular/core");
8
9
  let _intlayer_config_built = require("@intlayer/config/built");
9
- _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
10
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
10
11
 
11
12
  //#region src/client/useDictionaryDynamic.ts
12
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.cjs","names":["INTLAYER_TOKEN","configuration","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type {\n Dictionary,\n DictionaryKeys,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryDynamic = <\n T extends Dictionary,\n K extends DictionaryKeys,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: K,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () =>\n locale ??\n intlayer?.locale() ??\n configuration?.internationalization.defaultLocale\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget()}`,\n dictionaryPromise[localeTarget()]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAa,wBAIX,mBACA,KACA,WACG;CACH,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAEF,UACA,UAAU,QAAQ,IAClBC,gCAAe,qBAAqB,cACvC;AAOD,QAAOC,2CALYC,6CACjB,GAAG,OAAO,IAAI,CAAC,GAAG,cAAc,IAChC,kBAAkB,cAAc,KAAK,CACtC,EAEgC,cAAc,CAAQ"}
1
+ {"version":3,"file":"useDictionaryDynamic.cjs","names":["INTLAYER_TOKEN","configuration","useDictionary","useLoadDynamic"],"sources":["../../../src/client/useDictionaryDynamic.ts"],"sourcesContent":["'use client';\n\nimport { computed, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type {\n Dictionary,\n DictionaryKeys,\n LocalesValues,\n StrictModeLocaleMap,\n} from '@intlayer/types';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { useDictionary } from './useDictionary';\nimport { useLoadDynamic } from './useLoadDynamic';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the client context\n */\nexport const useDictionaryDynamic = <\n T extends Dictionary,\n K extends DictionaryKeys,\n>(\n dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n key: K,\n locale?: LocalesValues\n) => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n const localeTarget = computed(\n () =>\n locale ??\n intlayer?.locale() ??\n configuration?.internationalization.defaultLocale\n );\n\n const dictionary = useLoadDynamic<T>(\n `${String(key)}.${localeTarget()}`,\n dictionaryPromise[localeTarget()]?.()\n ) as T;\n\n return useDictionary(dictionary, localeTarget() as any);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,MAAa,wBAIX,mBACA,KACA,WACG;CACH,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAEF,UACA,UAAU,QAAQ,IAClBC,gCAAe,qBAAqB,cACvC;AAOD,QAAOC,2CALYC,6CACjB,GAAG,OAAO,IAAI,CAAC,GAAG,cAAc,IAChC,kBAAkB,cAAc,KAAK,CACtC,EAEgC,cAAc,CAAQ"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_installIntlayer = require('./installIntlayer.cjs');
3
4
  let _intlayer_core = require("@intlayer/core");
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"useIntl.cjs","names":["IntlayerProvider"],"sources":["../../../src/client/useIntl.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { bindIntl } from '@intlayer/core';\nimport type { LocalesValues } from '@intlayer/types';\nimport { IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular composable that provides a locale-bound `Intl` object.\n *\n * It acts exactly like the native `Intl` object, but acts as a proxy to:\n * 1. Inject the current locale automatically if none is provided.\n * 2. Use the performance-optimized `CachedIntl` under the hood.\n *\n * @example\n * ```typescript\n * import { Component, computed } from '@angular/core';\n * import { useIntl } from 'angular-intlayer';\n *\n * @Component({ ... })\n * export class MyComponent {\n * intl = useIntl();\n * formattedPrice = computed(() =>\n * new this.intl().NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45)\n * );\n * }\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const intlayer = inject(IntlayerProvider);\n\n return computed(() => {\n const currentLocale = locale ?? intlayer.locale();\n\n return bindIntl(currentLocale);\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,WAAW,WAA2B;CACjD,MAAM,qCAAkBA,gDAAiB;AAEzC,0CAAsB;AAGpB,sCAFsB,UAAU,SAAS,QAAQ,CAEnB;GAC9B"}
1
+ {"version":3,"file":"useIntl.cjs","names":["IntlayerProvider"],"sources":["../../../src/client/useIntl.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport { bindIntl } from '@intlayer/core';\nimport type { LocalesValues } from '@intlayer/types';\nimport { IntlayerProvider } from './installIntlayer';\n\n/**\n * Angular composable that provides a locale-bound `Intl` object.\n *\n * It acts exactly like the native `Intl` object, but acts as a proxy to:\n * 1. Inject the current locale automatically if none is provided.\n * 2. Use the performance-optimized `CachedIntl` under the hood.\n *\n * @example\n * ```typescript\n * import { Component, computed } from '@angular/core';\n * import { useIntl } from 'angular-intlayer';\n *\n * @Component({ ... })\n * export class MyComponent {\n * intl = useIntl();\n * formattedPrice = computed(() =>\n * new this.intl().NumberFormat({\n * style: 'currency',\n * currency: 'USD'\n * }).format(123.45)\n * );\n * }\n * ```\n */\nexport const useIntl = (locale?: LocalesValues) => {\n const intlayer = inject(IntlayerProvider);\n\n return computed(() => {\n const currentLocale = locale ?? intlayer.locale();\n\n return bindIntl(currentLocale);\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,WAAW,WAA2B;CACjD,MAAM,qCAAkBA,gDAAiB;AAEzC,0CAAsB;AAGpB,sCAFsB,UAAU,SAAS,QAAQ,CAEnB;GAC9B"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_installIntlayer = require('./installIntlayer.cjs');
3
4
  const require_getIntlayer = require('../getIntlayer.cjs');
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/** guard utility - true only for objects generated by `renderIntlayerNode()` */\nexport const isUpdatableNode = (\n val: unknown\n): val is { __update: (n: unknown) => void } =>\n !!val &&\n typeof val === 'object' &&\n typeof (val as any).__update === 'function';\n\n/**\n * Angular hook that picks one dictionary by its key and returns its reactive content.\n *\n * It utilizes Angular signals to provide deep reactivity, ensuring your components\n * update automatically when the locale changes.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useIntlayer } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-my-component',\n * template: `<div>{{ content().myField.value }}</div>`,\n * })\n * export class MyComponent {\n * content = useIntlayer('my-dictionary-key');\n * }\n * ```\n */\nexport const useIntlayer = <T extends DictionaryKeys, L extends LocalesValues>(\n key: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<DictionaryRegistryContent<T>>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n /** which locale should we use right now? */\n const localeTarget = computed(() => locale ?? intlayer.locale());\n\n /** a *stable* reactive dictionary object */\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const content = computed(() => getIntlayer<T, L>(key, localeTarget() as L));\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;AAWA,MAAa,mBACX,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BnC,MAAa,eACX,KACA,WAC+D;CAC/D,MAAM,qCAAoCA,8CAAe;;CAGzD,MAAM,iDAA8B,UAAU,SAAS,QAAQ,CAAC;AAMhE,0CAF+BC,gCAAkB,KAAK,cAAc,CAAM,CAAC"}
1
+ {"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject, type Signal } from '@angular/core';\nimport type {\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types';\nimport { getIntlayer } from '../getIntlayer';\nimport type { DeepTransformContent } from '../plugins';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\n\n/** guard utility - true only for objects generated by `renderIntlayerNode()` */\nexport const isUpdatableNode = (\n val: unknown\n): val is { __update: (n: unknown) => void } =>\n !!val &&\n typeof val === 'object' &&\n typeof (val as any).__update === 'function';\n\n/**\n * Angular hook that picks one dictionary by its key and returns its reactive content.\n *\n * It utilizes Angular signals to provide deep reactivity, ensuring your components\n * update automatically when the locale changes.\n *\n * @param key - The unique key of the dictionary to retrieve.\n * @param locale - Optional locale to override the current context locale.\n * @returns The transformed dictionary content.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useIntlayer } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-my-component',\n * template: `<div>{{ content().myField.value }}</div>`,\n * })\n * export class MyComponent {\n * content = useIntlayer('my-dictionary-key');\n * }\n * ```\n */\nexport const useIntlayer = <T extends DictionaryKeys, L extends LocalesValues>(\n key: T,\n locale?: LocalesValues\n): Signal<DeepTransformContent<DictionaryRegistryContent<T>>> => {\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN)!;\n\n /** which locale should we use right now? */\n const localeTarget = computed(() => locale ?? intlayer.locale());\n\n /** a *stable* reactive dictionary object */\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n const content = computed(() => getIntlayer<T, L>(key, localeTarget() as L));\n\n return content; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;;;AAWA,MAAa,mBACX,QAEA,CAAC,CAAC,OACF,OAAO,QAAQ,YACf,OAAQ,IAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BnC,MAAa,eACX,KACA,WAC+D;CAC/D,MAAM,qCAAoCA,8CAAe;;CAGzD,MAAM,iDAA8B,UAAU,SAAS,QAAQ,CAAC;AAMhE,0CAF+BC,gCAAkB,KAAK,cAAc,CAAM,CAAC"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _angular_core = require("@angular/core");
3
4
 
4
5
  //#region src/client/useLoadDynamic.ts
@@ -1 +1 @@
1
- {"version":3,"file":"useLoadDynamic.cjs","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"sourcesContent":["import { signal } from '@angular/core';\n\n/**\n * A \"synchronous\" loader for a dynamically‐imported JSON (or anything).\n *\n * - Immediately returns a reactive signal so that Angular can properly track changes.\n * - When the Promise resolves, it replaces the signal's value with the real data.\n */\nexport const useLoadDynamic = <T extends Record<string, any>>(\n key: string,\n promise: Promise<T>\n): T => {\n // A module‐level cache of Promises, so we only import once per key.\n const cache: Map<string, Promise<T>> = (useLoadDynamic as any)._cache ||\n ((useLoadDynamic as any)._cache = new Map());\n\n // Hold the \"current\" value as a reactive signal\n // This starts as an empty object but Angular can track changes to it\n const container = signal({} as T);\n\n if (!cache.has(key)) {\n // Kick off the dynamic import & cache it\n const p = promise.then((real) => {\n // As soon as the import resolves, update the signal with the real data\n container.set(real);\n return real;\n });\n cache.set(key, p);\n } else {\n // If it's already in flight (or done), hook into it so that the container still updates\n cache.get(key)?.then((real) => {\n container.set(real);\n });\n }\n\n // Return the current signal value directly - Angular can track all changes to it\n return container();\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,kBACX,KACA,YACM;CAEN,MAAM,QAAkC,eAAuB,WAC9D,AAAC,eAAuB,yBAAS,IAAI,KAAK;CAI3C,MAAM,sCAAmB,EAAE,CAAM;AAEjC,KAAI,CAAC,MAAM,IAAI,IAAI,EAAE;EAEnB,MAAM,IAAI,QAAQ,MAAM,SAAS;AAE/B,aAAU,IAAI,KAAK;AACnB,UAAO;IACP;AACF,QAAM,IAAI,KAAK,EAAE;OAGjB,OAAM,IAAI,IAAI,EAAE,MAAM,SAAS;AAC7B,YAAU,IAAI,KAAK;GACnB;AAIJ,QAAO,WAAW"}
1
+ {"version":3,"file":"useLoadDynamic.cjs","names":[],"sources":["../../../src/client/useLoadDynamic.ts"],"sourcesContent":["import { signal } from '@angular/core';\n\n/**\n * A \"synchronous\" loader for a dynamically‐imported JSON (or anything).\n *\n * - Immediately returns a reactive signal so that Angular can properly track changes.\n * - When the Promise resolves, it replaces the signal's value with the real data.\n */\nexport const useLoadDynamic = <T extends Record<string, any>>(\n key: string,\n promise: Promise<T>\n): T => {\n // A module‐level cache of Promises, so we only import once per key.\n const cache: Map<string, Promise<T>> = (useLoadDynamic as any)._cache ||\n ((useLoadDynamic as any)._cache = new Map());\n\n // Hold the \"current\" value as a reactive signal\n // This starts as an empty object but Angular can track changes to it\n const container = signal({} as T);\n\n if (!cache.has(key)) {\n // Kick off the dynamic import & cache it\n const p = promise.then((real) => {\n // As soon as the import resolves, update the signal with the real data\n container.set(real);\n return real;\n });\n cache.set(key, p);\n } else {\n // If it's already in flight (or done), hook into it so that the container still updates\n cache.get(key)?.then((real) => {\n container.set(real);\n });\n }\n\n // Return the current signal value directly - Angular can track all changes to it\n return container();\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,kBACX,KACA,YACM;CAEN,MAAM,QAAkC,eAAuB,WAC9D,AAAC,eAAuB,yBAAS,IAAI,KAAK;CAI3C,MAAM,sCAAmB,EAAE,CAAM;AAEjC,KAAI,CAAC,MAAM,IAAI,IAAI,EAAE;EAEnB,MAAM,IAAI,QAAQ,MAAM,SAAS;AAE/B,aAAU,IAAI,KAAK;AACnB,UAAO;IACP;AACF,QAAM,IAAI,KAAK,EAAE;OAGjB,OAAM,IAAI,IAAI,EAAE,MAAM,SAAS;AAC7B,YAAU,IAAI,KAAK;GACnB;AAIJ,QAAO,WAAW"}
@@ -1,9 +1,10 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_client_installIntlayer = require('./installIntlayer.cjs');
3
4
  const require_client_useLocaleStorage = require('./useLocaleStorage.cjs');
4
5
  let _angular_core = require("@angular/core");
5
6
  let _intlayer_config_built = require("@intlayer/config/built");
6
- _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
7
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
7
8
 
8
9
  //#region src/client/useLocale.ts
9
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useLocale.cjs","names":["configuration","INTLAYER_TOKEN"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype useLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: LocalesValues) => void;\n};\n\n/**\n * Angular hook to manage the current locale and related functions.\n *\n * @param props - Optional configuration for locale management.\n * @returns An object containing the current locale (signal), default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useLocale } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-locale-switcher',\n * template: `\n * <select [value]=\"locale()\" (change)=\"setLocale($any($event.target).value)\">\n * @for (loc of availableLocales; track loc) {\n * <option [value]=\"loc\">{{ loc }}</option>\n * }\n * </select>\n * `,\n * })\n * export class LocaleSwitcher {\n * const { locale, setLocale, availableLocales } = useLocale();\n * }\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: useLocaleProps = {}) => {\n const { defaultLocale, locales: availableLocales } =\n configuration?.internationalization ?? {};\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n // Create a reactive reference for the locale\n const locale = computed(() => intlayer?.locale() ?? defaultLocale);\n const isCookieEnabledContext = computed(\n () => intlayer?.isCookieEnabled() ?? true\n );\n\n const setLocale = (newLocale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(newLocale)) {\n console.error(`Locale ${newLocale} is not available`);\n return;\n }\n\n if (intlayer) {\n intlayer.setLocale(newLocale);\n }\n setLocaleInStorage(\n newLocale,\n isCookieEnabled ?? isCookieEnabledContext() ?? true\n );\n onLocaleChange?.(newLocale);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,aAAa,EACxB,iBACA,mBACkB,EAAE,KAAK;CACzB,MAAM,EAAE,eAAe,SAAS,qBAC9BA,gCAAe,wBAAwB,EAAE;CAC3C,MAAM,qCAAoCC,8CAAe;CAGzD,MAAM,2CAAwB,UAAU,QAAQ,IAAI,cAAc;CAClE,MAAM,2DACE,UAAU,iBAAiB,IAAI,KACtC;CAED,MAAM,aAAa,cAA6B;AAC9C,MAAI,CAAC,kBAAkB,IAAI,OAAO,CAAC,SAAS,UAAU,EAAE;AACtD,WAAQ,MAAM,UAAU,UAAU,mBAAmB;AACrD;;AAGF,MAAI,SACF,UAAS,UAAU,UAAU;AAE/B,qDACE,WACA,mBAAmB,wBAAwB,IAAI,KAChD;AACD,mBAAiB,UAAU;;AAG7B,QAAO;EACL;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"useLocale.cjs","names":["configuration","INTLAYER_TOKEN"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["import { computed, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types';\nimport { INTLAYER_TOKEN, type IntlayerProvider } from './installIntlayer';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\ntype useLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: LocalesValues) => void;\n};\n\n/**\n * Angular hook to manage the current locale and related functions.\n *\n * @param props - Optional configuration for locale management.\n * @returns An object containing the current locale (signal), default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { useLocale } from 'angular-intlayer';\n *\n * @Component({\n * standalone: true,\n * selector: 'app-locale-switcher',\n * template: `\n * <select [value]=\"locale()\" (change)=\"setLocale($any($event.target).value)\">\n * @for (loc of availableLocales; track loc) {\n * <option [value]=\"loc\">{{ loc }}</option>\n * }\n * </select>\n * `,\n * })\n * export class LocaleSwitcher {\n * const { locale, setLocale, availableLocales } = useLocale();\n * }\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: useLocaleProps = {}) => {\n const { defaultLocale, locales: availableLocales } =\n configuration?.internationalization ?? {};\n const intlayer = inject<IntlayerProvider>(INTLAYER_TOKEN);\n\n // Create a reactive reference for the locale\n const locale = computed(() => intlayer?.locale() ?? defaultLocale);\n const isCookieEnabledContext = computed(\n () => intlayer?.isCookieEnabled() ?? true\n );\n\n const setLocale = (newLocale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(newLocale)) {\n console.error(`Locale ${newLocale} is not available`);\n return;\n }\n\n if (intlayer) {\n intlayer.setLocale(newLocale);\n }\n setLocaleInStorage(\n newLocale,\n isCookieEnabled ?? isCookieEnabledContext() ?? true\n );\n onLocaleChange?.(newLocale);\n };\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,aAAa,EACxB,iBACA,mBACkB,EAAE,KAAK;CACzB,MAAM,EAAE,eAAe,SAAS,qBAC9BA,gCAAe,wBAAwB,EAAE;CAC3C,MAAM,qCAAoCC,8CAAe;CAGzD,MAAM,2CAAwB,UAAU,QAAQ,IAAI,cAAc;CAClE,MAAM,2DACE,UAAU,iBAAiB,IAAI,KACtC;CAED,MAAM,aAAa,cAA6B;AAC9C,MAAI,CAAC,kBAAkB,IAAI,OAAO,CAAC,SAAS,UAAU,EAAE;AACtD,WAAQ,MAAM,UAAU,UAAU,mBAAmB;AACrD;;AAGF,MAAI,SACF,UAAS,UAAU,UAAU;AAE/B,qDACE,WACA,mBAAmB,wBAAwB,IAAI,KAChD;AACD,mBAAiB,UAAU;;AAG7B,QAAO;EACL;EACA;EACA;EACA;EACD"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _intlayer_core = require("@intlayer/core");
3
4
 
4
5
  //#region src/client/useLocaleStorage.ts
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleStorage.cjs","names":["localeStorageOptions"],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":["import {\n getLocaleFromStorage,\n LocaleStorage,\n localeStorageOptions,\n setLocaleInStorage as setLocaleInStorageCore,\n} from '@intlayer/core';\nimport type { LocalesValues } from '@intlayer/types';\n\n/**\n * Get the locale cookie\n */\n/**\n * Get the locale cookie\n */\nexport const localeInStorage = getLocaleFromStorage(localeStorageOptions);\n/**\n * @deprecated Use localeInStorage instead\n *\n * Get the locale cookie\n */\nexport const localeCookie = localeInStorage;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n isCookieEnabled: boolean\n) =>\n setLocaleInStorageCore(locale, {\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use setLocaleInStorage instead\n *\n * Set the locale cookie\n */\nexport const setLocaleCookie = setLocaleInStorage;\n\n/**\n * Hook that provides the locale storage and a function to set it\n */\nexport const useLocaleStorage = (isCookieEnabled?: boolean) =>\n LocaleStorage({\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use useLocaleStorage instead\n *\n * For GDPR compliance, use useLocaleStorage instead\n *\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = (isCookieEnabled?: boolean) => {\n const storage = useLocaleStorage(isCookieEnabled);\n\n return {\n localeCookie: storage.getLocale(),\n setLocaleCookie: storage.setLocale,\n };\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAa,2DAAuCA,oCAAqB;;;;;;AAMzE,MAAa,eAAe;;;;AAK5B,MAAa,sBACX,QACA,2DAEuB,QAAQ;CAC7B,GAAGA;CACH;CACD,CAAC;;;;;;AAOJ,MAAa,kBAAkB;;;;AAK/B,MAAa,oBAAoB,sDACjB;CACZ,GAAGA;CACH;CACD,CAAC;;;;;;;;AASJ,MAAa,mBAAmB,oBAA8B;CAC5D,MAAM,UAAU,iBAAiB,gBAAgB;AAEjD,QAAO;EACL,cAAc,QAAQ,WAAW;EACjC,iBAAiB,QAAQ;EAC1B"}
1
+ {"version":3,"file":"useLocaleStorage.cjs","names":["localeStorageOptions"],"sources":["../../../src/client/useLocaleStorage.ts"],"sourcesContent":["import {\n getLocaleFromStorage,\n LocaleStorage,\n localeStorageOptions,\n setLocaleInStorage as setLocaleInStorageCore,\n} from '@intlayer/core';\nimport type { LocalesValues } from '@intlayer/types';\n\n/**\n * Get the locale cookie\n */\n/**\n * Get the locale cookie\n */\nexport const localeInStorage = getLocaleFromStorage(localeStorageOptions);\n/**\n * @deprecated Use localeInStorage instead\n *\n * Get the locale cookie\n */\nexport const localeCookie = localeInStorage;\n\n/**\n * Set the locale cookie\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n isCookieEnabled: boolean\n) =>\n setLocaleInStorageCore(locale, {\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use setLocaleInStorage instead\n *\n * Set the locale cookie\n */\nexport const setLocaleCookie = setLocaleInStorage;\n\n/**\n * Hook that provides the locale storage and a function to set it\n */\nexport const useLocaleStorage = (isCookieEnabled?: boolean) =>\n LocaleStorage({\n ...localeStorageOptions,\n isCookieEnabled,\n });\n\n/**\n * @deprecated Use useLocaleStorage instead\n *\n * For GDPR compliance, use useLocaleStorage instead\n *\n * Hook that provides the locale cookie and a function to set it\n */\nexport const useLocaleCookie = (isCookieEnabled?: boolean) => {\n const storage = useLocaleStorage(isCookieEnabled);\n\n return {\n localeCookie: storage.getLocale(),\n setLocaleCookie: storage.setLocale,\n };\n};\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,2DAAuCA,oCAAqB;;;;;;AAMzE,MAAa,eAAe;;;;AAK5B,MAAa,sBACX,QACA,2DAEuB,QAAQ;CAC7B,GAAGA;CACH;CACD,CAAC;;;;;;AAOJ,MAAa,kBAAkB;;;;AAK/B,MAAa,oBAAoB,sDACjB;CACZ,GAAGA;CACH;CACD,CAAC;;;;;;;;AASJ,MAAa,mBAAmB,oBAA8B;CAC5D,MAAM,UAAU,iBAAiB,gBAAgB;AAEjD,QAAO;EACL,cAAc,QAAQ,WAAW;EACjC,iBAAiB,QAAQ;EAC1B"}
@@ -1,6 +1,7 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.cjs');
4
5
  const require_UI_ContentSelector_component = require('../UI/ContentSelector.component.cjs');
5
6
  const require_editor_editorEnabled = require('./editorEnabled.cjs');
6
7
  const require_editor_focusDictionary = require('./focusDictionary.cjs');
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelectorWrapper.component.cjs","names":["useFocusDictionary","useEditorEnabled","NodeType","CommonModule","ContentSelectorComponent"],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input } from '@angular/core';\nimport { isSameKeyPath, type NodeProps } from '@intlayer/core';\nimport { NodeType } from '@intlayer/types';\nimport { ContentSelectorComponent } from '../UI/ContentSelector.component';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useFocusDictionary } from './focusDictionary';\nimport { useEditor } from './useEditor';\n\n/**\n * Combine your NodeProps (which include dictionaryKey & keyPath)\n * with any other div-like attributes.\n */\nexport interface ContentSelectorWrapperProps extends NodeProps {\n [key: string]: any;\n}\n\n@Component({\n selector: 'app-content-selector-wrapper',\n standalone: true,\n imports: [CommonModule, ContentSelectorComponent],\n template: `\n <app-content-selector\n *ngIf=\"enabled()\"\n (press)=\"handleSelect()\"\n [isSelecting]=\"isSelected()\"\n >\n <ng-content></ng-content>\n </app-content-selector>\n <ng-content *ngIf=\"!enabled()\"></ng-content>\n `,\n})\nexport class ContentSelectorWrapperComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n\n // pull in the editor state & focus API\n private focusDictionary = useFocusDictionary();\n private editorEnabled = useEditorEnabled();\n\n constructor() {\n useEditor();\n }\n\n // compute whether this node is the current focus\n isSelected = computed(() => {\n const focusedContent = this.focusDictionary.focusedContent();\n return (\n focusedContent?.dictionaryKey === this.dictionaryKey &&\n (focusedContent.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(focusedContent.keyPath ?? [], this.keyPath)\n );\n });\n\n enabled = computed(() => this.editorEnabled.enabled());\n\n // when the selector is clicked, update focus\n handleSelect() {\n this.focusDictionary.setFocusedContent({\n dictionaryKey: this.dictionaryKey,\n keyPath: this.keyPath.filter((key) => key.type !== NodeType.Translation),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAgCO,4CAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;CAGT,AAAQ,kBAAkBA,mDAAoB;CAC9C,AAAQ,gBAAgBC,+CAAkB;CAE1C,cAAc;AACZ,sCAAW;;CAIb,+CAA4B;EAC1B,MAAM,iBAAiB,KAAK,gBAAgB,gBAAgB;AAC5D,SACE,gBAAgB,kBAAkB,KAAK,kBACtC,eAAe,SAAS,UAAU,KAAK,uCAC1B,eAAe,WAAW,EAAE,EAAE,KAAK,QAAQ;GAE3D;CAEF,4CAAyB,KAAK,cAAc,SAAS,CAAC;CAGtD,eAAe;AACb,OAAK,gBAAgB,kBAAkB;GACrC,eAAe,KAAK;GACpB,SAAS,KAAK,QAAQ,QAAQ,QAAQ,IAAI,SAASC,yBAAS,YAAY;GACzE,CAAC;;;uDA5BI;uDACA;4FAjBC;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACC,8BAAcC,8DAAyB;CACjD,UAAU;;;;;;;;;;CAUX,CAAC"}
1
+ {"version":3,"file":"ContentSelectorWrapper.component.cjs","names":["useFocusDictionary","useEditorEnabled","NodeType","CommonModule","ContentSelectorComponent"],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input } from '@angular/core';\nimport { isSameKeyPath, type NodeProps } from '@intlayer/core';\nimport { NodeType } from '@intlayer/types';\nimport { ContentSelectorComponent } from '../UI/ContentSelector.component';\nimport { useEditorEnabled } from './editorEnabled';\nimport { useFocusDictionary } from './focusDictionary';\nimport { useEditor } from './useEditor';\n\n/**\n * Combine your NodeProps (which include dictionaryKey & keyPath)\n * with any other div-like attributes.\n */\nexport interface ContentSelectorWrapperProps extends NodeProps {\n [key: string]: any;\n}\n\n@Component({\n selector: 'app-content-selector-wrapper',\n standalone: true,\n imports: [CommonModule, ContentSelectorComponent],\n template: `\n <app-content-selector\n *ngIf=\"enabled()\"\n (press)=\"handleSelect()\"\n [isSelecting]=\"isSelected()\"\n >\n <ng-content></ng-content>\n </app-content-selector>\n <ng-content *ngIf=\"!enabled()\"></ng-content>\n `,\n})\nexport class ContentSelectorWrapperComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: any[];\n\n // pull in the editor state & focus API\n private focusDictionary = useFocusDictionary();\n private editorEnabled = useEditorEnabled();\n\n constructor() {\n useEditor();\n }\n\n // compute whether this node is the current focus\n isSelected = computed(() => {\n const focusedContent = this.focusDictionary.focusedContent();\n return (\n focusedContent?.dictionaryKey === this.dictionaryKey &&\n (focusedContent.keyPath?.length ?? 0) > 0 &&\n isSameKeyPath(focusedContent.keyPath ?? [], this.keyPath)\n );\n });\n\n enabled = computed(() => this.editorEnabled.enabled());\n\n // when the selector is clicked, update focus\n handleSelect() {\n this.focusDictionary.setFocusedContent({\n dictionaryKey: this.dictionaryKey,\n keyPath: this.keyPath.filter((key) => key.type !== NodeType.Translation),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCO,4CAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;CAGT,AAAQ,kBAAkBA,mDAAoB;CAC9C,AAAQ,gBAAgBC,+CAAkB;CAE1C,cAAc;AACZ,sCAAW;;CAIb,+CAA4B;EAC1B,MAAM,iBAAiB,KAAK,gBAAgB,gBAAgB;AAC5D,SACE,gBAAgB,kBAAkB,KAAK,kBACtC,eAAe,SAAS,UAAU,KAAK,uCAC1B,eAAe,WAAW,EAAE,EAAE,KAAK,QAAQ;GAE3D;CAEF,4CAAyB,KAAK,cAAc,SAAS,CAAC;CAGtD,eAAe;AACb,OAAK,gBAAgB,kBAAkB;GACrC,eAAe,KAAK;GACpB,SAAS,KAAK,QAAQ,QAAQ,QAAQ,IAAI,SAASC,yBAAS,YAAY;GACzE,CAAC;;;uDA5BI;uDACA;4FAjBC;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACC,8BAAcC,8DAAyB;CACjD,UAAU;;;;;;;;;;CAUX,CAAC"}
@@ -1,6 +1,7 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.cjs');
4
5
  const require_editor_useEditedContentRenderer = require('./useEditedContentRenderer.cjs');
5
6
  let _intlayer_core = require("@intlayer/core");
6
7
  let _angular_common = require("@angular/common");
@@ -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';\nimport type { ContentNode, KeyPath, Locale } from '@intlayer/types';\nimport { useEditedContentRenderer } from './useEditedContentRenderer';\n\nexport interface EditedContentRendererProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n locale?: Locale;\n}\n\n@Component({\n selector: 'app-edited-content-renderer',\n standalone: true,\n imports: [CommonModule],\n template: ` <span [innerHTML]=\"renderedContent()\"></span> `,\n})\nexport class EditedContentRendererComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: KeyPath[];\n @Input() locale?: Locale;\n\n private fallback = signal('');\n\n private rawContent = computed(() => {\n return useEditedContentRenderer(\n this.dictionaryKey,\n this.keyPath,\n this.fallback\n );\n });\n\n /**\n * Object → getContent → string, same as the React version.\n */\n renderedContent = computed(() => {\n const rawContentValue = this.rawContent();\n\n if (typeof rawContentValue === 'object' && rawContentValue !== null) {\n const transformed = getContent(\n rawContentValue as ContentNode,\n {\n dictionaryKey: this.dictionaryKey,\n keyPath: this.keyPath,\n },\n this.locale\n );\n\n if (typeof transformed !== 'string') {\n console.error(\n `Incorrect edited content format. Content type: ${typeof transformed}. Expected string. Value ${JSON.stringify(\n transformed\n )}`\n );\n return this.fallback();\n }\n return transformed;\n }\n\n return rawContentValue() as string;\n });\n}\n"],"mappings":";;;;;;;;;AAkBO,2CAAM,+BAA+B;CAC1C,AAAS;CACT,AAAS;CACT,AAAS;CAET,AAAQ,qCAAkB,GAAG;CAE7B,AAAQ,+CAA4B;AAClC,SAAOA,iEACL,KAAK,eACL,KAAK,SACL,KAAK,SACN;GACD;;;;CAKF,oDAAiC;EAC/B,MAAM,kBAAkB,KAAK,YAAY;AAEzC,MAAI,OAAO,oBAAoB,YAAY,oBAAoB,MAAM;GACnE,MAAM,6CACJ,iBACA;IACE,eAAe,KAAK;IACpB,SAAS,KAAK;IACf,EACD,KAAK,OACN;AAED,OAAI,OAAO,gBAAgB,UAAU;AACnC,YAAQ,MACN,kDAAkD,OAAO,YAAY,2BAA2B,KAAK,UACnG,YACD,GACF;AACD,WAAO,KAAK,UAAU;;AAExB,UAAO;;AAGT,SAAO,iBAAiB;GACxB;;uDA1CM;uDACA;uDACA;2FATC;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACC,6BAAa;CACvB,UAAU;CACX,CAAC"}
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';\nimport type { ContentNode, KeyPath, Locale } from '@intlayer/types';\nimport { useEditedContentRenderer } from './useEditedContentRenderer';\n\nexport interface EditedContentRendererProps {\n dictionaryKey: string;\n keyPath: KeyPath[];\n locale?: Locale;\n}\n\n@Component({\n selector: 'app-edited-content-renderer',\n standalone: true,\n imports: [CommonModule],\n template: ` <span [innerHTML]=\"renderedContent()\"></span> `,\n})\nexport class EditedContentRendererComponent {\n @Input() dictionaryKey!: string;\n @Input() keyPath!: KeyPath[];\n @Input() locale?: Locale;\n\n private fallback = signal('');\n\n private rawContent = computed(() => {\n return useEditedContentRenderer(\n this.dictionaryKey,\n this.keyPath,\n this.fallback\n );\n });\n\n /**\n * Object → getContent → string, same as the React version.\n */\n renderedContent = computed(() => {\n const rawContentValue = this.rawContent();\n\n if (typeof rawContentValue === 'object' && rawContentValue !== null) {\n const transformed = getContent(\n rawContentValue as ContentNode,\n {\n dictionaryKey: this.dictionaryKey,\n keyPath: this.keyPath,\n },\n this.locale\n );\n\n if (typeof transformed !== 'string') {\n console.error(\n `Incorrect edited content format. Content type: ${typeof transformed}. Expected string. Value ${JSON.stringify(\n transformed\n )}`\n );\n return this.fallback();\n }\n return transformed;\n }\n\n return rawContentValue() as string;\n });\n}\n"],"mappings":";;;;;;;;;;AAkBO,2CAAM,+BAA+B;CAC1C,AAAS;CACT,AAAS;CACT,AAAS;CAET,AAAQ,qCAAkB,GAAG;CAE7B,AAAQ,+CAA4B;AAClC,SAAOA,iEACL,KAAK,eACL,KAAK,SACL,KAAK,SACN;GACD;;;;CAKF,oDAAiC;EAC/B,MAAM,kBAAkB,KAAK,YAAY;AAEzC,MAAI,OAAO,oBAAoB,YAAY,oBAAoB,MAAM;GACnE,MAAM,6CACJ,iBACA;IACE,eAAe,KAAK;IACpB,SAAS,KAAK;IACf,EACD,KAAK,OACN;AAED,OAAI,OAAO,gBAAgB,UAAU;AACnC,YAAQ,MACN,kDAAkD,OAAO,YAAY,2BAA2B,KAAK,UACnG,YACD,GACF;AACD,WAAO,KAAK,UAAU;;AAExB,UAAO;;AAGT,SAAO,iBAAiB;GACxB;;uDA1CM;uDACA;uDACA;2FATC;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACC,6BAAa;CACvB,UAAU;CACX,CAAC"}
@@ -1,6 +1,7 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.cjs');
3
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.cjs');
4
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.cjs');
4
5
  const require_editor_ContentSelectorWrapper_component = require('./ContentSelectorWrapper.component.cjs');
5
6
  const require_editor_EditedContentRenderer_component = require('./EditedContentRenderer.component.cjs');
6
7
  let _angular_common = require("@angular/common");
@@ -1 +1 @@
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';\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":";;;;;;;;;AAoCO,4CAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;;uDADD;uDACA;4FAxBC;CACT,UAAU;CACV,YAAY;CACZ,SAAS;EACPA;EACAC;EACAC;EACD;CACD,UAAU;;;;;;;;;;;;;CAaX,CAAC"}
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';\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":";;;;;;;;;;AAoCO,4CAAM,gCAAgC;CAC3C,AAAS;CACT,AAAS;;uDADD;uDACA;4FAxBC;CACT,UAAU;CACV,YAAY;CACZ,SAAS;EACPA;EACAC;EACAC;EACD;CACD,UAAU;;;;;;;;;;;;;CAaX,CAAC"}
@@ -1,6 +1,7 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _intlayer_config_built = require("@intlayer/config/built");
3
- _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
4
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
4
5
 
5
6
  //#region src/editor/communicator.ts
6
7
  const randomUUID = () => Math.random().toString(36).slice(2);
@@ -1 +1 @@
1
- {"version":3,"file":"communicator.cjs","names":["configuration"],"sources":["../../../src/editor/communicator.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\n\nconst randomUUID = () => Math.random().toString(36).slice(2);\n\n/**\n * Interface defining a cross-frame communicator\n */\nexport type Communicator = {\n postMessage: typeof window.postMessage;\n allowedOrigins?: string[];\n senderId: string;\n};\n\n/**\n * Configuration options for the communicator\n */\nexport type CommunicatorOptions = Omit<Communicator, 'senderId'>;\n\nconst { editor } = configuration;\n\n/**\n * Default values for the communicator\n */\nconst defaultValue: Communicator = {\n postMessage: () => null,\n allowedOrigins: [\n editor?.applicationURL,\n editor?.editorURL,\n editor?.cmsURL,\n ] as string[],\n senderId: '',\n};\n\n/**\n * Singleton instance\n */\nlet instance: Communicator | null = null;\n\nconst _INTLAYER_COMMUNICATOR_SYMBOL = Symbol('Communicator');\n\n/**\n * Creates a communicator client\n * @param options - Options for configuring the communicator\n */\nexport const createCommunicator = (\n options: CommunicatorOptions = { postMessage: () => null }\n) => {\n if (instance) return instance;\n\n instance = {\n ...defaultValue,\n ...options,\n senderId: randomUUID(),\n };\n\n return instance;\n};\n\n/**\n * Helper to install the Intlayer communicator into the injector\n */\nexport const installCommunicator = (\n _injector: Injector,\n options: CommunicatorOptions = { postMessage: () => null }\n) => {\n const _client = createCommunicator(options);\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createCommunicator\n};\n\n/**\n * Hook to access the communicator\n * @returns The communicator instance\n */\nexport const useCommunicator = (): Communicator => {\n try {\n const communicator = createCommunicator();\n return communicator || defaultValue;\n } catch (_error) {\n console.warn(\n 'useCommunicator: Error accessing communicator. Returning default communicator.'\n );\n return {\n postMessage: () => null,\n senderId: '',\n };\n }\n};\n"],"mappings":";;;;;AAGA,MAAM,mBAAmB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE;AAgB5D,MAAM,EAAE,WAAWA;;;;AAKnB,MAAM,eAA6B;CACjC,mBAAmB;CACnB,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,QAAQ;EACT;CACD,UAAU;CACX;;;;AAKD,IAAI,WAAgC;;;;;AAQpC,MAAa,sBACX,UAA+B,EAAE,mBAAmB,MAAM,KACvD;AACH,KAAI,SAAU,QAAO;AAErB,YAAW;EACT,GAAG;EACH,GAAG;EACH,UAAU,YAAY;EACvB;AAED,QAAO;;;;;AAMT,MAAa,uBACX,WACA,UAA+B,EAAE,mBAAmB,MAAM,KACvD;AACa,oBAAmB,QAAQ;;;;;;AAU7C,MAAa,wBAAsC;AACjD,KAAI;AAEF,SADqB,oBAAoB,IAClB;UAChB,QAAQ;AACf,UAAQ,KACN,iFACD;AACD,SAAO;GACL,mBAAmB;GACnB,UAAU;GACX"}
1
+ {"version":3,"file":"communicator.cjs","names":["configuration"],"sources":["../../../src/editor/communicator.ts"],"sourcesContent":["import type { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\n\nconst randomUUID = () => Math.random().toString(36).slice(2);\n\n/**\n * Interface defining a cross-frame communicator\n */\nexport type Communicator = {\n postMessage: typeof window.postMessage;\n allowedOrigins?: string[];\n senderId: string;\n};\n\n/**\n * Configuration options for the communicator\n */\nexport type CommunicatorOptions = Omit<Communicator, 'senderId'>;\n\nconst { editor } = configuration;\n\n/**\n * Default values for the communicator\n */\nconst defaultValue: Communicator = {\n postMessage: () => null,\n allowedOrigins: [\n editor?.applicationURL,\n editor?.editorURL,\n editor?.cmsURL,\n ] as string[],\n senderId: '',\n};\n\n/**\n * Singleton instance\n */\nlet instance: Communicator | null = null;\n\nconst _INTLAYER_COMMUNICATOR_SYMBOL = Symbol('Communicator');\n\n/**\n * Creates a communicator client\n * @param options - Options for configuring the communicator\n */\nexport const createCommunicator = (\n options: CommunicatorOptions = { postMessage: () => null }\n) => {\n if (instance) return instance;\n\n instance = {\n ...defaultValue,\n ...options,\n senderId: randomUUID(),\n };\n\n return instance;\n};\n\n/**\n * Helper to install the Intlayer communicator into the injector\n */\nexport const installCommunicator = (\n _injector: Injector,\n options: CommunicatorOptions = { postMessage: () => null }\n) => {\n const _client = createCommunicator(options);\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createCommunicator\n};\n\n/**\n * Hook to access the communicator\n * @returns The communicator instance\n */\nexport const useCommunicator = (): Communicator => {\n try {\n const communicator = createCommunicator();\n return communicator || defaultValue;\n } catch (_error) {\n console.warn(\n 'useCommunicator: Error accessing communicator. Returning default communicator.'\n );\n return {\n postMessage: () => null,\n senderId: '',\n };\n }\n};\n"],"mappings":";;;;;;AAGA,MAAM,mBAAmB,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE;AAgB5D,MAAM,EAAE,WAAWA;;;;AAKnB,MAAM,eAA6B;CACjC,mBAAmB;CACnB,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,QAAQ;EACT;CACD,UAAU;CACX;;;;AAKD,IAAI,WAAgC;;;;;AAQpC,MAAa,sBACX,UAA+B,EAAE,mBAAmB,MAAM,KACvD;AACH,KAAI,SAAU,QAAO;AAErB,YAAW;EACT,GAAG;EACH,GAAG;EACH,UAAU,YAAY;EACvB;AAED,QAAO;;;;;AAMT,MAAa,uBACX,WACA,UAA+B,EAAE,mBAAmB,MAAM,KACvD;AACa,oBAAmB,QAAQ;;;;;;AAU7C,MAAa,wBAAsC;AACjD,KAAI;AAEF,SADqB,oBAAoB,IAClB;UAChB,QAAQ;AACf,UAAQ,KACN,iFACD;AACD,SAAO;GACL,mBAAmB;GACnB,UAAU;GACX"}
@@ -1,9 +1,10 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_editor_useCrossFrameState = require('./useCrossFrameState.cjs');
3
4
  let _angular_core = require("@angular/core");
4
5
  let _intlayer_editor = require("@intlayer/editor");
5
6
  let _intlayer_config_built = require("@intlayer/config/built");
6
- _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
7
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
7
8
 
8
9
  //#region src/editor/configuration.ts
9
10
  const useConfiguration = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.cjs","names":["useCrossFrameState","MessageKey","DestroyRef","configuration"],"sources":["../../../src/editor/configuration.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport { MessageKey } from '@intlayer/editor';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport const useConfiguration = () => {\n const [pushedConfiguration, setConfiguration] =\n useCrossFrameState<IntlayerConfig>(MessageKey.INTLAYER_CONFIGURATION);\n\n // Use Angular's injection context instead of Vue's onMounted\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef) {\n // Execute immediately since Angular doesn't have the same lifecycle hooks\n if (!pushedConfiguration()) {\n setConfiguration(configuration);\n }\n }\n } catch {\n console.warn(\n 'useConfiguration called outside injection context; ' +\n 'configuration may not be synchronized.'\n );\n }\n};\n"],"mappings":";;;;;;;;AAMA,MAAa,yBAAyB;CACpC,MAAM,CAAC,qBAAqB,oBAC1BA,qDAAmCC,4BAAW,uBAAuB;AAGvE,KAAI;AAGF,gCAF0BC,0BAAY,EAAE,UAAU,MAAM,CAAC,EAIvD;OAAI,CAAC,qBAAqB,CACxB,kBAAiBC,+BAAc;;SAG7B;AACN,UAAQ,KACN,4FAED"}
1
+ {"version":3,"file":"configuration.cjs","names":["useCrossFrameState","MessageKey","DestroyRef","configuration"],"sources":["../../../src/editor/configuration.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport { MessageKey } from '@intlayer/editor';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport const useConfiguration = () => {\n const [pushedConfiguration, setConfiguration] =\n useCrossFrameState<IntlayerConfig>(MessageKey.INTLAYER_CONFIGURATION);\n\n // Use Angular's injection context instead of Vue's onMounted\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef) {\n // Execute immediately since Angular doesn't have the same lifecycle hooks\n if (!pushedConfiguration()) {\n setConfiguration(configuration);\n }\n }\n } catch {\n console.warn(\n 'useConfiguration called outside injection context; ' +\n 'configuration may not be synchronized.'\n );\n }\n};\n"],"mappings":";;;;;;;;;AAMA,MAAa,yBAAyB;CACpC,MAAM,CAAC,qBAAqB,oBAC1BA,qDAAmCC,4BAAW,uBAAuB;AAGvE,KAAI;AAGF,gCAF0BC,0BAAY,EAAE,UAAU,MAAM,CAAC,EAIvD;OAAI,CAAC,qBAAqB,CACxB,kBAAiBC,+BAAc;;SAG7B;AACN,UAAQ,KACN,4FAED"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let _angular_core = require("@angular/core");
3
4
 
4
5
  //#region src/editor/createSharedComposable.ts
@@ -1 +1 @@
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":";;;;;;;;AAUA,SAAgB,kBAAkB,IAAgB;AAChD,KAAI;EACF,MAAM,uCAAoBA,0BAAY,EAAE,UAAU,MAAM,CAAC;AACzD,MAAI,YAAY;AACd,cAAW,UAAU,GAAG;AACxB,UAAO;;AAET,SAAO;SACD;AAEN,SAAO;;;;;;;AAQX,MAAa,0BACX,eAC+B;CAC/B,IAAI,cAAc;CAClB,IAAI;CACJ,IAAI;CAEJ,MAAM,gBAAgB;AACpB,iBAAe;AACf,MAAI,aAAa,eAAe,GAAG;AACjC,cAAW;AACX,WAAQ;AACR,eAAY;;;AAIhB,UAAa,GAAG,SAAS;AACvB,iBAAe;AACf,MAAI,CAAC,OAAO;AACV,WAAQ,WAAW,GAAG,KAAK;AAE3B,OAAI,kBAAkB,QAAQ,CAC5B,aAAY;QAId,mBAAkB,QAAQ;AAE5B,SAAO"}
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":";;;;;;;;;AAUA,SAAgB,kBAAkB,IAAgB;AAChD,KAAI;EACF,MAAM,uCAAoBA,0BAAY,EAAE,UAAU,MAAM,CAAC;AACzD,MAAI,YAAY;AACd,cAAW,UAAU,GAAG;AACxB,UAAO;;AAET,SAAO;SACD;AAEN,SAAO;;;;;;;AAQX,MAAa,0BACX,eAC+B;CAC/B,IAAI,cAAc;CAClB,IAAI;CACJ,IAAI;CAEJ,MAAM,gBAAgB;AACpB,iBAAe;AACf,MAAI,aAAa,eAAe,GAAG;AACjC,cAAW;AACX,WAAQ;AACR,eAAY;;;AAIhB,UAAa,GAAG,SAAS;AACvB,iBAAe;AACf,MAAI,CAAC,OAAO;AACV,WAAQ,WAAW,GAAG,KAAK;AAE3B,OAAI,kBAAkB,QAAQ,CAC5B,aAAY;QAId,mBAAkB,QAAQ;AAE5B,SAAO"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_editor_createSharedComposable = require('./createSharedComposable.cjs');
3
4
  const require_editor_useCrossFrameState = require('./useCrossFrameState.cjs');
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"dictionariesRecord.cjs","names":["createSharedComposable","useCrossFrameState","MessageKey"],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type { Dictionary } from '@intlayer/types';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\n/**\n * Singleton instance\n */\nlet instance: DictionariesRecordClient | null = null;\n\nexport type DictionaryContent = Record<Dictionary['key'], Dictionary>;\n\ntype DictionariesRecordClient = {\n localeDictionaries: Signal<DictionaryContent>;\n setLocaleDictionaries: (newValue: DictionaryContent) => void;\n setLocaleDictionary: (dictionary: Dictionary) => void;\n};\n\nexport const createDictionaryRecordClient = () => {\n if (instance) return instance;\n\n const localeDictionariesSignal = signal<DictionaryContent | undefined>(\n undefined\n );\n\n instance = {\n localeDictionaries:\n localeDictionariesSignal.asReadonly() as Signal<DictionaryContent>,\n\n setLocaleDictionaries: (newValue) => {\n localeDictionariesSignal.set(newValue ?? {});\n },\n\n setLocaleDictionary(dictionary) {\n const current = localeDictionariesSignal();\n localeDictionariesSignal.set({\n ...current,\n [dictionary.localId!]: dictionary,\n });\n },\n };\n\n return instance;\n};\n\n/**\n * Helper to install the provider into the injector\n */\nexport const installDictionariesRecord = (_injector: Injector) => {\n const _client = createDictionaryRecordClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createDictionaryRecordClient\n};\n\nexport const useDictionariesRecord = createSharedComposable(() => {\n const client = createDictionaryRecordClient();\n\n if (!client) {\n throw new Error('DictionariesRecord state not found');\n }\n\n const [_dictionariesRecord, setDictionariesRecord] =\n useCrossFrameState<DictionaryContent>(\n MessageKey.INTLAYER_LOCALE_DICTIONARIES_CHANGED,\n undefined\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = client.localeDictionaries();\n setDictionariesRecord(newValue); // its undefined but shouldnt\n });\n});\n"],"mappings":";;;;;;;;;;AASA,IAAI,WAA4C;AAUhD,MAAa,qCAAqC;AAChD,KAAI,SAAU,QAAO;CAErB,MAAM,qDACJ,OACD;AAED,YAAW;EACT,oBACE,yBAAyB,YAAY;EAEvC,wBAAwB,aAAa;AACnC,4BAAyB,IAAI,YAAY,EAAE,CAAC;;EAG9C,oBAAoB,YAAY;GAC9B,MAAM,UAAU,0BAA0B;AAC1C,4BAAyB,IAAI;IAC3B,GAAG;KACF,WAAW,UAAW;IACxB,CAAC;;EAEL;AAED,QAAO;;;;;AAMT,MAAa,6BAA6B,cAAwB;AAChD,+BAA8B;;AAMhD,MAAa,wBAAwBA,mEAA6B;CAChE,MAAM,SAAS,8BAA8B;AAE7C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,qCAAqC;CAGvD,MAAM,CAAC,qBAAqB,yBAC1BC,qDACEC,4BAAW,sCACX,OACD;AAGH,iCAAa;AAEX,wBADiB,OAAO,oBAAoB,CACb;GAC/B;EACF"}
1
+ {"version":3,"file":"dictionariesRecord.cjs","names":["createSharedComposable","useCrossFrameState","MessageKey"],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type { Dictionary } from '@intlayer/types';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\n/**\n * Singleton instance\n */\nlet instance: DictionariesRecordClient | null = null;\n\nexport type DictionaryContent = Record<Dictionary['key'], Dictionary>;\n\ntype DictionariesRecordClient = {\n localeDictionaries: Signal<DictionaryContent>;\n setLocaleDictionaries: (newValue: DictionaryContent) => void;\n setLocaleDictionary: (dictionary: Dictionary) => void;\n};\n\nexport const createDictionaryRecordClient = () => {\n if (instance) return instance;\n\n const localeDictionariesSignal = signal<DictionaryContent | undefined>(\n undefined\n );\n\n instance = {\n localeDictionaries:\n localeDictionariesSignal.asReadonly() as Signal<DictionaryContent>,\n\n setLocaleDictionaries: (newValue) => {\n localeDictionariesSignal.set(newValue ?? {});\n },\n\n setLocaleDictionary(dictionary) {\n const current = localeDictionariesSignal();\n localeDictionariesSignal.set({\n ...current,\n [dictionary.localId!]: dictionary,\n });\n },\n };\n\n return instance;\n};\n\n/**\n * Helper to install the provider into the injector\n */\nexport const installDictionariesRecord = (_injector: Injector) => {\n const _client = createDictionaryRecordClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createDictionaryRecordClient\n};\n\nexport const useDictionariesRecord = createSharedComposable(() => {\n const client = createDictionaryRecordClient();\n\n if (!client) {\n throw new Error('DictionariesRecord state not found');\n }\n\n const [_dictionariesRecord, setDictionariesRecord] =\n useCrossFrameState<DictionaryContent>(\n MessageKey.INTLAYER_LOCALE_DICTIONARIES_CHANGED,\n undefined\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = client.localeDictionaries();\n setDictionariesRecord(newValue); // its undefined but shouldnt\n });\n});\n"],"mappings":";;;;;;;;;;;AASA,IAAI,WAA4C;AAUhD,MAAa,qCAAqC;AAChD,KAAI,SAAU,QAAO;CAErB,MAAM,qDACJ,OACD;AAED,YAAW;EACT,oBACE,yBAAyB,YAAY;EAEvC,wBAAwB,aAAa;AACnC,4BAAyB,IAAI,YAAY,EAAE,CAAC;;EAG9C,oBAAoB,YAAY;GAC9B,MAAM,UAAU,0BAA0B;AAC1C,4BAAyB,IAAI;IAC3B,GAAG;KACF,WAAW,UAAW;IACxB,CAAC;;EAEL;AAED,QAAO;;;;;AAMT,MAAa,6BAA6B,cAAwB;AAChD,+BAA8B;;AAMhD,MAAa,wBAAwBA,mEAA6B;CAChE,MAAM,SAAS,8BAA8B;AAE7C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,qCAAqC;CAGvD,MAAM,CAAC,qBAAqB,yBAC1BC,qDACEC,4BAAW,sCACX,OACD;AAGH,iCAAa;AAEX,wBADiB,OAAO,oBAAoB,CACb;GAC/B;EACF"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_editor_createSharedComposable = require('./createSharedComposable.cjs');
3
4
  const require_editor_useCrossFrameState = require('./useCrossFrameState.cjs');
4
5
  let _intlayer_core = require("@intlayer/core");
@@ -1 +1 @@
1
- {"version":3,"file":"editedContent.cjs","names":["createSharedComposable","useCrossFrameState","MessageKey"],"sources":["../../../src/editor/editedContent.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { getContentNodeByKeyPath } from '@intlayer/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type {\n ContentNode,\n Dictionary,\n KeyPath,\n LocalDictionaryId,\n} from '@intlayer/types';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport type EditedContent = Record<Dictionary['key'], Dictionary>;\n\ntype EditedContentClient = {\n editedContent: Signal<EditedContent>;\n setEditedContent: (editedContent: EditedContent) => void;\n getEditedContentValue: (\n localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string,\n keyPath: KeyPath[]\n ) => ContentNode | undefined;\n};\n\n/**\n * Singleton instance\n */\nlet instance: EditedContentClient | null = null;\n\nconst _INTLAYER_EDITED_CONTENT_SYMBOL = Symbol('EditedContent');\n\n/**\n * Creates an edited content client\n */\nexport const createEditedContentClient = () => {\n if (instance) return instance;\n\n const editedContentSignal = signal<EditedContent>({});\n\n instance = {\n editedContent: editedContentSignal.asReadonly(),\n getEditedContentValue: (\n localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string,\n keyPath: KeyPath[]\n ): ContentNode | undefined => {\n const editedContent = editedContentSignal();\n\n if (!editedContent) return undefined;\n\n const isDictionaryId =\n localDictionaryIdOrKey.includes(':local:') ||\n localDictionaryIdOrKey.includes(':remote:');\n\n if (isDictionaryId) {\n const currentContent =\n editedContent?.[localDictionaryIdOrKey as LocalDictionaryId]\n ?.content ?? {};\n\n const contentNode = getContentNodeByKeyPath(currentContent, keyPath);\n\n return contentNode;\n }\n\n const filteredDictionariesLocalId = Object.keys(editedContent).filter(\n (key) => key.startsWith(`${localDictionaryIdOrKey}:`)\n );\n\n for (const localDictionaryId of filteredDictionariesLocalId) {\n const currentContent =\n editedContent?.[localDictionaryId as LocalDictionaryId]?.content ??\n {};\n const contentNode = getContentNodeByKeyPath(currentContent, keyPath);\n\n if (contentNode) return contentNode;\n }\n\n return undefined;\n },\n setEditedContent: (editedContent: EditedContent) => {\n editedContentSignal.set(editedContent);\n },\n };\n\n return instance;\n};\n\n/**\n * Helper to install the edited content into the injector\n */\nexport const installEditedContent = (_injector: Injector) => {\n const _client = createEditedContentClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createEditedContentClient\n};\n\nexport const useEditedContent = createSharedComposable(() => {\n const client = createEditedContentClient();\n\n if (!client) {\n throw new Error('EditedContent state not found');\n }\n\n const [edited, setEdited] = useCrossFrameState<EditedContent>(\n MessageKey.INTLAYER_EDITED_CONTENT_CHANGED,\n {}\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = edited();\n client.setEditedContent(newValue ?? {});\n });\n\n effect(() => {\n const newValue = client.editedContent();\n setEdited(newValue);\n });\n\n return client;\n});\n"],"mappings":";;;;;;;;;;;AA0BA,IAAI,WAAuC;;;;AAO3C,MAAa,kCAAkC;AAC7C,KAAI,SAAU,QAAO;CAErB,MAAM,gDAA4C,EAAE,CAAC;AAErD,YAAW;EACT,eAAe,oBAAoB,YAAY;EAC/C,wBACE,wBACA,YAC4B;GAC5B,MAAM,gBAAgB,qBAAqB;AAE3C,OAAI,CAAC,cAAe,QAAO;AAM3B,OAHE,uBAAuB,SAAS,UAAU,IAC1C,uBAAuB,SAAS,WAAW,CAS3C,oDALE,gBAAgB,yBACZ,WAAW,EAAE,EAEyC,QAAQ;GAKtE,MAAM,8BAA8B,OAAO,KAAK,cAAc,CAAC,QAC5D,QAAQ,IAAI,WAAW,GAAG,uBAAuB,GAAG,CACtD;AAED,QAAK,MAAM,qBAAqB,6BAA6B;IAI3D,MAAM,0DAFJ,gBAAgB,oBAAyC,WACzD,EAAE,EACwD,QAAQ;AAEpE,QAAI,YAAa,QAAO;;;EAK5B,mBAAmB,kBAAiC;AAClD,uBAAoB,IAAI,cAAc;;EAEzC;AAED,QAAO;;;;;AAMT,MAAa,wBAAwB,cAAwB;AAC3C,4BAA2B;;AAM7C,MAAa,mBAAmBA,mEAA6B;CAC3D,MAAM,SAAS,2BAA2B;AAE1C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,gCAAgC;CAGlD,MAAM,CAAC,QAAQ,aAAaC,qDAC1BC,4BAAW,iCACX,EAAE,CACH;AAGD,iCAAa;EACX,MAAM,WAAW,QAAQ;AACzB,SAAO,iBAAiB,YAAY,EAAE,CAAC;GACvC;AAEF,iCAAa;AAEX,YADiB,OAAO,eAAe,CACpB;GACnB;AAEF,QAAO;EACP"}
1
+ {"version":3,"file":"editedContent.cjs","names":["createSharedComposable","useCrossFrameState","MessageKey"],"sources":["../../../src/editor/editedContent.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport { getContentNodeByKeyPath } from '@intlayer/core';\nimport { MessageKey } from '@intlayer/editor';\nimport type {\n ContentNode,\n Dictionary,\n KeyPath,\n LocalDictionaryId,\n} from '@intlayer/types';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nexport type EditedContent = Record<Dictionary['key'], Dictionary>;\n\ntype EditedContentClient = {\n editedContent: Signal<EditedContent>;\n setEditedContent: (editedContent: EditedContent) => void;\n getEditedContentValue: (\n localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string,\n keyPath: KeyPath[]\n ) => ContentNode | undefined;\n};\n\n/**\n * Singleton instance\n */\nlet instance: EditedContentClient | null = null;\n\nconst _INTLAYER_EDITED_CONTENT_SYMBOL = Symbol('EditedContent');\n\n/**\n * Creates an edited content client\n */\nexport const createEditedContentClient = () => {\n if (instance) return instance;\n\n const editedContentSignal = signal<EditedContent>({});\n\n instance = {\n editedContent: editedContentSignal.asReadonly(),\n getEditedContentValue: (\n localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string,\n keyPath: KeyPath[]\n ): ContentNode | undefined => {\n const editedContent = editedContentSignal();\n\n if (!editedContent) return undefined;\n\n const isDictionaryId =\n localDictionaryIdOrKey.includes(':local:') ||\n localDictionaryIdOrKey.includes(':remote:');\n\n if (isDictionaryId) {\n const currentContent =\n editedContent?.[localDictionaryIdOrKey as LocalDictionaryId]\n ?.content ?? {};\n\n const contentNode = getContentNodeByKeyPath(currentContent, keyPath);\n\n return contentNode;\n }\n\n const filteredDictionariesLocalId = Object.keys(editedContent).filter(\n (key) => key.startsWith(`${localDictionaryIdOrKey}:`)\n );\n\n for (const localDictionaryId of filteredDictionariesLocalId) {\n const currentContent =\n editedContent?.[localDictionaryId as LocalDictionaryId]?.content ??\n {};\n const contentNode = getContentNodeByKeyPath(currentContent, keyPath);\n\n if (contentNode) return contentNode;\n }\n\n return undefined;\n },\n setEditedContent: (editedContent: EditedContent) => {\n editedContentSignal.set(editedContent);\n },\n };\n\n return instance;\n};\n\n/**\n * Helper to install the edited content into the injector\n */\nexport const installEditedContent = (_injector: Injector) => {\n const _client = createEditedContentClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createEditedContentClient\n};\n\nexport const useEditedContent = createSharedComposable(() => {\n const client = createEditedContentClient();\n\n if (!client) {\n throw new Error('EditedContent state not found');\n }\n\n const [edited, setEdited] = useCrossFrameState<EditedContent>(\n MessageKey.INTLAYER_EDITED_CONTENT_CHANGED,\n {}\n );\n\n // Use Angular effects instead of Vue watchers\n effect(() => {\n const newValue = edited();\n client.setEditedContent(newValue ?? {});\n });\n\n effect(() => {\n const newValue = client.editedContent();\n setEdited(newValue);\n });\n\n return client;\n});\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAI,WAAuC;;;;AAO3C,MAAa,kCAAkC;AAC7C,KAAI,SAAU,QAAO;CAErB,MAAM,gDAA4C,EAAE,CAAC;AAErD,YAAW;EACT,eAAe,oBAAoB,YAAY;EAC/C,wBACE,wBACA,YAC4B;GAC5B,MAAM,gBAAgB,qBAAqB;AAE3C,OAAI,CAAC,cAAe,QAAO;AAM3B,OAHE,uBAAuB,SAAS,UAAU,IAC1C,uBAAuB,SAAS,WAAW,CAS3C,oDALE,gBAAgB,yBACZ,WAAW,EAAE,EAEyC,QAAQ;GAKtE,MAAM,8BAA8B,OAAO,KAAK,cAAc,CAAC,QAC5D,QAAQ,IAAI,WAAW,GAAG,uBAAuB,GAAG,CACtD;AAED,QAAK,MAAM,qBAAqB,6BAA6B;IAI3D,MAAM,0DAFJ,gBAAgB,oBAAyC,WACzD,EAAE,EACwD,QAAQ;AAEpE,QAAI,YAAa,QAAO;;;EAK5B,mBAAmB,kBAAiC;AAClD,uBAAoB,IAAI,cAAc;;EAEzC;AAED,QAAO;;;;;AAMT,MAAa,wBAAwB,cAAwB;AAC3C,4BAA2B;;AAM7C,MAAa,mBAAmBA,mEAA6B;CAC3D,MAAM,SAAS,2BAA2B;AAE1C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,gCAAgC;CAGlD,MAAM,CAAC,QAAQ,aAAaC,qDAC1BC,4BAAW,iCACX,EAAE,CACH;AAGD,iCAAa;EACX,MAAM,WAAW,QAAQ;AACzB,SAAO,iBAAiB,YAAY,EAAE,CAAC;GACvC;AAEF,iCAAa;AAEX,YADiB,OAAO,eAAe,CACpB;GACnB;AAEF,QAAO;EACP"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_editor_createSharedComposable = require('./createSharedComposable.cjs');
3
4
  const require_editor_useCrossFrameMessageListener = require('./useCrossFrameMessageListener.cjs');
4
5
  let _angular_core = require("@angular/core");
@@ -1 +1 @@
1
- {"version":3,"file":"editorEnabled.cjs","names":["createSharedComposable","MessageKey"],"sources":["../../../src/editor/editorEnabled.ts"],"sourcesContent":["import {\n computed,\n effect,\n type Injector,\n type Signal,\n signal,\n} from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\n/* ------------------------------------------------------------------ */\n/* public type – identical to the React version */\n/* ------------------------------------------------------------------ */\nexport type EditorEnabledStateProps = {\n wrapperEnabled: Signal<boolean>;\n isInIframe: Signal<boolean>;\n enabled: Signal<boolean>;\n};\n\n/**\n * Singleton instance\n */\nlet instance: EditorEnabledStateProps | null = null;\n\nconst _INTLAYER_EDITOR_ENABLED_SYMBOL = Symbol('EditorEnabled');\n\n/**\n * Creates an editor wrapperEnabled client\n */\nexport const createEditorEnabledClient = () => {\n if (instance) return instance;\n\n const wrapperEnabledSignal = signal(false);\n const isInIframeSignal = signal(false);\n const enabledSignal = computed(\n () => wrapperEnabledSignal() && isInIframeSignal()\n );\n\n instance = {\n wrapperEnabled: wrapperEnabledSignal.asReadonly(),\n isInIframe: isInIframeSignal.asReadonly(),\n enabled: enabledSignal,\n };\n\n return instance;\n};\n\n/**\n * Helper to install the editor wrapperEnabled state into the injector\n */\nexport const installEditorEnabled = (_injector: Injector) => {\n const _client = createEditorEnabledClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createEditorEnabledClient\n};\n\nexport const useEditorEnabled = createSharedComposable(() => {\n const client = createEditorEnabledClient();\n\n if (!client) {\n throw new Error('EditorEnabled state not found');\n }\n\n // Listen for the iframe parent if the editor send a message `INTLAYER_EDITOR_ENABLED`\n useCrossFrameMessageListener<boolean>(\n `${MessageKey.INTLAYER_EDITOR_ENABLED}/post`,\n (data) => {\n (client.wrapperEnabled as any).set(data);\n }\n );\n\n // Use effect to set up the iframe check immediately\n effect(\n () => {\n if (typeof window !== 'undefined') {\n (client.isInIframe as any).set(window.self !== window.top);\n }\n },\n { allowSignalWrites: true }\n );\n\n return client;\n});\n"],"mappings":";;;;;;;;;;AAuBA,IAAI,WAA2C;;;;AAO/C,MAAa,kCAAkC;AAC7C,KAAI,SAAU,QAAO;CAErB,MAAM,iDAA8B,MAAM;CAC1C,MAAM,6CAA0B,MAAM;CACtC,MAAM,kDACE,sBAAsB,IAAI,kBAAkB,CACnD;AAED,YAAW;EACT,gBAAgB,qBAAqB,YAAY;EACjD,YAAY,iBAAiB,YAAY;EACzC,SAAS;EACV;AAED,QAAO;;;;;AAMT,MAAa,wBAAwB,cAAwB;AAC3C,4BAA2B;;AAM7C,MAAa,mBAAmBA,mEAA6B;CAC3D,MAAM,SAAS,2BAA2B;AAE1C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,gCAAgC;AAIlD,0EACE,GAAGC,4BAAW,wBAAwB,SACrC,SAAS;AACR,EAAC,OAAO,eAAuB,IAAI,KAAK;GAE3C;AAGD,iCACQ;AACJ,MAAI,OAAO,WAAW,YACpB,CAAC,OAAO,WAAmB,IAAI,OAAO,SAAS,OAAO,IAAI;IAG9D,EAAE,mBAAmB,MAAM,CAC5B;AAED,QAAO;EACP"}
1
+ {"version":3,"file":"editorEnabled.cjs","names":["createSharedComposable","MessageKey"],"sources":["../../../src/editor/editorEnabled.ts"],"sourcesContent":["import {\n computed,\n effect,\n type Injector,\n type Signal,\n signal,\n} from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\n/* ------------------------------------------------------------------ */\n/* public type – identical to the React version */\n/* ------------------------------------------------------------------ */\nexport type EditorEnabledStateProps = {\n wrapperEnabled: Signal<boolean>;\n isInIframe: Signal<boolean>;\n enabled: Signal<boolean>;\n};\n\n/**\n * Singleton instance\n */\nlet instance: EditorEnabledStateProps | null = null;\n\nconst _INTLAYER_EDITOR_ENABLED_SYMBOL = Symbol('EditorEnabled');\n\n/**\n * Creates an editor wrapperEnabled client\n */\nexport const createEditorEnabledClient = () => {\n if (instance) return instance;\n\n const wrapperEnabledSignal = signal(false);\n const isInIframeSignal = signal(false);\n const enabledSignal = computed(\n () => wrapperEnabledSignal() && isInIframeSignal()\n );\n\n instance = {\n wrapperEnabled: wrapperEnabledSignal.asReadonly(),\n isInIframe: isInIframeSignal.asReadonly(),\n enabled: enabledSignal,\n };\n\n return instance;\n};\n\n/**\n * Helper to install the editor wrapperEnabled state into the injector\n */\nexport const installEditorEnabled = (_injector: Injector) => {\n const _client = createEditorEnabledClient();\n\n // Angular doesn't have a direct equivalent to Vue's app.provide\n // The client is stored as a singleton and accessed via createEditorEnabledClient\n};\n\nexport const useEditorEnabled = createSharedComposable(() => {\n const client = createEditorEnabledClient();\n\n if (!client) {\n throw new Error('EditorEnabled state not found');\n }\n\n // Listen for the iframe parent if the editor send a message `INTLAYER_EDITOR_ENABLED`\n useCrossFrameMessageListener<boolean>(\n `${MessageKey.INTLAYER_EDITOR_ENABLED}/post`,\n (data) => {\n (client.wrapperEnabled as any).set(data);\n }\n );\n\n // Use effect to set up the iframe check immediately\n effect(\n () => {\n if (typeof window !== 'undefined') {\n (client.isInIframe as any).set(window.self !== window.top);\n }\n },\n { allowSignalWrites: true }\n );\n\n return client;\n});\n"],"mappings":";;;;;;;;;;;AAuBA,IAAI,WAA2C;;;;AAO/C,MAAa,kCAAkC;AAC7C,KAAI,SAAU,QAAO;CAErB,MAAM,iDAA8B,MAAM;CAC1C,MAAM,6CAA0B,MAAM;CACtC,MAAM,kDACE,sBAAsB,IAAI,kBAAkB,CACnD;AAED,YAAW;EACT,gBAAgB,qBAAqB,YAAY;EACjD,YAAY,iBAAiB,YAAY;EACzC,SAAS;EACV;AAED,QAAO;;;;;AAMT,MAAa,wBAAwB,cAAwB;AAC3C,4BAA2B;;AAM7C,MAAa,mBAAmBA,mEAA6B;CAC3D,MAAM,SAAS,2BAA2B;AAE1C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,gCAAgC;AAIlD,0EACE,GAAGC,4BAAW,wBAAwB,SACrC,SAAS;AACR,EAAC,OAAO,eAAuB,IAAI,KAAK;GAE3C;AAGD,iCACQ;AACJ,MAAI,OAAO,WAAW,YACpB,CAAC,OAAO,WAAmB,IAAI,OAAO,SAAS,OAAO,IAAI;IAG9D,EAAE,mBAAmB,MAAM,CAC5B;AAED,QAAO;EACP"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_editor_createSharedComposable = require('./createSharedComposable.cjs');
3
4
  const require_editor_useCrossFrameState = require('./useCrossFrameState.cjs');
4
5
  const require_client_installIntlayer = require('../client/installIntlayer.cjs');