@intlayer/editor 9.7.0 → 9.7.2
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/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/compareUrls.cjs +1 -2
- package/dist/cjs/components/ContentSelector.cjs +44 -8
- package/dist/cjs/components/ContentSelector.cjs.map +1 -1
- package/dist/cjs/components/ContentSelectorWrapper.cjs +32 -5
- package/dist/cjs/components/ContentSelectorWrapper.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +2 -2
- package/dist/cjs/components/isInteractiveClickTarget.cjs +1 -2
- package/dist/cjs/core/CrossFrameMessenger.cjs +2 -3
- package/dist/cjs/core/CrossFrameStateManager.cjs +1 -2
- package/dist/cjs/core/EditorStateManager.cjs +63 -18
- package/dist/cjs/core/EditorStateManager.cjs.map +1 -1
- package/dist/cjs/core/IframeClickInterceptor.cjs +3 -4
- package/dist/cjs/core/UrlStateManager.cjs +2 -3
- package/dist/cjs/core/getLocalEditorParentOrigin.cjs +1 -2
- package/dist/cjs/core/globalManager.cjs +1 -2
- package/dist/cjs/core/index.cjs +10 -8
- package/dist/cjs/core/initEditorClient.cjs +5 -6
- package/dist/cjs/core/selectionClick.cjs +1 -2
- package/dist/cjs/core/sharedWindowState.cjs +1 -2
- package/dist/cjs/index.cjs +13 -11
- package/dist/cjs/isEnabled.cjs +1 -2
- package/dist/cjs/messageKey.cjs +1 -2
- package/dist/esm/compareUrls.mjs +1 -2
- package/dist/esm/components/ContentSelector.mjs +41 -5
- package/dist/esm/components/ContentSelector.mjs.map +1 -1
- package/dist/esm/components/ContentSelectorWrapper.mjs +30 -3
- package/dist/esm/components/ContentSelectorWrapper.mjs.map +1 -1
- package/dist/esm/components/index.mjs +1 -1
- package/dist/esm/components/isInteractiveClickTarget.mjs +1 -2
- package/dist/esm/core/CrossFrameMessenger.mjs +1 -2
- package/dist/esm/core/CrossFrameStateManager.mjs +1 -2
- package/dist/esm/core/EditorStateManager.mjs +55 -12
- package/dist/esm/core/EditorStateManager.mjs.map +1 -1
- package/dist/esm/core/IframeClickInterceptor.mjs +1 -2
- package/dist/esm/core/UrlStateManager.mjs +1 -2
- package/dist/esm/core/getLocalEditorParentOrigin.mjs +1 -2
- package/dist/esm/core/globalManager.mjs +1 -2
- package/dist/esm/core/index.mjs +4 -4
- package/dist/esm/core/initEditorClient.mjs +2 -3
- package/dist/esm/core/selectionClick.mjs +1 -2
- package/dist/esm/core/sharedWindowState.mjs +1 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/isEnabled.mjs +1 -2
- package/dist/esm/messageKey.mjs +1 -2
- package/dist/types/compareUrls.d.ts +0 -2
- package/dist/types/compareUrls.d.ts.map +1 -1
- package/dist/types/components/ContentSelector.d.ts +1 -2
- package/dist/types/components/ContentSelector.d.ts.map +1 -1
- package/dist/types/components/ContentSelectorWrapper.d.ts +5 -2
- package/dist/types/components/ContentSelectorWrapper.d.ts.map +1 -1
- package/dist/types/components/isInteractiveClickTarget.d.ts +0 -2
- package/dist/types/components/isInteractiveClickTarget.d.ts.map +1 -1
- package/dist/types/core/CrossFrameMessenger.d.ts +1 -2
- package/dist/types/core/CrossFrameMessenger.d.ts.map +1 -1
- package/dist/types/core/CrossFrameStateManager.d.ts +0 -2
- package/dist/types/core/CrossFrameStateManager.d.ts.map +1 -1
- package/dist/types/core/EditorStateManager.d.ts +24 -3
- package/dist/types/core/EditorStateManager.d.ts.map +1 -1
- package/dist/types/core/IframeClickInterceptor.d.ts +0 -2
- package/dist/types/core/IframeClickInterceptor.d.ts.map +1 -1
- package/dist/types/core/UrlStateManager.d.ts +0 -2
- package/dist/types/core/UrlStateManager.d.ts.map +1 -1
- package/dist/types/core/getLocalEditorParentOrigin.d.ts +0 -2
- package/dist/types/core/getLocalEditorParentOrigin.d.ts.map +1 -1
- package/dist/types/core/globalManager.d.ts +0 -2
- package/dist/types/core/globalManager.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +4 -4
- package/dist/types/core/initEditorClient.d.ts +0 -2
- package/dist/types/core/initEditorClient.d.ts.map +1 -1
- package/dist/types/core/selectionClick.d.ts +0 -2
- package/dist/types/core/selectionClick.d.ts.map +1 -1
- package/dist/types/core/sharedWindowState.d.ts +1 -2
- package/dist/types/core/sharedWindowState.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/isEnabled.d.ts +0 -2
- package/dist/types/isEnabled.d.ts.map +1 -1
- package/dist/types/messageKey.d.ts +0 -2
- package/dist/types/messageKey.d.ts.map +1 -1
- package/package.json +32 -32
package/dist/esm/messageKey.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/messageKey.ts
|
|
2
2
|
let MessageKey = /* @__PURE__ */ function(MessageKey) {
|
|
3
3
|
/** Client → editor: announces the client is ready (also used as response to ARE_YOU_THERE) */
|
|
4
4
|
MessageKey["INTLAYER_CLIENT_READY"] = "INTLAYER_CLIENT_READY";
|
|
@@ -30,6 +30,5 @@ let MessageKey = /* @__PURE__ */ function(MessageKey) {
|
|
|
30
30
|
return MessageKey;
|
|
31
31
|
}({});
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
export { MessageKey };
|
|
35
34
|
//# sourceMappingURL=messageKey.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/compareUrls.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Compare two URLs for equality.
|
|
4
3
|
* This function is used to determine if a message originates from the same origin.
|
|
@@ -16,5 +15,4 @@
|
|
|
16
15
|
* @returns Whether the two URLs are equal.
|
|
17
16
|
*/
|
|
18
17
|
export declare const compareUrls: (url1: string, url2: string) => boolean;
|
|
19
|
-
//#endregion
|
|
20
18
|
//# sourceMappingURL=compareUrls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareUrls.d.ts","names":[],"sources":["../../src/compareUrls.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"compareUrls.d.ts","names":[],"sources":["../../src/compareUrls.ts"],"mappings":";;;;;;;;;;;;;;;;qBAgBa,cAAW,cAAgB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/ContentSelector.d.ts
|
|
2
1
|
declare const _HTMLElement: {
|
|
3
2
|
new (): HTMLElement;
|
|
4
3
|
prototype: HTMLElement;
|
|
@@ -56,5 +55,5 @@ export declare class IntlayerContentSelectorElement extends _HTMLElement {
|
|
|
56
55
|
* Safe to call multiple times — only registers elements that are not yet defined.
|
|
57
56
|
*/
|
|
58
57
|
export declare const defineIntlayerElements: () => void;
|
|
59
|
-
|
|
58
|
+
export {};
|
|
60
59
|
//# sourceMappingURL=ContentSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/components/ContentSelector.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentSelector.d.ts","names":[],"sources":["../../../src/components/ContentSelector.ts"],"mappings":"A,cA6DM;;;;;;;;;;;;;;;;;;;;;;;;qBAyBO,uCAAuC;UAC1C;UACA;UACA;UACA;UACA;UACA;UACA;aAEG;MAIP;MAGA,YAAY;MAKZ;MAGA,cAAc;EAIlB;EAgCA,yBACE,cACA,wBACA;EAWF;EAkBA;UASQ;UAUA;UAOA;UAMA;UAOA;UAKA;UAMA;UASA;UAuBA;;;;;;;qBAWG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { KeyPath } from "@intlayer/types/keyPath";
|
|
2
2
|
declare const _HTMLElement: {
|
|
3
3
|
new (): HTMLElement;
|
|
4
4
|
prototype: HTMLElement;
|
|
@@ -30,6 +30,8 @@ export declare class IntlayerContentSelectorWrapperElement extends _HTMLElement
|
|
|
30
30
|
/** Removes the listeners attached to the current manager's states */
|
|
31
31
|
private _unsubManagerState;
|
|
32
32
|
static get observedAttributes(): string[];
|
|
33
|
+
get dictionaryKey(): string;
|
|
34
|
+
get filteredKeyPath(): KeyPath[];
|
|
33
35
|
constructor();
|
|
34
36
|
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
35
37
|
connectedCallback(): void;
|
|
@@ -54,9 +56,10 @@ export declare class IntlayerContentSelectorWrapperElement extends _HTMLElement
|
|
|
54
56
|
private _handlePress;
|
|
55
57
|
private _handleHover;
|
|
56
58
|
private _handleUnhover;
|
|
59
|
+
private _handleClickOutside;
|
|
57
60
|
private _render;
|
|
58
61
|
private _rebuildContent;
|
|
59
62
|
}
|
|
60
63
|
export declare const defineIntlayerContentSelectorWrapper: () => void;
|
|
61
|
-
|
|
64
|
+
export {};
|
|
62
65
|
//# sourceMappingURL=ContentSelectorWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.d.ts","names":[],"sources":["../../../src/components/ContentSelectorWrapper.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"ContentSelectorWrapper.d.ts","names":[],"sources":["../../../src/components/ContentSelectorWrapper.ts"],"mappings":";cA6GM;;;;;;;;;;;;;;;;;;qBAmBO,8CAA8C;UACjD;UACA;UACA;UACA;UACA;UACA;UAEA;UACA;UAEA;;UAEA;aAEG;MAIP;MAIA,mBAAmB;EAIvB;EAQA,yBACE,cACA,0BACA;EAYF;EAQA;UAOQ;UAQA;UAMA;UAkDA;;;;;UA6BA;;;;;UA6BA;UAWA;UASA;UAoBA;UA8BA;UAWA;UAWA;UAQA;UAiCA;UA+BA;;qBAqCG"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/isInteractiveClickTarget.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Whether a click on editable content lands on something the application
|
|
4
3
|
* handles itself: a link, a button, a form control, or an ancestor rendered as
|
|
@@ -12,5 +11,4 @@
|
|
|
12
11
|
* @param event - Click event, read through its composed path
|
|
13
12
|
*/
|
|
14
13
|
export declare const isInteractiveClickTarget: (event: Event) => boolean;
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=isInteractiveClickTarget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInteractiveClickTarget.d.ts","names":[],"sources":["../../../src/components/isInteractiveClickTarget.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isInteractiveClickTarget.d.ts","names":[],"sources":["../../../src/components/isInteractiveClickTarget.ts"],"mappings":";;;;;;;;;;;;qBA4Da,2BAAwB,OAAW"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/core/CrossFrameMessenger.d.ts
|
|
2
1
|
export type MessagePayload = {
|
|
3
2
|
type: string;
|
|
4
3
|
data?: unknown;
|
|
@@ -49,5 +48,5 @@ export declare class CrossFrameMessenger {
|
|
|
49
48
|
subscribe<T = unknown>(type: string, handler: MessageHandler<T>): () => void;
|
|
50
49
|
private _handleMessage;
|
|
51
50
|
}
|
|
52
|
-
|
|
51
|
+
export {};
|
|
53
52
|
//# sourceMappingURL=CrossFrameMessenger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossFrameMessenger.d.ts","names":[],"sources":["../../../src/core/CrossFrameMessenger.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CrossFrameMessenger.d.ts","names":[],"sources":["../../../src/core/CrossFrameMessenger.ts"],"mappings":"A,YAIY;EACV;EACA;EACA;;EAEA;;YAGU;;;;;EAKV;;;;;EAKA,gBAAgB,SAAS,gBAAgB;;KAGtC,eAAe,gBAAgB,MAAM,GAAG;;;;;;;;qBAShC;WACF;mBACQ;mBACA;UAET;;mBAES;;mBAEA;EAEjB,YAAY,QAAQ;;EAMpB;;EAUA;;EAQA,KAAK,cAAc;;;;;EAmBnB,UAAU,aAAa,cAAc,SAAS,eAAe;UAUrD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CrossFrameMessenger } from "./CrossFrameMessenger.js";
|
|
2
|
-
//#region src/core/CrossFrameStateManager.d.ts
|
|
3
2
|
export type CrossFrameStateOptions = {
|
|
4
3
|
/** Whether to broadcast state changes to other frames. Default: true */
|
|
5
4
|
emit?: boolean;
|
|
@@ -55,5 +54,4 @@ export declare class CrossFrameStateManager<T> extends EventTarget {
|
|
|
55
54
|
/** Broadcast the current value to all frames (useful after reconnect). */
|
|
56
55
|
postCurrentValue(): void;
|
|
57
56
|
}
|
|
58
|
-
//#endregion
|
|
59
57
|
//# sourceMappingURL=CrossFrameStateManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossFrameStateManager.d.ts","names":[],"sources":["../../../src/core/CrossFrameStateManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CrossFrameStateManager.d.ts","names":[],"sources":["../../../src/core/CrossFrameStateManager.ts"],"mappings":";YAEY;;EAEV;;EAEA;;;;;;;;;YAUU,sBAAsB,KAC9B,MACE,eAAe,kBAAkB;;;;;;;;;;;;;qBAc1B,uBAAuB,WAAW;UACrC;mBACS;mBACA;mBACA;mBACA;EAEjB,YACE,aACA,WAAW,qBACX,UAAS;IAA2B,eAAe;;MAcjD,SAAS;;;;;;;;;EAYb,IAAI,UAAU,sBAAsB;;;;;EAiBpC;;EAgCA;;EAMA"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { CrossFrameMessenger, MessengerConfig } from "./CrossFrameMessenger.js";
|
|
2
2
|
import { CrossFrameStateManager } from "./CrossFrameStateManager.js";
|
|
3
|
+
import { KeyPath } from "@intlayer/types/keyPath";
|
|
3
4
|
import { Locale } from "@intlayer/types/allLocales";
|
|
4
5
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
5
6
|
import { ContentNode, Dictionary, LocalDictionaryId } from "@intlayer/types/dictionary";
|
|
6
|
-
import { KeyPath } from "@intlayer/types/keyPath";
|
|
7
|
-
//#region src/core/EditorStateManager.d.ts
|
|
8
7
|
export type DictionaryContent = Record<LocalDictionaryId, Dictionary>;
|
|
8
|
+
/** Delay between two editor pings checking the client still answers. */
|
|
9
|
+
export declare const CLIENT_HEARTBEAT_INTERVAL_MS = 3000;
|
|
10
|
+
/**
|
|
11
|
+
* Silence after which the client counts as disconnected (e.g. its dev server
|
|
12
|
+
* restarted). Pings go on, so it is activated again as soon as it answers.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CLIENT_HEARTBEAT_TIMEOUT_MS = 10000;
|
|
15
|
+
/** Sent by the client with `INTLAYER_CLIENT_READY`. */
|
|
16
|
+
export type ClientReadyPayload = {
|
|
17
|
+
/** Whether the editor already activated this client. */
|
|
18
|
+
isActivated: boolean;
|
|
19
|
+
};
|
|
9
20
|
type EditorConfig = Pick<IntlayerConfig, 'editor'>;
|
|
10
21
|
export type FileContent = {
|
|
11
22
|
dictionaryKey: string;
|
|
@@ -44,9 +55,12 @@ export declare class EditorStateManager {
|
|
|
44
55
|
private _unsubAreYouThere;
|
|
45
56
|
private _unsubActivate;
|
|
46
57
|
private _unsubClientReady;
|
|
58
|
+
private _clientHeartbeatTimer;
|
|
59
|
+
private _lastClientReadyAt;
|
|
47
60
|
private _displayedKeysObserver;
|
|
48
61
|
private _displayedKeysTimer;
|
|
49
62
|
private _displayedKeysListeners;
|
|
63
|
+
private _unsubDisplayedKeysGet;
|
|
50
64
|
private _stopSharedStateSyncs;
|
|
51
65
|
constructor(config: EditorStateManagerConfig);
|
|
52
66
|
start(): void;
|
|
@@ -88,9 +102,16 @@ export declare class EditorStateManager {
|
|
|
88
102
|
* Also pings the client immediately in case it loaded before the editor.
|
|
89
103
|
*/
|
|
90
104
|
private _setupEditorHandshake;
|
|
105
|
+
/**
|
|
106
|
+
* EDITOR mode: keeps pinging the client. A client that stopped answering
|
|
107
|
+
* (dev server restart, reloaded frame, re-evaluated client module) is marked
|
|
108
|
+
* disconnected, then activated again on its next answer.
|
|
109
|
+
*/
|
|
110
|
+
private _startClientHeartbeat;
|
|
111
|
+
private _stopClientHeartbeat;
|
|
91
112
|
private _setupActivationHandshake;
|
|
92
113
|
private _broadcastData;
|
|
93
114
|
private _loadDictionaries;
|
|
94
115
|
}
|
|
95
|
-
|
|
116
|
+
export {};
|
|
96
117
|
//# sourceMappingURL=EditorStateManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorStateManager.d.ts","names":[],"sources":["../../../src/core/EditorStateManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditorStateManager.d.ts","names":[],"sources":["../../../src/core/EditorStateManager.ts"],"mappings":";;;;;;YA2BY,oBAAoB,OAAO,mBAAmB;;qBAG7C;;;;;qBAMA;;YAGD;;EAEV;;KASG,eAAe,KAAK;YAQb;EACV;EACA,oBAAoB;EACpB,UAAU;;YAGA;;EAEV;;EAEA,WAAW;;EAEX,gBAAgB;;;;;;;;;;qBAWL;WACF,WAAW;WACX,eAAe;WACf,gBAAgB,uBAAuB;WACvC,oBAAoB,uBAAuB;WAC3C,eAAe,uBAAuB;WACtC,eAAe,uBAAuB;WACtC,eAAe,uBAAuB;WACtC,yBAAyB;mBAEjB;mBACA;mBACA;mBACA;UAGT;UACA;UAEA;UACA;UACA;UAGA;UACA;UACA;UACA;UAGA;EAER,YAAY,QAAQ;EA+DpB;EAoCA;;;;;EA8BA;;;;;EAcA,oBAAoB,QAAQ;;;;;EAU5B,wBAAwB,UAAU,QAAQ;EAW1C,yBAAyB,SAAS;EAUlC,oBAAoB,YAAY;EAYhC,oBAAoB,SAAS;EAa7B,iBACE,mBAAmB,mBACnB,UAAU;EAaZ,WACE,mBAAmB,mBACnB,UAAU,aACV,UAAS,WACT;EAgDF,cACE,mBAAmB,mBACnB,QAAQ,gBACR,UAAS;EAmBX,cACE,mBAAmB,mBACnB,SAAS;EAwBX,eAAe,mBAAmB;EAOlC,gBACE,wBAAwB,4BACxB,SAAS,YACR;;;;;UA0DK;UAyCA;UAeA;UAqCA;;;;;UAqBA;;;;;;UAmCA;UAeA;UAKA;UA0BA;UAmCM"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CrossFrameMessenger } from "./CrossFrameMessenger.js";
|
|
2
|
-
//#region src/core/IframeClickInterceptor.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Forwards clicks across the iframe boundary.
|
|
5
4
|
*
|
|
@@ -22,5 +21,4 @@ export declare class IframeClickInterceptor {
|
|
|
22
21
|
stopInterceptor(): void;
|
|
23
22
|
stopMerger(): void;
|
|
24
23
|
}
|
|
25
|
-
//#endregion
|
|
26
24
|
//# sourceMappingURL=IframeClickInterceptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeClickInterceptor.d.ts","names":[],"sources":["../../../src/core/IframeClickInterceptor.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IframeClickInterceptor.d.ts","names":[],"sources":["../../../src/core/IframeClickInterceptor.ts"],"mappings":";;;;;;;;;;;;;qBAgCa;mBACM;UACT;UACA;EAER,YAAY,WAAW;EAIvB;EAUA;EAOA;EAOA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CrossFrameMessenger } from "./CrossFrameMessenger.js";
|
|
2
|
-
//#region src/core/UrlStateManager.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* UrlStateManager patches window.history and broadcasts URL path changes
|
|
5
4
|
* across frames via postMessage.
|
|
@@ -15,5 +14,4 @@ export declare class UrlStateManager {
|
|
|
15
14
|
start(): void;
|
|
16
15
|
stop(): void;
|
|
17
16
|
}
|
|
18
|
-
//#endregion
|
|
19
17
|
//# sourceMappingURL=UrlStateManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlStateManager.d.ts","names":[],"sources":["../../../src/core/UrlStateManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"UrlStateManager.d.ts","names":[],"sources":["../../../src/core/UrlStateManager.ts"],"mappings":";;;;;;;qBASa;mBACM;UACT;UACA;UACA;EAER,YAAY,WAAW;EAIvB;EA2CA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/core/getLocalEditorParentOrigin.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Origin of the parent frame to trust as the editor, when both it and the
|
|
4
3
|
* configured `editorURL` are local. A local editor moves to the next free port
|
|
@@ -9,5 +8,4 @@
|
|
|
9
8
|
* @returns The parent origin, or `undefined` when it must not be trusted.
|
|
10
9
|
*/
|
|
11
10
|
export declare const getLocalEditorParentOrigin: (editorURL: string | undefined, parentOrigin: string | undefined) => string | undefined;
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=getLocalEditorParentOrigin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalEditorParentOrigin.d.ts","names":[],"sources":["../../../src/core/getLocalEditorParentOrigin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getLocalEditorParentOrigin.d.ts","names":[],"sources":["../../../src/core/getLocalEditorParentOrigin.ts"],"mappings":";;;;;;;;;qBAoBa,6BAA0B,+BACR"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EditorStateManager } from "./EditorStateManager.js";
|
|
2
|
-
//#region src/core/globalManager.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Retrieves the global editor state manager instance.
|
|
5
4
|
* Returns null if no manager has been set or in SSR environments where
|
|
@@ -33,5 +32,4 @@ export declare const setGlobalEditorManager: (manager: EditorStateManager | null
|
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
34
|
export declare const onGlobalEditorManagerChange: (changeCallback: (manager: EditorStateManager | null) => void) => (() => void);
|
|
36
|
-
//#endregion
|
|
37
35
|
//# sourceMappingURL=globalManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalManager.d.ts","names":[],"sources":["../../../src/core/globalManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"globalManager.d.ts","names":[],"sources":["../../../src/core/globalManager.ts"],"mappings":";;;;;;;;qBAmDa,8BAA6B;;;;;;;qBAiB7B,yBAAsB,SACxB;;;;;;;;;;;;;;;;;;qBA+BE,8BAA2B,iBACrB,SAAS"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CrossFrameMessenger, MessagePayload, MessengerConfig } from "./CrossFrameMessenger.js";
|
|
2
2
|
import { CrossFrameStateAction, CrossFrameStateManager, CrossFrameStateOptions } from "./CrossFrameStateManager.js";
|
|
3
|
-
import { DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent } from "./EditorStateManager.js";
|
|
4
|
-
import { IframeClickInterceptor } from "./IframeClickInterceptor.js";
|
|
5
|
-
import { UrlStateManager } from "./UrlStateManager.js";
|
|
3
|
+
import { CLIENT_HEARTBEAT_INTERVAL_MS, CLIENT_HEARTBEAT_TIMEOUT_MS, ClientReadyPayload, DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent } from "./EditorStateManager.js";
|
|
6
4
|
import { getGlobalEditorManager, onGlobalEditorManagerChange, setGlobalEditorManager } from "./globalManager.js";
|
|
5
|
+
import { IframeClickInterceptor } from "./IframeClickInterceptor.js";
|
|
7
6
|
import { initEditorClient, stopEditorClient } from "./initEditorClient.js";
|
|
8
7
|
import { SharedWindowState, createSharedWindowState } from "./sharedWindowState.js";
|
|
9
|
-
|
|
8
|
+
import { UrlStateManager } from "./UrlStateManager.js";
|
|
9
|
+
export { CLIENT_HEARTBEAT_INTERVAL_MS, CLIENT_HEARTBEAT_TIMEOUT_MS, ClientReadyPayload, CrossFrameMessenger, CrossFrameStateAction, CrossFrameStateManager, CrossFrameStateOptions, DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent, IframeClickInterceptor, MessagePayload, MessengerConfig, SharedWindowState, UrlStateManager, createSharedWindowState, getGlobalEditorManager, initEditorClient, onGlobalEditorManagerChange, setGlobalEditorManager, stopEditorClient };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EditorStateManager } from "./EditorStateManager.js";
|
|
2
|
-
//#region src/core/initEditorClient.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Initialize the Intlayer editor client singleton.
|
|
5
4
|
* Safe to call multiple times — returns the existing manager if already initialized.
|
|
@@ -12,5 +11,4 @@ export declare const initEditorClient: () => EditorStateManager;
|
|
|
12
11
|
* only when the last provider unmounts.
|
|
13
12
|
*/
|
|
14
13
|
export declare const stopEditorClient: () => void;
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=initEditorClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initEditorClient.d.ts","names":[],"sources":["../../../src/core/initEditorClient.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"initEditorClient.d.ts","names":[],"sources":["../../../src/core/initEditorClient.ts"],"mappings":";;;;;;;qBA2Da,wBAAuB;;;;;qBAuBvB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/core/selectionClick.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Marks a click as having selected content, so outer selectors don't select
|
|
4
3
|
* their own content too, and the iframe click interceptor doesn't report it to
|
|
@@ -13,5 +12,4 @@ export declare const markSelectionClick: (event: Event) => void;
|
|
|
13
12
|
* @param event - Click to check
|
|
14
13
|
*/
|
|
15
14
|
export declare const isSelectionClick: (event: Event) => boolean;
|
|
16
|
-
//#endregion
|
|
17
15
|
//# sourceMappingURL=selectionClick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectionClick.d.ts","names":[],"sources":["../../../src/core/selectionClick.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectionClick.d.ts","names":[],"sources":["../../../src/core/selectionClick.ts"],"mappings":";;;;;;;qBAUa,qBAAkB,OAAW;;;;;;qBAS7B,mBAAgB,OAAW"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/core/sharedWindowState.d.ts
|
|
2
1
|
type SharedWindowStateListener<T> = (value: T, sourceId?: string) => void;
|
|
3
2
|
export type SharedWindowState<T> = {
|
|
4
3
|
/** Last published value, `undefined` until one is published */
|
|
@@ -14,5 +13,5 @@ export type SharedWindowState<T> = {
|
|
|
14
13
|
* Stored on `window` so duplicated copies of this package share it too.
|
|
15
14
|
*/
|
|
16
15
|
export declare const createSharedWindowState: <T>(name: string) => SharedWindowState<T>;
|
|
17
|
-
|
|
16
|
+
export {};
|
|
18
17
|
//# sourceMappingURL=sharedWindowState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedWindowState.d.ts","names":[],"sources":["../../../src/core/sharedWindowState.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sharedWindowState.d.ts","names":[],"sources":["../../../src/core/sharedWindowState.ts"],"mappings":"A,KAQK,0BAA0B,MAAM,OAAO,GAAG;YAEnC,kBAAkB;;EAE5B,WAAW;;EAEX,MAAM,OAAO,GAAG;;EAEhB,YAAY,UAAU,0BAA0B;;;;;;;qBAQrC,0BAA2B,GAAC,iBAEtC,kBAAkB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import "./components/index.js";
|
|
1
2
|
import { IntlayerContentSelectorElement, defineIntlayerElements } from "./components/ContentSelector.js";
|
|
2
3
|
import { IntlayerContentSelectorWrapperElement, defineIntlayerContentSelectorWrapper } from "./components/ContentSelectorWrapper.js";
|
|
4
|
+
import "./core/index.js";
|
|
3
5
|
import { CrossFrameMessenger, MessagePayload, MessengerConfig } from "./core/CrossFrameMessenger.js";
|
|
4
6
|
import { CrossFrameStateAction, CrossFrameStateManager, CrossFrameStateOptions } from "./core/CrossFrameStateManager.js";
|
|
5
|
-
import { DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent } from "./core/EditorStateManager.js";
|
|
6
|
-
import { IframeClickInterceptor } from "./core/IframeClickInterceptor.js";
|
|
7
|
-
import { UrlStateManager } from "./core/UrlStateManager.js";
|
|
7
|
+
import { CLIENT_HEARTBEAT_INTERVAL_MS, CLIENT_HEARTBEAT_TIMEOUT_MS, ClientReadyPayload, DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent } from "./core/EditorStateManager.js";
|
|
8
8
|
import { getGlobalEditorManager, onGlobalEditorManagerChange, setGlobalEditorManager } from "./core/globalManager.js";
|
|
9
|
+
import { IframeClickInterceptor } from "./core/IframeClickInterceptor.js";
|
|
9
10
|
import { initEditorClient, stopEditorClient } from "./core/initEditorClient.js";
|
|
10
11
|
import { SharedWindowState, createSharedWindowState } from "./core/sharedWindowState.js";
|
|
11
|
-
import "./core/
|
|
12
|
+
import { UrlStateManager } from "./core/UrlStateManager.js";
|
|
12
13
|
import { MessageKey } from "./messageKey.js";
|
|
13
|
-
export { CrossFrameMessenger, CrossFrameStateAction, CrossFrameStateManager, CrossFrameStateOptions, DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent, IframeClickInterceptor, IntlayerContentSelectorElement, IntlayerContentSelectorWrapperElement, MessageKey, MessagePayload, MessengerConfig, SharedWindowState, UrlStateManager, createSharedWindowState, defineIntlayerContentSelectorWrapper, defineIntlayerElements, getGlobalEditorManager, initEditorClient, onGlobalEditorManagerChange, setGlobalEditorManager, stopEditorClient };
|
|
14
|
+
export { CLIENT_HEARTBEAT_INTERVAL_MS, CLIENT_HEARTBEAT_TIMEOUT_MS, ClientReadyPayload, CrossFrameMessenger, CrossFrameStateAction, CrossFrameStateManager, CrossFrameStateOptions, DictionaryContent, EditorStateManager, EditorStateManagerConfig, FileContent, IframeClickInterceptor, IntlayerContentSelectorElement, IntlayerContentSelectorWrapperElement, MessageKey, MessagePayload, MessengerConfig, SharedWindowState, UrlStateManager, createSharedWindowState, defineIntlayerContentSelectorWrapper, defineIntlayerElements, getGlobalEditorManager, initEditorClient, onGlobalEditorManagerChange, setGlobalEditorManager, stopEditorClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEnabled.d.ts","names":[],"sources":["../../src/isEnabled.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"isEnabled.d.ts","names":[],"sources":["../../src/isEnabled.ts"],"mappings":"A,qBAIa"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/messageKey.d.ts
|
|
2
1
|
export declare enum MessageKey {
|
|
3
2
|
/** Client → editor: announces the client is ready (also used as response to ARE_YOU_THERE) */
|
|
4
3
|
INTLAYER_CLIENT_READY = "INTLAYER_CLIENT_READY",
|
|
@@ -28,5 +27,4 @@ export declare enum MessageKey {
|
|
|
28
27
|
/** IDE host → editor: colour theme of the IDE embedding the editor */
|
|
29
28
|
INTLAYER_HOST_THEME_CHANGED = "INTLAYER_HOST_THEME_CHANGED"
|
|
30
29
|
}
|
|
31
|
-
//#endregion
|
|
32
30
|
//# sourceMappingURL=messageKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageKey.d.ts","names":[],"sources":["../../src/messageKey.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"messageKey.d.ts","names":[],"sources":["../../src/messageKey.ts"],"mappings":"A,oBAAY;;EAEV;;EAEA;;EAEA;;EAEA;;EAGA;EACA;EACA;;EAEA;;EAGA;EACA;;EAGA;EACA;EACA;;EAGA;;EAGA;;EAGA"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/editor",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Provides the utilities to interface the application with the Intlayer editor and manipulate dictionaries",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"
|
|
7
|
+
"api",
|
|
8
8
|
"editor",
|
|
9
|
-
"
|
|
9
|
+
"intlayer"
|
|
10
10
|
],
|
|
11
11
|
"homepage": "https://intlayer.org",
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
14
14
|
},
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
18
|
-
},
|
|
19
15
|
"license": "Apache-2.0",
|
|
20
16
|
"author": {
|
|
21
17
|
"name": "Aymeric PINEAU",
|
|
@@ -28,7 +24,25 @@
|
|
|
28
24
|
"url": "https://github.com/aymericzip"
|
|
29
25
|
}
|
|
30
26
|
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"./dist",
|
|
33
|
+
"./package.json"
|
|
34
|
+
],
|
|
31
35
|
"sideEffects": false,
|
|
36
|
+
"main": "dist/cjs/index.cjs",
|
|
37
|
+
"module": "dist/esm/index.mjs",
|
|
38
|
+
"types": "dist/types/index.d.ts",
|
|
39
|
+
"typesVersions": {
|
|
40
|
+
"*": {
|
|
41
|
+
"package.json": [
|
|
42
|
+
"./package.json"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
32
46
|
"exports": {
|
|
33
47
|
".": {
|
|
34
48
|
"types": "./dist/types/index.d.ts",
|
|
@@ -42,29 +56,15 @@
|
|
|
42
56
|
},
|
|
43
57
|
"./package.json": "./package.json"
|
|
44
58
|
},
|
|
45
|
-
"main": "dist/cjs/index.cjs",
|
|
46
|
-
"module": "dist/esm/index.mjs",
|
|
47
|
-
"types": "dist/types/index.d.ts",
|
|
48
|
-
"typesVersions": {
|
|
49
|
-
"*": {
|
|
50
|
-
"package.json": [
|
|
51
|
-
"./package.json"
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"files": [
|
|
56
|
-
"./dist",
|
|
57
|
-
"./package.json"
|
|
58
|
-
],
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "bun --bun tsdown --config tsdown.config.ts",
|
|
61
61
|
"build:ci": "bun --bun tsdown --config tsdown.config.ts",
|
|
62
62
|
"clean": "bun --bun rimraf ./dist .turbo",
|
|
63
63
|
"dev": "bun --bun tsdown --config tsdown.config.ts --watch",
|
|
64
|
-
"format": "
|
|
65
|
-
"format:fix": "
|
|
66
|
-
"lint": "
|
|
67
|
-
"lint:fix": "
|
|
64
|
+
"format": "oxfmt --check .",
|
|
65
|
+
"format:fix": "oxfmt .",
|
|
66
|
+
"lint": "oxlint .",
|
|
67
|
+
"lint:fix": "oxlint --fix .",
|
|
68
68
|
"process-files": "ts-node src/transpiler/processFilesCLI.ts --dir $npm_config_dir --extension $npm_config_extension --no-node-snapshot",
|
|
69
69
|
"prepublish": "cp -f ../../../README.md ./README.md",
|
|
70
70
|
"publish": "bun publish || true",
|
|
@@ -76,20 +76,20 @@
|
|
|
76
76
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@intlayer/config": "9.
|
|
80
|
-
"@intlayer/core": "9.7.
|
|
81
|
-
"@intlayer/dictionaries-entry": "9.
|
|
82
|
-
"@intlayer/types": "9.7.
|
|
79
|
+
"@intlayer/config": "9.7.2",
|
|
80
|
+
"@intlayer/core": "9.7.2",
|
|
81
|
+
"@intlayer/dictionaries-entry": "9.7.2",
|
|
82
|
+
"@intlayer/types": "9.7.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/node": "^26",
|
|
86
86
|
"@utils/ts-config": "1.0.4",
|
|
87
87
|
"@utils/ts-config-types": "1.0.4",
|
|
88
88
|
"@utils/tsdown-config": "1.0.4",
|
|
89
|
-
"rimraf": "6.1.
|
|
90
|
-
"tsdown": "0.23.
|
|
89
|
+
"rimraf": "6.1.4",
|
|
90
|
+
"tsdown": "0.23.7",
|
|
91
91
|
"typescript": "7.0.2",
|
|
92
|
-
"vitest": "5.0
|
|
92
|
+
"vitest": "5.1.0"
|
|
93
93
|
},
|
|
94
94
|
"engines": {
|
|
95
95
|
"node": ">=14.18"
|