@intlayer/editor-react 4.0.5 → 4.1.1

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <a href="https://www.npmjs.com/package/intlayer">
2
+ <a href="https://intlayer.org">
3
3
  <img src="https://raw.githubusercontent.com/aymericzip/intlayer/572ae9c9acafb74307b81530c1931a8e98990aef/docs/assets/logo.png" width="500" alt="intlayer" />
4
4
  </a>
5
5
  </div>
@@ -14,7 +14,6 @@
14
14
  <a href="https://npmjs.org/package/intlayer">
15
15
  <img alt="types included" src="https://badgen.net/npm/types/intlayer?labelColor=49516F&color=8994BC"
16
16
  />
17
- </a>
18
17
  </div>
19
18
 
20
19
  # @intlayer/editor-react: React States, Contexts, Hooks and Components to interact with the Intlayer editor
@@ -27,22 +27,14 @@ module.exports = __toCommonJS(ConfigurationContext_exports);
27
27
  var import_jsx_runtime = require("react/jsx-runtime");
28
28
  var import_react = require("react");
29
29
  var import_useCrossFrameState = require('./useCrossFrameState.cjs');
30
- const ConfigurationStatesContext = (0, import_react.createContext)(void 0);
30
+ const ConfigurationStatesContext = (0, import_react.createContext)(
31
+ void 0
32
+ );
31
33
  const useConfigurationState = () => (0, import_useCrossFrameState.useCrossFrameState)("INTLAYER_CONFIGURATION", void 0, {
32
34
  receive: false,
33
35
  emit: true
34
36
  });
35
- const ConfigurationProvider = ({ children }) => {
36
- const [configuration] = (0, import_useCrossFrameState.useCrossFrameState)(
37
- "INTLAYER_CONFIGURATION",
38
- void 0,
39
- {
40
- emit: false,
41
- receive: true
42
- }
43
- );
44
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigurationStatesContext.Provider, { value: { configuration }, children });
45
- };
37
+ const ConfigurationProvider = ({ children, configuration }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigurationStatesContext.Provider, { value: configuration, children });
46
38
  const useConfiguration = () => {
47
39
  const statesContext = (0, import_react.useContext)(ConfigurationStatesContext);
48
40
  if (!statesContext) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ConfigurationContext.tsx"],"sourcesContent":["'use client';\n\nimport { type IntlayerConfig } from '@intlayer/config/client';\nimport { createContext, useContext, FC, PropsWithChildren } from 'react';\nimport { useCrossFrameState } from './useCrossFrameState';\n\ntype ConfigurationStatesContextType = {\n configuration: IntlayerConfig;\n};\n\nconst ConfigurationStatesContext = createContext<\n ConfigurationStatesContextType | undefined\n>(undefined);\n\nexport const useConfigurationState = () =>\n useCrossFrameState<IntlayerConfig>('INTLAYER_CONFIGURATION', undefined, {\n receive: false,\n emit: true,\n });\n\nexport const ConfigurationProvider: FC<PropsWithChildren> = ({ children }) => {\n const [configuration] = useCrossFrameState<IntlayerConfig>(\n 'INTLAYER_CONFIGURATION',\n undefined,\n {\n emit: false,\n receive: true,\n }\n );\n\n return (\n <ConfigurationStatesContext.Provider value={{ configuration }}>\n {children}\n </ConfigurationStatesContext.Provider>\n );\n};\n\nexport const useConfiguration = () => {\n const statesContext = useContext(ConfigurationStatesContext);\n\n if (!statesContext) {\n throw new Error(\n 'useConfigurationStates must be used within a ConfigurationProvider'\n );\n }\n\n return statesContext;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BI;AA5BJ,mBAAiE;AACjE,gCAAmC;AAMnC,MAAM,iCAA6B,4BAEjC,MAAS;AAEJ,MAAM,wBAAwB,UACnC,8CAAmC,0BAA0B,QAAW;AAAA,EACtE,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAEI,MAAM,wBAA+C,CAAC,EAAE,SAAS,MAAM;AAC5E,QAAM,CAAC,aAAa,QAAI;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAEA,SACE,4CAAC,2BAA2B,UAA3B,EAAoC,OAAO,EAAE,cAAc,GACzD,UACH;AAEJ;AAEO,MAAM,mBAAmB,MAAM;AACpC,QAAM,oBAAgB,yBAAW,0BAA0B;AAE3D,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/ConfigurationContext.tsx"],"sourcesContent":["'use client';\n\nimport { type IntlayerConfig } from '@intlayer/config/client';\nimport { createContext, useContext, FC, PropsWithChildren } from 'react';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nconst ConfigurationStatesContext = createContext<IntlayerConfig | undefined>(\n undefined\n);\n\nexport const useConfigurationState = () =>\n useCrossFrameState<IntlayerConfig>('INTLAYER_CONFIGURATION', undefined, {\n receive: false,\n emit: true,\n });\n\nexport type ConfigurationProviderProps = {\n configuration: IntlayerConfig;\n};\n\nexport const ConfigurationProvider: FC<\n PropsWithChildren<ConfigurationProviderProps>\n> = ({ children, configuration }) => (\n <ConfigurationStatesContext.Provider value={configuration}>\n {children}\n </ConfigurationStatesContext.Provider>\n);\n\nexport const useConfiguration = () => {\n const statesContext = useContext(ConfigurationStatesContext);\n\n if (!statesContext) {\n throw new Error(\n 'useConfigurationStates must be used within a ConfigurationProvider'\n );\n }\n\n return statesContext;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBE;AApBF,mBAAiE;AACjE,gCAAmC;AAEnC,MAAM,iCAA6B;AAAA,EACjC;AACF;AAEO,MAAM,wBAAwB,UACnC,8CAAmC,0BAA0B,QAAW;AAAA,EACtE,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAMI,MAAM,wBAET,CAAC,EAAE,UAAU,cAAc,MAC7B,4CAAC,2BAA2B,UAA3B,EAAoC,OAAO,eACzC,UACH;AAGK,MAAM,mBAAmB,MAAM;AACpC,QAAM,oBAAgB,yBAAW,0BAA0B;AAE3D,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -36,8 +36,9 @@ const EditorProviderEnabled = ({ mode, children }) => {
36
36
  const EditorProvider = ({
37
37
  children,
38
38
  mode,
39
+ configuration,
39
40
  ...props
40
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CommunicatorContext.CommunicatorProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditorEnabledContext.EditorEnabledProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ConfigurationContext.ConfigurationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditorProviderEnabled, { mode, children }) }) }) });
41
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CommunicatorContext.CommunicatorProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditorEnabledContext.EditorEnabledProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ConfigurationContext.ConfigurationProvider, { configuration, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditorProviderEnabled, { mode, children }) }) }) });
41
42
  // Annotate the CommonJS export names for ESM import in node:
42
43
  0 && (module.exports = {
43
44
  EditorProvider
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/EditorProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type PropsWithChildren } from 'react';\nimport {\n CommunicatorProvider,\n UseCrossPlatformStateProps,\n} from './CommunicatorContext';\nimport { ConfigurationProvider } from './ConfigurationContext';\nimport { DictionariesRecordProvider } from './DictionariesRecordContext';\nimport { EditedContentProvider } from './EditedContentContext';\nimport {\n EditorEnabledProvider,\n useEditorEnabled,\n} from './EditorEnabledContext';\nimport { FocusDictionaryProvider } from './FocusDictionaryContext';\n\ntype EditorProviderEnabledProps = {\n mode: 'editor' | 'client';\n};\n\nconst EditorProviderEnabled: FC<\n PropsWithChildren<EditorProviderEnabledProps>\n> = ({ mode, children }) => {\n const { enabled } = useEditorEnabled();\n\n return enabled || mode === 'editor' ? (\n <DictionariesRecordProvider>\n <EditedContentProvider>\n <FocusDictionaryProvider>{children}</FocusDictionaryProvider>\n </EditedContentProvider>\n </DictionariesRecordProvider>\n ) : (\n children\n );\n};\n\ntype EditorProviderProps = UseCrossPlatformStateProps &\n EditorProviderEnabledProps;\n\nexport const EditorProvider: FC<PropsWithChildren<EditorProviderProps>> = ({\n children,\n mode,\n ...props\n}) => (\n <CommunicatorProvider {...props}>\n <EditorEnabledProvider>\n <ConfigurationProvider>\n <EditorProviderEnabled mode={mode}>{children}</EditorProviderEnabled>\n </ConfigurationProvider>\n </EditorEnabledProvider>\n </CommunicatorProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BQ;AAzBR,iCAGO;AACP,kCAAsC;AACtC,uCAA2C;AAC3C,kCAAsC;AACtC,kCAGO;AACP,oCAAwC;AAMxC,MAAM,wBAEF,CAAC,EAAE,MAAM,SAAS,MAAM;AAC1B,QAAM,EAAE,QAAQ,QAAI,8CAAiB;AAErC,SAAO,WAAW,SAAS,WACzB,4CAAC,+DACC,sDAAC,qDACC,sDAAC,yDAAyB,UAAS,GACrC,GACF,IAEA;AAEJ;AAKO,MAAM,iBAA6D,CAAC;AAAA,EACzE;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,4CAAC,mDAAsB,GAAG,OACxB,sDAAC,qDACC,sDAAC,qDACC,sDAAC,yBAAsB,MAAa,UAAS,GAC/C,GACF,GACF;","names":[]}
1
+ {"version":3,"sources":["../../src/EditorProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type PropsWithChildren } from 'react';\nimport {\n CommunicatorProvider,\n UseCrossPlatformStateProps,\n} from './CommunicatorContext';\nimport {\n ConfigurationProvider,\n ConfigurationProviderProps,\n} from './ConfigurationContext';\nimport { DictionariesRecordProvider } from './DictionariesRecordContext';\nimport { EditedContentProvider } from './EditedContentContext';\nimport {\n EditorEnabledProvider,\n useEditorEnabled,\n} from './EditorEnabledContext';\nimport { FocusDictionaryProvider } from './FocusDictionaryContext';\n\ntype EditorProviderEnabledProps = {\n mode: 'editor' | 'client';\n};\n\nconst EditorProviderEnabled: FC<\n PropsWithChildren<EditorProviderEnabledProps>\n> = ({ mode, children }) => {\n const { enabled } = useEditorEnabled();\n\n return enabled || mode === 'editor' ? (\n <DictionariesRecordProvider>\n <EditedContentProvider>\n <FocusDictionaryProvider>{children}</FocusDictionaryProvider>\n </EditedContentProvider>\n </DictionariesRecordProvider>\n ) : (\n children\n );\n};\n\ntype EditorProviderProps = UseCrossPlatformStateProps &\n EditorProviderEnabledProps &\n ConfigurationProviderProps;\n\nexport const EditorProvider: FC<PropsWithChildren<EditorProviderProps>> = ({\n children,\n mode,\n configuration,\n ...props\n}) => (\n <CommunicatorProvider {...props}>\n <EditorEnabledProvider>\n <ConfigurationProvider configuration={configuration}>\n <EditorProviderEnabled mode={mode}>{children}</EditorProviderEnabled>\n </ConfigurationProvider>\n </EditorEnabledProvider>\n </CommunicatorProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BQ;AA5BR,iCAGO;AACP,kCAGO;AACP,uCAA2C;AAC3C,kCAAsC;AACtC,kCAGO;AACP,oCAAwC;AAMxC,MAAM,wBAEF,CAAC,EAAE,MAAM,SAAS,MAAM;AAC1B,QAAM,EAAE,QAAQ,QAAI,8CAAiB;AAErC,SAAO,WAAW,SAAS,WACzB,4CAAC,+DACC,sDAAC,qDACC,sDAAC,yDAAyB,UAAS,GACrC,GACF,IAEA;AAEJ;AAMO,MAAM,iBAA6D,CAAC;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,4CAAC,mDAAsB,GAAG,OACxB,sDAAC,qDACC,sDAAC,qDAAsB,eACrB,sDAAC,yBAAsB,MAAa,UAAS,GAC/C,GACF,GACF;","names":[]}
@@ -2,22 +2,14 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { createContext, useContext } from "react";
4
4
  import { useCrossFrameState } from "./useCrossFrameState.mjs";
5
- const ConfigurationStatesContext = createContext(void 0);
5
+ const ConfigurationStatesContext = createContext(
6
+ void 0
7
+ );
6
8
  const useConfigurationState = () => useCrossFrameState("INTLAYER_CONFIGURATION", void 0, {
7
9
  receive: false,
8
10
  emit: true
9
11
  });
10
- const ConfigurationProvider = ({ children }) => {
11
- const [configuration] = useCrossFrameState(
12
- "INTLAYER_CONFIGURATION",
13
- void 0,
14
- {
15
- emit: false,
16
- receive: true
17
- }
18
- );
19
- return /* @__PURE__ */ jsx(ConfigurationStatesContext.Provider, { value: { configuration }, children });
20
- };
12
+ const ConfigurationProvider = ({ children, configuration }) => /* @__PURE__ */ jsx(ConfigurationStatesContext.Provider, { value: configuration, children });
21
13
  const useConfiguration = () => {
22
14
  const statesContext = useContext(ConfigurationStatesContext);
23
15
  if (!statesContext) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ConfigurationContext.tsx"],"sourcesContent":["'use client';\n\nimport { type IntlayerConfig } from '@intlayer/config/client';\nimport { createContext, useContext, FC, PropsWithChildren } from 'react';\nimport { useCrossFrameState } from './useCrossFrameState';\n\ntype ConfigurationStatesContextType = {\n configuration: IntlayerConfig;\n};\n\nconst ConfigurationStatesContext = createContext<\n ConfigurationStatesContextType | undefined\n>(undefined);\n\nexport const useConfigurationState = () =>\n useCrossFrameState<IntlayerConfig>('INTLAYER_CONFIGURATION', undefined, {\n receive: false,\n emit: true,\n });\n\nexport const ConfigurationProvider: FC<PropsWithChildren> = ({ children }) => {\n const [configuration] = useCrossFrameState<IntlayerConfig>(\n 'INTLAYER_CONFIGURATION',\n undefined,\n {\n emit: false,\n receive: true,\n }\n );\n\n return (\n <ConfigurationStatesContext.Provider value={{ configuration }}>\n {children}\n </ConfigurationStatesContext.Provider>\n );\n};\n\nexport const useConfiguration = () => {\n const statesContext = useContext(ConfigurationStatesContext);\n\n if (!statesContext) {\n throw new Error(\n 'useConfigurationStates must be used within a ConfigurationProvider'\n );\n }\n\n return statesContext;\n};\n"],"mappings":";AA+BI;AA5BJ,SAAS,eAAe,kBAAyC;AACjE,SAAS,0BAA0B;AAMnC,MAAM,6BAA6B,cAEjC,MAAS;AAEJ,MAAM,wBAAwB,MACnC,mBAAmC,0BAA0B,QAAW;AAAA,EACtE,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAEI,MAAM,wBAA+C,CAAC,EAAE,SAAS,MAAM;AAC5E,QAAM,CAAC,aAAa,IAAI;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAEA,SACE,oBAAC,2BAA2B,UAA3B,EAAoC,OAAO,EAAE,cAAc,GACzD,UACH;AAEJ;AAEO,MAAM,mBAAmB,MAAM;AACpC,QAAM,gBAAgB,WAAW,0BAA0B;AAE3D,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/ConfigurationContext.tsx"],"sourcesContent":["'use client';\n\nimport { type IntlayerConfig } from '@intlayer/config/client';\nimport { createContext, useContext, FC, PropsWithChildren } from 'react';\nimport { useCrossFrameState } from './useCrossFrameState';\n\nconst ConfigurationStatesContext = createContext<IntlayerConfig | undefined>(\n undefined\n);\n\nexport const useConfigurationState = () =>\n useCrossFrameState<IntlayerConfig>('INTLAYER_CONFIGURATION', undefined, {\n receive: false,\n emit: true,\n });\n\nexport type ConfigurationProviderProps = {\n configuration: IntlayerConfig;\n};\n\nexport const ConfigurationProvider: FC<\n PropsWithChildren<ConfigurationProviderProps>\n> = ({ children, configuration }) => (\n <ConfigurationStatesContext.Provider value={configuration}>\n {children}\n </ConfigurationStatesContext.Provider>\n);\n\nexport const useConfiguration = () => {\n const statesContext = useContext(ConfigurationStatesContext);\n\n if (!statesContext) {\n throw new Error(\n 'useConfigurationStates must be used within a ConfigurationProvider'\n );\n }\n\n return statesContext;\n};\n"],"mappings":";AAuBE;AApBF,SAAS,eAAe,kBAAyC;AACjE,SAAS,0BAA0B;AAEnC,MAAM,6BAA6B;AAAA,EACjC;AACF;AAEO,MAAM,wBAAwB,MACnC,mBAAmC,0BAA0B,QAAW;AAAA,EACtE,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAMI,MAAM,wBAET,CAAC,EAAE,UAAU,cAAc,MAC7B,oBAAC,2BAA2B,UAA3B,EAAoC,OAAO,eACzC,UACH;AAGK,MAAM,mBAAmB,MAAM;AACpC,QAAM,gBAAgB,WAAW,0BAA0B;AAE3D,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -3,7 +3,9 @@ import { jsx } from "react/jsx-runtime";
3
3
  import {
4
4
  CommunicatorProvider
5
5
  } from "./CommunicatorContext.mjs";
6
- import { ConfigurationProvider } from "./ConfigurationContext.mjs";
6
+ import {
7
+ ConfigurationProvider
8
+ } from "./ConfigurationContext.mjs";
7
9
  import { DictionariesRecordProvider } from "./DictionariesRecordContext.mjs";
8
10
  import { EditedContentProvider } from "./EditedContentContext.mjs";
9
11
  import {
@@ -18,8 +20,9 @@ const EditorProviderEnabled = ({ mode, children }) => {
18
20
  const EditorProvider = ({
19
21
  children,
20
22
  mode,
23
+ configuration,
21
24
  ...props
22
- }) => /* @__PURE__ */ jsx(CommunicatorProvider, { ...props, children: /* @__PURE__ */ jsx(EditorEnabledProvider, { children: /* @__PURE__ */ jsx(ConfigurationProvider, { children: /* @__PURE__ */ jsx(EditorProviderEnabled, { mode, children }) }) }) });
25
+ }) => /* @__PURE__ */ jsx(CommunicatorProvider, { ...props, children: /* @__PURE__ */ jsx(EditorEnabledProvider, { children: /* @__PURE__ */ jsx(ConfigurationProvider, { configuration, children: /* @__PURE__ */ jsx(EditorProviderEnabled, { mode, children }) }) }) });
23
26
  export {
24
27
  EditorProvider
25
28
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/EditorProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type PropsWithChildren } from 'react';\nimport {\n CommunicatorProvider,\n UseCrossPlatformStateProps,\n} from './CommunicatorContext';\nimport { ConfigurationProvider } from './ConfigurationContext';\nimport { DictionariesRecordProvider } from './DictionariesRecordContext';\nimport { EditedContentProvider } from './EditedContentContext';\nimport {\n EditorEnabledProvider,\n useEditorEnabled,\n} from './EditorEnabledContext';\nimport { FocusDictionaryProvider } from './FocusDictionaryContext';\n\ntype EditorProviderEnabledProps = {\n mode: 'editor' | 'client';\n};\n\nconst EditorProviderEnabled: FC<\n PropsWithChildren<EditorProviderEnabledProps>\n> = ({ mode, children }) => {\n const { enabled } = useEditorEnabled();\n\n return enabled || mode === 'editor' ? (\n <DictionariesRecordProvider>\n <EditedContentProvider>\n <FocusDictionaryProvider>{children}</FocusDictionaryProvider>\n </EditedContentProvider>\n </DictionariesRecordProvider>\n ) : (\n children\n );\n};\n\ntype EditorProviderProps = UseCrossPlatformStateProps &\n EditorProviderEnabledProps;\n\nexport const EditorProvider: FC<PropsWithChildren<EditorProviderProps>> = ({\n children,\n mode,\n ...props\n}) => (\n <CommunicatorProvider {...props}>\n <EditorEnabledProvider>\n <ConfigurationProvider>\n <EditorProviderEnabled mode={mode}>{children}</EditorProviderEnabled>\n </ConfigurationProvider>\n </EditorEnabledProvider>\n </CommunicatorProvider>\n);\n"],"mappings":";AA4BQ;AAzBR;AAAA,EACE;AAAA,OAEK;AACP,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,+BAA+B;AAMxC,MAAM,wBAEF,CAAC,EAAE,MAAM,SAAS,MAAM;AAC1B,QAAM,EAAE,QAAQ,IAAI,iBAAiB;AAErC,SAAO,WAAW,SAAS,WACzB,oBAAC,8BACC,8BAAC,yBACC,8BAAC,2BAAyB,UAAS,GACrC,GACF,IAEA;AAEJ;AAKO,MAAM,iBAA6D,CAAC;AAAA,EACzE;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,oBAAC,wBAAsB,GAAG,OACxB,8BAAC,yBACC,8BAAC,yBACC,8BAAC,yBAAsB,MAAa,UAAS,GAC/C,GACF,GACF;","names":[]}
1
+ {"version":3,"sources":["../../src/EditorProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type PropsWithChildren } from 'react';\nimport {\n CommunicatorProvider,\n UseCrossPlatformStateProps,\n} from './CommunicatorContext';\nimport {\n ConfigurationProvider,\n ConfigurationProviderProps,\n} from './ConfigurationContext';\nimport { DictionariesRecordProvider } from './DictionariesRecordContext';\nimport { EditedContentProvider } from './EditedContentContext';\nimport {\n EditorEnabledProvider,\n useEditorEnabled,\n} from './EditorEnabledContext';\nimport { FocusDictionaryProvider } from './FocusDictionaryContext';\n\ntype EditorProviderEnabledProps = {\n mode: 'editor' | 'client';\n};\n\nconst EditorProviderEnabled: FC<\n PropsWithChildren<EditorProviderEnabledProps>\n> = ({ mode, children }) => {\n const { enabled } = useEditorEnabled();\n\n return enabled || mode === 'editor' ? (\n <DictionariesRecordProvider>\n <EditedContentProvider>\n <FocusDictionaryProvider>{children}</FocusDictionaryProvider>\n </EditedContentProvider>\n </DictionariesRecordProvider>\n ) : (\n children\n );\n};\n\ntype EditorProviderProps = UseCrossPlatformStateProps &\n EditorProviderEnabledProps &\n ConfigurationProviderProps;\n\nexport const EditorProvider: FC<PropsWithChildren<EditorProviderProps>> = ({\n children,\n mode,\n configuration,\n ...props\n}) => (\n <CommunicatorProvider {...props}>\n <EditorEnabledProvider>\n <ConfigurationProvider configuration={configuration}>\n <EditorProviderEnabled mode={mode}>{children}</EditorProviderEnabled>\n </ConfigurationProvider>\n </EditorEnabledProvider>\n </CommunicatorProvider>\n);\n"],"mappings":";AA+BQ;AA5BR;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,kCAAkC;AAC3C,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,+BAA+B;AAMxC,MAAM,wBAEF,CAAC,EAAE,MAAM,SAAS,MAAM;AAC1B,QAAM,EAAE,QAAQ,IAAI,iBAAiB;AAErC,SAAO,WAAW,SAAS,WACzB,oBAAC,8BACC,8BAAC,yBACC,8BAAC,2BAAyB,UAAS,GACrC,GACF,IAEA;AAEJ;AAMO,MAAM,iBAA6D,CAAC;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,oBAAC,wBAAsB,GAAG,OACxB,8BAAC,yBACC,8BAAC,yBAAsB,eACrB,8BAAC,yBAAsB,MAAa,UAAS,GAC/C,GACF,GACF;","names":[]}
@@ -1,10 +1,9 @@
1
1
  import { type IntlayerConfig } from '@intlayer/config/client';
2
2
  import { FC, PropsWithChildren } from 'react';
3
- type ConfigurationStatesContextType = {
3
+ export declare const useConfigurationState: () => [IntlayerConfig, import("react").Dispatch<import("react").SetStateAction<IntlayerConfig>>];
4
+ export type ConfigurationProviderProps = {
4
5
  configuration: IntlayerConfig;
5
6
  };
6
- export declare const useConfigurationState: () => [IntlayerConfig, import("react").Dispatch<import("react").SetStateAction<IntlayerConfig>>];
7
- export declare const ConfigurationProvider: FC<PropsWithChildren>;
8
- export declare const useConfiguration: () => ConfigurationStatesContextType;
9
- export {};
7
+ export declare const ConfigurationProvider: FC<PropsWithChildren<ConfigurationProviderProps>>;
8
+ export declare const useConfiguration: () => IntlayerConfig;
10
9
  //# 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;AAC9D,OAAO,EAA6B,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGzE,KAAK,8BAA8B,GAAG;IACpC,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC;AAMF,eAAO,MAAM,qBAAqB,kGAI9B,CAAC;AAEL,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAevD,CAAC;AAEF,eAAO,MAAM,gBAAgB,sCAU5B,CAAC"}
1
+ {"version":3,"file":"ConfigurationContext.d.ts","sourceRoot":"","sources":["../../src/ConfigurationContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAA6B,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAOzE,eAAO,MAAM,qBAAqB,kGAI9B,CAAC;AAEL,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CACpC,iBAAiB,CAAC,0BAA0B,CAAC,CAK9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,sBAU5B,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { type FC, type PropsWithChildren } from 'react';
2
2
  import { UseCrossPlatformStateProps } from './CommunicatorContext';
3
+ import { ConfigurationProviderProps } from './ConfigurationContext';
3
4
  type EditorProviderEnabledProps = {
4
5
  mode: 'editor' | 'client';
5
6
  };
6
- type EditorProviderProps = UseCrossPlatformStateProps & EditorProviderEnabledProps;
7
+ type EditorProviderProps = UseCrossPlatformStateProps & EditorProviderEnabledProps & ConfigurationProviderProps;
7
8
  export declare const EditorProvider: FC<PropsWithChildren<EditorProviderProps>>;
8
9
  export {};
9
10
  //# sourceMappingURL=EditorProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorProvider.d.ts","sourceRoot":"","sources":["../../src/EditorProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AAU/B,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC3B,CAAC;AAkBF,KAAK,mBAAmB,GAAG,0BAA0B,GACnD,0BAA0B,CAAC;AAE7B,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAYrE,CAAC"}
1
+ {"version":3,"file":"EditorProvider.d.ts","sourceRoot":"","sources":["../../src/EditorProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,0BAA0B,EAC3B,MAAM,wBAAwB,CAAC;AAShC,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC3B,CAAC;AAkBF,KAAK,mBAAmB,GAAG,0BAA0B,GACnD,0BAA0B,GAC1B,0BAA0B,CAAC;AAE7B,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAarE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/editor-react",
3
- "version": "4.0.5",
3
+ "version": "4.1.1",
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": [
@@ -51,9 +51,9 @@
51
51
  "./package.json"
52
52
  ],
53
53
  "dependencies": {
54
- "@intlayer/editor": "4.0.5",
55
- "@intlayer/config": "^4.0.5",
56
- "@intlayer/core": "4.0.5"
54
+ "@intlayer/config": "^4.1.1",
55
+ "@intlayer/core": "4.1.1",
56
+ "@intlayer/editor": "4.1.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/node": "^22.10.6",
@@ -67,17 +67,17 @@
67
67
  "tsc-alias": "^1.8.10",
68
68
  "tsup": "^8.3.5",
69
69
  "typescript": "^5.7.3",
70
- "@utils/ts-config": "1.0.4",
71
- "@utils/ts-config-types": "1.0.4",
72
70
  "@utils/eslint-config": "1.0.4",
73
- "@utils/tsup-config": "1.0.4"
71
+ "@utils/tsup-config": "1.0.4",
72
+ "@utils/ts-config-types": "1.0.4",
73
+ "@utils/ts-config": "1.0.4"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": ">=18.3.1",
77
77
  "react-dom": ">=18.3.1",
78
- "@intlayer/core": "^4.0.5",
79
- "@intlayer/editor": "4.0.5",
80
- "@intlayer/config": "4.0.5"
78
+ "@intlayer/config": "4.1.1",
79
+ "@intlayer/core": "^4.1.1",
80
+ "@intlayer/editor": "4.1.1"
81
81
  },
82
82
  "engines": {
83
83
  "node": ">=14.18"