angular-intlayer 8.0.0-canary.4 → 8.0.0-canary.6

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 (85) hide show
  1. package/README.md +0 -2
  2. package/dist/cjs/UI/ContentSelector.component.cjs +53 -32
  3. package/dist/cjs/UI/ContentSelector.component.cjs.map +1 -1
  4. package/dist/cjs/_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.cjs +11 -0
  5. package/dist/cjs/_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.cjs +8 -0
  6. package/dist/cjs/client/index.cjs +6 -1
  7. package/dist/cjs/client/installIntlayer.cjs +9 -2
  8. package/dist/cjs/client/installIntlayer.cjs.map +1 -1
  9. package/dist/cjs/client/useDictionary.cjs +1 -1
  10. package/dist/cjs/client/useDictionary.cjs.map +1 -1
  11. package/dist/cjs/client/useIntlayer.cjs +1 -1
  12. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  13. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +28 -18
  14. package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +1 -1
  15. package/dist/cjs/editor/EditedContentRenderer.component.cjs +21 -10
  16. package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +1 -1
  17. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs +16 -6
  18. package/dist/cjs/editor/EditorSelectorRenderer.component.cjs.map +1 -1
  19. package/dist/cjs/editor/index.cjs +18 -3
  20. package/dist/cjs/editor/useEditedContentRenderer.cjs +9 -2
  21. package/dist/cjs/editor/useEditedContentRenderer.cjs.map +1 -1
  22. package/dist/cjs/getDictionary.cjs +1 -0
  23. package/dist/cjs/getDictionary.cjs.map +1 -1
  24. package/dist/cjs/getIntlayer.cjs +2 -0
  25. package/dist/cjs/getIntlayer.cjs.map +1 -1
  26. package/dist/cjs/index.cjs +15 -2
  27. package/dist/cjs/markdown/index.cjs +7 -1
  28. package/dist/cjs/markdown/installIntlayerMarkdown.cjs +45 -4
  29. package/dist/cjs/markdown/installIntlayerMarkdown.cjs.map +1 -1
  30. package/dist/cjs/plugins.cjs +101 -3
  31. package/dist/cjs/plugins.cjs.map +1 -1
  32. package/dist/cjs/renderIntlayerNode.cjs +15 -5
  33. package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
  34. package/dist/esm/UI/ContentSelector.component.mjs +47 -31
  35. package/dist/esm/UI/ContentSelector.component.mjs.map +1 -1
  36. package/dist/esm/_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.mjs +10 -0
  37. package/dist/esm/_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.mjs +7 -0
  38. package/dist/esm/client/installIntlayer.mjs +3 -1
  39. package/dist/esm/client/installIntlayer.mjs.map +1 -1
  40. package/dist/esm/client/useDictionary.mjs +1 -1
  41. package/dist/esm/client/useDictionary.mjs.map +1 -1
  42. package/dist/esm/client/useIntlayer.mjs +1 -1
  43. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  44. package/dist/esm/editor/ContentSelectorWrapper.component.mjs +22 -17
  45. package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +1 -1
  46. package/dist/esm/editor/EditedContentRenderer.component.mjs +15 -9
  47. package/dist/esm/editor/EditedContentRenderer.component.mjs.map +1 -1
  48. package/dist/esm/editor/EditorSelectorRenderer.component.mjs +10 -5
  49. package/dist/esm/editor/EditorSelectorRenderer.component.mjs.map +1 -1
  50. package/dist/esm/editor/useEditedContentRenderer.mjs +3 -1
  51. package/dist/esm/editor/useEditedContentRenderer.mjs.map +1 -1
  52. package/dist/esm/getDictionary.mjs +2 -1
  53. package/dist/esm/getDictionary.mjs.map +1 -1
  54. package/dist/esm/getIntlayer.mjs +3 -1
  55. package/dist/esm/getIntlayer.mjs.map +1 -1
  56. package/dist/esm/index.mjs +3 -3
  57. package/dist/esm/markdown/index.mjs +2 -2
  58. package/dist/esm/markdown/installIntlayerMarkdown.mjs +39 -4
  59. package/dist/esm/markdown/installIntlayerMarkdown.mjs.map +1 -1
  60. package/dist/esm/plugins.mjs +102 -6
  61. package/dist/esm/plugins.mjs.map +1 -1
  62. package/dist/esm/renderIntlayerNode.mjs +15 -5
  63. package/dist/esm/renderIntlayerNode.mjs.map +1 -1
  64. package/dist/types/client/installIntlayer.d.ts +2 -2
  65. package/dist/types/client/useDictionary.d.ts +2 -1
  66. package/dist/types/client/useDictionary.d.ts.map +1 -1
  67. package/dist/types/client/useDictionaryAsync.d.ts +2 -1
  68. package/dist/types/client/useDictionaryAsync.d.ts.map +1 -1
  69. package/dist/types/client/useDictionaryDynamic.d.ts +4 -3
  70. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  71. package/dist/types/client/useIntl.d.ts +2 -2
  72. package/dist/types/client/useIntlayer.d.ts +2 -1
  73. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  74. package/dist/types/client/useLocale.d.ts +5 -5
  75. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  76. package/dist/types/editor/EditedContentRenderer.component.d.ts +2 -2
  77. package/dist/types/editor/useCrossURLPathState.d.ts +3 -3
  78. package/dist/types/getIntlayer.d.ts.map +1 -1
  79. package/dist/types/index.d.ts +3 -3
  80. package/dist/types/markdown/index.d.ts +2 -2
  81. package/dist/types/markdown/installIntlayerMarkdown.d.ts +3 -1
  82. package/dist/types/markdown/installIntlayerMarkdown.d.ts.map +1 -1
  83. package/dist/types/plugins.d.ts +38 -10
  84. package/dist/types/plugins.d.ts.map +1 -1
  85. package/package.json +9 -9
package/README.md CHANGED
@@ -27,8 +27,6 @@
27
27
  <a href="https://github.com/aymericzip/intlayer/blob/main/LICENSE" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/license/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="license"/></a>
28
28
  <a href="https://github.com/aymericzip/intlayer/commits/main" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/last-commit/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="last commit"/>
29
29
  </a>
30
- <a href="https://www.bountyhub.dev/en/bounty/view/a2f24259-80ae-4a19-82e7-288718fba449/adapt-markdown-parser-in-a-custom-packages" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/badge/Bounties-on%20BountyHub-yellow?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="Bounties on BountyHub"/>
31
- </a>
32
30
  </p>
33
31
 
34
32
  ![Watch the video](https://github.com/aymericzip/intlayer/blob/main/docs/assets/demo_video.gif)
@@ -1,39 +1,19 @@
1
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');
2
4
  let _angular_common = require("@angular/common");
3
5
  let _angular_core = require("@angular/core");
4
6
 
5
7
  //#region src/UI/ContentSelector.component.ts
8
+ var _ref;
6
9
  const DEFAULT_PRESS_DETECT_DURATION = 250;
7
- var ContentSelectorComponent = @((0, _angular_core.Component)({
8
- selector: "app-content-selector",
9
- template: `
10
- <span
11
- #containerRef
12
- role="button"
13
- tabindex="0"
14
- (click)="handleClick($event)"
15
- (mousedown)="handleMouseDown()"
16
- (mouseup)="handleMouseUp()"
17
- (mouseleave)="handleMouseUp()"
18
- (touchstart)="handleMouseDown()"
19
- (touchend)="handleMouseUp()"
20
- (touchcancel)="handleMouseUp()"
21
- (blur)="handleBlur()"
22
- (mouseenter)="onMouseEnter()"
23
- [ngStyle]="getContainerStyle()"
24
- >
25
- <ng-content></ng-content>
26
- </span>
27
- `,
28
- standalone: true,
29
- imports: [_angular_common.CommonModule]
30
- })) class {
31
- @((0, _angular_core.Input)()) onClickOutside;
32
- @((0, _angular_core.Input)()) pressDuration;
33
- @((0, _angular_core.Input)()) isSelecting;
34
- @((0, _angular_core.Output)()) click = new _angular_core.EventEmitter();
35
- @((0, _angular_core.Output)()) press = new _angular_core.EventEmitter();
36
- @((0, _angular_core.ViewChild)("containerRef", { static: true })) containerRef;
10
+ let ContentSelectorComponent = class ContentSelectorComponent {
11
+ onClickOutside;
12
+ pressDuration;
13
+ isSelecting;
14
+ click = new _angular_core.EventEmitter();
15
+ press = new _angular_core.EventEmitter();
16
+ containerRef;
37
17
  isHovered = (0, _angular_core.signal)(false);
38
18
  isSelectingState = (0, _angular_core.signal)(false);
39
19
  pressTimerRef = null;
@@ -47,7 +27,7 @@ var ContentSelectorComponent = @((0, _angular_core.Component)({
47
27
  ngOnDestroy() {
48
28
  this.clearPressTimer();
49
29
  }
50
- @((0, _angular_core.HostListener)("document:mousedown", ["$event"])) onDocumentMouseDown(event) {
30
+ onDocumentMouseDown(event) {
51
31
  this.handleClickOutside(event);
52
32
  }
53
33
  handleOnLongPress() {
@@ -106,7 +86,48 @@ var ContentSelectorComponent = @((0, _angular_core.Component)({
106
86
  };
107
87
  }
108
88
  };
89
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Function)], ContentSelectorComponent.prototype, "onClickOutside", void 0);
90
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Number)], ContentSelectorComponent.prototype, "pressDuration", void 0);
91
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Boolean)], ContentSelectorComponent.prototype, "isSelecting", void 0);
92
+ require_decorate.__decorate([(0, _angular_core.Output)(), require_decorateMetadata.__decorateMetadata("design:type", Object)], ContentSelectorComponent.prototype, "click", void 0);
93
+ require_decorate.__decorate([(0, _angular_core.Output)(), require_decorateMetadata.__decorateMetadata("design:type", Object)], ContentSelectorComponent.prototype, "press", void 0);
94
+ require_decorate.__decorate([(0, _angular_core.ViewChild)("containerRef", { static: true }), require_decorateMetadata.__decorateMetadata("design:type", Object)], ContentSelectorComponent.prototype, "containerRef", void 0);
95
+ require_decorate.__decorate([
96
+ (0, _angular_core.HostListener)("document:mousedown", ["$event"]),
97
+ require_decorateMetadata.__decorateMetadata("design:type", Function),
98
+ require_decorateMetadata.__decorateMetadata("design:paramtypes", [typeof (_ref = typeof MouseEvent !== "undefined" && MouseEvent) === "function" ? _ref : Object]),
99
+ require_decorateMetadata.__decorateMetadata("design:returntype", void 0)
100
+ ], ContentSelectorComponent.prototype, "onDocumentMouseDown", null);
101
+ ContentSelectorComponent = require_decorate.__decorate([(0, _angular_core.Component)({
102
+ selector: "app-content-selector",
103
+ template: `
104
+ <span
105
+ #containerRef
106
+ role="button"
107
+ tabindex="0"
108
+ (click)="handleClick($event)"
109
+ (mousedown)="handleMouseDown()"
110
+ (mouseup)="handleMouseUp()"
111
+ (mouseleave)="handleMouseUp()"
112
+ (touchstart)="handleMouseDown()"
113
+ (touchend)="handleMouseUp()"
114
+ (touchcancel)="handleMouseUp()"
115
+ (blur)="handleBlur()"
116
+ (mouseenter)="onMouseEnter()"
117
+ [ngStyle]="getContainerStyle()"
118
+ >
119
+ <ng-content></ng-content>
120
+ </span>
121
+ `,
122
+ standalone: true,
123
+ imports: [_angular_common.CommonModule]
124
+ })], ContentSelectorComponent);
109
125
 
110
126
  //#endregion
111
- exports.ContentSelectorComponent = ContentSelectorComponent;
127
+ Object.defineProperty(exports, 'ContentSelectorComponent', {
128
+ enumerable: true,
129
+ get: function () {
130
+ return ContentSelectorComponent;
131
+ }
132
+ });
112
133
  //# sourceMappingURL=ContentSelector.component.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelector.component.cjs","names":["CommonModule","EventEmitter"],"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;AA0BtC,IAAa,2BAxBb,+BAAW;CACT,UAAU;CACV,UAAU;;;;;;;;;;;;;;;;;;;CAmBV,YAAY;CACZ,SAAS,CAACA,6BAAa;CACxB,CAAC,EACF,MAAmE;CACjE,4BAAQ,EAAC;CACT,4BAAQ,EAAC;CACT,4BAAQ,EAAC;CAET,6BAAS,EAAC,QAAQ,IAAIC,4BAA0B;CAChD,6BAAS,EAAC,QAAQ,IAAIA,4BAAoB;CAE1C,+BAAW,gBAAgB,EAAE,QAAQ,MAAM,CAAC,EAC5C;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,kCAAc,sBAAsB,CAAC,SAAS,CAAC,EAC/C,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"}
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"}
@@ -0,0 +1,11 @@
1
+
2
+ //#region \0@oxc-project+runtime@0.110.0/helpers/decorate.js
3
+ function __decorate(decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ }
9
+
10
+ //#endregion
11
+ exports.__decorate = __decorate;
@@ -0,0 +1,8 @@
1
+
2
+ //#region \0@oxc-project+runtime@0.110.0/helpers/decorateMetadata.js
3
+ function __decorateMetadata(k, v) {
4
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
5
+ }
6
+
7
+ //#endregion
8
+ exports.__decorateMetadata = __decorateMetadata;
@@ -8,7 +8,12 @@ const require_client_useIntlayer = require('./useIntlayer.cjs');
8
8
  const require_client_useLocale = require('./useLocale.cjs');
9
9
 
10
10
  exports.INTLAYER_TOKEN = require_client_installIntlayer.INTLAYER_TOKEN;
11
- exports.IntlayerProvider = require_client_installIntlayer.IntlayerProvider;
11
+ Object.defineProperty(exports, 'IntlayerProvider', {
12
+ enumerable: true,
13
+ get: function () {
14
+ return require_client_installIntlayer.IntlayerProvider;
15
+ }
16
+ });
12
17
  exports.createIntlayerClient = require_client_installIntlayer.createIntlayerClient;
13
18
  exports.installIntlayer = require_client_installIntlayer.installIntlayer;
14
19
  exports.isUpdatableNode = require_client_useIntlayer.isUpdatableNode;
@@ -1,4 +1,5 @@
1
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');
2
3
  let _angular_core = require("@angular/core");
3
4
  let _intlayer_config_built = require("@intlayer/config/built");
4
5
  _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
@@ -9,7 +10,7 @@ const INTLAYER_TOKEN = new _angular_core.InjectionToken("intlayer");
9
10
  * Singleton instance
10
11
  */
11
12
  let instance = null;
12
- var IntlayerProvider = @((0, _angular_core.Injectable)({ providedIn: "root" })) class {
13
+ let IntlayerProvider = class IntlayerProvider {
13
14
  isCookieEnabled = (0, _angular_core.signal)(true);
14
15
  _locale = (0, _angular_core.signal)(_intlayer_config_built.default.internationalization?.defaultLocale);
15
16
  locale = this._locale.asReadonly();
@@ -17,6 +18,7 @@ var IntlayerProvider = @((0, _angular_core.Injectable)({ providedIn: "root" }))
17
18
  this._locale.set(locale);
18
19
  };
19
20
  };
21
+ IntlayerProvider = require_decorate.__decorate([(0, _angular_core.Injectable)({ providedIn: "root" })], IntlayerProvider);
20
22
  /**
21
23
  * Create and return a single IntlayerProvider instance
22
24
  */
@@ -63,7 +65,12 @@ const installIntlayer = (locale, isCookieEnabled = true) => {
63
65
 
64
66
  //#endregion
65
67
  exports.INTLAYER_TOKEN = INTLAYER_TOKEN;
66
- exports.IntlayerProvider = IntlayerProvider;
68
+ Object.defineProperty(exports, 'IntlayerProvider', {
69
+ enumerable: true,
70
+ get: function () {
71
+ return IntlayerProvider;
72
+ }
73
+ });
67
74
  exports.createIntlayerClient = createIntlayerClient;
68
75
  exports.installIntlayer = installIntlayer;
69
76
  exports.provideIntlayer = provideIntlayer;
@@ -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;AAKxC,IAAa,mBAHb,gCAAY,EACV,YAAY,QACb,CAAC,EACF,MAA8B;CAC5B,4CAAyB,KAAK;CAC9B,AAAQ,oCACNC,+BAAc,sBAAsB,cACrC;CAED,AAAS,SAAgC,KAAK,QAAQ,YAAY;CAElE,aAAa,WAA0B;AACrC,OAAK,QAAQ,IAAI,OAAO;;;;;;AAO5B,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"}
@@ -7,7 +7,7 @@ let _angular_core = require("@angular/core");
7
7
  const useDictionary = (dictionary, locale) => {
8
8
  const intlayer = (0, _angular_core.inject)(require_client_installIntlayer.INTLAYER_TOKEN);
9
9
  const localeTarget = (0, _angular_core.computed)(() => locale ?? intlayer?.locale());
10
- return (0, _angular_core.computed)(() => require_getDictionary.getDictionary(dictionary, localeTarget()))();
10
+ return (0, _angular_core.computed)(() => require_getDictionary.getDictionary(dictionary, localeTarget()));
11
11
  };
12
12
 
13
13
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.cjs","names":["INTLAYER_TOKEN","getDictionary"],"sources":["../../../src/client/useDictionary.ts"],"sourcesContent":["import { computed, inject } 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): 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() as DeepTransformContent<T['content']>; // all consumers keep full reactivity\n};\n"],"mappings":";;;;;;AAMA,MAAa,iBACX,YACA,WACuC;CACvC,MAAM,qCAAoCA,8CAAe;CAEzD,MAAM,iDAA8B,UAAU,UAAU,QAAQ,CAAC;AAOjE,0CAHEC,oCAAgC,YAAY,cAAc,CAAC,CAC5D,EAEe"}
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"}
@@ -35,7 +35,7 @@ const useIntlayer = (key, locale) => {
35
35
  const intlayer = (0, _angular_core.inject)(require_client_installIntlayer.INTLAYER_TOKEN);
36
36
  /** which locale should we use right now? */
37
37
  const localeTarget = (0, _angular_core.computed)(() => locale ?? intlayer.locale());
38
- return (0, _angular_core.computed)(() => require_getIntlayer.getIntlayer(key, localeTarget()))();
38
+ return (0, _angular_core.computed)(() => require_getIntlayer.getIntlayer(key, localeTarget()));
39
39
  };
40
40
 
41
41
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.cjs","names":["INTLAYER_TOKEN","getIntlayer"],"sources":["../../../src/client/useIntlayer.ts"],"sourcesContent":["import { computed, inject } 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): 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() as DeepTransformContent<DictionaryRegistryContent<T>>; // 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,WACuD;CACvD,MAAM,qCAAoCA,8CAAe;;CAGzD,MAAM,iDAA8B,UAAU,SAAS,QAAQ,CAAC;AAMhE,0CAF+BC,gCAAkB,KAAK,cAAc,CAAM,CAAC,EAE3D"}
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,6 @@
1
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');
2
4
  const require_UI_ContentSelector_component = require('../UI/ContentSelector.component.cjs');
3
5
  const require_editor_editorEnabled = require('./editorEnabled.cjs');
4
6
  const require_editor_focusDictionary = require('./focusDictionary.cjs');
@@ -9,23 +11,9 @@ let _angular_common = require("@angular/common");
9
11
  let _angular_core = require("@angular/core");
10
12
 
11
13
  //#region src/editor/ContentSelectorWrapper.component.ts
12
- var ContentSelectorWrapperComponent = @((0, _angular_core.Component)({
13
- selector: "app-content-selector-wrapper",
14
- standalone: true,
15
- imports: [_angular_common.CommonModule, require_UI_ContentSelector_component.ContentSelectorComponent],
16
- template: `
17
- <app-content-selector
18
- *ngIf="enabled()"
19
- (press)="handleSelect()"
20
- [isSelecting]="isSelected()"
21
- >
22
- <ng-content></ng-content>
23
- </app-content-selector>
24
- <ng-content *ngIf="!enabled()"></ng-content>
25
- `
26
- })) class {
27
- @((0, _angular_core.Input)()) dictionaryKey;
28
- @((0, _angular_core.Input)()) keyPath;
14
+ let ContentSelectorWrapperComponent = class ContentSelectorWrapperComponent {
15
+ dictionaryKey;
16
+ keyPath;
29
17
  focusDictionary = require_editor_focusDictionary.useFocusDictionary();
30
18
  editorEnabled = require_editor_editorEnabled.useEditorEnabled();
31
19
  constructor() {
@@ -43,7 +31,29 @@ var ContentSelectorWrapperComponent = @((0, _angular_core.Component)({
43
31
  });
44
32
  }
45
33
  };
34
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", String)], ContentSelectorWrapperComponent.prototype, "dictionaryKey", void 0);
35
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Array)], ContentSelectorWrapperComponent.prototype, "keyPath", void 0);
36
+ ContentSelectorWrapperComponent = require_decorate.__decorate([(0, _angular_core.Component)({
37
+ selector: "app-content-selector-wrapper",
38
+ standalone: true,
39
+ imports: [_angular_common.CommonModule, require_UI_ContentSelector_component.ContentSelectorComponent],
40
+ template: `
41
+ <app-content-selector
42
+ *ngIf="enabled()"
43
+ (press)="handleSelect()"
44
+ [isSelecting]="isSelected()"
45
+ >
46
+ <ng-content></ng-content>
47
+ </app-content-selector>
48
+ <ng-content *ngIf="!enabled()"></ng-content>
49
+ `
50
+ }), require_decorateMetadata.__decorateMetadata("design:paramtypes", [])], ContentSelectorWrapperComponent);
46
51
 
47
52
  //#endregion
48
- exports.ContentSelectorWrapperComponent = ContentSelectorWrapperComponent;
53
+ Object.defineProperty(exports, 'ContentSelectorWrapperComponent', {
54
+ enumerable: true,
55
+ get: function () {
56
+ return ContentSelectorWrapperComponent;
57
+ }
58
+ });
49
59
  //# sourceMappingURL=ContentSelectorWrapper.component.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentSelectorWrapper.component.cjs","names":["CommonModule","ContentSelectorComponent","useFocusDictionary","useEditorEnabled","NodeType"],"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":";;;;;;;;;;;AAgCA,IAAa,kCAfb,+BAAW;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,8BAAcC,8DAAyB;CACjD,UAAU;;;;;;;;;;CAUX,CAAC,EACF,MAA6C;CAC3C,4BAAQ,EAAC;CACT,4BAAQ,EAAC;CAGT,AAAQ,kBAAkBC,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"}
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,19 +1,16 @@
1
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');
2
4
  const require_editor_useEditedContentRenderer = require('./useEditedContentRenderer.cjs');
3
5
  let _intlayer_core = require("@intlayer/core");
4
6
  let _angular_common = require("@angular/common");
5
7
  let _angular_core = require("@angular/core");
6
8
 
7
9
  //#region src/editor/EditedContentRenderer.component.ts
8
- var EditedContentRendererComponent = @((0, _angular_core.Component)({
9
- selector: "app-edited-content-renderer",
10
- standalone: true,
11
- imports: [_angular_common.CommonModule],
12
- template: ` <span [innerHTML]="renderedContent()"></span> `
13
- })) class {
14
- @((0, _angular_core.Input)()) dictionaryKey;
15
- @((0, _angular_core.Input)()) keyPath;
16
- @((0, _angular_core.Input)()) locale;
10
+ let EditedContentRendererComponent = class EditedContentRendererComponent {
11
+ dictionaryKey;
12
+ keyPath;
13
+ locale;
17
14
  fallback = (0, _angular_core.signal)("");
18
15
  rawContent = (0, _angular_core.computed)(() => {
19
16
  return require_editor_useEditedContentRenderer.useEditedContentRenderer(this.dictionaryKey, this.keyPath, this.fallback);
@@ -37,7 +34,21 @@ var EditedContentRendererComponent = @((0, _angular_core.Component)({
37
34
  return rawContentValue();
38
35
  });
39
36
  };
37
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", String)], EditedContentRendererComponent.prototype, "dictionaryKey", void 0);
38
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Array)], EditedContentRendererComponent.prototype, "keyPath", void 0);
39
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Object)], EditedContentRendererComponent.prototype, "locale", void 0);
40
+ EditedContentRendererComponent = require_decorate.__decorate([(0, _angular_core.Component)({
41
+ selector: "app-edited-content-renderer",
42
+ standalone: true,
43
+ imports: [_angular_common.CommonModule],
44
+ template: ` <span [innerHTML]="renderedContent()"></span> `
45
+ })], EditedContentRendererComponent);
40
46
 
41
47
  //#endregion
42
- exports.EditedContentRendererComponent = EditedContentRendererComponent;
48
+ Object.defineProperty(exports, 'EditedContentRendererComponent', {
49
+ enumerable: true,
50
+ get: function () {
51
+ return EditedContentRendererComponent;
52
+ }
53
+ });
43
54
  //# sourceMappingURL=EditedContentRenderer.component.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditedContentRenderer.component.cjs","names":["CommonModule","useEditedContentRenderer"],"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":";;;;;;;AAkBA,IAAa,iCANb,+BAAW;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,6BAAa;CACvB,UAAU;CACX,CAAC,EACF,MAA4C;CAC1C,4BAAQ,EAAC;CACT,4BAAQ,EAAC;CACT,4BAAQ,EAAC;CAET,AAAQ,qCAAkB,GAAG;CAE7B,AAAQ,+CAA4B;AAClC,SAAOC,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"}
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,11 +1,19 @@
1
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');
2
4
  const require_editor_ContentSelectorWrapper_component = require('./ContentSelectorWrapper.component.cjs');
3
5
  const require_editor_EditedContentRenderer_component = require('./EditedContentRenderer.component.cjs');
4
6
  let _angular_common = require("@angular/common");
5
7
  let _angular_core = require("@angular/core");
6
8
 
7
9
  //#region src/editor/EditorSelectorRenderer.component.ts
8
- var EditorSelectorRendererComponent = @((0, _angular_core.Component)({
10
+ let EditorSelectorRendererComponent = class EditorSelectorRendererComponent {
11
+ dictionaryKey;
12
+ keyPath;
13
+ };
14
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", String)], EditorSelectorRendererComponent.prototype, "dictionaryKey", void 0);
15
+ require_decorate.__decorate([(0, _angular_core.Input)(), require_decorateMetadata.__decorateMetadata("design:type", Array)], EditorSelectorRendererComponent.prototype, "keyPath", void 0);
16
+ EditorSelectorRendererComponent = require_decorate.__decorate([(0, _angular_core.Component)({
9
17
  selector: "app-editor-selector-renderer",
10
18
  standalone: true,
11
19
  imports: [
@@ -26,11 +34,13 @@ var EditorSelectorRendererComponent = @((0, _angular_core.Component)({
26
34
  </app-edited-content-renderer>
27
35
  </app-content-selector-wrapper>
28
36
  `
29
- })) class {
30
- @((0, _angular_core.Input)()) dictionaryKey;
31
- @((0, _angular_core.Input)()) keyPath;
32
- };
37
+ })], EditorSelectorRendererComponent);
33
38
 
34
39
  //#endregion
35
- exports.EditorSelectorRendererComponent = EditorSelectorRendererComponent;
40
+ Object.defineProperty(exports, 'EditorSelectorRendererComponent', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return EditorSelectorRendererComponent;
44
+ }
45
+ });
36
46
  //# sourceMappingURL=EditorSelectorRenderer.component.cjs.map
@@ -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":";;;;;;;AAoCA,IAAa,kCAtBb,+BAAW;CACT,UAAU;CACV,YAAY;CACZ,SAAS;EACPA;EACAC;EACAC;EACD;CACD,UAAU;;;;;;;;;;;;;CAaX,CAAC,EACF,MAA6C;CAC3C,4BAAQ,EAAC;CACT,4BAAQ,EAAC"}
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"}
@@ -3,7 +3,22 @@ const require_editor_EditedContentRenderer_component = require('./EditedContentR
3
3
  const require_editor_EditorSelectorRenderer_component = require('./EditorSelectorRenderer.component.cjs');
4
4
  const require_editor_installIntlayerEditor = require('./installIntlayerEditor.cjs');
5
5
 
6
- exports.ContentSelectorWrapperComponent = require_editor_ContentSelectorWrapper_component.ContentSelectorWrapperComponent;
7
- exports.EditedContentRendererComponent = require_editor_EditedContentRenderer_component.EditedContentRendererComponent;
8
- exports.EditorSelectorRendererComponent = require_editor_EditorSelectorRenderer_component.EditorSelectorRendererComponent;
6
+ Object.defineProperty(exports, 'ContentSelectorWrapperComponent', {
7
+ enumerable: true,
8
+ get: function () {
9
+ return require_editor_ContentSelectorWrapper_component.ContentSelectorWrapperComponent;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, 'EditedContentRendererComponent', {
13
+ enumerable: true,
14
+ get: function () {
15
+ return require_editor_EditedContentRenderer_component.EditedContentRendererComponent;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, 'EditorSelectorRendererComponent', {
19
+ enumerable: true,
20
+ get: function () {
21
+ return require_editor_EditorSelectorRenderer_component.EditorSelectorRendererComponent;
22
+ }
23
+ });
9
24
  exports.installIntlayerEditor = require_editor_installIntlayerEditor.installIntlayerEditor;
@@ -1,9 +1,10 @@
1
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');
2
3
  let _angular_core = require("@angular/core");
3
4
 
4
5
  //#region src/editor/useEditedContentRenderer.ts
5
6
  const EDITED_CONTENT_ACTIONS_TOKEN = new _angular_core.InjectionToken("editedContentActions");
6
- var EditedContentRendererService = @((0, _angular_core.Injectable)({ providedIn: "root" })) class {
7
+ let EditedContentRendererService = class EditedContentRendererService {
7
8
  /**
8
9
  * Mirrors the React hook one-for-one.
9
10
  */
@@ -14,6 +15,7 @@ var EditedContentRendererService = @((0, _angular_core.Injectable)({ providedIn:
14
15
  });
15
16
  }
16
17
  };
18
+ EditedContentRendererService = require_decorate.__decorate([(0, _angular_core.Injectable)({ providedIn: "root" })], EditedContentRendererService);
17
19
  /**
18
20
  * Standalone function that can be used like the Vue composable
19
21
  */
@@ -23,6 +25,11 @@ const useEditedContentRenderer = (dictionaryKey, keyPath, fallback) => {
23
25
 
24
26
  //#endregion
25
27
  exports.EDITED_CONTENT_ACTIONS_TOKEN = EDITED_CONTENT_ACTIONS_TOKEN;
26
- exports.EditedContentRendererService = EditedContentRendererService;
28
+ Object.defineProperty(exports, 'EditedContentRendererService', {
29
+ enumerable: true,
30
+ get: function () {
31
+ return EditedContentRendererService;
32
+ }
33
+ });
27
34
  exports.useEditedContentRenderer = useEditedContentRenderer;
28
35
  //# sourceMappingURL=useEditedContentRenderer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEditedContentRenderer.cjs","names":["InjectionToken"],"sources":["../../../src/editor/useEditedContentRenderer.ts"],"sourcesContent":["import {\n computed,\n Injectable,\n InjectionToken,\n inject,\n type Signal,\n} from '@angular/core';\nimport type { KeyPath } from '@intlayer/types';\n\nexport interface EditedContentActions {\n getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;\n}\n\nexport const EDITED_CONTENT_ACTIONS_TOKEN =\n new InjectionToken<EditedContentActions | null>('editedContentActions');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EditedContentRendererService {\n /**\n * Mirrors the React hook one-for-one.\n */\n useEditedContentRenderer(\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n ): Signal<unknown> {\n const editedContentContext = inject(EDITED_CONTENT_ACTIONS_TOKEN, {\n optional: true,\n });\n\n return computed(() => {\n const edited = editedContentContext?.getEditedContentValue(\n dictionaryKey,\n keyPath\n ) as string | undefined;\n\n return edited ?? fallback;\n });\n }\n}\n\n/**\n * Standalone function that can be used like the Vue composable\n */\nexport const useEditedContentRenderer = (\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n): Signal<unknown> => {\n const service = inject(EditedContentRendererService);\n return service.useEditedContentRenderer(dictionaryKey, keyPath, fallback);\n};\n"],"mappings":";;;;AAaA,MAAa,+BACX,IAAIA,6BAA4C,uBAAuB;AAKzE,IAAa,+BAHb,gCAAY,EACV,YAAY,QACb,CAAC,EACF,MAA0C;;;;CAIxC,yBACE,eACA,SACA,UACiB;EACjB,MAAM,iDAA8B,8BAA8B,EAChE,UAAU,MACX,CAAC;AAEF,2CAAsB;AAMpB,UALe,sBAAsB,sBACnC,eACA,QACD,IAEgB;IACjB;;;;;;AAON,MAAa,4BACX,eACA,SACA,aACoB;AAEpB,kCADuB,6BAA6B,CACrC,yBAAyB,eAAe,SAAS,SAAS"}
1
+ {"version":3,"file":"useEditedContentRenderer.cjs","names":["InjectionToken"],"sources":["../../../src/editor/useEditedContentRenderer.ts"],"sourcesContent":["import {\n computed,\n Injectable,\n InjectionToken,\n inject,\n type Signal,\n} from '@angular/core';\nimport type { KeyPath } from '@intlayer/types';\n\nexport interface EditedContentActions {\n getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;\n}\n\nexport const EDITED_CONTENT_ACTIONS_TOKEN =\n new InjectionToken<EditedContentActions | null>('editedContentActions');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EditedContentRendererService {\n /**\n * Mirrors the React hook one-for-one.\n */\n useEditedContentRenderer(\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n ): Signal<unknown> {\n const editedContentContext = inject(EDITED_CONTENT_ACTIONS_TOKEN, {\n optional: true,\n });\n\n return computed(() => {\n const edited = editedContentContext?.getEditedContentValue(\n dictionaryKey,\n keyPath\n ) as string | undefined;\n\n return edited ?? fallback;\n });\n }\n}\n\n/**\n * Standalone function that can be used like the Vue composable\n */\nexport const useEditedContentRenderer = (\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n): Signal<unknown> => {\n const service = inject(EditedContentRendererService);\n return service.useEditedContentRenderer(dictionaryKey, keyPath, fallback);\n};\n"],"mappings":";;;;;AAaA,MAAa,+BACX,IAAIA,6BAA4C,uBAAuB;AAKlE,yCAAM,6BAA6B;;;;CAIxC,yBACE,eACA,SACA,UACiB;EACjB,MAAM,iDAA8B,8BAA8B,EAChE,UAAU,MACX,CAAC;AAEF,2CAAsB;AAMpB,UALe,sBAAsB,sBACnC,eACA,QACD,IAEgB;IACjB;;;0FAvBM,EACV,YAAY,QACb,CAAC;;;;AA4BF,MAAa,4BACX,eACA,SACA,aACoB;AAEpB,kCADuB,6BAA6B,CACrC,yBAAyB,eAAe,SAAS,SAAS"}
@@ -7,6 +7,7 @@ const getDictionary = (dictionary, locale, additionalPlugins) => {
7
7
  return (0, _intlayer_core.getDictionary)(dictionary, locale, [
8
8
  require_plugins.intlayerNodePlugins,
9
9
  require_plugins.markdownPlugin,
10
+ require_plugins.htmlPlugin,
10
11
  ...additionalPlugins ?? []
11
12
  ]);
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getDictionary.cjs","names":["intlayerNodePlugins","markdownPlugin"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import {\n getDictionary as getDictionaryCore,\n type Plugins,\n} from '@intlayer/core';\nimport type {\n DeclaredLocales,\n Dictionary,\n LocalesValues,\n} from '@intlayer/types';\nimport { intlayerNodePlugins, markdownPlugin } from './plugins';\n\nexport const getDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L,\n additionalPlugins?: Plugins[]\n) => {\n const plugins: Plugins[] = [\n intlayerNodePlugins,\n markdownPlugin,\n ...(additionalPlugins ?? []),\n ];\n\n return getDictionaryCore<T, L>(dictionary, locale, plugins);\n};\n"],"mappings":";;;;;AAWA,MAAa,iBAIX,YACA,QACA,sBACG;AAOH,0CAA+B,YAAY,QANhB;EACzBA;EACAC;EACA,GAAI,qBAAqB,EAAE;EAC5B,CAE0D"}
1
+ {"version":3,"file":"getDictionary.cjs","names":["intlayerNodePlugins","markdownPlugin","htmlPlugin"],"sources":["../../src/getDictionary.ts"],"sourcesContent":["import {\n getDictionary as getDictionaryCore,\n type Plugins,\n} from '@intlayer/core';\nimport type {\n DeclaredLocales,\n Dictionary,\n LocalesValues,\n} from '@intlayer/types';\nimport { htmlPlugin, intlayerNodePlugins, markdownPlugin } from './plugins';\n\nexport const getDictionary = <\n T extends Dictionary,\n L extends LocalesValues = DeclaredLocales,\n>(\n dictionary: T,\n locale?: L,\n additionalPlugins?: Plugins[]\n) => {\n const plugins: Plugins[] = [\n intlayerNodePlugins,\n markdownPlugin,\n htmlPlugin,\n ...(additionalPlugins ?? []),\n ];\n\n return getDictionaryCore<T, L>(dictionary, locale, plugins);\n};\n"],"mappings":";;;;;AAWA,MAAa,iBAIX,YACA,QACA,sBACG;AAQH,0CAA+B,YAAY,QAPhB;EACzBA;EACAC;EACAC;EACA,GAAI,qBAAqB,EAAE;EAC5B,CAE0D"}
@@ -7,6 +7,8 @@ const getIntlayer = (key, locale, additionalPlugins) => {
7
7
  return (0, _intlayer_core.getIntlayer)(key, locale, [
8
8
  require_plugins.intlayerNodePlugins,
9
9
  require_plugins.markdownPlugin,
10
+ require_plugins.htmlPlugin,
11
+ require_plugins.insertionPlugin,
10
12
  ...additionalPlugins ?? []
11
13
  ]);
12
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getIntlayer.cjs","names":["intlayerNodePlugins","markdownPlugin"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore, type Plugins } from '@intlayer/core';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types';\nimport {\n type DeepTransformContent,\n intlayerNodePlugins,\n markdownPlugin,\n} from './plugins';\n\nexport const getIntlayer = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L,\n additionalPlugins?: Plugins[]\n) => {\n const plugins: Plugins[] = [\n intlayerNodePlugins,\n markdownPlugin,\n ...(additionalPlugins ?? []),\n ];\n\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n return getIntlayerCore<T, L>(key, locale, plugins) as DeepTransformContent<\n DictionaryRegistryContent<T>\n >;\n};\n"],"mappings":";;;;;AAaA,MAAa,eAIX,KACA,QACA,sBACG;AAQH,wCAA6B,KAAK,QAPP;EACzBA;EACAC;EACA,GAAI,qBAAqB,EAAE;EAC5B,CAGiD"}
1
+ {"version":3,"file":"getIntlayer.cjs","names":["intlayerNodePlugins","markdownPlugin","htmlPlugin","insertionPlugin"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore, type Plugins } from '@intlayer/core';\nimport type {\n DeclaredLocales,\n DictionaryKeys,\n DictionaryRegistryContent,\n LocalesValues,\n} from '@intlayer/types';\nimport {\n type DeepTransformContent,\n htmlPlugin,\n insertionPlugin,\n intlayerNodePlugins,\n markdownPlugin,\n} from './plugins';\n\nexport const getIntlayer = <\n T extends DictionaryKeys,\n L extends LocalesValues = DeclaredLocales,\n>(\n key: T,\n locale?: L,\n additionalPlugins?: Plugins[]\n) => {\n const plugins: Plugins[] = [\n intlayerNodePlugins,\n markdownPlugin,\n htmlPlugin,\n insertionPlugin,\n ...(additionalPlugins ?? []),\n ];\n\n // @ts-ignore Type instantiation is excessively deep and possibly infinite\n return getIntlayerCore<T, L>(key, locale, plugins) as DeepTransformContent<\n DictionaryRegistryContent<T>\n >;\n};\n"],"mappings":";;;;;AAeA,MAAa,eAIX,KACA,QACA,sBACG;AAUH,wCAA6B,KAAK,QATP;EACzBA;EACAC;EACAC;EACAC;EACA,GAAI,qBAAqB,EAAE;EAC5B,CAGiD"}