angular-intlayer 7.0.2-canary.0 → 7.0.3-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +3 -1
- package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +1 -1
- package/dist/cjs/editor/dictionariesRecord.cjs +2 -4
- package/dist/cjs/editor/dictionariesRecord.cjs.map +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.component.mjs +2 -1
- package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +1 -1
- package/dist/esm/editor/dictionariesRecord.mjs +2 -3
- package/dist/esm/editor/dictionariesRecord.mjs.map +1 -1
- package/dist/types/client/installIntlayer.d.ts +2 -2
- package/dist/types/editor/ContentSelectorWrapper.component.d.ts +3 -3
- package/dist/types/editor/ContentSelectorWrapper.component.d.ts.map +1 -1
- package/dist/types/editor/EditedContentRenderer.component.d.ts +2 -2
- package/dist/types/editor/dictionariesRecord.d.ts +1 -1
- package/dist/types/editor/dictionariesRecord.d.ts.map +1 -1
- package/dist/types/editor/useCrossURLPathState.d.ts +3 -3
- package/dist/types/plugins.d.ts.map +1 -1
- package/package.json +16 -16
|
@@ -5,6 +5,8 @@ const require_editor_focusDictionary = require('./focusDictionary.cjs');
|
|
|
5
5
|
const require_editor_useEditor = require('./useEditor.cjs');
|
|
6
6
|
let __intlayer_core = require("@intlayer/core");
|
|
7
7
|
__intlayer_core = require_rolldown_runtime.__toESM(__intlayer_core);
|
|
8
|
+
let __intlayer_types = require("@intlayer/types");
|
|
9
|
+
__intlayer_types = require_rolldown_runtime.__toESM(__intlayer_types);
|
|
8
10
|
let __angular_common = require("@angular/common");
|
|
9
11
|
__angular_common = require_rolldown_runtime.__toESM(__angular_common);
|
|
10
12
|
let __angular_core = require("@angular/core");
|
|
@@ -41,7 +43,7 @@ var ContentSelectorWrapperComponent = @((0, __angular_core.Component)({
|
|
|
41
43
|
handleSelect() {
|
|
42
44
|
this.focusDictionary.setFocusedContent({
|
|
43
45
|
dictionaryKey: this.dictionaryKey,
|
|
44
|
-
keyPath: this.keyPath
|
|
46
|
+
keyPath: this.keyPath.filter((key) => key.type !== __intlayer_types.NodeType.Translation)
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.component.cjs","names":["CommonModule","ContentSelectorComponent","useFocusDictionary","useEditorEnabled"],"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 { 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,\n });\n }\n}\n"],"mappings":"
|
|
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,gCAAW;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAACA,+BAAcC,8DAAyB;CACjD,UAAU;;;;;;;;;;CAUX,CAAC,EACF,MAA6C;CAC3C,6BAAQ,EAAC;CACT,6BAAQ,EAAC;CAGT,AAAQ,kBAAkBC,mDAAoB;CAC9C,AAAQ,gBAAgBC,+CAAkB;CAE1C,cAAc;AACZ,sCAAW;;CAIb,gDAA4B;EAC1B,MAAM,iBAAiB,KAAK,gBAAgB,gBAAgB;AAC5D,SACE,gBAAgB,kBAAkB,KAAK,kBACtC,eAAe,SAAS,UAAU,KAAK,wCAC1B,eAAe,WAAW,EAAE,EAAE,KAAK,QAAQ;GAE3D;CAEF,6CAAyB,KAAK,cAAc,SAAS,CAAC;CAGtD,eAAe;AACb,OAAK,gBAAgB,kBAAkB;GACrC,eAAe,KAAK;GACpB,SAAS,KAAK,QAAQ,QAAQ,QAAQ,IAAI,SAASC,0BAAS,YAAY;GACzE,CAAC"}
|
|
@@ -5,8 +5,6 @@ let __angular_core = require("@angular/core");
|
|
|
5
5
|
__angular_core = require_rolldown_runtime.__toESM(__angular_core);
|
|
6
6
|
let __intlayer_editor = require("@intlayer/editor");
|
|
7
7
|
__intlayer_editor = require_rolldown_runtime.__toESM(__intlayer_editor);
|
|
8
|
-
let __intlayer_dictionaries_entry = require("@intlayer/dictionaries-entry");
|
|
9
|
-
__intlayer_dictionaries_entry = require_rolldown_runtime.__toESM(__intlayer_dictionaries_entry);
|
|
10
8
|
|
|
11
9
|
//#region src/editor/dictionariesRecord.ts
|
|
12
10
|
/**
|
|
@@ -15,7 +13,7 @@ __intlayer_dictionaries_entry = require_rolldown_runtime.__toESM(__intlayer_dict
|
|
|
15
13
|
let instance = null;
|
|
16
14
|
const createDictionaryRecordClient = () => {
|
|
17
15
|
if (instance) return instance;
|
|
18
|
-
const localeDictionariesSignal = (0, __angular_core.signal)(
|
|
16
|
+
const localeDictionariesSignal = (0, __angular_core.signal)(void 0);
|
|
19
17
|
instance = {
|
|
20
18
|
localeDictionaries: localeDictionariesSignal.asReadonly(),
|
|
21
19
|
setLocaleDictionaries: (newValue) => {
|
|
@@ -25,7 +23,7 @@ const createDictionaryRecordClient = () => {
|
|
|
25
23
|
const current = localeDictionariesSignal();
|
|
26
24
|
localeDictionariesSignal.set({
|
|
27
25
|
...current,
|
|
28
|
-
[dictionary.
|
|
26
|
+
[dictionary.localId]: dictionary
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.cjs","names":["instance: DictionariesRecordClient | null","createSharedComposable","useCrossFrameState","MessageKey"],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"dictionariesRecord.cjs","names":["instance: DictionariesRecordClient | null","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,IAAIA,WAA4C;AAUhD,MAAa,qCAAqC;AAChD,KAAI,SAAU,QAAO;CAErB,MAAM,sDACJ,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,wBAAwBC,mEAA6B;CAChE,MAAM,SAAS,8BAA8B;AAE7C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,qCAAqC;CAGvD,MAAM,CAAC,qBAAqB,yBAC1BC,qDACEC,6BAAW,sCACX,OACD;AAGH,kCAAa;AAEX,wBADiB,OAAO,oBAAoB,CACb;GAC/B;EACF"}
|
|
@@ -3,6 +3,7 @@ import { useEditorEnabled } from "./editorEnabled.mjs";
|
|
|
3
3
|
import { useFocusDictionary } from "./focusDictionary.mjs";
|
|
4
4
|
import { useEditor } from "./useEditor.mjs";
|
|
5
5
|
import { isSameKeyPath } from "@intlayer/core";
|
|
6
|
+
import { NodeType } from "@intlayer/types";
|
|
6
7
|
import { CommonModule } from "@angular/common";
|
|
7
8
|
import { Component, Input, computed } from "@angular/core";
|
|
8
9
|
|
|
@@ -37,7 +38,7 @@ var ContentSelectorWrapperComponent = @Component({
|
|
|
37
38
|
handleSelect() {
|
|
38
39
|
this.focusDictionary.setFocusedContent({
|
|
39
40
|
dictionaryKey: this.dictionaryKey,
|
|
40
|
-
keyPath: this.keyPath
|
|
41
|
+
keyPath: this.keyPath.filter((key) => key.type !== NodeType.Translation)
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.component.mjs","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input } from '@angular/core';\nimport { isSameKeyPath, type NodeProps } from '@intlayer/core';\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,\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentSelectorWrapper.component.mjs","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, Input } from '@angular/core';\nimport { 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,CAAC,UAAU;CACT,UAAU;CACV,YAAY;CACZ,SAAS,CAAC,cAAc,yBAAyB;CACjD,UAAU;;;;;;;;;;CAUX,CAAC,CACF,MAA6C;CAC3C,CAAC,OAAO,CAAC;CACT,CAAC,OAAO,CAAC;CAGT,AAAQ,kBAAkB,oBAAoB;CAC9C,AAAQ,gBAAgB,kBAAkB;CAE1C,cAAc;AACZ,aAAW;;CAIb,aAAa,eAAe;EAC1B,MAAM,iBAAiB,KAAK,gBAAgB,gBAAgB;AAC5D,SACE,gBAAgB,kBAAkB,KAAK,kBACtC,eAAe,SAAS,UAAU,KAAK,KACxC,cAAc,eAAe,WAAW,EAAE,EAAE,KAAK,QAAQ;GAE3D;CAEF,UAAU,eAAe,KAAK,cAAc,SAAS,CAAC;CAGtD,eAAe;AACb,OAAK,gBAAgB,kBAAkB;GACrC,eAAe,KAAK;GACpB,SAAS,KAAK,QAAQ,QAAQ,QAAQ,IAAI,SAAS,SAAS,YAAY;GACzE,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { createSharedComposable } from "./createSharedComposable.mjs";
|
|
|
2
2
|
import { useCrossFrameState } from "./useCrossFrameState.mjs";
|
|
3
3
|
import { effect, signal } from "@angular/core";
|
|
4
4
|
import { MessageKey } from "@intlayer/editor";
|
|
5
|
-
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
6
5
|
|
|
7
6
|
//#region src/editor/dictionariesRecord.ts
|
|
8
7
|
/**
|
|
@@ -11,7 +10,7 @@ import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
|
11
10
|
let instance = null;
|
|
12
11
|
const createDictionaryRecordClient = () => {
|
|
13
12
|
if (instance) return instance;
|
|
14
|
-
const localeDictionariesSignal = signal(
|
|
13
|
+
const localeDictionariesSignal = signal(void 0);
|
|
15
14
|
instance = {
|
|
16
15
|
localeDictionaries: localeDictionariesSignal.asReadonly(),
|
|
17
16
|
setLocaleDictionaries: (newValue) => {
|
|
@@ -21,7 +20,7 @@ const createDictionaryRecordClient = () => {
|
|
|
21
20
|
const current = localeDictionariesSignal();
|
|
22
21
|
localeDictionariesSignal.set({
|
|
23
22
|
...current,
|
|
24
|
-
[dictionary.
|
|
23
|
+
[dictionary.localId]: dictionary
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.mjs","names":["instance: DictionariesRecordClient | null"],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":["import { effect, type Injector, type Signal, signal } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"dictionariesRecord.mjs","names":["instance: DictionariesRecordClient | null"],"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,IAAIA,WAA4C;AAUhD,MAAa,qCAAqC;AAChD,KAAI,SAAU,QAAO;CAErB,MAAM,2BAA2B,OAC/B,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,wBAAwB,6BAA6B;CAChE,MAAM,SAAS,8BAA8B;AAE7C,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,qCAAqC;CAGvD,MAAM,CAAC,qBAAqB,yBAC1B,mBACE,WAAW,sCACX,OACD;AAGH,cAAa;AAEX,wBADiB,OAAO,oBAAoB,CACb;GAC/B;EACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core5 from "@angular/core";
|
|
2
2
|
import { InjectionToken, Signal } from "@angular/core";
|
|
3
3
|
import { LocalesValues } from "@intlayer/types";
|
|
4
4
|
|
|
5
5
|
//#region src/client/installIntlayer.d.ts
|
|
6
6
|
declare const INTLAYER_TOKEN: InjectionToken<IntlayerProvider>;
|
|
7
7
|
declare class IntlayerProvider {
|
|
8
|
-
isCookieEnabled:
|
|
8
|
+
isCookieEnabled: _angular_core5.WritableSignal<boolean>;
|
|
9
9
|
private _locale;
|
|
10
10
|
readonly locale: Signal<LocalesValues>;
|
|
11
11
|
setLocale: (locale: LocalesValues) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core1 from "@angular/core";
|
|
2
2
|
import { NodeProps } from "@intlayer/core";
|
|
3
3
|
|
|
4
4
|
//#region src/editor/ContentSelectorWrapper.component.d.ts
|
|
@@ -16,8 +16,8 @@ declare class ContentSelectorWrapperComponent {
|
|
|
16
16
|
private focusDictionary;
|
|
17
17
|
private editorEnabled;
|
|
18
18
|
constructor();
|
|
19
|
-
isSelected:
|
|
20
|
-
enabled:
|
|
19
|
+
isSelected: _angular_core1.Signal<boolean>;
|
|
20
|
+
enabled: _angular_core1.Signal<boolean>;
|
|
21
21
|
handleSelect(): void;
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.component.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"ContentSelectorWrapper.component.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;AAmBa,UAnBI,2BAAA,SAAoC,SAmBT,CAAA;;;cAA/B,+BAAA;;;;;;cAA+B,cAAA,CAahC;WAAA,cAAA,CASH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core0 from "@angular/core";
|
|
2
2
|
import { KeyPath, Locale } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/editor/EditedContentRenderer.component.d.ts
|
|
@@ -16,7 +16,7 @@ declare class EditedContentRendererComponent {
|
|
|
16
16
|
/**
|
|
17
17
|
* Object → getContent → string, same as the React version.
|
|
18
18
|
*/
|
|
19
|
-
renderedContent:
|
|
19
|
+
renderedContent: _angular_core0.Signal<string>;
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
export { EditedContentRendererComponent, EditedContentRendererProps };
|
|
@@ -6,7 +6,7 @@ type DictionaryContent = Record<Dictionary['key'], Dictionary>;
|
|
|
6
6
|
type DictionariesRecordClient = {
|
|
7
7
|
localeDictionaries: Signal<DictionaryContent>;
|
|
8
8
|
setLocaleDictionaries: (newValue: DictionaryContent) => void;
|
|
9
|
-
setLocaleDictionary: (
|
|
9
|
+
setLocaleDictionary: (dictionary: Dictionary) => void;
|
|
10
10
|
};
|
|
11
11
|
declare const createDictionaryRecordClient: () => DictionariesRecordClient;
|
|
12
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.d.ts","names":[],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"dictionariesRecord.d.ts","names":[],"sources":["../../../src/editor/dictionariesRecord.ts"],"sourcesContent":[],"mappings":";;;;KAWY,iBAAA,GAAoB,OAAO,mBAAmB;KAErD,wBAAA;EAFO,kBAAA,EAGU,MAHO,CAGA,iBAHA,CAAA;EAAU,qBAAA,EAAA,CAAA,QAAA,EAIH,iBAJG,EAAA,GAAA,IAAA;EAAmB,mBAAA,EAAA,CAAA,UAAA,EAKtB,UALsB,EAAA,GAAA,IAAA;CAA1B;AAAM,cAQzB,4BARyB,EAAA,GAAA,GAQG,wBARH;AAAgC;;;AAIlC,cAkCvB,yBAlCuB,EAAA,CAAA,SAAA,EAkCiB,QAlCjB,EAAA,GAAA,IAAA;AACA,cAwCvB,qBAxCuB,EAAA,GAAA,GAAA,IAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCrossFrameState } from "./useCrossFrameState.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _angular_core3 from "@angular/core";
|
|
3
3
|
|
|
4
4
|
//#region src/editor/useCrossURLPathState.d.ts
|
|
5
5
|
|
|
@@ -9,14 +9,14 @@ import * as _angular_core4 from "@angular/core";
|
|
|
9
9
|
* @param opts - Options for controlling emit and receive behavior
|
|
10
10
|
* @returns A tuple containing [state signal, setState function, forceSync function]
|
|
11
11
|
*/
|
|
12
|
-
declare const useCrossURLPathState: (initial?: string, opts?: Parameters<typeof useCrossFrameState>[2]) => [
|
|
12
|
+
declare const useCrossURLPathState: (initial?: string, opts?: Parameters<typeof useCrossFrameState>[2]) => [_angular_core3.Signal<string>, (v: string | ((prev: string) => string)) => void, () => void];
|
|
13
13
|
/**
|
|
14
14
|
* Hook for host applications to push URL path changes into the shared state
|
|
15
15
|
* This also monkey patches history methods to capture navigation events
|
|
16
16
|
* @param initial - The initial URL path
|
|
17
17
|
* @returns A tuple containing [state signal, setState function]
|
|
18
18
|
*/
|
|
19
|
-
declare const useCrossURLPathSetter: (initial?: string) => readonly [
|
|
19
|
+
declare const useCrossURLPathSetter: (initial?: string) => readonly [_angular_core3.Signal<string>, (v: string | ((prev: string) => string)) => void];
|
|
20
20
|
//#endregion
|
|
21
21
|
export { useCrossURLPathSetter, useCrossURLPathState };
|
|
22
22
|
//# sourceMappingURL=useCrossURLPathState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;AAAkC,KAAtB,gBAAsB,CAAA,CAAA,CAAA,GAAA,CAAA,SAAA,MAAA,GAAA,MAAA,GAC9B,YAD8B,CACjB,CADiB,CAAA,GAAA,KAAA;AACjB,UAGA,YAHA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;EAAb,KAAA,EAIK,CAJL;EAAY,QAAA,CAAA,EAAA,GAAA;EAGC,eAAY,CAAA,EAGT,CAHS;AAO7B;AAyBA;AAAoC,cAzBvB,mBAyBuB,EAzBF,OAyBE;;;;AAKvB,KALD,kBAyDX,CAAA,CAAA,CAAA,GAzDmC,CAyDnC,
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgBA;AAAkC,KAAtB,gBAAsB,CAAA,CAAA,CAAA,GAAA,CAAA,SAAA,MAAA,GAAA,MAAA,GAC9B,YAD8B,CACjB,CADiB,CAAA,GAAA,KAAA;AACjB,UAGA,YAHA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;EAAb,KAAA,EAIK,CAJL;EAAY,QAAA,CAAA,EAAA,GAAA;EAGC,eAAY,CAAA,EAGT,CAHS;AAO7B;AAyBA;AAAoC,cAzBvB,mBAyBuB,EAzBF,OAyBE;;;;AAKvB,KALD,kBAyDX,CAAA,CAAA,CAAA,GAzDmC,CAyDnC,SApDkC,MAoDlC,GAxDG,YAwDH,CAAA,MAAA,EAAA;EAEW,QAAA,EA1DyB,oBA0Db,CAAA,MAAA,CAAA;CAAM,CAAA,GAAA,KAAA;;AAE3B,cAxDU,oBAwDD,EAxDuB,OAwDvB;AAG0B,KAL1B,YAK0B,CAAA,CAAA,CAAA,GALR,CAKQ,SAAA;EAArB,QAAA,EAJL,QAIK,GAAA,MAAA;EAA0D,CAHxE,QAAA,CAAS,QAAA,CAG+D,EAAA,KAAA,EAAA;EAArB,QAAA,CAAA,EAAA,KAAA,EAAA;CAAlD,GAAA,YAAA,CAAa,oBAAb,CAAkC,CAAlC,CAAA,EAAA;EAAY,QAAA,EAAsC,oBAAtC,CAA2D,CAA3D,CAAA;AAGhB,CAAA,CAAA,GAAa,KAAA;AA2BI,cA3BJ,cA2B6B,EA3Bb,OA2Ba;;;;AAE9B,UAFK,yBAEL,CAAA,CAAA,CAAA,CAAA;EAAY,YAAA,EADR,gBACQ,CADS,CACT,CAAA;EAQZ,QAAA,EARA,YAQA,CARa,CAQb,CAAA;AAKZ;;;;;;KALY,uBAAA,GAA0B;;;;KAK1B,0BAA0B,uBACpC,GACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-intlayer",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@intlayer/chokidar": "7.0.
|
|
85
|
-
"@intlayer/config": "7.0.
|
|
86
|
-
"@intlayer/core": "7.0.
|
|
87
|
-
"@intlayer/dictionaries-entry": "7.0.
|
|
88
|
-
"@intlayer/editor": "7.0.
|
|
89
|
-
"@intlayer/types": "7.0.
|
|
90
|
-
"@intlayer/webpack": "7.0.
|
|
84
|
+
"@intlayer/chokidar": "7.0.3-canary.0",
|
|
85
|
+
"@intlayer/config": "7.0.3-canary.0",
|
|
86
|
+
"@intlayer/core": "7.0.3-canary.0",
|
|
87
|
+
"@intlayer/dictionaries-entry": "7.0.3-canary.0",
|
|
88
|
+
"@intlayer/editor": "7.0.3-canary.0",
|
|
89
|
+
"@intlayer/types": "7.0.3-canary.0",
|
|
90
|
+
"@intlayer/webpack": "7.0.3-canary.0",
|
|
91
91
|
"deepmerge": "4.3.1",
|
|
92
92
|
"js-cookie": "3.0.5",
|
|
93
93
|
"uuid": "13.0.0"
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/node": "24.9.1",
|
|
97
97
|
"@types/webpack": "5.28.5",
|
|
98
|
-
"@utils/ts-config": "7.0.
|
|
99
|
-
"@utils/ts-config-types": "7.0.
|
|
100
|
-
"@utils/tsdown-config": "7.0.
|
|
98
|
+
"@utils/ts-config": "7.0.3-canary.0",
|
|
99
|
+
"@utils/ts-config-types": "7.0.3-canary.0",
|
|
100
|
+
"@utils/tsdown-config": "7.0.3-canary.0",
|
|
101
101
|
"rimraf": "6.0.1",
|
|
102
102
|
"tsdown": "0.15.9",
|
|
103
103
|
"typescript": "5.9.3",
|
|
@@ -106,11 +106,11 @@
|
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@angular/common": "15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
108
108
|
"@angular/core": "15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
109
|
-
"@intlayer/chokidar": "7.0.
|
|
110
|
-
"@intlayer/config": "7.0.
|
|
111
|
-
"@intlayer/core": "7.0.
|
|
112
|
-
"@intlayer/dictionaries-entry": "7.0.
|
|
113
|
-
"@intlayer/types": "7.0.
|
|
109
|
+
"@intlayer/chokidar": "7.0.3-canary.0",
|
|
110
|
+
"@intlayer/config": "7.0.3-canary.0",
|
|
111
|
+
"@intlayer/core": "7.0.3-canary.0",
|
|
112
|
+
"@intlayer/dictionaries-entry": "7.0.3-canary.0",
|
|
113
|
+
"@intlayer/types": "7.0.3-canary.0",
|
|
114
114
|
"rxjs": "6.0.0 || ^7.0.0"
|
|
115
115
|
},
|
|
116
116
|
"engines": {
|