react-intlayer 2.0.7 → 2.0.8

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.
@@ -22,15 +22,16 @@ __export(ContentEditionLayout_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(ContentEditionLayout_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
+ const import_meta = {};
25
26
  const BlankLayout = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
26
- const requireFunction = (packagePath) => {
27
+ const requireFunction = () => {
27
28
  try {
28
- return typeof require === "undefined" ? import(packagePath) : require(packagePath);
29
+ return typeof import_meta.url === "undefined" ? require("intlayer-editor/client") : module.require("intlayer-editor/client");
29
30
  } catch (error) {
30
31
  return void 0;
31
32
  }
32
33
  };
33
- const ContentEditionLayout = typeof requireFunction("intlayer-editor/client")?.ContentEditionLayoutBase === "undefined" ? BlankLayout : requireFunction("intlayer-editor/client").ContentEditionLayoutBase;
34
+ const ContentEditionLayout = typeof requireFunction()?.ContentEditionLayoutBase === "undefined" ? BlankLayout : requireFunction().ContentEditionLayoutBase;
34
35
  // Annotate the CommonJS export names for ESM import in node:
35
36
  0 && (module.exports = {
36
37
  ContentEditionLayout
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/ContentEditionLayout.tsx"],"sourcesContent":["import type { ContentEditionLayoutProps } from 'intlayer-editor/client';\nimport type { FC } from 'react';\n\nconst BlankLayout: FC<ContentEditionLayoutProps> = ({ children }) => (\n <>{children}</>\n);\n\nconst requireFunction = (packagePath: string) => {\n try {\n return typeof require === 'undefined'\n ? import(packagePath)\n : require(packagePath);\n } catch (error) {\n return undefined;\n }\n};\n// intlayer-editor is an optional dependency. If it's not installed, return the blank layout\nexport const ContentEditionLayout: FC<ContentEditionLayoutProps> =\n typeof requireFunction('intlayer-editor/client')?.ContentEditionLayoutBase ===\n 'undefined'\n ? BlankLayout\n : requireFunction('intlayer-editor/client').ContentEditionLayoutBase;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIE;AADF,MAAM,cAA6C,CAAC,EAAE,SAAS,MAC7D,2EAAG,UAAS;AAGd,MAAM,kBAAkB,CAAC,gBAAwB;AAC/C,MAAI;AACF,WAAO,OAAO,YAAY,cACtB,OAAO,eACP,QAAQ,WAAW;AAAA,EACzB,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEO,MAAM,uBACX,OAAO,gBAAgB,wBAAwB,GAAG,6BAClD,cACI,cACA,gBAAgB,wBAAwB,EAAE;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/ContentEditionLayout.tsx"],"sourcesContent":["import type { ContentEditionLayoutProps } from 'intlayer-editor/client';\nimport type { FC } from 'react';\n\nconst BlankLayout: FC<ContentEditionLayoutProps> = ({ children }) => (\n <>{children}</>\n);\n\nconst requireFunction = () => {\n try {\n return typeof import.meta.url === 'undefined'\n ? require('intlayer-editor/client')\n : module.require('intlayer-editor/client');\n } catch (error) {\n return undefined;\n }\n};\n// intlayer-editor is an optional dependency. If it's not installed, return the blank layout\nexport const ContentEditionLayout: FC<ContentEditionLayoutProps> =\n typeof requireFunction()?.ContentEditionLayoutBase === 'undefined'\n ? BlankLayout\n : requireFunction().ContentEditionLayoutBase;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIE;AAJF;AAGA,MAAM,cAA6C,CAAC,EAAE,SAAS,MAC7D,2EAAG,UAAS;AAGd,MAAM,kBAAkB,MAAM;AAC5B,MAAI;AACF,WAAO,OAAO,YAAY,QAAQ,cAC9B,QAAQ,wBAAwB,IAChC,OAAO,QAAQ,wBAAwB;AAAA,EAC7C,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEO,MAAM,uBACX,OAAO,gBAAgB,GAAG,6BAA6B,cACnD,cACA,gBAAgB,EAAE;","names":[]}
@@ -22,9 +22,10 @@ __export(renderIntlayerEditor_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(renderIntlayerEditor_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
- const requireFunction = (packagePath) => {
25
+ const import_meta = {};
26
+ const requireFunction = () => {
26
27
  try {
27
- return typeof require === "undefined" ? import(packagePath) : require(packagePath);
28
+ return typeof import_meta.url === "undefined" ? require("intlayer-editor/client") : module.require("intlayer-editor/client");
28
29
  } catch (error) {
29
30
  return void 0;
30
31
  }
@@ -32,14 +33,9 @@ const requireFunction = (packagePath) => {
32
33
  const IntlayerEditorElement = ({
33
34
  content,
34
35
  ..._props
35
- }) => {
36
- return content;
37
- };
38
- IntlayerEditorElement.content = "";
36
+ }) => content;
39
37
  const renderIntlayerEditor = (props) => {
40
- const _renderIntlayerEditor = requireFunction(
41
- "intlayer-editor/client"
42
- )?.renderIntlayerEditor;
38
+ const _renderIntlayerEditor = requireFunction()?.renderIntlayerEditor;
43
39
  if (typeof _renderIntlayerEditor === "undefined") {
44
40
  const Result = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IntlayerEditorElement, { ...props });
45
41
  return { ...Result, value: props.content };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/renderIntlayerEditor.tsx"],"sourcesContent":["import type { IntlayerEditorElementProps } from 'intlayer-editor/client';\n\nconst requireFunction = (packagePath: string) => {\n try {\n return typeof require === 'undefined'\n ? import(packagePath)\n : require(packagePath);\n } catch (error) {\n return undefined;\n }\n};\n\nconst IntlayerEditorElement = ({\n content,\n ..._props\n}: IntlayerEditorElementProps) => {\n return content;\n};\n\nIntlayerEditorElement.content = '';\n\nexport const renderIntlayerEditor = (props: IntlayerEditorElementProps) => {\n const _renderIntlayerEditor = requireFunction(\n 'intlayer-editor/client'\n )?.renderIntlayerEditor;\n\n if (typeof _renderIntlayerEditor === 'undefined') {\n const Result = <IntlayerEditorElement {...props} />;\n\n return { ...Result, value: props.content };\n }\n\n return _renderIntlayerEditor(props);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BmB;AAzBnB,MAAM,kBAAkB,CAAC,gBAAwB;AAC/C,MAAI;AACF,WAAO,OAAO,YAAY,cACtB,OAAO,eACP,QAAQ,WAAW;AAAA,EACzB,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEA,MAAM,wBAAwB,CAAC;AAAA,EAC7B;AAAA,EACA,GAAG;AACL,MAAkC;AAChC,SAAO;AACT;AAEA,sBAAsB,UAAU;AAEzB,MAAM,uBAAuB,CAAC,UAAsC;AACzE,QAAM,wBAAwB;AAAA,IAC5B;AAAA,EACF,GAAG;AAEH,MAAI,OAAO,0BAA0B,aAAa;AAChD,UAAM,SAAS,4CAAC,yBAAuB,GAAG,OAAO;AAEjD,WAAO,EAAE,GAAG,QAAQ,OAAO,MAAM,QAAQ;AAAA,EAC3C;AAEA,SAAO,sBAAsB,KAAK;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../src/renderIntlayerEditor.tsx"],"sourcesContent":["import type {\n IntlayerEditorElementProps,\n RenderIntlayerEditorResult,\n} from 'intlayer-editor/client';\nimport type { FC } from 'react';\n\nconst requireFunction = () => {\n try {\n return typeof import.meta.url === 'undefined'\n ? require('intlayer-editor/client')\n : module.require('intlayer-editor/client');\n } catch (error) {\n return undefined;\n }\n};\n\nconst IntlayerEditorElement: FC<IntlayerEditorElementProps> = ({\n content,\n ..._props\n}) => content;\n\nexport const renderIntlayerEditor = (\n props: IntlayerEditorElementProps\n): RenderIntlayerEditorResult => {\n const _renderIntlayerEditor = requireFunction()?.renderIntlayerEditor;\n\n if (typeof _renderIntlayerEditor === 'undefined') {\n const Result = <IntlayerEditorElement {...props} />;\n\n return { ...Result, value: props.content };\n }\n\n return _renderIntlayerEditor(props);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BmB;AA3BnB;AAMA,MAAM,kBAAkB,MAAM;AAC5B,MAAI;AACF,WAAO,OAAO,YAAY,QAAQ,cAC9B,QAAQ,wBAAwB,IAChC,OAAO,QAAQ,wBAAwB;AAAA,EAC7C,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEA,MAAM,wBAAwD,CAAC;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,MAAM;AAEC,MAAM,uBAAuB,CAClC,UAC+B;AAC/B,QAAM,wBAAwB,gBAAgB,GAAG;AAEjD,MAAI,OAAO,0BAA0B,aAAa;AAChD,UAAM,SAAS,4CAAC,yBAAuB,GAAG,OAAO;AAEjD,WAAO,EAAE,GAAG,QAAQ,OAAO,MAAM,QAAQ;AAAA,EAC3C;AAEA,SAAO,sBAAsB,KAAK;AACpC;","names":[]}
@@ -1,5 +1,5 @@
1
- import { IntlayerEditorElementProps } from 'intlayer-editor/client';
1
+ import { IntlayerEditorElementProps, RenderIntlayerEditorResult } from 'intlayer-editor/client';
2
2
 
3
- declare const renderIntlayerEditor: (props: IntlayerEditorElementProps) => any;
3
+ declare const renderIntlayerEditor: (props: IntlayerEditorElementProps) => RenderIntlayerEditorResult;
4
4
 
5
5
  export { renderIntlayerEditor };
@@ -1,14 +1,14 @@
1
1
  import "../chunk-ZD7AOCMD.mjs";
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  const BlankLayout = ({ children }) => /* @__PURE__ */ jsx(Fragment, { children });
4
- const requireFunction = (packagePath) => {
4
+ const requireFunction = () => {
5
5
  try {
6
- return typeof require === "undefined" ? import(packagePath) : require(packagePath);
6
+ return typeof import.meta.url === "undefined" ? require("intlayer-editor/client") : module.require("intlayer-editor/client");
7
7
  } catch (error) {
8
8
  return void 0;
9
9
  }
10
10
  };
11
- const ContentEditionLayout = typeof requireFunction("intlayer-editor/client")?.ContentEditionLayoutBase === "undefined" ? BlankLayout : requireFunction("intlayer-editor/client").ContentEditionLayoutBase;
11
+ const ContentEditionLayout = typeof requireFunction()?.ContentEditionLayoutBase === "undefined" ? BlankLayout : requireFunction().ContentEditionLayoutBase;
12
12
  export {
13
13
  ContentEditionLayout
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/ContentEditionLayout.tsx"],"sourcesContent":["import type { ContentEditionLayoutProps } from 'intlayer-editor/client';\nimport type { FC } from 'react';\n\nconst BlankLayout: FC<ContentEditionLayoutProps> = ({ children }) => (\n <>{children}</>\n);\n\nconst requireFunction = (packagePath: string) => {\n try {\n return typeof require === 'undefined'\n ? import(packagePath)\n : require(packagePath);\n } catch (error) {\n return undefined;\n }\n};\n// intlayer-editor is an optional dependency. If it's not installed, return the blank layout\nexport const ContentEditionLayout: FC<ContentEditionLayoutProps> =\n typeof requireFunction('intlayer-editor/client')?.ContentEditionLayoutBase ===\n 'undefined'\n ? BlankLayout\n : requireFunction('intlayer-editor/client').ContentEditionLayoutBase;\n"],"mappings":";AAIE;AADF,MAAM,cAA6C,CAAC,EAAE,SAAS,MAC7D,gCAAG,UAAS;AAGd,MAAM,kBAAkB,CAAC,gBAAwB;AAC/C,MAAI;AACF,WAAO,OAAO,YAAY,cACtB,OAAO,eACP,QAAQ,WAAW;AAAA,EACzB,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEO,MAAM,uBACX,OAAO,gBAAgB,wBAAwB,GAAG,6BAClD,cACI,cACA,gBAAgB,wBAAwB,EAAE;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/ContentEditionLayout.tsx"],"sourcesContent":["import type { ContentEditionLayoutProps } from 'intlayer-editor/client';\nimport type { FC } from 'react';\n\nconst BlankLayout: FC<ContentEditionLayoutProps> = ({ children }) => (\n <>{children}</>\n);\n\nconst requireFunction = () => {\n try {\n return typeof import.meta.url === 'undefined'\n ? require('intlayer-editor/client')\n : module.require('intlayer-editor/client');\n } catch (error) {\n return undefined;\n }\n};\n// intlayer-editor is an optional dependency. If it's not installed, return the blank layout\nexport const ContentEditionLayout: FC<ContentEditionLayoutProps> =\n typeof requireFunction()?.ContentEditionLayoutBase === 'undefined'\n ? BlankLayout\n : requireFunction().ContentEditionLayoutBase;\n"],"mappings":";AAIE;AADF,MAAM,cAA6C,CAAC,EAAE,SAAS,MAC7D,gCAAG,UAAS;AAGd,MAAM,kBAAkB,MAAM;AAC5B,MAAI;AACF,WAAO,OAAO,YAAY,QAAQ,cAC9B,QAAQ,wBAAwB,IAChC,OAAO,QAAQ,wBAAwB;AAAA,EAC7C,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEO,MAAM,uBACX,OAAO,gBAAgB,GAAG,6BAA6B,cACnD,cACA,gBAAgB,EAAE;","names":[]}
@@ -1,5 +1,5 @@
1
- import { IntlayerEditorElementProps } from 'intlayer-editor/client';
1
+ import { IntlayerEditorElementProps, RenderIntlayerEditorResult } from 'intlayer-editor/client';
2
2
 
3
- declare const renderIntlayerEditor: (props: IntlayerEditorElementProps) => any;
3
+ declare const renderIntlayerEditor: (props: IntlayerEditorElementProps) => RenderIntlayerEditorResult;
4
4
 
5
5
  export { renderIntlayerEditor };
@@ -1,8 +1,8 @@
1
1
  import "./chunk-ZD7AOCMD.mjs";
2
2
  import { jsx } from "react/jsx-runtime";
3
- const requireFunction = (packagePath) => {
3
+ const requireFunction = () => {
4
4
  try {
5
- return typeof require === "undefined" ? import(packagePath) : require(packagePath);
5
+ return typeof import.meta.url === "undefined" ? require("intlayer-editor/client") : module.require("intlayer-editor/client");
6
6
  } catch (error) {
7
7
  return void 0;
8
8
  }
@@ -10,14 +10,9 @@ const requireFunction = (packagePath) => {
10
10
  const IntlayerEditorElement = ({
11
11
  content,
12
12
  ..._props
13
- }) => {
14
- return content;
15
- };
16
- IntlayerEditorElement.content = "";
13
+ }) => content;
17
14
  const renderIntlayerEditor = (props) => {
18
- const _renderIntlayerEditor = requireFunction(
19
- "intlayer-editor/client"
20
- )?.renderIntlayerEditor;
15
+ const _renderIntlayerEditor = requireFunction()?.renderIntlayerEditor;
21
16
  if (typeof _renderIntlayerEditor === "undefined") {
22
17
  const Result = /* @__PURE__ */ jsx(IntlayerEditorElement, { ...props });
23
18
  return { ...Result, value: props.content };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/renderIntlayerEditor.tsx"],"sourcesContent":["import type { IntlayerEditorElementProps } from 'intlayer-editor/client';\n\nconst requireFunction = (packagePath: string) => {\n try {\n return typeof require === 'undefined'\n ? import(packagePath)\n : require(packagePath);\n } catch (error) {\n return undefined;\n }\n};\n\nconst IntlayerEditorElement = ({\n content,\n ..._props\n}: IntlayerEditorElementProps) => {\n return content;\n};\n\nIntlayerEditorElement.content = '';\n\nexport const renderIntlayerEditor = (props: IntlayerEditorElementProps) => {\n const _renderIntlayerEditor = requireFunction(\n 'intlayer-editor/client'\n )?.renderIntlayerEditor;\n\n if (typeof _renderIntlayerEditor === 'undefined') {\n const Result = <IntlayerEditorElement {...props} />;\n\n return { ...Result, value: props.content };\n }\n\n return _renderIntlayerEditor(props);\n};\n"],"mappings":";AA2BmB;AAzBnB,MAAM,kBAAkB,CAAC,gBAAwB;AAC/C,MAAI;AACF,WAAO,OAAO,YAAY,cACtB,OAAO,eACP,QAAQ,WAAW;AAAA,EACzB,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEA,MAAM,wBAAwB,CAAC;AAAA,EAC7B;AAAA,EACA,GAAG;AACL,MAAkC;AAChC,SAAO;AACT;AAEA,sBAAsB,UAAU;AAEzB,MAAM,uBAAuB,CAAC,UAAsC;AACzE,QAAM,wBAAwB;AAAA,IAC5B;AAAA,EACF,GAAG;AAEH,MAAI,OAAO,0BAA0B,aAAa;AAChD,UAAM,SAAS,oBAAC,yBAAuB,GAAG,OAAO;AAEjD,WAAO,EAAE,GAAG,QAAQ,OAAO,MAAM,QAAQ;AAAA,EAC3C;AAEA,SAAO,sBAAsB,KAAK;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../src/renderIntlayerEditor.tsx"],"sourcesContent":["import type {\n IntlayerEditorElementProps,\n RenderIntlayerEditorResult,\n} from 'intlayer-editor/client';\nimport type { FC } from 'react';\n\nconst requireFunction = () => {\n try {\n return typeof import.meta.url === 'undefined'\n ? require('intlayer-editor/client')\n : module.require('intlayer-editor/client');\n } catch (error) {\n return undefined;\n }\n};\n\nconst IntlayerEditorElement: FC<IntlayerEditorElementProps> = ({\n content,\n ..._props\n}) => content;\n\nexport const renderIntlayerEditor = (\n props: IntlayerEditorElementProps\n): RenderIntlayerEditorResult => {\n const _renderIntlayerEditor = requireFunction()?.renderIntlayerEditor;\n\n if (typeof _renderIntlayerEditor === 'undefined') {\n const Result = <IntlayerEditorElement {...props} />;\n\n return { ...Result, value: props.content };\n }\n\n return _renderIntlayerEditor(props);\n};\n"],"mappings":";AA2BmB;AArBnB,MAAM,kBAAkB,MAAM;AAC5B,MAAI;AACF,WAAO,OAAO,YAAY,QAAQ,cAC9B,QAAQ,wBAAwB,IAChC,OAAO,QAAQ,wBAAwB;AAAA,EAC7C,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAEA,MAAM,wBAAwD,CAAC;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,MAAM;AAEC,MAAM,uBAAuB,CAClC,UAC+B;AAC/B,QAAM,wBAAwB,gBAAgB,GAAG;AAEjD,MAAI,OAAO,0BAA0B,aAAa;AAChD,UAAM,SAAS,oBAAC,yBAAuB,GAAG,OAAO;AAEjD,WAAO,EAAE,GAAG,QAAQ,OAAO,MAAM,QAAQ;AAAA,EAC3C;AAEA,SAAO,sBAAsB,KAAK;AACpC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-intlayer",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "private": false,
5
5
  "description": "Internationalization layer for React applications - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
6
6
  "keywords": [
@@ -75,12 +75,12 @@
75
75
  "react-cookie": "^7.1.4",
76
76
  "vite": "^5.3.1",
77
77
  "webpack": "^5.92.1",
78
- "@intlayer/chokidar": "^2.0.7",
79
- "@intlayer/config": "^2.0.7",
80
- "@intlayer/core": "^2.0.7",
81
- "@intlayer/dictionaries-entry": "^2.0.7",
82
- "@intlayer/webpack": "^2.0.7",
83
- "intlayer": "^2.0.7"
78
+ "@intlayer/chokidar": "^2.0.8",
79
+ "@intlayer/config": "^2.0.8",
80
+ "@intlayer/core": "^2.0.8",
81
+ "@intlayer/webpack": "^2.0.8",
82
+ "@intlayer/dictionaries-entry": "^2.0.8",
83
+ "intlayer": "^2.0.8"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@craco/types": "^7.1.0",
@@ -99,7 +99,7 @@
99
99
  "peerDependencies": {
100
100
  "react": "^18.2.0",
101
101
  "react-dom": "^18.2.0",
102
- "intlayer-editor": "^2.1.6"
102
+ "intlayer-editor": "^2.1.7"
103
103
  },
104
104
  "peerDependenciesMeta": {
105
105
  "intlayer-editor": {