@intlayer/editor-react 8.0.0-canary.0 → 8.0.0-canary.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.
@@ -34,8 +34,8 @@ const useCrossFrameState = (key, initialState, options) => {
34
34
  emit: true,
35
35
  receive: true
36
36
  };
37
- const handleStateChange = (state$1, prevState) => {
38
- const resolvedState = resolveState(state$1, prevState);
37
+ const handleStateChange = (state, prevState) => {
38
+ const resolvedState = resolveState(state, prevState);
39
39
  if (emit && typeof postMessage === "function" && typeof resolvedState !== "undefined") postMessage({
40
40
  type: `${key}/post`,
41
41
  data: resolvedState,
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameState.cjs","names":["useCommunicator","state"],"sources":["../../src/useCrossFrameState.tsx"],"sourcesContent":["'use client';\n\nimport type { MessageKey } from '@intlayer/editor';\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react';\nimport { useCommunicator } from './CommunicatorContext';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport type CrossFrameStateOptions = {\n emit?: boolean;\n receive?: boolean;\n};\n\nconst resolveState = <S,>(state?: SetStateAction<S>, prevState?: S): S =>\n typeof state === 'function'\n ? (state as (prevState?: S) => S)(prevState)\n : (state as S);\n\n/**\n * Configuration options for `useCrossFrameState`.\n * @typedef {Object} CrossFrameStateOptions\n * @property {boolean} [emit=true] - Whether to broadcast state changes to other instances.\n * @property {boolean} [receive=true] - Whether to listen for state updates from other instances.\n */\n\n/**\n * useCrossFrameState\n *\n * This React hook synchronizes state across multiple instances (e.g., different iframes or windows).\n * It uses the `postMessage` API to communicate state changes and updates between instances.\n *\n * @template S - The type of the state.\n * @param key - A unique identifier for the state to synchronize.\n * @param initialState - The initial state value or a function to compute it lazily.\n * @param options - Configuration options to control emitting and receiving messages.\n * - `emit` (default: true): Whether to broadcast state changes to other instances.\n * - `receive` (default: true): Whether to listen for state updates from other instances.\n *\n * @returns {[S, Dispatch<SetStateAction<S>>]} An array containing the current state and a setter function.\n */\nexport const useCrossFrameState = <S,>(\n key: `${MessageKey}`,\n initialState?: S | (() => S),\n options?: CrossFrameStateOptions\n): [S, Dispatch<SetStateAction<S>>, typeof postState] => {\n const { postMessage, senderId } = useCommunicator();\n\n const { emit, receive } = options ?? { emit: true, receive: true };\n\n const handleStateChange = (state?: SetStateAction<S>, prevState?: S) => {\n // Initialize state from the provided initial value, if defined\n const resolvedState: S = resolveState(state, prevState);\n\n // Emit the initial state if `emit` is enabled and initial state is defined\n if (\n emit &&\n typeof postMessage === 'function' &&\n typeof resolvedState !== 'undefined'\n ) {\n postMessage({ type: `${key}/post`, data: resolvedState, senderId });\n }\n\n return resolvedState;\n };\n\n const postState = () => {\n if (typeof postMessage !== 'function') return;\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n const [state, setState] = useState<S>(() => handleStateChange(initialState));\n\n /**\n * A wrapper function around the `setState` function to handle messaging efficiently.\n *\n * This approach has several advantages over using an additional `useEffect`:\n * - **Avoid Redundant Re-renders:** By emitting the message directly within the `setState` logic,\n * it prevents the extra render cycle that would be triggered when using `useEffect`.\n * - **Consistency:** Ensures the message is emitted immediately when the state is updated,\n * avoiding potential delays caused by the asynchronous nature of `useEffect`.\n *\n * This function keeps the same API as `setState` and is memoized using `useCallback`\n * to prevent unnecessary re-renders of dependent components.\n *\n * @template S - The type of the state.\n * @param {SetStateAction<S>} valueOrUpdater - The new state or a function to produce it.\n * @returns {void}\n */\n const setStateWrapper: Dispatch<SetStateAction<S>> = (valueOrUpdater) =>\n setState((prevState) => handleStateChange(valueOrUpdater, prevState));\n\n /**\n * Listen for messages with the specified key and update the state accordingly.\n */\n useCrossFrameMessageListener<S>(\n `${key}/post`,\n // Only activate the state listener if the `receive` option is true\n receive\n ? (data) => {\n setState(data);\n }\n : undefined\n );\n\n const onGetMessage = (_: unknown, originSenderId?: string) => {\n if (!emit) return;\n if (typeof postMessage !== 'function') return;\n if (originSenderId === senderId) return;\n if (typeof state === 'undefined') return;\n\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n /**\n * Listen for messages request to get the state content and send it back.\n */\n useCrossFrameMessageListener<S>(\n `${key}/get`,\n // Only activate the state listener if the `emit` option is true\n emit ? onGetMessage : undefined,\n state // Revalidate the listener if the state changes\n );\n\n useEffect(() => {\n // If the component is mounted and the hook in receive mode,\n // Request the state from the other instance\n if (\n receive &&\n typeof postMessage === 'function' &&\n typeof state === 'undefined'\n ) {\n postMessage({ type: `${key}/get`, senderId });\n }\n }, []);\n\n // Return the useState state and setter\n return [state, setStateWrapper, postState];\n};\n"],"mappings":";;;;;;;;AAYA,MAAM,gBAAoB,OAA2B,cACnD,OAAO,UAAU,aACZ,MAA+B,UAAU,GACzC;;;;;;;;;;;;;;;;;;;;;;AAwBP,MAAa,sBACX,KACA,cACA,YACuD;CACvD,MAAM,EAAE,aAAa,aAAaA,6CAAiB;CAEnD,MAAM,EAAE,MAAM,YAAY,WAAW;EAAE,MAAM;EAAM,SAAS;EAAM;CAElE,MAAM,qBAAqB,SAA2B,cAAkB;EAEtE,MAAM,gBAAmB,aAAaC,SAAO,UAAU;AAGvD,MACE,QACA,OAAO,gBAAgB,cACvB,OAAO,kBAAkB,YAEzB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAe;GAAU,CAAC;AAGrE,SAAO;;CAGT,MAAM,kBAAkB;AACtB,MAAI,OAAO,gBAAgB,WAAY;AACvC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;CAG7D,MAAM,CAAC,OAAO,sCAA8B,kBAAkB,aAAa,CAAC;;;;;;;;;;;;;;;;;CAkB5E,MAAM,mBAAgD,mBACpD,UAAU,cAAc,kBAAkB,gBAAgB,UAAU,CAAC;;;;AAKvE,mEACE,GAAG,IAAI,QAEP,WACK,SAAS;AACR,WAAS,KAAK;KAEhB,OACL;CAED,MAAM,gBAAgB,GAAY,mBAA4B;AAC5D,MAAI,CAAC,KAAM;AACX,MAAI,OAAO,gBAAgB,WAAY;AACvC,MAAI,mBAAmB,SAAU;AACjC,MAAI,OAAO,UAAU,YAAa;AAElC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;;;;AAM7D,mEACE,GAAG,IAAI,OAEP,OAAO,eAAe,QACtB,MACD;AAED,4BAAgB;AAGd,MACE,WACA,OAAO,gBAAgB,cACvB,OAAO,UAAU,YAEjB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAO;GAAU,CAAC;IAE9C,EAAE,CAAC;AAGN,QAAO;EAAC;EAAO;EAAiB;EAAU"}
1
+ {"version":3,"file":"useCrossFrameState.cjs","names":["useCommunicator"],"sources":["../../src/useCrossFrameState.tsx"],"sourcesContent":["'use client';\n\nimport type { MessageKey } from '@intlayer/editor';\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react';\nimport { useCommunicator } from './CommunicatorContext';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport type CrossFrameStateOptions = {\n emit?: boolean;\n receive?: boolean;\n};\n\nconst resolveState = <S,>(state?: SetStateAction<S>, prevState?: S): S =>\n typeof state === 'function'\n ? (state as (prevState?: S) => S)(prevState)\n : (state as S);\n\n/**\n * Configuration options for `useCrossFrameState`.\n * @typedef {Object} CrossFrameStateOptions\n * @property {boolean} [emit=true] - Whether to broadcast state changes to other instances.\n * @property {boolean} [receive=true] - Whether to listen for state updates from other instances.\n */\n\n/**\n * useCrossFrameState\n *\n * This React hook synchronizes state across multiple instances (e.g., different iframes or windows).\n * It uses the `postMessage` API to communicate state changes and updates between instances.\n *\n * @template S - The type of the state.\n * @param key - A unique identifier for the state to synchronize.\n * @param initialState - The initial state value or a function to compute it lazily.\n * @param options - Configuration options to control emitting and receiving messages.\n * - `emit` (default: true): Whether to broadcast state changes to other instances.\n * - `receive` (default: true): Whether to listen for state updates from other instances.\n *\n * @returns {[S, Dispatch<SetStateAction<S>>]} An array containing the current state and a setter function.\n */\nexport const useCrossFrameState = <S,>(\n key: `${MessageKey}`,\n initialState?: S | (() => S),\n options?: CrossFrameStateOptions\n): [S, Dispatch<SetStateAction<S>>, typeof postState] => {\n const { postMessage, senderId } = useCommunicator();\n\n const { emit, receive } = options ?? { emit: true, receive: true };\n\n const handleStateChange = (state?: SetStateAction<S>, prevState?: S) => {\n // Initialize state from the provided initial value, if defined\n const resolvedState: S = resolveState(state, prevState);\n\n // Emit the initial state if `emit` is enabled and initial state is defined\n if (\n emit &&\n typeof postMessage === 'function' &&\n typeof resolvedState !== 'undefined'\n ) {\n postMessage({ type: `${key}/post`, data: resolvedState, senderId });\n }\n\n return resolvedState;\n };\n\n const postState = () => {\n if (typeof postMessage !== 'function') return;\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n const [state, setState] = useState<S>(() => handleStateChange(initialState));\n\n /**\n * A wrapper function around the `setState` function to handle messaging efficiently.\n *\n * This approach has several advantages over using an additional `useEffect`:\n * - **Avoid Redundant Re-renders:** By emitting the message directly within the `setState` logic,\n * it prevents the extra render cycle that would be triggered when using `useEffect`.\n * - **Consistency:** Ensures the message is emitted immediately when the state is updated,\n * avoiding potential delays caused by the asynchronous nature of `useEffect`.\n *\n * This function keeps the same API as `setState` and is memoized using `useCallback`\n * to prevent unnecessary re-renders of dependent components.\n *\n * @template S - The type of the state.\n * @param {SetStateAction<S>} valueOrUpdater - The new state or a function to produce it.\n * @returns {void}\n */\n const setStateWrapper: Dispatch<SetStateAction<S>> = (valueOrUpdater) =>\n setState((prevState) => handleStateChange(valueOrUpdater, prevState));\n\n /**\n * Listen for messages with the specified key and update the state accordingly.\n */\n useCrossFrameMessageListener<S>(\n `${key}/post`,\n // Only activate the state listener if the `receive` option is true\n receive\n ? (data) => {\n setState(data);\n }\n : undefined\n );\n\n const onGetMessage = (_: unknown, originSenderId?: string) => {\n if (!emit) return;\n if (typeof postMessage !== 'function') return;\n if (originSenderId === senderId) return;\n if (typeof state === 'undefined') return;\n\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n /**\n * Listen for messages request to get the state content and send it back.\n */\n useCrossFrameMessageListener<S>(\n `${key}/get`,\n // Only activate the state listener if the `emit` option is true\n emit ? onGetMessage : undefined,\n state // Revalidate the listener if the state changes\n );\n\n useEffect(() => {\n // If the component is mounted and the hook in receive mode,\n // Request the state from the other instance\n if (\n receive &&\n typeof postMessage === 'function' &&\n typeof state === 'undefined'\n ) {\n postMessage({ type: `${key}/get`, senderId });\n }\n }, []);\n\n // Return the useState state and setter\n return [state, setStateWrapper, postState];\n};\n"],"mappings":";;;;;;;;AAYA,MAAM,gBAAoB,OAA2B,cACnD,OAAO,UAAU,aACZ,MAA+B,UAAU,GACzC;;;;;;;;;;;;;;;;;;;;;;AAwBP,MAAa,sBACX,KACA,cACA,YACuD;CACvD,MAAM,EAAE,aAAa,aAAaA,6CAAiB;CAEnD,MAAM,EAAE,MAAM,YAAY,WAAW;EAAE,MAAM;EAAM,SAAS;EAAM;CAElE,MAAM,qBAAqB,OAA2B,cAAkB;EAEtE,MAAM,gBAAmB,aAAa,OAAO,UAAU;AAGvD,MACE,QACA,OAAO,gBAAgB,cACvB,OAAO,kBAAkB,YAEzB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAe;GAAU,CAAC;AAGrE,SAAO;;CAGT,MAAM,kBAAkB;AACtB,MAAI,OAAO,gBAAgB,WAAY;AACvC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;CAG7D,MAAM,CAAC,OAAO,sCAA8B,kBAAkB,aAAa,CAAC;;;;;;;;;;;;;;;;;CAkB5E,MAAM,mBAAgD,mBACpD,UAAU,cAAc,kBAAkB,gBAAgB,UAAU,CAAC;;;;AAKvE,mEACE,GAAG,IAAI,QAEP,WACK,SAAS;AACR,WAAS,KAAK;KAEhB,OACL;CAED,MAAM,gBAAgB,GAAY,mBAA4B;AAC5D,MAAI,CAAC,KAAM;AACX,MAAI,OAAO,gBAAgB,WAAY;AACvC,MAAI,mBAAmB,SAAU;AACjC,MAAI,OAAO,UAAU,YAAa;AAElC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;;;;AAM7D,mEACE,GAAG,IAAI,OAEP,OAAO,eAAe,QACtB,MACD;AAED,4BAAgB;AAGd,MACE,WACA,OAAO,gBAAgB,cACvB,OAAO,UAAU,YAEjB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAO;GAAU,CAAC;IAE9C,EAAE,CAAC;AAGN,QAAO;EAAC;EAAO;EAAiB;EAAU"}
@@ -33,8 +33,8 @@ const useCrossFrameState = (key, initialState, options) => {
33
33
  emit: true,
34
34
  receive: true
35
35
  };
36
- const handleStateChange = (state$1, prevState) => {
37
- const resolvedState = resolveState(state$1, prevState);
36
+ const handleStateChange = (state, prevState) => {
37
+ const resolvedState = resolveState(state, prevState);
38
38
  if (emit && typeof postMessage === "function" && typeof resolvedState !== "undefined") postMessage({
39
39
  type: `${key}/post`,
40
40
  data: resolvedState,
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameState.mjs","names":["state"],"sources":["../../src/useCrossFrameState.tsx"],"sourcesContent":["'use client';\n\nimport type { MessageKey } from '@intlayer/editor';\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react';\nimport { useCommunicator } from './CommunicatorContext';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport type CrossFrameStateOptions = {\n emit?: boolean;\n receive?: boolean;\n};\n\nconst resolveState = <S,>(state?: SetStateAction<S>, prevState?: S): S =>\n typeof state === 'function'\n ? (state as (prevState?: S) => S)(prevState)\n : (state as S);\n\n/**\n * Configuration options for `useCrossFrameState`.\n * @typedef {Object} CrossFrameStateOptions\n * @property {boolean} [emit=true] - Whether to broadcast state changes to other instances.\n * @property {boolean} [receive=true] - Whether to listen for state updates from other instances.\n */\n\n/**\n * useCrossFrameState\n *\n * This React hook synchronizes state across multiple instances (e.g., different iframes or windows).\n * It uses the `postMessage` API to communicate state changes and updates between instances.\n *\n * @template S - The type of the state.\n * @param key - A unique identifier for the state to synchronize.\n * @param initialState - The initial state value or a function to compute it lazily.\n * @param options - Configuration options to control emitting and receiving messages.\n * - `emit` (default: true): Whether to broadcast state changes to other instances.\n * - `receive` (default: true): Whether to listen for state updates from other instances.\n *\n * @returns {[S, Dispatch<SetStateAction<S>>]} An array containing the current state and a setter function.\n */\nexport const useCrossFrameState = <S,>(\n key: `${MessageKey}`,\n initialState?: S | (() => S),\n options?: CrossFrameStateOptions\n): [S, Dispatch<SetStateAction<S>>, typeof postState] => {\n const { postMessage, senderId } = useCommunicator();\n\n const { emit, receive } = options ?? { emit: true, receive: true };\n\n const handleStateChange = (state?: SetStateAction<S>, prevState?: S) => {\n // Initialize state from the provided initial value, if defined\n const resolvedState: S = resolveState(state, prevState);\n\n // Emit the initial state if `emit` is enabled and initial state is defined\n if (\n emit &&\n typeof postMessage === 'function' &&\n typeof resolvedState !== 'undefined'\n ) {\n postMessage({ type: `${key}/post`, data: resolvedState, senderId });\n }\n\n return resolvedState;\n };\n\n const postState = () => {\n if (typeof postMessage !== 'function') return;\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n const [state, setState] = useState<S>(() => handleStateChange(initialState));\n\n /**\n * A wrapper function around the `setState` function to handle messaging efficiently.\n *\n * This approach has several advantages over using an additional `useEffect`:\n * - **Avoid Redundant Re-renders:** By emitting the message directly within the `setState` logic,\n * it prevents the extra render cycle that would be triggered when using `useEffect`.\n * - **Consistency:** Ensures the message is emitted immediately when the state is updated,\n * avoiding potential delays caused by the asynchronous nature of `useEffect`.\n *\n * This function keeps the same API as `setState` and is memoized using `useCallback`\n * to prevent unnecessary re-renders of dependent components.\n *\n * @template S - The type of the state.\n * @param {SetStateAction<S>} valueOrUpdater - The new state or a function to produce it.\n * @returns {void}\n */\n const setStateWrapper: Dispatch<SetStateAction<S>> = (valueOrUpdater) =>\n setState((prevState) => handleStateChange(valueOrUpdater, prevState));\n\n /**\n * Listen for messages with the specified key and update the state accordingly.\n */\n useCrossFrameMessageListener<S>(\n `${key}/post`,\n // Only activate the state listener if the `receive` option is true\n receive\n ? (data) => {\n setState(data);\n }\n : undefined\n );\n\n const onGetMessage = (_: unknown, originSenderId?: string) => {\n if (!emit) return;\n if (typeof postMessage !== 'function') return;\n if (originSenderId === senderId) return;\n if (typeof state === 'undefined') return;\n\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n /**\n * Listen for messages request to get the state content and send it back.\n */\n useCrossFrameMessageListener<S>(\n `${key}/get`,\n // Only activate the state listener if the `emit` option is true\n emit ? onGetMessage : undefined,\n state // Revalidate the listener if the state changes\n );\n\n useEffect(() => {\n // If the component is mounted and the hook in receive mode,\n // Request the state from the other instance\n if (\n receive &&\n typeof postMessage === 'function' &&\n typeof state === 'undefined'\n ) {\n postMessage({ type: `${key}/get`, senderId });\n }\n }, []);\n\n // Return the useState state and setter\n return [state, setStateWrapper, postState];\n};\n"],"mappings":";;;;;;;AAYA,MAAM,gBAAoB,OAA2B,cACnD,OAAO,UAAU,aACZ,MAA+B,UAAU,GACzC;;;;;;;;;;;;;;;;;;;;;;AAwBP,MAAa,sBACX,KACA,cACA,YACuD;CACvD,MAAM,EAAE,aAAa,aAAa,iBAAiB;CAEnD,MAAM,EAAE,MAAM,YAAY,WAAW;EAAE,MAAM;EAAM,SAAS;EAAM;CAElE,MAAM,qBAAqB,SAA2B,cAAkB;EAEtE,MAAM,gBAAmB,aAAaA,SAAO,UAAU;AAGvD,MACE,QACA,OAAO,gBAAgB,cACvB,OAAO,kBAAkB,YAEzB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAe;GAAU,CAAC;AAGrE,SAAO;;CAGT,MAAM,kBAAkB;AACtB,MAAI,OAAO,gBAAgB,WAAY;AACvC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;CAG7D,MAAM,CAAC,OAAO,YAAY,eAAkB,kBAAkB,aAAa,CAAC;;;;;;;;;;;;;;;;;CAkB5E,MAAM,mBAAgD,mBACpD,UAAU,cAAc,kBAAkB,gBAAgB,UAAU,CAAC;;;;AAKvE,8BACE,GAAG,IAAI,QAEP,WACK,SAAS;AACR,WAAS,KAAK;KAEhB,OACL;CAED,MAAM,gBAAgB,GAAY,mBAA4B;AAC5D,MAAI,CAAC,KAAM;AACX,MAAI,OAAO,gBAAgB,WAAY;AACvC,MAAI,mBAAmB,SAAU;AACjC,MAAI,OAAO,UAAU,YAAa;AAElC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;;;;AAM7D,8BACE,GAAG,IAAI,OAEP,OAAO,eAAe,QACtB,MACD;AAED,iBAAgB;AAGd,MACE,WACA,OAAO,gBAAgB,cACvB,OAAO,UAAU,YAEjB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAO;GAAU,CAAC;IAE9C,EAAE,CAAC;AAGN,QAAO;EAAC;EAAO;EAAiB;EAAU"}
1
+ {"version":3,"file":"useCrossFrameState.mjs","names":[],"sources":["../../src/useCrossFrameState.tsx"],"sourcesContent":["'use client';\n\nimport type { MessageKey } from '@intlayer/editor';\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react';\nimport { useCommunicator } from './CommunicatorContext';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport type CrossFrameStateOptions = {\n emit?: boolean;\n receive?: boolean;\n};\n\nconst resolveState = <S,>(state?: SetStateAction<S>, prevState?: S): S =>\n typeof state === 'function'\n ? (state as (prevState?: S) => S)(prevState)\n : (state as S);\n\n/**\n * Configuration options for `useCrossFrameState`.\n * @typedef {Object} CrossFrameStateOptions\n * @property {boolean} [emit=true] - Whether to broadcast state changes to other instances.\n * @property {boolean} [receive=true] - Whether to listen for state updates from other instances.\n */\n\n/**\n * useCrossFrameState\n *\n * This React hook synchronizes state across multiple instances (e.g., different iframes or windows).\n * It uses the `postMessage` API to communicate state changes and updates between instances.\n *\n * @template S - The type of the state.\n * @param key - A unique identifier for the state to synchronize.\n * @param initialState - The initial state value or a function to compute it lazily.\n * @param options - Configuration options to control emitting and receiving messages.\n * - `emit` (default: true): Whether to broadcast state changes to other instances.\n * - `receive` (default: true): Whether to listen for state updates from other instances.\n *\n * @returns {[S, Dispatch<SetStateAction<S>>]} An array containing the current state and a setter function.\n */\nexport const useCrossFrameState = <S,>(\n key: `${MessageKey}`,\n initialState?: S | (() => S),\n options?: CrossFrameStateOptions\n): [S, Dispatch<SetStateAction<S>>, typeof postState] => {\n const { postMessage, senderId } = useCommunicator();\n\n const { emit, receive } = options ?? { emit: true, receive: true };\n\n const handleStateChange = (state?: SetStateAction<S>, prevState?: S) => {\n // Initialize state from the provided initial value, if defined\n const resolvedState: S = resolveState(state, prevState);\n\n // Emit the initial state if `emit` is enabled and initial state is defined\n if (\n emit &&\n typeof postMessage === 'function' &&\n typeof resolvedState !== 'undefined'\n ) {\n postMessage({ type: `${key}/post`, data: resolvedState, senderId });\n }\n\n return resolvedState;\n };\n\n const postState = () => {\n if (typeof postMessage !== 'function') return;\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n const [state, setState] = useState<S>(() => handleStateChange(initialState));\n\n /**\n * A wrapper function around the `setState` function to handle messaging efficiently.\n *\n * This approach has several advantages over using an additional `useEffect`:\n * - **Avoid Redundant Re-renders:** By emitting the message directly within the `setState` logic,\n * it prevents the extra render cycle that would be triggered when using `useEffect`.\n * - **Consistency:** Ensures the message is emitted immediately when the state is updated,\n * avoiding potential delays caused by the asynchronous nature of `useEffect`.\n *\n * This function keeps the same API as `setState` and is memoized using `useCallback`\n * to prevent unnecessary re-renders of dependent components.\n *\n * @template S - The type of the state.\n * @param {SetStateAction<S>} valueOrUpdater - The new state or a function to produce it.\n * @returns {void}\n */\n const setStateWrapper: Dispatch<SetStateAction<S>> = (valueOrUpdater) =>\n setState((prevState) => handleStateChange(valueOrUpdater, prevState));\n\n /**\n * Listen for messages with the specified key and update the state accordingly.\n */\n useCrossFrameMessageListener<S>(\n `${key}/post`,\n // Only activate the state listener if the `receive` option is true\n receive\n ? (data) => {\n setState(data);\n }\n : undefined\n );\n\n const onGetMessage = (_: unknown, originSenderId?: string) => {\n if (!emit) return;\n if (typeof postMessage !== 'function') return;\n if (originSenderId === senderId) return;\n if (typeof state === 'undefined') return;\n\n postMessage({ type: `${key}/post`, data: state, senderId });\n };\n\n /**\n * Listen for messages request to get the state content and send it back.\n */\n useCrossFrameMessageListener<S>(\n `${key}/get`,\n // Only activate the state listener if the `emit` option is true\n emit ? onGetMessage : undefined,\n state // Revalidate the listener if the state changes\n );\n\n useEffect(() => {\n // If the component is mounted and the hook in receive mode,\n // Request the state from the other instance\n if (\n receive &&\n typeof postMessage === 'function' &&\n typeof state === 'undefined'\n ) {\n postMessage({ type: `${key}/get`, senderId });\n }\n }, []);\n\n // Return the useState state and setter\n return [state, setStateWrapper, postState];\n};\n"],"mappings":";;;;;;;AAYA,MAAM,gBAAoB,OAA2B,cACnD,OAAO,UAAU,aACZ,MAA+B,UAAU,GACzC;;;;;;;;;;;;;;;;;;;;;;AAwBP,MAAa,sBACX,KACA,cACA,YACuD;CACvD,MAAM,EAAE,aAAa,aAAa,iBAAiB;CAEnD,MAAM,EAAE,MAAM,YAAY,WAAW;EAAE,MAAM;EAAM,SAAS;EAAM;CAElE,MAAM,qBAAqB,OAA2B,cAAkB;EAEtE,MAAM,gBAAmB,aAAa,OAAO,UAAU;AAGvD,MACE,QACA,OAAO,gBAAgB,cACvB,OAAO,kBAAkB,YAEzB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAe;GAAU,CAAC;AAGrE,SAAO;;CAGT,MAAM,kBAAkB;AACtB,MAAI,OAAO,gBAAgB,WAAY;AACvC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;CAG7D,MAAM,CAAC,OAAO,YAAY,eAAkB,kBAAkB,aAAa,CAAC;;;;;;;;;;;;;;;;;CAkB5E,MAAM,mBAAgD,mBACpD,UAAU,cAAc,kBAAkB,gBAAgB,UAAU,CAAC;;;;AAKvE,8BACE,GAAG,IAAI,QAEP,WACK,SAAS;AACR,WAAS,KAAK;KAEhB,OACL;CAED,MAAM,gBAAgB,GAAY,mBAA4B;AAC5D,MAAI,CAAC,KAAM;AACX,MAAI,OAAO,gBAAgB,WAAY;AACvC,MAAI,mBAAmB,SAAU;AACjC,MAAI,OAAO,UAAU,YAAa;AAElC,cAAY;GAAE,MAAM,GAAG,IAAI;GAAQ,MAAM;GAAO;GAAU,CAAC;;;;;AAM7D,8BACE,GAAG,IAAI,OAEP,OAAO,eAAe,QACtB,MACD;AAED,iBAAgB;AAGd,MACE,WACA,OAAO,gBAAgB,cACvB,OAAO,UAAU,YAEjB,aAAY;GAAE,MAAM,GAAG,IAAI;GAAO;GAAU,CAAC;IAE9C,EAAE,CAAC;AAGN,QAAO;EAAC;EAAO;EAAiB;EAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommunicatorContext.d.ts","names":[],"sources":["../../src/CommunicatorContext.tsx"],"sourcesContent":[],"mappings":";;;KAcY,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
+ {"version":3,"file":"CommunicatorContext.d.ts","names":[],"sources":["../../src/CommunicatorContext.tsx"],"mappings":";;;KAcY,0BAAA;EACV,WAAA,SAAoB,MAAA,CAAO,WAAA;EAC3B,cAAA;EACA,QAAA;AAAA;AAAA,KAeU,yBAAA,GAA4B,iBAAA,CACtC,IAAA,CAAK,0BAAA;AAAA,cAGM,oBAAA,EAAsB,EAAA,CAAG,yBAAA;AAAA,cAoBzB,eAAA,QAAe,0BAAA"}
@@ -1,9 +1,9 @@
1
- import * as react9 from "react";
1
+ import * as react0 from "react";
2
2
  import { FC, PropsWithChildren } from "react";
3
3
  import { IntlayerConfig } from "@intlayer/types";
4
4
 
5
5
  //#region src/ConfigurationContext.d.ts
6
- declare const useConfigurationState: () => [IntlayerConfig, react9.Dispatch<react9.SetStateAction<IntlayerConfig>>, () => void];
6
+ declare const useConfigurationState: () => [IntlayerConfig, react0.Dispatch<react0.SetStateAction<IntlayerConfig>>, () => void];
7
7
  type ConfigurationProviderProps = {
8
8
  configuration?: IntlayerConfig;
9
9
  };
@@ -1 +1 @@
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
+ {"version":3,"file":"ConfigurationContext.d.ts","names":[],"sources":["../../src/ConfigurationContext.tsx"],"mappings":";;;;;cAgBa,qBAAA,SAAqB,cAAA,EAAA,MAAA,CAAA,QAAA,CAAA,MAAA,CAAA,cAAA,CAAA,cAAA;AAAA,KAUtB,0BAAA;EACV,aAAA,GAAgB,cAAA;AAAA;AAAA,cAGL,qBAAA,EAAuB,EAAA,CAClC,iBAAA,CAAkB,0BAAA;AAAA,cAOP,gBAAA,QAAgB,cAAA"}
@@ -1 +1 @@
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
+ {"version":3,"file":"DictionariesRecordContext.d.ts","names":[],"sources":["../../src/DictionariesRecordContext.tsx"],"mappings":";;;;KAeY,iBAAA,GAAoB,MAAA,CAAO,iBAAA,EAAmB,UAAA;AAAA,KAKrD,oCAAA;EACH,qBAAA,EAAuB,QAAA,CAAS,cAAA,CAAe,iBAAA;EAC/C,mBAAA,GAAsB,UAAA,EAAY,UAAA;AAAA;AAAA,cAUvB,0BAAA,EAA4B,EAAA,CAAG,iBAAA;AAAA,cAwC/B,4BAAA,QAA4B,oCAAA;AAAA,cAG5B,qBAAA;yBAtDY,QAAA,CAAS,cAAA,CAAe,iBAAA;wBACzB,UAAA,EAAY,UAAA;sBAJd,iBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditedContentContext.d.ts","names":[],"sources":["../../src/EditedContentContext.tsx"],"sourcesContent":[],"mappings":";;;;;cAuCa,yDACe,uBAAU;cAOzB,wDACe,uBAAU;AATtC,KAgBK,+BAAA,GAVF;EAEU,qBAAA,EAAA,CAAA,aAMV,EAGsC,iBARH,EAAA,GAAA,IAAA;EAOjC,mBAAA,EAEkB,QAFlB,CAE2B,cAFI,CAEW,UAFX,CAAA,CAAA;EACK,gBAAA,EAAA,CAAA,iBAAA,EAGlB,iBAHkB,EAAA,QAAA,EAI3B,UAJ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,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
+ {"version":3,"file":"EditorEnabledContext.d.ts","names":[],"sources":["../../src/EditorEnabledContext.tsx"],"mappings":";;;;;KAeY,uBAAA;EACV,OAAA;AAAA;AAAA,cAOW,qBAAA,GAAyB,OAAA,GAAU,sBAAA,eAAsB,MAAA,CAAA,QAAA,CAAA,MAAA,CAAA,cAAA;AAAA,cAGzD,yBAAA,MACX,gBAAA,IAAoB,IAAA,EAAM,CAAA,eAAU,IAAA,GAAA,CAAA;AAAA,cAOzB,wBAAA,MACX,gBAAA,IAAoB,IAAA,EAAM,CAAA,eAAU,IAAA,GAAA,CAAA;AAAA,cAOzB,qBAAA,EAAuB,EAAA,CAAG,iBAAA;AAAA,cAa1B,gBAAA,QAAgB,uBAAA"}
@@ -1 +1 @@
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
+ {"version":3,"file":"EditorProvider.d.ts","names":[],"sources":["../../src/EditorProvider.tsx"],"mappings":";;;;;KA2FY,mBAAA,GAAsB,yBAAA,GAChC,0BAAA;EACE,IAAA;AAAA;AAAA,cAGS,cAAA,EAAgB,EAAA,CAAG,iBAAA,CAAkB,mBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"FocusDictionaryContext.d.ts","names":[],"sources":["../../src/FocusDictionaryContext.tsx"],"sourcesContent":[],"mappings":";;;;KAkBY,WAAA;;EAAA,iBAAW,CAAA,EAED,iBAAA;EAIV,OAAA,CAAA,EAHA,OAGA,EAAA;AAIZ,CAAA;AAC6C,KALjC,oBAAA,GAKiC;EAAf,cAAA,EAJZ,WAIY,GAAA,IAAA;CAAT;AACiB,KAF1B,sBAAA,GAE0B;EAAO,iBAAA,EADxB,QACwB,CADf,cACe,CADA,WACA,GAAA,IAAA,CAAA,CAAA;EAUhC,wBAAA,EAoCZ,CAAA,OAAA,EA9CqC,OAUG,EAAA,EAAA,GAAA,IAAA;AAsCzC,CAAA;AAUa,cAhDA,uBA2DZ,EA3DqC,EA2DrC,CA3DwC,iBA2DxC,CAAA;AAtE4C,cAiDhC,yBAjDgC,EAAA,GAAA,GAiDP,sBAjDO;AAAf,cA2DjB,kBA3DiB,EAAA,GAAA,GAAA;EAAT,iBAAA,EAAA,QAAA,CAAS,cAAT,CAAwB,WAAxB,GAAA,IAAA,CAAA,CAAA;EACiB,wBAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,EAAA,GAAA,IAAA;EALpB,cAAA,EAAA,WAAA,GAAA,IAAA;CAAW"}
1
+ {"version":3,"file":"FocusDictionaryContext.d.ts","names":[],"sources":["../../src/FocusDictionaryContext.tsx"],"mappings":";;;;KAkBY,WAAA;EACV,aAAA;EACA,iBAAA,GAAoB,iBAAA;EACpB,OAAA,GAAU,OAAA;AAAA;AAAA,KAGA,oBAAA;EACV,cAAA,EAAgB,WAAA;AAAA;AAAA,KAGN,sBAAA;EACV,iBAAA,EAAmB,QAAA,CAAS,cAAA,CAAe,WAAA;EAC3C,wBAAA,GAA2B,OAAA,EAAS,OAAA;AAAA;AAAA,cAUzB,uBAAA,EAAyB,EAAA,CAAG,iBAAA;AAAA,cAsC5B,yBAAA,QAAyB,sBAAA;AAAA,cAUzB,kBAAA;qBA3DQ,QAAA,CAAS,cAAA,CAAe,WAAA;6BAChB,OAAA,EAAS,OAAA;kBALpB,WAAA;AAAA"}
@@ -1,7 +1,6 @@
1
1
  import { MessageKey } from "@intlayer/editor";
2
2
 
3
3
  //#region src/useCrossFrameMessageListener.d.ts
4
-
5
4
  /**
6
5
  * useCrossFrameMessageListener
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossFrameMessageListener.d.ts","names":[],"sources":["../../src/useCrossFrameMessageListener.tsx"],"sourcesContent":[],"mappings":";;;;;;AAsBA;;;;;;;;;;;;;;cAAa,0CACH,kBAAkB,uBAAuB,4CACvB,0CAuDQ"}
1
+ {"version":3,"file":"useCrossFrameMessageListener.d.ts","names":[],"sources":["../../src/useCrossFrameMessageListener.tsx"],"mappings":";;;;;AAsBA;;;;;;;;;;;;;;cAAa,4BAAA,MACX,GAAA,KAAQ,UAAA,QAAkB,UAAA,aAAuB,UAAA,QACjD,gBAAA,IAAoB,IAAA,EAAM,CAAA,WAC1B,WAAA,YAAiB,IAAA,GAsDiB,CAAA"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"useCrossFrameState.d.ts","names":[],"sources":["../../src/useCrossFrameState.tsx"],"mappings":";;;;KAOY,sBAAA;EACV,IAAA;EACA,OAAA;AAAA;;;;AA8BF;;;;;;;;;;;;;;;;;;cAAa,kBAAA,MACX,GAAA,KAAQ,UAAA,IACR,YAAA,GAAe,CAAA,UAAW,CAAA,GAC1B,OAAA,GAAU,sBAAA,MACR,CAAA,EAAG,QAAA,CAAS,cAAA,CAAe,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { CrossFrameStateOptions } from "./useCrossFrameState.js";
2
- import * as react0 from "react";
2
+ import * as react1 from "react";
3
3
 
4
4
  //#region src/useCrossURLPathState.d.ts
5
- declare const useCrossURLPathState: (initialState?: string, options?: CrossFrameStateOptions) => [string, react0.Dispatch<react0.SetStateAction<string>>, () => void];
6
- declare const useCrossURLPathSetter: (initialState?: string) => [string, react0.Dispatch<react0.SetStateAction<string>>, () => void];
5
+ declare const useCrossURLPathState: (initialState?: string, options?: CrossFrameStateOptions) => [string, react1.Dispatch<react1.SetStateAction<string>>, () => void];
6
+ declare const useCrossURLPathSetter: (initialState?: string) => [string, react1.Dispatch<react1.SetStateAction<string>>, () => void];
7
7
  //#endregion
8
8
  export { useCrossURLPathSetter, useCrossURLPathState };
9
9
  //# sourceMappingURL=useCrossURLPathState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCrossURLPathState.d.ts","names":[],"sources":["../../src/useCrossURLPathState.tsx"],"sourcesContent":[],"mappings":";;;;cASa,wDAED,oCAAsB,MAAA,CAAA,SAAA,MAAA,CAAA;cAGrB,2DAA8C,MAAA,CAAA,SA8D1D,MAAA,CA9D0D"}
1
+ {"version":3,"file":"useCrossURLPathState.d.ts","names":[],"sources":["../../src/useCrossURLPathState.tsx"],"mappings":";;;;cASa,oBAAA,GACX,YAAA,WACA,OAAA,GAAU,sBAAA,cAAsB,MAAA,CAAA,QAAA,CAAA,MAAA,CAAA,cAAA;AAAA,cAGrB,qBAAA,GAAyB,YAAA,uBAAqB,MAAA,CAAA,QAAA,CA8D1D,MAAA,CA9D0D,cAAA"}
@@ -1,9 +1,9 @@
1
- import * as react5 from "react";
1
+ import * as react9 from "react";
2
2
  import { Locale } from "@intlayer/types";
3
3
 
4
4
  //#region src/useEditorLocale.d.ts
5
5
  declare const useEditorLocale: () => Locale;
6
- declare const useSetEditorLocale: () => [Locale, react5.Dispatch<react5.SetStateAction<Locale>>, () => void];
6
+ declare const useSetEditorLocale: () => [Locale, react9.Dispatch<react9.SetStateAction<Locale>>, () => void];
7
7
  //#endregion
8
8
  export { useEditorLocale, useSetEditorLocale };
9
9
  //# sourceMappingURL=useEditorLocale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEditorLocale.d.ts","names":[],"sources":["../../src/useEditorLocale.tsx"],"sourcesContent":[],"mappings":";;;;cAIa,uBAAe;cAaf,2BAAkB,QAAA,MAAA,CAAA,SAAA,MAAA,CAAA,eAAA"}
1
+ {"version":3,"file":"useEditorLocale.d.ts","names":[],"sources":["../../src/useEditorLocale.tsx"],"mappings":";;;;cAIa,eAAA,QAAe,MAAA;AAAA,cAaf,kBAAA,SAAkB,MAAA,EAAA,MAAA,CAAA,QAAA,CAAA,MAAA,CAAA,cAAA,CAAA,MAAA"}
@@ -1,11 +1,11 @@
1
1
  import { FileContent } from "./FocusDictionaryContext.js";
2
- import * as react3 from "react";
2
+ import * as react5 from "react";
3
3
  import { KeyPath } from "@intlayer/types";
4
4
 
5
5
  //#region src/useFocusUnmergedDictionary.d.ts
6
6
  declare const useFocusUnmergedDictionary: () => {
7
7
  focusedContent: FileContent;
8
- setFocusedContent: react3.Dispatch<react3.SetStateAction<FileContent>>;
8
+ setFocusedContent: react5.Dispatch<react5.SetStateAction<FileContent>>;
9
9
  setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
10
10
  };
11
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusUnmergedDictionary.d.ts","names":[],"sources":["../../src/useFocusUnmergedDictionary.tsx"],"sourcesContent":[],"mappings":";;;;;cAiDa;;;EAAA,wBAAA,EAAA,CAAA,OAmCZ,SAAA,EAAA,EAAA,GAAA,IAAA"}
1
+ {"version":3,"file":"useFocusUnmergedDictionary.d.ts","names":[],"sources":["../../src/useFocusUnmergedDictionary.tsx"],"mappings":";;;;;cAiDa,0BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIframeClickInterceptor.d.ts","names":[],"sources":["../../src/useIframeClickInterceptor.tsx"],"sourcesContent":[],"mappings":";cAMa;AAAA,cAgBA,oBAFZ,EAAA,GAAA,GAAA,CAAA,IAAA,CAAA,EAEgC,YAFhC,CAAA,GAAA,CAAA,EAAA,GAAA,IAAA"}
1
+ {"version":3,"file":"useIframeClickInterceptor.d.ts","names":[],"sources":["../../src/useIframeClickInterceptor.tsx"],"mappings":";cAMa,yBAAA;AAAA,cAgBA,oBAAA,SAAoB,IAAA,GAAA,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/editor-react",
3
- "version": "8.0.0-canary.0",
3
+ "version": "8.0.0-canary.2",
4
4
  "private": false,
5
5
  "description": "Provides the states, contexts, hooks and components to interact with the Intlayer editor for a React application",
6
6
  "keywords": [
@@ -71,11 +71,11 @@
71
71
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
72
72
  },
73
73
  "dependencies": {
74
- "@intlayer/config": "8.0.0-canary.0",
75
- "@intlayer/core": "8.0.0-canary.0",
76
- "@intlayer/editor": "8.0.0-canary.0",
77
- "@intlayer/types": "8.0.0-canary.0",
78
- "@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.0"
74
+ "@intlayer/config": "8.0.0-canary.2",
75
+ "@intlayer/core": "8.0.0-canary.2",
76
+ "@intlayer/editor": "8.0.0-canary.2",
77
+ "@intlayer/types": "8.0.0-canary.2",
78
+ "@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.2"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/node": "25.0.9",
@@ -87,9 +87,9 @@
87
87
  "react": ">=16.0.0",
88
88
  "react-dom": ">=16.0.0",
89
89
  "rimraf": "6.1.2",
90
- "tsdown": "0.19.0",
90
+ "tsdown": "0.20.0",
91
91
  "typescript": "5.9.3",
92
- "vitest": "4.0.17"
92
+ "vitest": "4.0.18"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "react": ">=16.0.0",