angular-intlayer 5.7.4 → 5.7.6-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/installIntlayerEditor.cjs +0 -2
- package/dist/cjs/editor/installIntlayerEditor.cjs.map +1 -1
- package/dist/esm/editor/installIntlayerEditor.mjs +0 -2
- package/dist/esm/editor/installIntlayerEditor.mjs.map +1 -1
- package/dist/types/editor/installIntlayerEditor.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/cjs/editor/changedContent.cjs +0 -62
- package/dist/cjs/editor/changedContent.cjs.map +0 -1
- package/dist/esm/editor/changedContent.mjs +0 -36
- package/dist/esm/editor/changedContent.mjs.map +0 -1
- package/dist/types/editor/changedContent.d.ts +0 -14
- package/dist/types/editor/changedContent.d.ts.map +0 -1
|
@@ -32,7 +32,6 @@ __export(installIntlayerEditor_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(installIntlayerEditor_exports);
|
|
34
34
|
var import_built = __toESM(require("@intlayer/config/built"));
|
|
35
|
-
var import_changedContent = require('./changedContent.cjs');
|
|
36
35
|
var import_communicator = require('./communicator.cjs');
|
|
37
36
|
var import_dictionariesRecord = require('./dictionariesRecord.cjs');
|
|
38
37
|
var import_editedContent = require('./editedContent.cjs');
|
|
@@ -60,7 +59,6 @@ const installIntlayerEditor = (injector) => {
|
|
|
60
59
|
allowedOrigins: [applicationURL, editorURL, cmsURL]
|
|
61
60
|
});
|
|
62
61
|
(0, import_editorEnabled.installEditorEnabled)(injector);
|
|
63
|
-
(0, import_changedContent.installChangedContent)(injector);
|
|
64
62
|
(0, import_dictionariesRecord.installDictionariesRecord)(injector);
|
|
65
63
|
(0, import_editedContent.installEditedContent)(injector);
|
|
66
64
|
(0, import_focusDictionary.installFocusDictionary)(injector);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport { installCommunicator } from './communicator';\nimport { installDictionariesRecord } from './dictionariesRecord';\nimport { installEditedContent } from './editedContent';\nimport { installEditorEnabled } from './editorEnabled';\nimport { installFocusDictionary } from './focusDictionary';\n\nconst { editor } = configuration;\nconst { applicationURL, editorURL, cmsURL } = editor ?? {};\n\nconst postMessage = (data: any) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n\n if (editor.applicationURL.length > 0) {\n window.postMessage(data, editor.applicationURL);\n }\n\n if (editor.editorURL.length > 0) {\n window.parent.postMessage(data, editor.editorURL);\n }\n\n if (editor.cmsURL.length > 0) {\n window.parent.postMessage(data, editor.cmsURL);\n }\n};\n\n/**\n * Angular-side replacement for the former <IntlayerEditorProvider> React component.\n *\n * Call **once** in your Angular application's bootstrap function or main module:\n *\n * ```typescript\n * import { bootstrapApplication } from '@angular/platform-browser';\n * import { AppComponent } from './app/app.component';\n * import { installIntlayerEditor } from 'angular-intlayer';\n *\n * bootstrapApplication(AppComponent).then(appRef => {\n * installIntlayerEditor(appRef.injector);\n * });\n * ```\n */\nexport const installIntlayerEditor = (injector: Injector): void => {\n /* ---------------------------------------------------------------------\n * 1. Base providers – always on\n * -------------------------------------------------------------------*/\n\n installCommunicator(injector, {\n postMessage,\n allowedOrigins: [applicationURL, editorURL, cmsURL] as string[],\n });\n installEditorEnabled(injector);\n installDictionariesRecord(injector);\n installEditedContent(injector);\n installFocusDictionary(injector);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA0B;AAC1B,0BAAoC;AACpC,gCAA0C;AAC1C,2BAAqC;AACrC,2BAAqC;AACrC,6BAAuC;AAEvC,MAAM,EAAE,OAAO,IAAI,aAAAA;AACnB,MAAM,EAAE,gBAAgB,WAAW,OAAO,IAAI,UAAU,CAAC;AAEzD,MAAM,cAAc,CAAC,SAAc;AACjC,MAAI,OAAO,WAAW,YAAa;AAEnC,QAAM,aAAa,OAAO,SAAS,OAAO;AAE1C,MAAI,CAAC,WAAY;AAEjB,MAAI,OAAO,eAAe,SAAS,GAAG;AACpC,WAAO,YAAY,MAAM,OAAO,cAAc;AAAA,EAChD;AAEA,MAAI,OAAO,UAAU,SAAS,GAAG;AAC/B,WAAO,OAAO,YAAY,MAAM,OAAO,SAAS;AAAA,EAClD;AAEA,MAAI,OAAO,OAAO,SAAS,GAAG;AAC5B,WAAO,OAAO,YAAY,MAAM,OAAO,MAAM;AAAA,EAC/C;AACF;AAiBO,MAAM,wBAAwB,CAAC,aAA6B;AAKjE,+CAAoB,UAAU;AAAA,IAC5B;AAAA,IACA,gBAAgB,CAAC,gBAAgB,WAAW,MAAM;AAAA,EACpD,CAAC;AACD,iDAAqB,QAAQ;AAC7B,2DAA0B,QAAQ;AAClC,iDAAqB,QAAQ;AAC7B,qDAAuB,QAAQ;AACjC;","names":["configuration"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import configuration from "@intlayer/config/built";
|
|
2
|
-
import { installChangedContent } from "./changedContent.mjs";
|
|
3
2
|
import { installCommunicator } from "./communicator.mjs";
|
|
4
3
|
import { installDictionariesRecord } from "./dictionariesRecord.mjs";
|
|
5
4
|
import { installEditedContent } from "./editedContent.mjs";
|
|
@@ -27,7 +26,6 @@ const installIntlayerEditor = (injector) => {
|
|
|
27
26
|
allowedOrigins: [applicationURL, editorURL, cmsURL]
|
|
28
27
|
});
|
|
29
28
|
installEditorEnabled(injector);
|
|
30
|
-
installChangedContent(injector);
|
|
31
29
|
installDictionariesRecord(injector);
|
|
32
30
|
installEditedContent(injector);
|
|
33
31
|
installFocusDictionary(injector);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/editor/installIntlayerEditor.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport configuration from '@intlayer/config/built';\nimport { installCommunicator } from './communicator';\nimport { installDictionariesRecord } from './dictionariesRecord';\nimport { installEditedContent } from './editedContent';\nimport { installEditorEnabled } from './editorEnabled';\nimport { installFocusDictionary } from './focusDictionary';\n\nconst { editor } = configuration;\nconst { applicationURL, editorURL, cmsURL } = editor ?? {};\n\nconst postMessage = (data: any) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n\n if (editor.applicationURL.length > 0) {\n window.postMessage(data, editor.applicationURL);\n }\n\n if (editor.editorURL.length > 0) {\n window.parent.postMessage(data, editor.editorURL);\n }\n\n if (editor.cmsURL.length > 0) {\n window.parent.postMessage(data, editor.cmsURL);\n }\n};\n\n/**\n * Angular-side replacement for the former <IntlayerEditorProvider> React component.\n *\n * Call **once** in your Angular application's bootstrap function or main module:\n *\n * ```typescript\n * import { bootstrapApplication } from '@angular/platform-browser';\n * import { AppComponent } from './app/app.component';\n * import { installIntlayerEditor } from 'angular-intlayer';\n *\n * bootstrapApplication(AppComponent).then(appRef => {\n * installIntlayerEditor(appRef.injector);\n * });\n * ```\n */\nexport const installIntlayerEditor = (injector: Injector): void => {\n /* ---------------------------------------------------------------------\n * 1. Base providers – always on\n * -------------------------------------------------------------------*/\n\n installCommunicator(injector, {\n postMessage,\n allowedOrigins: [applicationURL, editorURL, cmsURL] as string[],\n });\n installEditorEnabled(injector);\n installDictionariesRecord(injector);\n installEditedContent(injector);\n installFocusDictionary(injector);\n};\n"],"mappings":"AACA,OAAO,mBAAmB;AAC1B,SAAS,2BAA2B;AACpC,SAAS,iCAAiC;AAC1C,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AAEvC,MAAM,EAAE,OAAO,IAAI;AACnB,MAAM,EAAE,gBAAgB,WAAW,OAAO,IAAI,UAAU,CAAC;AAEzD,MAAM,cAAc,CAAC,SAAc;AACjC,MAAI,OAAO,WAAW,YAAa;AAEnC,QAAM,aAAa,OAAO,SAAS,OAAO;AAE1C,MAAI,CAAC,WAAY;AAEjB,MAAI,OAAO,eAAe,SAAS,GAAG;AACpC,WAAO,YAAY,MAAM,OAAO,cAAc;AAAA,EAChD;AAEA,MAAI,OAAO,UAAU,SAAS,GAAG;AAC/B,WAAO,OAAO,YAAY,MAAM,OAAO,SAAS;AAAA,EAClD;AAEA,MAAI,OAAO,OAAO,SAAS,GAAG;AAC5B,WAAO,OAAO,YAAY,MAAM,OAAO,MAAM;AAAA,EAC/C;AACF;AAiBO,MAAM,wBAAwB,CAAC,aAA6B;AAKjE,sBAAoB,UAAU;AAAA,IAC5B;AAAA,IACA,gBAAgB,CAAC,gBAAgB,WAAW,MAAM;AAAA,EACpD,CAAC;AACD,uBAAqB,QAAQ;AAC7B,4BAA0B,QAAQ;AAClC,uBAAqB,QAAQ;AAC7B,yBAAuB,QAAQ;AACjC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayerEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/installIntlayerEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"installIntlayerEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/installIntlayerEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+BzC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,QAAQ,KAAG,IAa1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-intlayer",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.6-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"deepmerge": "^4.3.1",
|
|
65
65
|
"js-cookie": "^3.0.5",
|
|
66
66
|
"uuid": "^11.1.0",
|
|
67
|
-
"@intlayer/chokidar": "5.7.
|
|
68
|
-
"@intlayer/
|
|
69
|
-
"@intlayer/
|
|
70
|
-
"@intlayer/
|
|
71
|
-
"@intlayer/
|
|
72
|
-
"@intlayer/
|
|
67
|
+
"@intlayer/chokidar": "5.7.6-canary.0",
|
|
68
|
+
"@intlayer/config": "5.7.6-canary.0",
|
|
69
|
+
"@intlayer/core": "5.7.6-canary.0",
|
|
70
|
+
"@intlayer/editor": "5.7.6-canary.0",
|
|
71
|
+
"@intlayer/webpack": "5.7.6-canary.0",
|
|
72
|
+
"@intlayer/dictionaries-entry": "5.7.6-canary.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "^22.15.30",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"tsup": "^8.5.0",
|
|
84
84
|
"typescript": "^5.8.3",
|
|
85
85
|
"vitest": "^3.2.2",
|
|
86
|
-
"@utils/ts-config": "1.0.4",
|
|
87
86
|
"@utils/eslint-config": "1.0.4",
|
|
87
|
+
"@utils/ts-config": "1.0.4",
|
|
88
88
|
"@utils/ts-config-types": "1.0.4",
|
|
89
89
|
"@utils/tsup-config": "1.0.4"
|
|
90
90
|
},
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
93
93
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
94
94
|
"rxjs": "^6.0.0 || ^7.0.0",
|
|
95
|
-
"@intlayer/
|
|
96
|
-
"@intlayer/
|
|
97
|
-
"@intlayer/
|
|
98
|
-
"@intlayer/dictionaries-entry": "5.7.
|
|
95
|
+
"@intlayer/chokidar": "5.7.6-canary.0",
|
|
96
|
+
"@intlayer/config": "5.7.6-canary.0",
|
|
97
|
+
"@intlayer/core": "5.7.6-canary.0",
|
|
98
|
+
"@intlayer/dictionaries-entry": "5.7.6-canary.0"
|
|
99
99
|
},
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=14.18"
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var changedContent_exports = {};
|
|
20
|
-
__export(changedContent_exports, {
|
|
21
|
-
createChangedContentClient: () => createChangedContentClient,
|
|
22
|
-
installChangedContent: () => installChangedContent,
|
|
23
|
-
useChangedContent: () => useChangedContent
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(changedContent_exports);
|
|
26
|
-
var import_core = require("@angular/core");
|
|
27
|
-
let instance = null;
|
|
28
|
-
const INTLAYER_CHANGED_CONTENT_SYMBOL = Symbol("intlayerChangedContent");
|
|
29
|
-
const createChangedContentClient = () => {
|
|
30
|
-
if (instance) return instance;
|
|
31
|
-
const stateSignal = (0, import_core.signal)({});
|
|
32
|
-
const setChangedContent = (dictionaryKey, newValue) => {
|
|
33
|
-
const currentState = stateSignal();
|
|
34
|
-
stateSignal.set({
|
|
35
|
-
...currentState,
|
|
36
|
-
[dictionaryKey]: {
|
|
37
|
-
...currentState[dictionaryKey] ?? { key: dictionaryKey, content: {} },
|
|
38
|
-
content: newValue
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
instance = {
|
|
43
|
-
get content() {
|
|
44
|
-
return stateSignal();
|
|
45
|
-
},
|
|
46
|
-
setContent: setChangedContent
|
|
47
|
-
};
|
|
48
|
-
return instance;
|
|
49
|
-
};
|
|
50
|
-
const installChangedContent = (injector) => {
|
|
51
|
-
const client = createChangedContentClient();
|
|
52
|
-
};
|
|
53
|
-
const useChangedContent = () => {
|
|
54
|
-
return createChangedContentClient();
|
|
55
|
-
};
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
createChangedContentClient,
|
|
59
|
-
installChangedContent,
|
|
60
|
-
useChangedContent
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=changedContent.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editor/changedContent.ts"],"sourcesContent":["import { Injector, signal } from '@angular/core';\nimport type { Dictionary } from '@intlayer/core';\n\n/**\n * Singleton instance\n */\nlet instance: ChangedContent | null = null;\n\nconst INTLAYER_CHANGED_CONTENT_SYMBOL = Symbol('intlayerChangedContent');\n\ntype ChangedContent = {\n content: Record<Dictionary['key'], Dictionary>;\n setContent: (key: Dictionary['key'], newValue: Dictionary['content']) => void;\n};\n\nexport const createChangedContentClient = () => {\n if (instance) return instance;\n\n const stateSignal = signal<ChangedContent['content']>({});\n\n /**\n * Sets the content for a specific dictionary\n * @param dictionaryKey - The key of the dictionary to update\n * @param newValue - The new content to set\n */\n const setChangedContent = (\n dictionaryKey: Dictionary['key'],\n newValue: Dictionary['content']\n ) => {\n const currentState = stateSignal();\n stateSignal.set({\n ...currentState,\n [dictionaryKey]: {\n ...(currentState[dictionaryKey] ?? { key: dictionaryKey, content: {} }),\n content: newValue,\n } as Dictionary,\n });\n };\n\n instance = {\n get content() {\n return stateSignal();\n },\n setContent: setChangedContent,\n };\n\n return instance;\n};\n\n/**\n * Helper to install the Intlayer provider into the injector\n */\nexport const installChangedContent = (injector: Injector) => {\n const client = createChangedContentClient();\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 createChangedContentClient\n};\n\nexport const useChangedContent = () => {\n return createChangedContentClient();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAMjC,IAAI,WAAkC;AAEtC,MAAM,kCAAkC,OAAO,wBAAwB;AAOhE,MAAM,6BAA6B,MAAM;AAC9C,MAAI,SAAU,QAAO;AAErB,QAAM,kBAAc,oBAAkC,CAAC,CAAC;AAOxD,QAAM,oBAAoB,CACxB,eACA,aACG;AACH,UAAM,eAAe,YAAY;AACjC,gBAAY,IAAI;AAAA,MACd,GAAG;AAAA,MACH,CAAC,aAAa,GAAG;AAAA,QACf,GAAI,aAAa,aAAa,KAAK,EAAE,KAAK,eAAe,SAAS,CAAC,EAAE;AAAA,QACrE,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH;AAEA,aAAW;AAAA,IACT,IAAI,UAAU;AACZ,aAAO,YAAY;AAAA,IACrB;AAAA,IACA,YAAY;AAAA,EACd;AAEA,SAAO;AACT;AAKO,MAAM,wBAAwB,CAAC,aAAuB;AAC3D,QAAM,SAAS,2BAA2B;AAI5C;AAEO,MAAM,oBAAoB,MAAM;AACrC,SAAO,2BAA2B;AACpC;","names":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { signal } from "@angular/core";
|
|
2
|
-
let instance = null;
|
|
3
|
-
const INTLAYER_CHANGED_CONTENT_SYMBOL = Symbol("intlayerChangedContent");
|
|
4
|
-
const createChangedContentClient = () => {
|
|
5
|
-
if (instance) return instance;
|
|
6
|
-
const stateSignal = signal({});
|
|
7
|
-
const setChangedContent = (dictionaryKey, newValue) => {
|
|
8
|
-
const currentState = stateSignal();
|
|
9
|
-
stateSignal.set({
|
|
10
|
-
...currentState,
|
|
11
|
-
[dictionaryKey]: {
|
|
12
|
-
...currentState[dictionaryKey] ?? { key: dictionaryKey, content: {} },
|
|
13
|
-
content: newValue
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
instance = {
|
|
18
|
-
get content() {
|
|
19
|
-
return stateSignal();
|
|
20
|
-
},
|
|
21
|
-
setContent: setChangedContent
|
|
22
|
-
};
|
|
23
|
-
return instance;
|
|
24
|
-
};
|
|
25
|
-
const installChangedContent = (injector) => {
|
|
26
|
-
const client = createChangedContentClient();
|
|
27
|
-
};
|
|
28
|
-
const useChangedContent = () => {
|
|
29
|
-
return createChangedContentClient();
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
createChangedContentClient,
|
|
33
|
-
installChangedContent,
|
|
34
|
-
useChangedContent
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=changedContent.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/editor/changedContent.ts"],"sourcesContent":["import { Injector, signal } from '@angular/core';\nimport type { Dictionary } from '@intlayer/core';\n\n/**\n * Singleton instance\n */\nlet instance: ChangedContent | null = null;\n\nconst INTLAYER_CHANGED_CONTENT_SYMBOL = Symbol('intlayerChangedContent');\n\ntype ChangedContent = {\n content: Record<Dictionary['key'], Dictionary>;\n setContent: (key: Dictionary['key'], newValue: Dictionary['content']) => void;\n};\n\nexport const createChangedContentClient = () => {\n if (instance) return instance;\n\n const stateSignal = signal<ChangedContent['content']>({});\n\n /**\n * Sets the content for a specific dictionary\n * @param dictionaryKey - The key of the dictionary to update\n * @param newValue - The new content to set\n */\n const setChangedContent = (\n dictionaryKey: Dictionary['key'],\n newValue: Dictionary['content']\n ) => {\n const currentState = stateSignal();\n stateSignal.set({\n ...currentState,\n [dictionaryKey]: {\n ...(currentState[dictionaryKey] ?? { key: dictionaryKey, content: {} }),\n content: newValue,\n } as Dictionary,\n });\n };\n\n instance = {\n get content() {\n return stateSignal();\n },\n setContent: setChangedContent,\n };\n\n return instance;\n};\n\n/**\n * Helper to install the Intlayer provider into the injector\n */\nexport const installChangedContent = (injector: Injector) => {\n const client = createChangedContentClient();\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 createChangedContentClient\n};\n\nexport const useChangedContent = () => {\n return createChangedContentClient();\n};\n"],"mappings":"AAAA,SAAmB,cAAc;AAMjC,IAAI,WAAkC;AAEtC,MAAM,kCAAkC,OAAO,wBAAwB;AAOhE,MAAM,6BAA6B,MAAM;AAC9C,MAAI,SAAU,QAAO;AAErB,QAAM,cAAc,OAAkC,CAAC,CAAC;AAOxD,QAAM,oBAAoB,CACxB,eACA,aACG;AACH,UAAM,eAAe,YAAY;AACjC,gBAAY,IAAI;AAAA,MACd,GAAG;AAAA,MACH,CAAC,aAAa,GAAG;AAAA,QACf,GAAI,aAAa,aAAa,KAAK,EAAE,KAAK,eAAe,SAAS,CAAC,EAAE;AAAA,QACrE,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH;AAEA,aAAW;AAAA,IACT,IAAI,UAAU;AACZ,aAAO,YAAY;AAAA,IACrB;AAAA,IACA,YAAY;AAAA,EACd;AAEA,SAAO;AACT;AAKO,MAAM,wBAAwB,CAAC,aAAuB;AAC3D,QAAM,SAAS,2BAA2B;AAI5C;AAEO,MAAM,oBAAoB,MAAM;AACrC,SAAO,2BAA2B;AACpC;","names":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
2
|
-
import type { Dictionary } from '@intlayer/core';
|
|
3
|
-
type ChangedContent = {
|
|
4
|
-
content: Record<Dictionary['key'], Dictionary>;
|
|
5
|
-
setContent: (key: Dictionary['key'], newValue: Dictionary['content']) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const createChangedContentClient: () => ChangedContent;
|
|
8
|
-
/**
|
|
9
|
-
* Helper to install the Intlayer provider into the injector
|
|
10
|
-
*/
|
|
11
|
-
export declare const installChangedContent: (injector: Injector) => void;
|
|
12
|
-
export declare const useChangedContent: () => ChangedContent;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=changedContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changedContent.d.ts","sourceRoot":"","sources":["../../../src/editor/changedContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASjD,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/C,UAAU,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;CAC/E,CAAC;AAEF,eAAO,MAAM,0BAA0B,sBAgCtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,QAAQ,SAKvD,CAAC;AAEF,eAAO,MAAM,iBAAiB,sBAE7B,CAAC"}
|