@intlayer/editor 9.5.11 → 9.6.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/components/ContentSelector.cjs +0 -4
- package/dist/cjs/components/ContentSelector.cjs.map +1 -1
- package/dist/cjs/components/ContentSelectorWrapper.cjs +72 -76
- package/dist/cjs/components/ContentSelectorWrapper.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +0 -6
- package/dist/cjs/core/EditorStateManager.cjs +32 -75
- package/dist/cjs/core/EditorStateManager.cjs.map +1 -1
- package/dist/cjs/core/IframeClickInterceptor.cjs +15 -9
- package/dist/cjs/core/IframeClickInterceptor.cjs.map +1 -1
- package/dist/cjs/core/index.cjs +3 -10
- package/dist/cjs/core/initEditorClient.cjs +1 -2
- package/dist/cjs/core/initEditorClient.cjs.map +1 -1
- package/dist/cjs/core/sharedWindowState.cjs +49 -0
- package/dist/cjs/core/sharedWindowState.cjs.map +1 -0
- package/dist/cjs/index.cjs +4 -21
- package/dist/esm/components/ContentSelector.mjs +0 -4
- package/dist/esm/components/ContentSelector.mjs.map +1 -1
- package/dist/esm/components/ContentSelectorWrapper.mjs +72 -76
- package/dist/esm/components/ContentSelectorWrapper.mjs.map +1 -1
- package/dist/esm/components/index.mjs +1 -3
- package/dist/esm/core/EditorStateManager.mjs +32 -75
- package/dist/esm/core/EditorStateManager.mjs.map +1 -1
- package/dist/esm/core/IframeClickInterceptor.mjs +15 -9
- package/dist/esm/core/IframeClickInterceptor.mjs.map +1 -1
- package/dist/esm/core/index.mjs +3 -4
- package/dist/esm/core/initEditorClient.mjs +2 -2
- package/dist/esm/core/initEditorClient.mjs.map +1 -1
- package/dist/esm/core/sharedWindowState.mjs +48 -0
- package/dist/esm/core/sharedWindowState.mjs.map +1 -0
- package/dist/esm/index.mjs +4 -9
- package/dist/types/components/ContentSelector.d.ts.map +1 -1
- package/dist/types/components/ContentSelectorWrapper.d.ts +12 -9
- package/dist/types/components/ContentSelectorWrapper.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -3
- package/dist/types/core/EditorStateManager.d.ts +7 -13
- package/dist/types/core/EditorStateManager.d.ts.map +1 -1
- package/dist/types/core/IframeClickInterceptor.d.ts +3 -7
- package/dist/types/core/IframeClickInterceptor.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +3 -4
- package/dist/types/core/initEditorClient.d.ts +0 -2
- package/dist/types/core/initEditorClient.d.ts.map +1 -1
- package/dist/types/core/sharedWindowState.d.ts +18 -0
- package/dist/types/core/sharedWindowState.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -9
- package/package.json +6 -6
- package/dist/cjs/components/EditedContent.cjs +0 -161
- package/dist/cjs/components/EditedContent.cjs.map +0 -1
- package/dist/cjs/components/IntlayerEditor.cjs +0 -94
- package/dist/cjs/components/IntlayerEditor.cjs.map +0 -1
- package/dist/cjs/core/editedContentBus.cjs +0 -36
- package/dist/cjs/core/editedContentBus.cjs.map +0 -1
- package/dist/cjs/core/focusedContentBus.cjs +0 -42
- package/dist/cjs/core/focusedContentBus.cjs.map +0 -1
- package/dist/cjs/mergeIframeClick.cjs +0 -22
- package/dist/cjs/mergeIframeClick.cjs.map +0 -1
- package/dist/esm/components/EditedContent.mjs +0 -159
- package/dist/esm/components/EditedContent.mjs.map +0 -1
- package/dist/esm/components/IntlayerEditor.mjs +0 -92
- package/dist/esm/components/IntlayerEditor.mjs.map +0 -1
- package/dist/esm/core/editedContentBus.mjs +0 -33
- package/dist/esm/core/editedContentBus.mjs.map +0 -1
- package/dist/esm/core/focusedContentBus.mjs +0 -39
- package/dist/esm/core/focusedContentBus.mjs.map +0 -1
- package/dist/esm/mergeIframeClick.mjs +0 -21
- package/dist/esm/mergeIframeClick.mjs.map +0 -1
- package/dist/types/components/EditedContent.d.ts +0 -49
- package/dist/types/components/EditedContent.d.ts.map +0 -1
- package/dist/types/components/IntlayerEditor.d.ts +0 -44
- package/dist/types/components/IntlayerEditor.d.ts.map +0 -1
- package/dist/types/core/editedContentBus.d.ts +0 -7
- package/dist/types/core/editedContentBus.d.ts.map +0 -1
- package/dist/types/core/focusedContentBus.d.ts +0 -7
- package/dist/types/core/focusedContentBus.d.ts.map +0 -1
- package/dist/types/mergeIframeClick.d.ts +0 -4
- package/dist/types/mergeIframeClick.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeIframeClick.mjs","names":[],"sources":["../../src/mergeIframeClick.ts"],"sourcesContent":["// Listener for messages from the iframe\nexport const mergeIframeClick = (event: MessageEvent) => {\n // Simulate or merge the iframe message with a click event\n const simulatedMouseDownEvent = new MouseEvent('mousedown', {\n bubbles: true,\n cancelable: true,\n view: window,\n });\n const simulatedClickEvent = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n });\n\n // Optionally attach additional properties from the iframe message\n Object.assign(simulatedClickEvent, { iframeData: event });\n Object.assign(simulatedMouseDownEvent, { iframeData: event });\n\n // Dispatch the simulated click event on the window or a specific element\n window.dispatchEvent(simulatedClickEvent);\n window.dispatchEvent(simulatedMouseDownEvent);\n};\n"],"mappings":";AACA,MAAa,oBAAoB,UAAwB;CAEvD,MAAM,0BAA0B,IAAI,WAAW,aAAa;EAC1D,SAAS;EACT,YAAY;EACZ,MAAM;CACR,CAAC;CACD,MAAM,sBAAsB,IAAI,WAAW,SAAS;EAClD,SAAS;EACT,YAAY;EACZ,MAAM;CACR,CAAC;CAGD,OAAO,OAAO,qBAAqB,EAAE,YAAY,MAAM,CAAC;CACxD,OAAO,OAAO,yBAAyB,EAAE,YAAY,MAAM,CAAC;CAG5D,OAAO,cAAc,mBAAmB;CACxC,OAAO,cAAc,uBAAuB;AAC9C"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//#region src/components/EditedContent.d.ts
|
|
2
|
-
declare const _HTMLElement: {
|
|
3
|
-
new (): HTMLElement;
|
|
4
|
-
prototype: HTMLElement;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* <intlayer-edited-content>
|
|
8
|
-
*
|
|
9
|
-
* Framework-agnostic web component that displays edited content from the Intlayer
|
|
10
|
-
* editor. When the editor has an edited value for the given dictionary key and
|
|
11
|
-
* key path, it renders the edited value; otherwise it renders the original
|
|
12
|
-
* content via a slot.
|
|
13
|
-
*
|
|
14
|
-
* Always wraps content in <intlayer-content-selector-wrapper> for selection UI.
|
|
15
|
-
*
|
|
16
|
-
* @attr {string} dictionary-key - The dictionary key owning this content node
|
|
17
|
-
* @attr {string} key-path - JSON-serialized KeyPath[] for this content node
|
|
18
|
-
* @attr {string} locale - The current locale string
|
|
19
|
-
*/
|
|
20
|
-
export declare class IntlayerEditedContentElement extends _HTMLElement {
|
|
21
|
-
private _dictionaryKey;
|
|
22
|
-
private _keyPathJson;
|
|
23
|
-
private _locale;
|
|
24
|
-
private _editedText;
|
|
25
|
-
private _unsubManager;
|
|
26
|
-
private _unsubEditedContent;
|
|
27
|
-
private _selectorWrapper;
|
|
28
|
-
private _slot;
|
|
29
|
-
static get observedAttributes(): string[];
|
|
30
|
-
get dictionaryKey(): string;
|
|
31
|
-
set dictionaryKey(v: string);
|
|
32
|
-
get keyPathJson(): string;
|
|
33
|
-
set keyPathJson(v: string);
|
|
34
|
-
get locale(): string;
|
|
35
|
-
set locale(v: string);
|
|
36
|
-
constructor();
|
|
37
|
-
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
38
|
-
connectedCallback(): void;
|
|
39
|
-
disconnectedCallback(): void;
|
|
40
|
-
private _teardown;
|
|
41
|
-
private _getKeyPath;
|
|
42
|
-
private _render;
|
|
43
|
-
private _resolveEditedText;
|
|
44
|
-
private _setupManagerSubscriptions;
|
|
45
|
-
private _subscribeToManager;
|
|
46
|
-
}
|
|
47
|
-
export declare const defineIntlayerEditedContent: () => void;
|
|
48
|
-
//#endregion
|
|
49
|
-
//# sourceMappingURL=EditedContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditedContent.d.ts","names":[],"sources":["../../../src/components/EditedContent.ts"],"mappings":";cAQM;UAAA;aAAA;;;;;;;;;;;;;;;;qBAmBO,qCAAqC;UACxC;UACA;UACA;UACA;UAEA;UACA;UAEA;UACA;aAEG;MAIP;MAGA,cAAc;MAKd;MAGA,YAAY;MAKZ;MAGA,OAAO;EAIX;EAgBA,yBACE,cACA,wBACA;EAcF;EAIA;UAIQ;UAOA;UAQA;UAaA;UA2CA;UAUA;;qBAmBG"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
|
-
//#region src/components/IntlayerEditor.d.ts
|
|
3
|
-
declare const _HTMLElement: {
|
|
4
|
-
new (): HTMLElement;
|
|
5
|
-
prototype: HTMLElement;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* <intlayer-editor>
|
|
9
|
-
*
|
|
10
|
-
* A framework-agnostic web component that manages the Intlayer editor singleton
|
|
11
|
-
* lifecycle and keeps the current locale in sync with the EditorStateManager.
|
|
12
|
-
*
|
|
13
|
-
* Drop this element once at the root of your application to activate the editor.
|
|
14
|
-
* It renders no UI.
|
|
15
|
-
*
|
|
16
|
-
* @prop {IntlayerConfig} configuration - The Intlayer config (required; set as JS property, not attribute)
|
|
17
|
-
* @prop {string} locale - The active application locale (attribute/property)
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // Svelte
|
|
21
|
-
* <intlayer-editor .configuration={config} locale={$locale} />
|
|
22
|
-
*
|
|
23
|
-
* // Vue
|
|
24
|
-
* <intlayer-editor :configuration="config" :locale="currentLocale" />
|
|
25
|
-
*/
|
|
26
|
-
export declare class IntlayerEditorElement extends _HTMLElement {
|
|
27
|
-
private _configuration;
|
|
28
|
-
private _locale;
|
|
29
|
-
private _initialized;
|
|
30
|
-
private _unsubManager;
|
|
31
|
-
static get observedAttributes(): string[];
|
|
32
|
-
get configuration(): IntlayerConfig | undefined;
|
|
33
|
-
set configuration(v: IntlayerConfig | undefined);
|
|
34
|
-
get locale(): string | undefined;
|
|
35
|
-
set locale(v: string | undefined);
|
|
36
|
-
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
37
|
-
connectedCallback(): void;
|
|
38
|
-
disconnectedCallback(): void;
|
|
39
|
-
private _init;
|
|
40
|
-
private _syncLocale;
|
|
41
|
-
}
|
|
42
|
-
export declare const defineIntlayerEditorElement: () => void;
|
|
43
|
-
//#endregion
|
|
44
|
-
//# sourceMappingURL=IntlayerEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntlayerEditor.d.ts","names":[],"sources":["../../../src/components/IntlayerEditor.ts"],"mappings":";;cAQM;UAAA;aAAA;;;;;;;;;;;;;;;;;;;;;qBAwBO,8BAA8B;UACjC;UACA;UACA;UACA;aAEG;MAIP,iBAAiB;MAGjB,cAAc,GAAG;MAKjB;MAGA,OAAO;EAKX,yBACE,cACA,wBACA;EAQF;EAIA;UASQ;UAOA;;qBAkBG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DictionaryContent } from "./EditorStateManager.js";
|
|
2
|
-
//#region src/core/editedContentBus.d.ts
|
|
3
|
-
export declare const getGlobalEditedContent: () => DictionaryContent;
|
|
4
|
-
export declare const setGlobalEditedContent: (content: DictionaryContent, sourceId?: string) => void;
|
|
5
|
-
export declare const subscribeToGlobalEditedContent: (cb: (content: DictionaryContent, sourceId?: string) => void) => (() => void);
|
|
6
|
-
//#endregion
|
|
7
|
-
//# sourceMappingURL=editedContentBus.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editedContentBus.d.ts","names":[],"sources":["../../../src/core/editedContentBus.ts"],"mappings":";;qBAmBa,8BAA6B;qBAK7B,yBAAsB,SACxB,mBAAiB;qBAWf,iCAA8B,KACpC,SAAS,mBAAmB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FileContent } from "./EditorStateManager.js";
|
|
2
|
-
//#region src/core/focusedContentBus.d.ts
|
|
3
|
-
export declare const getGlobalFocusedContent: () => FileContent | null | undefined;
|
|
4
|
-
export declare const setGlobalFocusedContent: (content: FileContent | null, sourceId?: string) => void;
|
|
5
|
-
export declare const subscribeToGlobalFocusedContent: (cb: (content: FileContent | null, sourceId?: string) => void) => (() => void);
|
|
6
|
-
//#endregion
|
|
7
|
-
//# sourceMappingURL=focusedContentBus.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focusedContentBus.d.ts","names":[],"sources":["../../../src/core/focusedContentBus.ts"],"mappings":";;qBAoBa,+BAA8B;qBAO9B,0BAAuB,SACzB,oBAAkB;qBAahB,kCAA+B,KACrC,SAAS,oBAAoB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mergeIframeClick.d.ts","names":[],"sources":["../../src/mergeIframeClick.ts"],"mappings":";qBACa,mBAAgB,OAAW"}
|