@intlayer/editor-react 6.1.6 → 7.0.0-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.
Files changed (75) hide show
  1. package/dist/cjs/CommunicatorContext.cjs +43 -65
  2. package/dist/cjs/CommunicatorContext.cjs.map +1 -1
  3. package/dist/cjs/ConfigurationContext.cjs +26 -47
  4. package/dist/cjs/ConfigurationContext.cjs.map +1 -1
  5. package/dist/cjs/DictionariesRecordContext.cjs +48 -74
  6. package/dist/cjs/DictionariesRecordContext.cjs.map +1 -1
  7. package/dist/cjs/EditedContentContext.cjs +164 -225
  8. package/dist/cjs/EditedContentContext.cjs.map +1 -1
  9. package/dist/cjs/EditorEnabledContext.cjs +34 -59
  10. package/dist/cjs/EditorEnabledContext.cjs.map +1 -1
  11. package/dist/cjs/EditorProvider.cjs +65 -66
  12. package/dist/cjs/EditorProvider.cjs.map +1 -1
  13. package/dist/cjs/FocusDictionaryContext.cjs +51 -75
  14. package/dist/cjs/FocusDictionaryContext.cjs.map +1 -1
  15. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  16. package/dist/cjs/index.cjs +46 -44
  17. package/dist/cjs/useCrossFrameMessageListener.cjs +73 -50
  18. package/dist/cjs/useCrossFrameMessageListener.cjs.map +1 -1
  19. package/dist/cjs/useCrossFrameState.cjs +106 -73
  20. package/dist/cjs/useCrossFrameState.cjs.map +1 -1
  21. package/dist/cjs/useCrossURLPathState.cjs +67 -66
  22. package/dist/cjs/useCrossURLPathState.cjs.map +1 -1
  23. package/dist/cjs/useIframeClickInterceptor.cjs +24 -47
  24. package/dist/cjs/useIframeClickInterceptor.cjs.map +1 -1
  25. package/dist/esm/CommunicatorContext.mjs +34 -32
  26. package/dist/esm/CommunicatorContext.mjs.map +1 -1
  27. package/dist/esm/ConfigurationContext.mjs +19 -23
  28. package/dist/esm/ConfigurationContext.mjs.map +1 -1
  29. package/dist/esm/DictionariesRecordContext.mjs +37 -47
  30. package/dist/esm/DictionariesRecordContext.mjs.map +1 -1
  31. package/dist/esm/EditedContentContext.mjs +150 -201
  32. package/dist/esm/EditedContentContext.mjs.map +1 -1
  33. package/dist/esm/EditorEnabledContext.mjs +22 -32
  34. package/dist/esm/EditorEnabledContext.mjs.map +1 -1
  35. package/dist/esm/EditorProvider.mjs +60 -54
  36. package/dist/esm/EditorProvider.mjs.map +1 -1
  37. package/dist/esm/FocusDictionaryContext.mjs +41 -48
  38. package/dist/esm/FocusDictionaryContext.mjs.map +1 -1
  39. package/dist/esm/index.mjs +15 -13
  40. package/dist/esm/useCrossFrameMessageListener.mjs +69 -25
  41. package/dist/esm/useCrossFrameMessageListener.mjs.map +1 -1
  42. package/dist/esm/useCrossFrameState.mjs +102 -47
  43. package/dist/esm/useCrossFrameState.mjs.map +1 -1
  44. package/dist/esm/useCrossURLPathState.mjs +61 -41
  45. package/dist/esm/useCrossURLPathState.mjs.map +1 -1
  46. package/dist/esm/useIframeClickInterceptor.mjs +19 -21
  47. package/dist/esm/useIframeClickInterceptor.mjs.map +1 -1
  48. package/dist/types/CommunicatorContext.d.ts +12 -8
  49. package/dist/types/CommunicatorContext.d.ts.map +1 -1
  50. package/dist/types/ConfigurationContext.d.ts +12 -7
  51. package/dist/types/ConfigurationContext.d.ts.map +1 -1
  52. package/dist/types/DictionariesRecordContext.d.ts +15 -12
  53. package/dist/types/DictionariesRecordContext.d.ts.map +1 -1
  54. package/dist/types/EditedContentContext.d.ts +33 -30
  55. package/dist/types/EditedContentContext.d.ts.map +1 -1
  56. package/dist/types/EditorEnabledContext.d.ts +14 -9
  57. package/dist/types/EditorEnabledContext.d.ts.map +1 -1
  58. package/dist/types/EditorProvider.d.ts +10 -6
  59. package/dist/types/EditorProvider.d.ts.map +1 -1
  60. package/dist/types/FocusDictionaryContext.d.ts +18 -15
  61. package/dist/types/FocusDictionaryContext.d.ts.map +1 -1
  62. package/dist/types/index.d.ts +13 -13
  63. package/dist/types/useCrossFrameMessageListener.d.ts +7 -2
  64. package/dist/types/useCrossFrameMessageListener.d.ts.map +1 -1
  65. package/dist/types/useCrossFrameState.d.ts +10 -6
  66. package/dist/types/useCrossFrameState.d.ts.map +1 -1
  67. package/dist/types/useCrossURLPathState.d.ts +8 -3
  68. package/dist/types/useCrossURLPathState.d.ts.map +1 -1
  69. package/dist/types/useIframeClickInterceptor.d.ts +5 -2
  70. package/dist/types/useIframeClickInterceptor.d.ts.map +1 -1
  71. package/package.json +34 -40
  72. package/LICENSE +0 -202
  73. package/dist/cjs/index.cjs.map +0 -1
  74. package/dist/esm/index.mjs.map +0 -1
  75. package/dist/types/index.d.ts.map +0 -1
@@ -1,46 +1,66 @@
1
- "use client";
2
- import { MessageKey } from "@intlayer/editor";
1
+ 'use client';
2
+
3
+
4
+ import { useCrossFrameState } from "./useCrossFrameState.mjs";
3
5
  import { useEffect } from "react";
4
- import {
5
- useCrossFrameState
6
- } from "./useCrossFrameState.mjs";
6
+ import { MessageKey } from "@intlayer/editor";
7
+
8
+ //#region src/useCrossURLPathState.tsx
7
9
  const useCrossURLPathState = (initialState, options) => useCrossFrameState(MessageKey.INTLAYER_URL_CHANGE, initialState, options);
8
10
  const useCrossURLPathSetter = (initialState) => {
9
- const states = useCrossURLPathState(initialState, {
10
- emit: true,
11
- receive: false
12
- });
13
- const [_state, setState] = states;
14
- useEffect(() => {
15
- const originalPushState = history.pushState;
16
- const originalReplaceState = history.replaceState;
17
- const injectLocationChangeEvent = (method) => function(...args) {
18
- method.apply(this, args);
19
- window.dispatchEvent(new Event("locationchange"));
20
- };
21
- history.pushState = injectLocationChangeEvent(originalPushState);
22
- history.replaceState = injectLocationChangeEvent(originalReplaceState);
23
- const updateURLState = () => {
24
- setState(window.location.pathname);
25
- };
26
- window.addEventListener("locationchange", updateURLState);
27
- window.addEventListener("popstate", updateURLState);
28
- window.addEventListener("hashchange", updateURLState);
29
- window.addEventListener("load", updateURLState);
30
- updateURLState();
31
- return () => {
32
- window.removeEventListener("locationchange", updateURLState);
33
- window.removeEventListener("popstate", updateURLState);
34
- window.removeEventListener("hashchange", updateURLState);
35
- window.removeEventListener("load", updateURLState);
36
- history.pushState = originalPushState;
37
- history.replaceState = originalReplaceState;
38
- };
39
- }, []);
40
- return states;
41
- };
42
- export {
43
- useCrossURLPathSetter,
44
- useCrossURLPathState
11
+ const states = useCrossURLPathState(initialState, {
12
+ emit: true,
13
+ receive: false
14
+ });
15
+ const [_state, setState] = states;
16
+ useEffect(() => {
17
+ /**
18
+ * 1) Monkey patch history methods (pushState, replaceState)
19
+ * to dispatch a custom event whenever they are called.
20
+ */
21
+ const originalPushState = history.pushState;
22
+ const originalReplaceState = history.replaceState;
23
+ const injectLocationChangeEvent = (method) => function(...args) {
24
+ method.apply(this, args);
25
+ window.dispatchEvent(new Event("locationchange"));
26
+ };
27
+ history.pushState = injectLocationChangeEvent(originalPushState);
28
+ history.replaceState = injectLocationChangeEvent(originalReplaceState);
29
+ /**
30
+ * 2) The callback to update our state whenever the URL changes.
31
+ */
32
+ const updateURLState = () => {
33
+ setState(window.location.pathname);
34
+ };
35
+ /**
36
+ * 3) Attach event listeners for locationchange, popstate, hashchange.
37
+ * - 'locationchange' is our custom event triggered by push/replaceState overrides.
38
+ * - 'popstate' is fired on back/forward navigation.
39
+ * - 'hashchange' is for URL hash (#) changes.
40
+ * - 'load' is when new page is loaded
41
+ */
42
+ window.addEventListener("locationchange", updateURLState);
43
+ window.addEventListener("popstate", updateURLState);
44
+ window.addEventListener("hashchange", updateURLState);
45
+ window.addEventListener("load", updateURLState);
46
+ updateURLState();
47
+ /**
48
+ * 4) Cleanup when the component unmounts:
49
+ * - Remove event listeners.
50
+ * - Restore original pushState & replaceState to avoid side effects.
51
+ */
52
+ return () => {
53
+ window.removeEventListener("locationchange", updateURLState);
54
+ window.removeEventListener("popstate", updateURLState);
55
+ window.removeEventListener("hashchange", updateURLState);
56
+ window.removeEventListener("load", updateURLState);
57
+ history.pushState = originalPushState;
58
+ history.replaceState = originalReplaceState;
59
+ };
60
+ }, []);
61
+ return states;
45
62
  };
63
+
64
+ //#endregion
65
+ export { useCrossURLPathSetter, useCrossURLPathState };
46
66
  //# sourceMappingURL=useCrossURLPathState.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/useCrossURLPathState.tsx"],"sourcesContent":["'use client';\n\nimport { MessageKey } from '@intlayer/editor';\nimport { useEffect } from 'react';\nimport {\n useCrossFrameState,\n type CrossFrameStateOptions,\n} from './useCrossFrameState';\n\nexport const useCrossURLPathState = (\n initialState?: string,\n options?: CrossFrameStateOptions\n) => useCrossFrameState(MessageKey.INTLAYER_URL_CHANGE, initialState, options);\n\nexport const useCrossURLPathSetter = (initialState?: string) => {\n const states = useCrossURLPathState(initialState, {\n emit: true,\n receive: false,\n });\n const [_state, setState] = states;\n\n useEffect(() => {\n /**\n * 1) Monkey patch history methods (pushState, replaceState)\n * to dispatch a custom event whenever they are called.\n */\n const originalPushState = history.pushState;\n const originalReplaceState = history.replaceState;\n\n const injectLocationChangeEvent = (method: (...args: any[]) => void) =>\n function (this: typeof history, ...args: [any, string, string?]) {\n method.apply(this, args);\n window.dispatchEvent(new Event('locationchange'));\n };\n\n history.pushState = injectLocationChangeEvent(originalPushState);\n history.replaceState = injectLocationChangeEvent(originalReplaceState);\n\n /**\n * 2) The callback to update our state whenever the URL changes.\n */\n const updateURLState = () => {\n setState(window.location.pathname);\n };\n\n /**\n * 3) Attach event listeners for locationchange, popstate, hashchange.\n * - 'locationchange' is our custom event triggered by push/replaceState overrides.\n * - 'popstate' is fired on back/forward navigation.\n * - 'hashchange' is for URL hash (#) changes.\n * - 'load' is when new page is loaded\n */\n window.addEventListener('locationchange', updateURLState);\n window.addEventListener('popstate', updateURLState);\n window.addEventListener('hashchange', updateURLState);\n window.addEventListener('load', updateURLState);\n\n // Initialize our state immediately on mount\n updateURLState();\n\n /**\n * 4) Cleanup when the component unmounts:\n * - Remove event listeners.\n * - Restore original pushState & replaceState to avoid side effects.\n */\n return () => {\n window.removeEventListener('locationchange', updateURLState);\n window.removeEventListener('popstate', updateURLState);\n window.removeEventListener('hashchange', updateURLState);\n window.removeEventListener('load', updateURLState);\n history.pushState = originalPushState;\n history.replaceState = originalReplaceState;\n };\n }, []);\n\n return states;\n};\n"],"mappings":";AAEA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,OAEK;AAEA,MAAM,uBAAuB,CAClC,cACA,YACG,mBAAmB,WAAW,qBAAqB,cAAc,OAAO;AAEtE,MAAM,wBAAwB,CAAC,iBAA0B;AAC9D,QAAM,SAAS,qBAAqB,cAAc;AAAA,IAChD,MAAM;AAAA,IACN,SAAS;AAAA,EACX,CAAC;AACD,QAAM,CAAC,QAAQ,QAAQ,IAAI;AAE3B,YAAU,MAAM;AAKd,UAAM,oBAAoB,QAAQ;AAClC,UAAM,uBAAuB,QAAQ;AAErC,UAAM,4BAA4B,CAAC,WACjC,YAAmC,MAA8B;AAC/D,aAAO,MAAM,MAAM,IAAI;AACvB,aAAO,cAAc,IAAI,MAAM,gBAAgB,CAAC;AAAA,IAClD;AAEF,YAAQ,YAAY,0BAA0B,iBAAiB;AAC/D,YAAQ,eAAe,0BAA0B,oBAAoB;AAKrE,UAAM,iBAAiB,MAAM;AAC3B,eAAS,OAAO,SAAS,QAAQ;AAAA,IACnC;AASA,WAAO,iBAAiB,kBAAkB,cAAc;AACxD,WAAO,iBAAiB,YAAY,cAAc;AAClD,WAAO,iBAAiB,cAAc,cAAc;AACpD,WAAO,iBAAiB,QAAQ,cAAc;AAG9C,mBAAe;AAOf,WAAO,MAAM;AACX,aAAO,oBAAoB,kBAAkB,cAAc;AAC3D,aAAO,oBAAoB,YAAY,cAAc;AACrD,aAAO,oBAAoB,cAAc,cAAc;AACvD,aAAO,oBAAoB,QAAQ,cAAc;AACjD,cAAQ,YAAY;AACpB,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;","names":[]}
1
+ {"version":3,"file":"useCrossURLPathState.mjs","names":[],"sources":["../../src/useCrossURLPathState.tsx"],"sourcesContent":["'use client';\n\nimport { MessageKey } from '@intlayer/editor';\nimport { useEffect } from 'react';\nimport {\n type CrossFrameStateOptions,\n useCrossFrameState,\n} from './useCrossFrameState';\n\nexport const useCrossURLPathState = (\n initialState?: string,\n options?: CrossFrameStateOptions\n) => useCrossFrameState(MessageKey.INTLAYER_URL_CHANGE, initialState, options);\n\nexport const useCrossURLPathSetter = (initialState?: string) => {\n const states = useCrossURLPathState(initialState, {\n emit: true,\n receive: false,\n });\n const [_state, setState] = states;\n\n useEffect(() => {\n /**\n * 1) Monkey patch history methods (pushState, replaceState)\n * to dispatch a custom event whenever they are called.\n */\n const originalPushState = history.pushState;\n const originalReplaceState = history.replaceState;\n\n const injectLocationChangeEvent = (method: (...args: any[]) => void) =>\n function (this: typeof history, ...args: [any, string, string?]) {\n method.apply(this, args);\n window.dispatchEvent(new Event('locationchange'));\n };\n\n history.pushState = injectLocationChangeEvent(originalPushState);\n history.replaceState = injectLocationChangeEvent(originalReplaceState);\n\n /**\n * 2) The callback to update our state whenever the URL changes.\n */\n const updateURLState = () => {\n setState(window.location.pathname);\n };\n\n /**\n * 3) Attach event listeners for locationchange, popstate, hashchange.\n * - 'locationchange' is our custom event triggered by push/replaceState overrides.\n * - 'popstate' is fired on back/forward navigation.\n * - 'hashchange' is for URL hash (#) changes.\n * - 'load' is when new page is loaded\n */\n window.addEventListener('locationchange', updateURLState);\n window.addEventListener('popstate', updateURLState);\n window.addEventListener('hashchange', updateURLState);\n window.addEventListener('load', updateURLState);\n\n // Initialize our state immediately on mount\n updateURLState();\n\n /**\n * 4) Cleanup when the component unmounts:\n * - Remove event listeners.\n * - Restore original pushState & replaceState to avoid side effects.\n */\n return () => {\n window.removeEventListener('locationchange', updateURLState);\n window.removeEventListener('popstate', updateURLState);\n window.removeEventListener('hashchange', updateURLState);\n window.removeEventListener('load', updateURLState);\n history.pushState = originalPushState;\n history.replaceState = originalReplaceState;\n };\n }, []);\n\n return states;\n};\n"],"mappings":";;;;;;;;AASA,MAAa,wBACX,cACA,YACG,mBAAmB,WAAW,qBAAqB,cAAc,QAAQ;AAE9E,MAAa,yBAAyB,iBAA0B;CAC9D,MAAM,SAAS,qBAAqB,cAAc;EAChD,MAAM;EACN,SAAS;EACV,CAAC;CACF,MAAM,CAAC,QAAQ,YAAY;AAE3B,iBAAgB;;;;;EAKd,MAAM,oBAAoB,QAAQ;EAClC,MAAM,uBAAuB,QAAQ;EAErC,MAAM,6BAA6B,WACjC,SAAgC,GAAG,MAA8B;AAC/D,UAAO,MAAM,MAAM,KAAK;AACxB,UAAO,cAAc,IAAI,MAAM,iBAAiB,CAAC;;AAGrD,UAAQ,YAAY,0BAA0B,kBAAkB;AAChE,UAAQ,eAAe,0BAA0B,qBAAqB;;;;EAKtE,MAAM,uBAAuB;AAC3B,YAAS,OAAO,SAAS,SAAS;;;;;;;;;AAUpC,SAAO,iBAAiB,kBAAkB,eAAe;AACzD,SAAO,iBAAiB,YAAY,eAAe;AACnD,SAAO,iBAAiB,cAAc,eAAe;AACrD,SAAO,iBAAiB,QAAQ,eAAe;AAG/C,kBAAgB;;;;;;AAOhB,eAAa;AACX,UAAO,oBAAoB,kBAAkB,eAAe;AAC5D,UAAO,oBAAoB,YAAY,eAAe;AACtD,UAAO,oBAAoB,cAAc,eAAe;AACxD,UAAO,oBAAoB,QAAQ,eAAe;AAClD,WAAQ,YAAY;AACpB,WAAQ,eAAe;;IAExB,EAAE,CAAC;AAEN,QAAO"}
@@ -1,25 +1,23 @@
1
- "use client";
2
- import { MessageKey, mergeIframeClick } from "@intlayer/editor";
3
- import { useEffect } from "react";
1
+ 'use client';
2
+
3
+
4
4
  import { useCrossFrameMessageListener } from "./useCrossFrameMessageListener.mjs";
5
+ import { useEffect } from "react";
6
+ import { MessageKey, mergeIframeClick } from "@intlayer/editor";
7
+
8
+ //#region src/useIframeClickInterceptor.tsx
5
9
  const useIframeClickInterceptor = () => {
6
- const postMessage = useCrossFrameMessageListener(
7
- MessageKey.INTLAYER_IFRAME_CLICKED
8
- );
9
- const handlePostMessageEvent = () => {
10
- postMessage();
11
- };
12
- useEffect(() => {
13
- window.addEventListener("mousedown", handlePostMessageEvent);
14
- return () => window.removeEventListener("mousedown", handlePostMessageEvent);
15
- }, [postMessage]);
16
- };
17
- const useIframeClickMerger = () => useCrossFrameMessageListener(
18
- MessageKey.INTLAYER_IFRAME_CLICKED,
19
- mergeIframeClick
20
- );
21
- export {
22
- useIframeClickInterceptor,
23
- useIframeClickMerger
10
+ const postMessage = useCrossFrameMessageListener(MessageKey.INTLAYER_IFRAME_CLICKED);
11
+ const handlePostMessageEvent = () => {
12
+ postMessage();
13
+ };
14
+ useEffect(() => {
15
+ window.addEventListener("mousedown", handlePostMessageEvent);
16
+ return () => window.removeEventListener("mousedown", handlePostMessageEvent);
17
+ }, [postMessage]);
24
18
  };
19
+ const useIframeClickMerger = () => useCrossFrameMessageListener(MessageKey.INTLAYER_IFRAME_CLICKED, mergeIframeClick);
20
+
21
+ //#endregion
22
+ export { useIframeClickInterceptor, useIframeClickMerger };
25
23
  //# sourceMappingURL=useIframeClickInterceptor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/useIframeClickInterceptor.tsx"],"sourcesContent":["'use client';\n\nimport { MessageKey, mergeIframeClick } from '@intlayer/editor';\nimport { useEffect } from 'react';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport const useIframeClickInterceptor = () => {\n const postMessage = useCrossFrameMessageListener<undefined>(\n MessageKey.INTLAYER_IFRAME_CLICKED\n );\n const handlePostMessageEvent: EventListener = () => {\n postMessage();\n };\n\n useEffect(() => {\n window.addEventListener('mousedown', handlePostMessageEvent);\n\n return () =>\n window.removeEventListener('mousedown', handlePostMessageEvent);\n }, [postMessage]);\n};\n\nexport const useIframeClickMerger = () =>\n useCrossFrameMessageListener<MessageEvent>(\n MessageKey.INTLAYER_IFRAME_CLICKED,\n mergeIframeClick\n );\n"],"mappings":";AAEA,SAAS,YAAY,wBAAwB;AAC7C,SAAS,iBAAiB;AAC1B,SAAS,oCAAoC;AAEtC,MAAM,4BAA4B,MAAM;AAC7C,QAAM,cAAc;AAAA,IAClB,WAAW;AAAA,EACb;AACA,QAAM,yBAAwC,MAAM;AAClD,gBAAY;AAAA,EACd;AAEA,YAAU,MAAM;AACd,WAAO,iBAAiB,aAAa,sBAAsB;AAE3D,WAAO,MACL,OAAO,oBAAoB,aAAa,sBAAsB;AAAA,EAClE,GAAG,CAAC,WAAW,CAAC;AAClB;AAEO,MAAM,uBAAuB,MAClC;AAAA,EACE,WAAW;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"file":"useIframeClickInterceptor.mjs","names":["handlePostMessageEvent: EventListener"],"sources":["../../src/useIframeClickInterceptor.tsx"],"sourcesContent":["'use client';\n\nimport { MessageKey, mergeIframeClick } from '@intlayer/editor';\nimport { useEffect } from 'react';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport const useIframeClickInterceptor = () => {\n const postMessage = useCrossFrameMessageListener<undefined>(\n MessageKey.INTLAYER_IFRAME_CLICKED\n );\n const handlePostMessageEvent: EventListener = () => {\n postMessage();\n };\n\n useEffect(() => {\n window.addEventListener('mousedown', handlePostMessageEvent);\n\n return () =>\n window.removeEventListener('mousedown', handlePostMessageEvent);\n }, [postMessage]);\n};\n\nexport const useIframeClickMerger = () =>\n useCrossFrameMessageListener<MessageEvent>(\n MessageKey.INTLAYER_IFRAME_CLICKED,\n mergeIframeClick\n );\n"],"mappings":";;;;;;;;AAMA,MAAa,kCAAkC;CAC7C,MAAM,cAAc,6BAClB,WAAW,wBACZ;CACD,MAAMA,+BAA8C;AAClD,eAAa;;AAGf,iBAAgB;AACd,SAAO,iBAAiB,aAAa,uBAAuB;AAE5D,eACE,OAAO,oBAAoB,aAAa,uBAAuB;IAChE,CAAC,YAAY,CAAC;;AAGnB,MAAa,6BACX,6BACE,WAAW,yBACX,iBACD"}
@@ -1,10 +1,14 @@
1
- import { type FC, type PropsWithChildren } from 'react';
2
- export type UseCrossPlatformStateProps = {
3
- postMessage: typeof window.postMessage;
4
- allowedOrigins?: string[];
5
- senderId: string;
1
+ import { FC, PropsWithChildren } from "react";
2
+
3
+ //#region src/CommunicatorContext.d.ts
4
+ type UseCrossPlatformStateProps = {
5
+ postMessage: typeof window.postMessage;
6
+ allowedOrigins?: string[];
7
+ senderId: string;
6
8
  };
7
- export type CommunicatorProviderProps = PropsWithChildren<Omit<UseCrossPlatformStateProps, 'senderId'>>;
8
- export declare const CommunicatorProvider: FC<CommunicatorProviderProps>;
9
- export declare const useCommunicator: () => UseCrossPlatformStateProps;
9
+ type CommunicatorProviderProps = PropsWithChildren<Omit<UseCrossPlatformStateProps, 'senderId'>>;
10
+ declare const CommunicatorProvider: FC<CommunicatorProviderProps>;
11
+ declare const useCommunicator: () => UseCrossPlatformStateProps;
12
+ //#endregion
13
+ export { CommunicatorProvider, CommunicatorProviderProps, UseCrossPlatformStateProps, useCommunicator };
10
14
  //# sourceMappingURL=CommunicatorContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommunicatorContext.d.ts","sourceRoot":"","sources":["../../src/CommunicatorContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,OAAO,MAAM,CAAC,WAAW,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAcF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CACvD,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAC7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAkB9D,CAAC;AAEF,eAAO,MAAM,eAAe,kCAAwC,CAAC"}
1
+ {"version":3,"file":"CommunicatorContext.d.ts","names":[],"sources":["../../src/CommunicatorContext.tsx"],"sourcesContent":[],"mappings":";;;KAaY,0BAAA;sBACU,MAAA,CAAO;EADjB,cAAA,CAAA,EAAA,MAAA,EAAA;EAkBA,QAAA,EAAA,MAAA;CACL;AAAL,KADU,yBAAA,GAA4B,iBACtC,CAAA,IAAA,CAAK,0BAAL,EAAA,UAAA,CAAA,CAAA;AADsC,cAI3B,oBAJ2B,EAIL,EAJK,CAIF,yBAJE,CAAA;AAAiB,cAwB5C,eAxB4C,EAAA,GAAA,GAwB7B,0BAxB6B"}
@@ -1,9 +1,14 @@
1
- import { type IntlayerConfig } from '@intlayer/config/client';
2
- import { type FC, type PropsWithChildren } from 'react';
3
- export declare const useConfigurationState: () => [IntlayerConfig, import("react").Dispatch<import("react").SetStateAction<IntlayerConfig>>, () => void];
4
- export type ConfigurationProviderProps = {
5
- configuration?: IntlayerConfig;
1
+ import * as react0 from "react";
2
+ import { FC, PropsWithChildren } from "react";
3
+ import { IntlayerConfig } from "@intlayer/types";
4
+
5
+ //#region src/ConfigurationContext.d.ts
6
+ declare const useConfigurationState: () => [IntlayerConfig, react0.Dispatch<react0.SetStateAction<IntlayerConfig>>, () => void];
7
+ type ConfigurationProviderProps = {
8
+ configuration?: IntlayerConfig;
6
9
  };
7
- export declare const ConfigurationProvider: FC<PropsWithChildren<ConfigurationProviderProps>>;
8
- export declare const useConfiguration: () => IntlayerConfig;
10
+ declare const ConfigurationProvider: FC<PropsWithChildren<ConfigurationProviderProps>>;
11
+ declare const useConfiguration: () => IntlayerConfig;
12
+ //#endregion
13
+ export { ConfigurationProvider, ConfigurationProviderProps, useConfiguration, useConfigurationState };
9
14
  //# sourceMappingURL=ConfigurationContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurationContext.d.ts","sourceRoot":"","sources":["../../src/ConfigurationContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EACL,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAOf,eAAO,MAAM,qBAAqB,8GAQ/B,CAAC;AAEJ,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CACpC,iBAAiB,CAAC,0BAA0B,CAAC,CAK9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,sBAA+C,CAAC"}
1
+ {"version":3,"file":"ConfigurationContext.d.ts","names":[],"sources":["../../src/ConfigurationContext.tsx"],"sourcesContent":[],"mappings":";;;;;cAgBa,8BAAqB,gBAAA,MAAA,CAAA,SAAA,MAAA,CAAA,eAAA;KAUtB,0BAAA;kBACM;AAXlB,CAAA;AAAkC,cAcrB,qBAdqB,EAcE,EAdF,CAehC,iBAfgC,CAed,0BAfc,CAAA,CAAA;AAAA,cAsBrB,gBAtBqB,EAAA,GAAA,GAsBL,cAtBK"}
@@ -1,16 +1,19 @@
1
- import type { Dictionary, LocalDictionaryId } from '@intlayer/core';
2
- import { type Dispatch, type FC, type PropsWithChildren, type SetStateAction } from 'react';
3
- export type DictionaryContent = Record<LocalDictionaryId, Dictionary>;
1
+ import { Dispatch, FC, PropsWithChildren, SetStateAction } from "react";
2
+ import { Dictionary, LocalDictionaryId } from "@intlayer/types";
3
+
4
+ //#region src/DictionariesRecordContext.d.ts
5
+ type DictionaryContent = Record<LocalDictionaryId, Dictionary>;
4
6
  type DictionariesRecordActionsContextType = {
5
- setLocaleDictionaries: Dispatch<SetStateAction<DictionaryContent>>;
6
- setLocaleDictionary: (dictionary: Dictionary) => void;
7
+ setLocaleDictionaries: Dispatch<SetStateAction<DictionaryContent>>;
8
+ setLocaleDictionary: (dictionary: Dictionary) => void;
7
9
  };
8
- export declare const DictionariesRecordProvider: FC<PropsWithChildren>;
9
- export declare const useDictionariesRecordActions: () => DictionariesRecordActionsContextType;
10
- export declare const useDictionariesRecord: () => {
11
- setLocaleDictionaries: Dispatch<SetStateAction<DictionaryContent>>;
12
- setLocaleDictionary: (dictionary: Dictionary) => void;
13
- localeDictionaries: DictionaryContent;
10
+ declare const DictionariesRecordProvider: FC<PropsWithChildren>;
11
+ declare const useDictionariesRecordActions: () => DictionariesRecordActionsContextType;
12
+ declare const useDictionariesRecord: () => {
13
+ setLocaleDictionaries: Dispatch<SetStateAction<DictionaryContent>>;
14
+ setLocaleDictionary: (dictionary: Dictionary) => void;
15
+ localeDictionaries: DictionaryContent;
14
16
  };
15
- export {};
17
+ //#endregion
18
+ export { DictionariesRecordProvider, DictionaryContent, useDictionariesRecord, useDictionariesRecordActions };
16
19
  //# sourceMappingURL=DictionariesRecordContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DictionariesRecordContext.d.ts","sourceRoot":"","sources":["../../src/DictionariesRecordContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAKtE,KAAK,oCAAoC,GAAG;IAC1C,qBAAqB,EAAE,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACnE,mBAAmB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CACvD,CAAC;AASF,eAAO,MAAM,0BAA0B,EAAE,EAAE,CAAC,iBAAiB,CAsC5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,4CACK,CAAC;AAE/C,eAAO,MAAM,qBAAqB;2BAtDT,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;yBAC7C,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI;wBAJjC,iBAAiB;CAoEtC,CAAC"}
1
+ {"version":3,"file":"DictionariesRecordContext.d.ts","names":[],"sources":["../../src/DictionariesRecordContext.tsx"],"sourcesContent":[],"mappings":";;;;KAeY,iBAAA,GAAoB,OAAO,mBAAmB;KAKrD,oCAAA;EALO,qBAAiB,EAMJ,QANI,CAMK,cANL,CAMoB,iBANpB,CAAA,CAAA;EAAU,mBAAA,EAAA,CAAA,UAAA,EAOH,UAPG,EAAA,GAAA,IAAA;CAAmB;AAA1B,cAiBnB,0BAjBmB,EAiBS,EAjBT,CAiBY,iBAjBZ,CAAA;AAAM,cAyDzB,4BAzDyB,EAAA,GAAA,GAyDG,oCAzDH;AAKjC,cAuDQ,qBAvDR,EAAoC,GAAA,GAAA;EACQ,qBAAA,EAAxB,QAAwB,CAAf,cAAe,CAAA,iBAAA,CAAA,CAAA;EAAf,mBAAA,EAAA,CAAA,UAAA,EACE,UADF,EAAA,GAAA,IAAA;EAAT,kBAAA,EAHH,iBAGG;CACW"}
@@ -1,34 +1,37 @@
1
- import { type ContentNode, type Dictionary, type KeyPath, type LocalDictionaryId } from '@intlayer/core';
2
- import { type Dispatch, type FC, type PropsWithChildren, type SetStateAction } from 'react';
3
- import { type DictionaryContent } from './DictionariesRecordContext';
4
- export declare const usePostEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
5
- export declare const useGetEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
1
+ import { DictionaryContent } from "./DictionariesRecordContext.js";
2
+ import { Dispatch, FC, PropsWithChildren, SetStateAction } from "react";
3
+ import { ContentNode, Dictionary, KeyPath, LocalDictionaryId } from "@intlayer/types";
4
+
5
+ //#region src/EditedContentContext.d.ts
6
+ declare const usePostEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
7
+ declare const useGetEditedContentState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
6
8
  type EditedContentActionsContextType = {
7
- setEditedContentState: (editedContent: DictionaryContent) => void;
8
- setEditedDictionary: Dispatch<SetStateAction<Dictionary>>;
9
- setEditedContent: (localDictionaryId: LocalDictionaryId, newValue: Dictionary['content']) => void;
10
- addEditedContent: (localDictionaryId: LocalDictionaryId, newValue: ContentNode<any>, keyPath?: KeyPath[], overwrite?: boolean) => void;
11
- renameEditedContent: (localDictionaryId: LocalDictionaryId, newKey: KeyPath['key'], keyPath?: KeyPath[]) => void;
12
- removeEditedContent: (localDictionaryId: LocalDictionaryId, keyPath: KeyPath[]) => void;
13
- restoreEditedContent: (localDictionaryId: LocalDictionaryId) => void;
14
- clearEditedDictionaryContent: (localDictionaryId: LocalDictionaryId) => void;
15
- clearEditedContent: () => void;
16
- getEditedContentValue: (dictionaryKey: string, keyPath: KeyPath[], localDictionaryId?: LocalDictionaryId) => ContentNode | undefined;
9
+ setEditedContentState: (editedContent: DictionaryContent) => void;
10
+ setEditedDictionary: Dispatch<SetStateAction<Dictionary>>;
11
+ setEditedContent: (localDictionaryId: LocalDictionaryId, newValue: Dictionary['content']) => void;
12
+ addEditedContent: (localDictionaryId: LocalDictionaryId, newValue: ContentNode<any>, keyPath?: KeyPath[], overwrite?: boolean) => void;
13
+ renameEditedContent: (localDictionaryId: LocalDictionaryId, newKey: KeyPath['key'], keyPath?: KeyPath[]) => void;
14
+ removeEditedContent: (localDictionaryId: LocalDictionaryId, keyPath: KeyPath[]) => void;
15
+ restoreEditedContent: (localDictionaryId: LocalDictionaryId) => void;
16
+ clearEditedDictionaryContent: (localDictionaryId: LocalDictionaryId) => void;
17
+ clearEditedContent: () => void;
18
+ getEditedContentValue: (localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string, keyPath: KeyPath[]) => ContentNode | undefined;
17
19
  };
18
- export declare const EditedContentProvider: FC<PropsWithChildren>;
19
- export declare const useEditedContentActions: () => EditedContentActionsContextType;
20
- export declare const useEditedContent: () => {
21
- setEditedContentState: (editedContent: DictionaryContent) => void;
22
- setEditedDictionary: Dispatch<SetStateAction<Dictionary>>;
23
- setEditedContent: (localDictionaryId: LocalDictionaryId, newValue: Dictionary["content"]) => void;
24
- addEditedContent: (localDictionaryId: LocalDictionaryId, newValue: ContentNode<any>, keyPath?: KeyPath[], overwrite?: boolean) => void;
25
- renameEditedContent: (localDictionaryId: LocalDictionaryId, newKey: KeyPath["key"], keyPath?: KeyPath[]) => void;
26
- removeEditedContent: (localDictionaryId: LocalDictionaryId, keyPath: KeyPath[]) => void;
27
- restoreEditedContent: (localDictionaryId: LocalDictionaryId) => void;
28
- clearEditedDictionaryContent: (localDictionaryId: LocalDictionaryId) => void;
29
- clearEditedContent: () => void;
30
- getEditedContentValue: (dictionaryKey: string, keyPath: KeyPath[], localDictionaryId?: LocalDictionaryId) => ContentNode | undefined;
31
- editedContent: Record<LocalDictionaryId, Dictionary> | undefined;
20
+ declare const EditedContentProvider: FC<PropsWithChildren>;
21
+ declare const useEditedContentActions: () => EditedContentActionsContextType;
22
+ declare const useEditedContent: () => {
23
+ setEditedContentState: (editedContent: DictionaryContent) => void;
24
+ setEditedDictionary: Dispatch<SetStateAction<Dictionary>>;
25
+ setEditedContent: (localDictionaryId: LocalDictionaryId, newValue: Dictionary["content"]) => void;
26
+ addEditedContent: (localDictionaryId: LocalDictionaryId, newValue: ContentNode<any>, keyPath?: KeyPath[], overwrite?: boolean) => void;
27
+ renameEditedContent: (localDictionaryId: LocalDictionaryId, newKey: KeyPath["key"], keyPath?: KeyPath[]) => void;
28
+ removeEditedContent: (localDictionaryId: LocalDictionaryId, keyPath: KeyPath[]) => void;
29
+ restoreEditedContent: (localDictionaryId: LocalDictionaryId) => void;
30
+ clearEditedDictionaryContent: (localDictionaryId: LocalDictionaryId) => void;
31
+ clearEditedContent: () => void;
32
+ getEditedContentValue: (localDictionaryIdOrKey: LocalDictionaryId | Dictionary["key"] | string, keyPath: KeyPath[]) => ContentNode | undefined;
33
+ editedContent: Record<LocalDictionaryId, Dictionary> | undefined;
32
34
  };
33
- export {};
35
+ //#endregion
36
+ export { EditedContentProvider, useEditedContent, useEditedContentActions, useGetEditedContentState, usePostEditedContentState };
34
37
  //# sourceMappingURL=EditedContentContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditedContentContext.d.ts","sourceRoot":"","sources":["../../src/EditedContentContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAYrC,eAAO,MAAM,yBAAyB,GAAI,CAAC,EACzC,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,uBAKnC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,GAAI,CAAC,EACxC,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,uBAKnC,CAAC;AAEJ,KAAK,+BAA+B,GAAG;IACrC,qBAAqB,EAAE,CAAC,aAAa,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClE,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1D,gBAAgB,EAAE,CAChB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,KAC5B,IAAI,CAAC;IACV,gBAAgB,EAAE,CAChB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,WAAW,CAAC,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,OAAO,EAAE,EACnB,SAAS,CAAC,EAAE,OAAO,KAChB,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,OAAO,CAAC,KAAK,C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CAAA,GAAA,MAAA,EAAA,OAAA,EAbzB,OAayB,EAAA,EAAA,GAZ/B,WAY+B,GAAA,SAAA;EAqPzB,aAAA,EApTI,MAoTJ,CApTW,iBAoTY,EApTO,UAoTP,CAAA,GAAA,SAAA;AAGpC,CAAA"}
@@ -1,11 +1,16 @@
1
- import { type FC, type PropsWithChildren } from 'react';
2
- import { type CrossFrameStateOptions } from './useCrossFrameState';
3
- export type EditorEnabledStateProps = {
4
- enabled: boolean;
1
+ import { CrossFrameStateOptions } from "./useCrossFrameState.js";
2
+ import * as react1 from "react";
3
+ import { FC, PropsWithChildren } from "react";
4
+
5
+ //#region src/EditorEnabledContext.d.ts
6
+ type EditorEnabledStateProps = {
7
+ enabled: boolean;
5
8
  };
6
- export declare const useEditorEnabledState: (options?: CrossFrameStateOptions) => [boolean, import("react").Dispatch<import("react").SetStateAction<boolean>>, () => void];
7
- export declare const usePostEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
8
- export declare const useGetEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
9
- export declare const EditorEnabledProvider: FC<PropsWithChildren>;
10
- export declare const useEditorEnabled: () => EditorEnabledStateProps;
9
+ declare const useEditorEnabledState: (options?: CrossFrameStateOptions) => [boolean, react1.Dispatch<react1.SetStateAction<boolean>>, () => void];
10
+ declare const usePostEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
11
+ declare const useGetEditorEnabledState: <S>(onEventTriggered?: (data: S) => void) => (data?: S) => void;
12
+ declare const EditorEnabledProvider: FC<PropsWithChildren>;
13
+ declare const useEditorEnabled: () => EditorEnabledStateProps;
14
+ //#endregion
15
+ export { EditorEnabledProvider, EditorEnabledStateProps, useEditorEnabled, useEditorEnabledState, useGetEditorEnabledState, usePostEditorEnabledState };
11
16
  //# sourceMappingURL=EditorEnabledContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorEnabledContext.d.ts","sourceRoot":"","sources":["../../src/EditorEnabledContext.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF,eAAO,MAAM,qBAAqB,GAAI,UAAU,sBAAsB,6FACE,CAAC;AAEzE,eAAO,MAAM,yBAAyB,GAAI,CAAC,EACzC,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,uBAKnC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,GAAI,CAAC,EACxC,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,uBAKnC,CAAC;AAEJ,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAWvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BAAyC,CAAC"}
1
+ {"version":3,"file":"EditorEnabledContext.d.ts","names":[],"sources":["../../src/EditorEnabledContext.tsx"],"sourcesContent":[],"mappings":";;;;;KAeY,uBAAA;;;AAAA,cAQC,qBARsB,EAAA,CAAA,OAAA,CAAA,EAQa,sBARb,EAAA,GAAA,CAAA,OAAA,EAQmC,MAAA,CAAA,QARnC,CAQmC,MAAA,CAAA,cARnC,CAAA,OAAA,CAAA,CAAA,EAAA,GAAA,GAAA,IAAA,CAAA;AAQtB,cAGA,yBAF2D,EAAA,CAAA,CAAA,CAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,IAAA,EAG5C,CAH4C,EAAA,GAAA,IAAA,EAAA,GAAA,CAAA,IAAA,CAAA,EAGlC,CAHkC,EAAA,GAAA,IAAA;AADxB,cAWnC,wBAXmC,EAAA,CAAA,CAAA,CAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,IAAA,EAYpB,CAZoB,EAAA,GAAA,IAAA,EAAA,GAAA,CAAA,IAAA,CAAA,EAYV,CAZU,EAAA,GAAA,IAAA;AAAsB,cAmBzD,qBAnByD,EAmBlC,EAnBkC,CAmB/B,iBAnB+B,CAAA;AAAA,cAgCzD,gBAhCyD,EAAA,GAAA,GAgCzC,uBAhCyC"}
@@ -1,8 +1,12 @@
1
- import { type FC, type PropsWithChildren } from 'react';
2
- import { type CommunicatorProviderProps } from './CommunicatorContext';
3
- import { type ConfigurationProviderProps } from './ConfigurationContext';
4
- export type EditorProviderProps = CommunicatorProviderProps & ConfigurationProviderProps & {
5
- mode: 'editor' | 'client';
1
+ import { CommunicatorProviderProps } from "./CommunicatorContext.js";
2
+ import { ConfigurationProviderProps } from "./ConfigurationContext.js";
3
+ import { FC, PropsWithChildren } from "react";
4
+
5
+ //#region src/EditorProvider.d.ts
6
+ type EditorProviderProps = CommunicatorProviderProps & ConfigurationProviderProps & {
7
+ mode: 'editor' | 'client';
6
8
  };
7
- export declare const EditorProvider: FC<PropsWithChildren<EditorProviderProps>>;
9
+ declare const EditorProvider: FC<PropsWithChildren<EditorProviderProps>>;
10
+ //#endregion
11
+ export { EditorProvider, EditorProviderProps };
8
12
  //# sourceMappingURL=EditorProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorProvider.d.ts","sourceRoot":"","sources":["../../src/EditorProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,0BAA0B,EAEhC,MAAM,wBAAwB,CAAC;AA2EhC,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,0BAA0B,GAAG;IAC3B,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC3B,CAAC;AAEJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAsBrE,CAAC"}
1
+ {"version":3,"file":"EditorProvider.d.ts","names":[],"sources":["../../src/EditorProvider.tsx"],"sourcesContent":[],"mappings":";;;;;KA2FY,mBAAA,GAAsB,4BAChC;;AADF,CAAA;AAKa,cAAA,cAsBZ,EAtB4B,EAsB5B,CAtB+B,iBAsB/B,CAtBiD,mBAsBjD,CAAA,CAAA"}
@@ -1,20 +1,23 @@
1
- import type { KeyPath } from '@intlayer/core';
2
- import { type Dispatch, type FC, type PropsWithChildren, type SetStateAction } from 'react';
3
- export type FileContent = {
4
- dictionaryKey: string;
5
- dictionaryLocalId?: string;
6
- keyPath?: KeyPath[];
1
+ import { Dispatch, FC, PropsWithChildren, SetStateAction } from "react";
2
+ import { KeyPath } from "@intlayer/types";
3
+
4
+ //#region src/FocusDictionaryContext.d.ts
5
+ type FileContent = {
6
+ dictionaryKey: string;
7
+ dictionaryLocalId?: string;
8
+ keyPath?: KeyPath[];
7
9
  };
8
10
  type FocusDictionaryActions = {
9
- setFocusedContent: Dispatch<SetStateAction<FileContent | null>>;
10
- setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
11
+ setFocusedContent: Dispatch<SetStateAction<FileContent | null>>;
12
+ setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
11
13
  };
12
- export declare const FocusDictionaryProvider: FC<PropsWithChildren>;
13
- export declare const useFocusDictionaryActions: () => FocusDictionaryActions;
14
- export declare const useFocusDictionary: () => {
15
- setFocusedContent: Dispatch<SetStateAction<FileContent | null>>;
16
- setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
17
- focusedContent: FileContent | null;
14
+ declare const FocusDictionaryProvider: FC<PropsWithChildren>;
15
+ declare const useFocusDictionaryActions: () => FocusDictionaryActions;
16
+ declare const useFocusDictionary: () => {
17
+ setFocusedContent: Dispatch<SetStateAction<FileContent | null>>;
18
+ setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
19
+ focusedContent: FileContent | null;
18
20
  };
19
- export {};
21
+ //#endregion
22
+ export { FileContent, FocusDictionaryProvider, useFocusDictionary, useFocusDictionaryActions };
20
23
  //# sourceMappingURL=FocusDictionaryContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusDictionaryContext.d.ts","sourceRoot":"","sources":["../../src/FocusDictionaryContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAMF,KAAK,sBAAsB,GAAG;IAC5B,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;IAChE,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACxD,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,iBAAiB,CA2BzD,CAAC;AAEF,eAAO,MAAM,yBAAyB,8BAQrC,CAAC;AAEF,eAAO,MAAM,kBAAkB;uBAlDV,QAAQ,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;8BACrC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI;oBALtC,WAAW,GAAG,IAAI;CAiEnC,CAAC"}
1
+ {"version":3,"file":"FocusDictionaryContext.d.ts","names":[],"sources":["../../src/FocusDictionaryContext.tsx"],"sourcesContent":[],"mappings":";;;;KAcY,WAAA;;EAAA,iBAAW,CAAA,EAAA,MAGX;EAOP,OAAA,CAAA,EAPO,OAOP,EAAA;CACwC;KADxC,sBAAA,GACyB;EAAT,iBAAA,EAAA,QAAA,CAAS,cAAT,CAAwB,WAAxB,GAAA,IAAA,CAAA,CAAA;EACiB,wBAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,EAAA,GAAA,IAAA;CAAO;AAUhC,cAAA,uBAA4B,EAAH,EAAG,CAAA,iBAAD,CAAA;AA6B3B,cAAA,yBAAyB,EAAA,GAAA,GAAA,sBAQrC;AAEY,cAAA,kBAWZ,EAAA,GAAA,GAAA;EA7D4C,iBAAA,EAAxB,QAAwB,CAAf,cAAe,CAAA,WAAA,GAAA,IAAA,CAAA,CAAA;EAAf,wBAAA,EAAA,CAAA,OAAA,EACQ,OADR,EAAA,EAAA,GAAA,IAAA;EAAT,cAAA,EAJH,WAIG,GAAA,IAAA;CACiB"}
@@ -1,13 +1,13 @@
1
- export * from '@intlayer/editor';
2
- export * from './CommunicatorContext';
3
- export * from './ConfigurationContext';
4
- export * from './DictionariesRecordContext';
5
- export * from './EditedContentContext';
6
- export * from './EditorEnabledContext';
7
- export * from './EditorProvider';
8
- export * from './FocusDictionaryContext';
9
- export * from './useCrossFrameMessageListener';
10
- export * from './useCrossFrameState';
11
- export * from './useCrossURLPathState';
12
- export * from './useIframeClickInterceptor';
13
- //# sourceMappingURL=index.d.ts.map
1
+ import { CommunicatorProvider, CommunicatorProviderProps, UseCrossPlatformStateProps, useCommunicator } from "./CommunicatorContext.js";
2
+ import { ConfigurationProvider, ConfigurationProviderProps, useConfiguration, useConfigurationState } from "./ConfigurationContext.js";
3
+ import { DictionariesRecordProvider, DictionaryContent, useDictionariesRecord, useDictionariesRecordActions } from "./DictionariesRecordContext.js";
4
+ import { EditedContentProvider, useEditedContent, useEditedContentActions, useGetEditedContentState, usePostEditedContentState } from "./EditedContentContext.js";
5
+ import { CrossFrameStateOptions, useCrossFrameState } from "./useCrossFrameState.js";
6
+ import { EditorEnabledProvider, EditorEnabledStateProps, useEditorEnabled, useEditorEnabledState, useGetEditorEnabledState, usePostEditorEnabledState } from "./EditorEnabledContext.js";
7
+ import { EditorProvider, EditorProviderProps } from "./EditorProvider.js";
8
+ import { FileContent, FocusDictionaryProvider, useFocusDictionary, useFocusDictionaryActions } from "./FocusDictionaryContext.js";
9
+ import { useCrossFrameMessageListener } from "./useCrossFrameMessageListener.js";
10
+ import { useCrossURLPathSetter, useCrossURLPathState } from "./useCrossURLPathState.js";
11
+ import { useIframeClickInterceptor, useIframeClickMerger } from "./useIframeClickInterceptor.js";
12
+ export * from "@intlayer/editor";
13
+ export { CommunicatorProvider, CommunicatorProviderProps, ConfigurationProvider, ConfigurationProviderProps, CrossFrameStateOptions, DictionariesRecordProvider, DictionaryContent, EditedContentProvider, EditorEnabledProvider, EditorEnabledStateProps, EditorProvider, EditorProviderProps, FileContent, FocusDictionaryProvider, UseCrossPlatformStateProps, useCommunicator, useConfiguration, useConfigurationState, useCrossFrameMessageListener, useCrossFrameState, useCrossURLPathSetter, useCrossURLPathState, useDictionariesRecord, useDictionariesRecordActions, useEditedContent, useEditedContentActions, useEditorEnabled, useEditorEnabledState, useFocusDictionary, useFocusDictionaryActions, useGetEditedContentState, useGetEditorEnabledState, useIframeClickInterceptor, useIframeClickMerger, usePostEditedContentState, usePostEditorEnabledState };
@@ -1,4 +1,7 @@
1
- import { type MessageKey } from '@intlayer/editor';
1
+ import { MessageKey } from "@intlayer/editor";
2
+
3
+ //#region src/useCrossFrameMessageListener.d.ts
4
+
2
5
  /**
3
6
  * useCrossFrameMessageListener
4
7
  *
@@ -15,5 +18,7 @@ import { type MessageKey } from '@intlayer/editor';
15
18
  * @returns {{ postMessage: (data: S) => void }} An object containing a `postMessage` function
16
19
  * that allows broadcasting messages with the specified key and data.
17
20
  */
18
- export declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void, revalidator?: any) => (data?: S) => void;
21
+ declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void, revalidator?: any) => (data?: S) => void;
22
+ //#endregion
23
+ export { useCrossFrameMessageListener };
19
24
  //# sourceMappingURL=useCrossFrameMessageListener.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameMessageListener.d.ts","sourceRoot":"","sources":["../../src/useCrossFrameMessageListener.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAIhE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,GAAI,CAAC,EAC5C,KAAK,GAAG,UAAU,EAAE,GAAG,GAAG,UAAU,OAAO,GAAG,GAAG,UAAU,MAAM,EACjE,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,EACpC,cAAc,GAAG,aAoDiB,CAAC,KAAK,IAKzC,CAAC"}
1
+ {"version":3,"file":"useCrossFrameMessageListener.d.ts","names":[],"sources":["../../src/useCrossFrameMessageListener.tsx"],"sourcesContent":[],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;cAAa,0CACH,kBAAkB,uBAAuB,4CACvB,0CAqDQ"}
@@ -1,8 +1,10 @@
1
- import { type MessageKey } from '@intlayer/editor';
2
- import { type Dispatch, type SetStateAction } from 'react';
3
- export type CrossFrameStateOptions = {
4
- emit?: boolean;
5
- receive?: boolean;
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { MessageKey } from "@intlayer/editor";
3
+
4
+ //#region src/useCrossFrameState.d.ts
5
+ type CrossFrameStateOptions = {
6
+ emit?: boolean;
7
+ receive?: boolean;
6
8
  };
7
9
  /**
8
10
  * Configuration options for `useCrossFrameState`.
@@ -25,5 +27,7 @@ export type CrossFrameStateOptions = {
25
27
  *
26
28
  * @returns {[S, Dispatch<SetStateAction<S>>]} An array containing the current state and a setter function.
27
29
  */
28
- export declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [S, Dispatch<SetStateAction<S>>, () => void];
30
+ declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [S, Dispatch<SetStateAction<S>>, () => void];
31
+ //#endregion
32
+ export { CrossFrameStateOptions, useCrossFrameState };
29
33
  //# sourceMappingURL=useCrossFrameState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameState.d.ts","sourceRoot":"","sources":["../../src/useCrossFrameState.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAuB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAOF;;;;;GAKG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAClC,KAAK,GAAG,UAAU,EAAE,EACpB,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAC5B,UAAU,sBAAsB,KAC/B,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,aA6FjC,CAAC"}
1
+ {"version":3,"file":"useCrossFrameState.d.ts","names":[],"sources":["../../src/useCrossFrameState.tsx"],"sourcesContent":[],"mappings":";;;;KAOY,sBAAA;;EAAA,OAAA,CAAA,EAAA,OAAA;AAgCZ,CAAA;;;;;;;;;;;;;;;;;;;;;;cAAa,gCACH,6BACO,WAAW,cAChB,4BACR,GAAG,SAAS,eAAe"}