vanilla-intlayer 9.3.1 → 9.3.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.
|
@@ -33,13 +33,13 @@ const useEditor = () => {
|
|
|
33
33
|
unsubscribeLocale = client.subscribe((newLocale) => {
|
|
34
34
|
manager.currentLocale.set(newLocale);
|
|
35
35
|
});
|
|
36
|
-
});
|
|
36
|
+
}).catch(() => {});
|
|
37
37
|
return () => {
|
|
38
38
|
stopped = true;
|
|
39
39
|
unsubscribeLocale?.();
|
|
40
40
|
import("@intlayer/editor").then(({ stopEditorClient }) => {
|
|
41
41
|
stopEditorClient();
|
|
42
|
-
});
|
|
42
|
+
}).catch(() => {});
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.cjs","names":["isEnabled","getIntlayerClient"],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { getIntlayerClient } from '../client/installIntlayer';\n\n/**\n * Initialises the Intlayer visual editor client.\n *\n * Does nothing when `INTLAYER_EDITOR_ENABLED` is `\"false\"` or the editor\n * package reports that it is disabled.\n *\n * Call this once at application startup.\n *\n * @returns A cleanup function that stops the editor.\n *\n * @example\n * ```ts\n * import { installIntlayer, useEditor } from 'vanilla-intlayer';\n *\n * installIntlayer('en');\n * const stopEditor = useEditor();\n * ```\n */\n\nexport const useEditor = (): (() => void) => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled)\n return () => {};\n\n let unsubscribeLocale: (() => void) | null = null;\n let stopped = false;\n\n import('@intlayer/editor').then(({ initEditorClient }) => {\n
|
|
1
|
+
{"version":3,"file":"useEditor.cjs","names":["isEnabled","getIntlayerClient"],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { getIntlayerClient } from '../client/installIntlayer';\n\n/**\n * Initialises the Intlayer visual editor client.\n *\n * Does nothing when `INTLAYER_EDITOR_ENABLED` is `\"false\"` or the editor\n * package reports that it is disabled.\n *\n * Call this once at application startup.\n *\n * @returns A cleanup function that stops the editor.\n *\n * @example\n * ```ts\n * import { installIntlayer, useEditor } from 'vanilla-intlayer';\n *\n * installIntlayer('en');\n * const stopEditor = useEditor();\n * ```\n */\n\nexport const useEditor = (): (() => void) => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled)\n return () => {};\n\n let unsubscribeLocale: (() => void) | null = null;\n let stopped = false;\n\n import('@intlayer/editor')\n .then(({ initEditorClient }) => {\n if (stopped) return;\n const manager: EditorStateManager = initEditorClient();\n const client = getIntlayerClient();\n\n manager.currentLocale.set(client.locale as Locale);\n\n unsubscribeLocale = client.subscribe((newLocale) => {\n manager.currentLocale.set(newLocale as Locale);\n });\n })\n .catch(() => {});\n\n return () => {\n stopped = true;\n unsubscribeLocale?.();\n import('@intlayer/editor')\n .then(({ stopEditorClient }) => {\n stopEditorClient();\n })\n .catch(() => {});\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,kBAAgC;CAC3C,IAAI,QAAQ,IAAI,4BAA4B,WAAW,CAACA,sCACtD,aAAa,CAAC;CAEhB,IAAI,oBAAyC;CAC7C,IAAI,UAAU;CAEd,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;EAC9B,IAAI,SAAS;EACb,MAAM,UAA8B,iBAAiB;EACrD,MAAM,SAASC,iDAAkB;EAEjC,QAAQ,cAAc,IAAI,OAAO,MAAgB;EAEjD,oBAAoB,OAAO,WAAW,cAAc;GAClD,QAAQ,cAAc,IAAI,SAAmB;EAC/C,CAAC;CACH,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;CAEjB,aAAa;EACX,UAAU;EACV,oBAAoB;EACpB,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;GAC9B,iBAAiB;EACnB,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;CACnB;AACF"}
|
|
@@ -32,13 +32,13 @@ const useEditor = () => {
|
|
|
32
32
|
unsubscribeLocale = client.subscribe((newLocale) => {
|
|
33
33
|
manager.currentLocale.set(newLocale);
|
|
34
34
|
});
|
|
35
|
-
});
|
|
35
|
+
}).catch(() => {});
|
|
36
36
|
return () => {
|
|
37
37
|
stopped = true;
|
|
38
38
|
unsubscribeLocale?.();
|
|
39
39
|
import("@intlayer/editor").then(({ stopEditorClient }) => {
|
|
40
40
|
stopEditorClient();
|
|
41
|
-
});
|
|
41
|
+
}).catch(() => {});
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { getIntlayerClient } from '../client/installIntlayer';\n\n/**\n * Initialises the Intlayer visual editor client.\n *\n * Does nothing when `INTLAYER_EDITOR_ENABLED` is `\"false\"` or the editor\n * package reports that it is disabled.\n *\n * Call this once at application startup.\n *\n * @returns A cleanup function that stops the editor.\n *\n * @example\n * ```ts\n * import { installIntlayer, useEditor } from 'vanilla-intlayer';\n *\n * installIntlayer('en');\n * const stopEditor = useEditor();\n * ```\n */\n\nexport const useEditor = (): (() => void) => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled)\n return () => {};\n\n let unsubscribeLocale: (() => void) | null = null;\n let stopped = false;\n\n import('@intlayer/editor').then(({ initEditorClient }) => {\n
|
|
1
|
+
{"version":3,"file":"useEditor.mjs","names":[],"sources":["../../../src/editor/useEditor.ts"],"sourcesContent":["import type { EditorStateManager } from '@intlayer/editor';\nimport { isEnabled } from '@intlayer/editor/isEnabled';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { getIntlayerClient } from '../client/installIntlayer';\n\n/**\n * Initialises the Intlayer visual editor client.\n *\n * Does nothing when `INTLAYER_EDITOR_ENABLED` is `\"false\"` or the editor\n * package reports that it is disabled.\n *\n * Call this once at application startup.\n *\n * @returns A cleanup function that stops the editor.\n *\n * @example\n * ```ts\n * import { installIntlayer, useEditor } from 'vanilla-intlayer';\n *\n * installIntlayer('en');\n * const stopEditor = useEditor();\n * ```\n */\n\nexport const useEditor = (): (() => void) => {\n if (process.env.INTLAYER_EDITOR_ENABLED === 'false' || !isEnabled)\n return () => {};\n\n let unsubscribeLocale: (() => void) | null = null;\n let stopped = false;\n\n import('@intlayer/editor')\n .then(({ initEditorClient }) => {\n if (stopped) return;\n const manager: EditorStateManager = initEditorClient();\n const client = getIntlayerClient();\n\n manager.currentLocale.set(client.locale as Locale);\n\n unsubscribeLocale = client.subscribe((newLocale) => {\n manager.currentLocale.set(newLocale as Locale);\n });\n })\n .catch(() => {});\n\n return () => {\n stopped = true;\n unsubscribeLocale?.();\n import('@intlayer/editor')\n .then(({ stopEditorClient }) => {\n stopEditorClient();\n })\n .catch(() => {});\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,kBAAgC;CAC3C,IAAI,QAAQ,IAAI,4BAA4B,WAAW,CAAC,WACtD,aAAa,CAAC;CAEhB,IAAI,oBAAyC;CAC7C,IAAI,UAAU;CAEd,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;EAC9B,IAAI,SAAS;EACb,MAAM,UAA8B,iBAAiB;EACrD,MAAM,SAAS,kBAAkB;EAEjC,QAAQ,cAAc,IAAI,OAAO,MAAgB;EAEjD,oBAAoB,OAAO,WAAW,cAAc;GAClD,QAAQ,cAAc,IAAI,SAAmB;EAC/C,CAAC;CACH,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;CAEjB,aAAa;EACX,UAAU;EACV,oBAAoB;EACpB,OAAO,mBAAmB,CACvB,MAAM,EAAE,uBAAuB;GAC9B,iBAAiB;EACnB,CAAC,CAAC,CACD,YAAY,CAAC,CAAC;CACnB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vanilla-intlayer",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vanilla JS, HTML, and PHP applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@intlayer/api": "9.3.
|
|
105
|
-
"@intlayer/config": "9.3.
|
|
106
|
-
"@intlayer/core": "9.3.
|
|
107
|
-
"@intlayer/editor": "9.3.
|
|
108
|
-
"@intlayer/types": "9.3.
|
|
104
|
+
"@intlayer/api": "9.3.2",
|
|
105
|
+
"@intlayer/config": "9.3.2",
|
|
106
|
+
"@intlayer/core": "9.3.2",
|
|
107
|
+
"@intlayer/editor": "9.3.2",
|
|
108
|
+
"@intlayer/types": "9.3.2"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@types/node": "26.2.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"vitest": "4.1.10"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
|
-
"intlayer": "9.3.
|
|
121
|
+
"intlayer": "9.3.2"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"intlayer": {
|