@intlayer/editor 8.6.4 → 8.6.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"initEditorClient.cjs","names":["editor","getGlobalEditorManager","EditorStateManager"],"sources":["../../../src/core/initEditorClient.ts"],"sourcesContent":["import { default as configuration, editor } from '@intlayer/config/built';\n\nimport { defineIntlayerElements } from '../components';\nimport type { MessengerConfig } from './CrossFrameMessenger';\nimport { EditorStateManager } from './EditorStateManager';\nimport {\n getGlobalEditorManager,\n setGlobalEditorManager,\n} from './globalManager';\n\nexport const buildClientMessengerConfig = (): MessengerConfig => {\n return {\n allowedOrigins: [editor?.editorURL, editor?.cmsURL].filter(\n Boolean\n ) as string[],\n postMessageFn: (payload: unknown, origin: string) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n window.parent?.postMessage(payload, origin);\n },\n };\n};\n\n/** Reference count — tracks how many providers have called initEditorClient. */\nlet _clientRefCount = 0;\n\n/**\n * Initialize the Intlayer editor client singleton.\n * Safe to call multiple times — returns the existing manager if already initialized.\n * Increments a reference counter so nested providers don't destroy the manager\n * prematurely when the inner provider unmounts.\n */\nexport const initEditorClient = (): EditorStateManager => {\n _clientRefCount++;\n\n const existing = getGlobalEditorManager();\n if (existing) return existing;\n\n const manager = new EditorStateManager({\n mode: 'client',\n messenger: buildClientMessengerConfig(),\n configuration,\n });\n\n setGlobalEditorManager(manager);\n defineIntlayerElements();\n manager.start();\n\n return manager;\n};\n\n/**\n * Decrement the reference count and stop the global editor client singleton\n * only when the last provider unmounts.\n */\nexport const stopEditorClient = (): void => {\n _clientRefCount = Math.max(0, _clientRefCount - 1);\n\n if (_clientRefCount > 0) return;\n\n const manager = getGlobalEditorManager();\n manager?.stop();\n setGlobalEditorManager(null);\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,mCAAoD;AAC/D,QAAO;EACL,gBAAgB,CAACA,+BAAQ,WAAWA,+BAAQ,OAAO,CAAC,OAClD,QACD;EACD,gBAAgB,SAAkB,WAAmB;AACnD,OAAI,OAAO,WAAW,YAAa;AAInC,OAAI,EAFe,OAAO,SAAS,OAAO,KAEzB;AACjB,UAAO,QAAQ,YAAY,SAAS,OAAO;;EAE9C;;;AAIH,IAAI,kBAAkB;;;;;;;AAQtB,MAAa,yBAA6C;AACxD;CAEA,MAAM,WAAWC,mDAAwB;AACzC,KAAI,SAAU,QAAO;CAErB,MAAM,UAAU,IAAIC,mDAAmB;EACrC,MAAM;EACN,WAAW,4BAA4B;EACvC;EACD,CAAC;AAEF,mDAAuB,QAAQ;AAC/B,4DAAwB;AACxB,SAAQ,OAAO;AAEf,QAAO;;;;;;AAOT,MAAa,yBAA+B;AAC1C,mBAAkB,KAAK,IAAI,GAAG,kBAAkB,EAAE;AAElD,KAAI,kBAAkB,EAAG;AAGzB,CADgBD,mDAAwB,EAC/B,MAAM;AACf,mDAAuB,KAAK"}
1
+ {"version":3,"file":"initEditorClient.cjs","names":["editor","getGlobalEditorManager","EditorStateManager"],"sources":["../../../src/core/initEditorClient.ts"],"sourcesContent":["import { default as configuration, editor } from '@intlayer/config/built';\nimport { defineIntlayerElements } from '../components';\nimport type { MessengerConfig } from './CrossFrameMessenger';\nimport { EditorStateManager } from './EditorStateManager';\nimport {\n getGlobalEditorManager,\n setGlobalEditorManager,\n} from './globalManager';\n\nexport const buildClientMessengerConfig = (): MessengerConfig => {\n return {\n allowedOrigins: [editor?.editorURL, editor?.cmsURL].filter(\n Boolean\n ) as string[],\n postMessageFn: (payload: unknown, origin: string) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n window.parent?.postMessage(payload, origin);\n },\n };\n};\n\n/** Reference count — tracks how many providers have called initEditorClient. */\nlet _clientRefCount = 0;\n\n/**\n * Initialize the Intlayer editor client singleton.\n * Safe to call multiple times — returns the existing manager if already initialized.\n * Increments a reference counter so nested providers don't destroy the manager\n * prematurely when the inner provider unmounts.\n */\nexport const initEditorClient = (): EditorStateManager => {\n _clientRefCount++;\n\n const existing = getGlobalEditorManager();\n if (existing) return existing;\n\n const manager = new EditorStateManager({\n mode: 'client',\n messenger: buildClientMessengerConfig(),\n configuration,\n });\n\n setGlobalEditorManager(manager);\n defineIntlayerElements();\n manager.start();\n\n return manager;\n};\n\n/**\n * Decrement the reference count and stop the global editor client singleton\n * only when the last provider unmounts.\n */\nexport const stopEditorClient = (): void => {\n _clientRefCount = Math.max(0, _clientRefCount - 1);\n\n if (_clientRefCount > 0) return;\n\n const manager = getGlobalEditorManager();\n manager?.stop();\n setGlobalEditorManager(null);\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,mCAAoD;AAC/D,QAAO;EACL,gBAAgB,CAACA,+BAAQ,WAAWA,+BAAQ,OAAO,CAAC,OAClD,QACD;EACD,gBAAgB,SAAkB,WAAmB;AACnD,OAAI,OAAO,WAAW,YAAa;AAInC,OAAI,EAFe,OAAO,SAAS,OAAO,KAEzB;AACjB,UAAO,QAAQ,YAAY,SAAS,OAAO;;EAE9C;;;AAIH,IAAI,kBAAkB;;;;;;;AAQtB,MAAa,yBAA6C;AACxD;CAEA,MAAM,WAAWC,mDAAwB;AACzC,KAAI,SAAU,QAAO;CAErB,MAAM,UAAU,IAAIC,mDAAmB;EACrC,MAAM;EACN,WAAW,4BAA4B;EACvC;EACD,CAAC;AAEF,mDAAuB,QAAQ;AAC/B,4DAAwB;AACxB,SAAQ,OAAO;AAEf,QAAO;;;;;;AAOT,MAAa,yBAA+B;AAC1C,mBAAkB,KAAK,IAAI,GAAG,kBAAkB,EAAE;AAElD,KAAI,kBAAkB,EAAG;AAGzB,CADgBD,mDAAwB,EAC/B,MAAM;AACf,mDAAuB,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"initEditorClient.mjs","names":[],"sources":["../../../src/core/initEditorClient.ts"],"sourcesContent":["import { default as configuration, editor } from '@intlayer/config/built';\n\nimport { defineIntlayerElements } from '../components';\nimport type { MessengerConfig } from './CrossFrameMessenger';\nimport { EditorStateManager } from './EditorStateManager';\nimport {\n getGlobalEditorManager,\n setGlobalEditorManager,\n} from './globalManager';\n\nexport const buildClientMessengerConfig = (): MessengerConfig => {\n return {\n allowedOrigins: [editor?.editorURL, editor?.cmsURL].filter(\n Boolean\n ) as string[],\n postMessageFn: (payload: unknown, origin: string) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n window.parent?.postMessage(payload, origin);\n },\n };\n};\n\n/** Reference count — tracks how many providers have called initEditorClient. */\nlet _clientRefCount = 0;\n\n/**\n * Initialize the Intlayer editor client singleton.\n * Safe to call multiple times — returns the existing manager if already initialized.\n * Increments a reference counter so nested providers don't destroy the manager\n * prematurely when the inner provider unmounts.\n */\nexport const initEditorClient = (): EditorStateManager => {\n _clientRefCount++;\n\n const existing = getGlobalEditorManager();\n if (existing) return existing;\n\n const manager = new EditorStateManager({\n mode: 'client',\n messenger: buildClientMessengerConfig(),\n configuration,\n });\n\n setGlobalEditorManager(manager);\n defineIntlayerElements();\n manager.start();\n\n return manager;\n};\n\n/**\n * Decrement the reference count and stop the global editor client singleton\n * only when the last provider unmounts.\n */\nexport const stopEditorClient = (): void => {\n _clientRefCount = Math.max(0, _clientRefCount - 1);\n\n if (_clientRefCount > 0) return;\n\n const manager = getGlobalEditorManager();\n manager?.stop();\n setGlobalEditorManager(null);\n};\n"],"mappings":";;;;;;AAUA,MAAa,mCAAoD;AAC/D,QAAO;EACL,gBAAgB,CAAC,QAAQ,WAAW,QAAQ,OAAO,CAAC,OAClD,QACD;EACD,gBAAgB,SAAkB,WAAmB;AACnD,OAAI,OAAO,WAAW,YAAa;AAInC,OAAI,EAFe,OAAO,SAAS,OAAO,KAEzB;AACjB,UAAO,QAAQ,YAAY,SAAS,OAAO;;EAE9C;;;AAIH,IAAI,kBAAkB;;;;;;;AAQtB,MAAa,yBAA6C;AACxD;CAEA,MAAM,WAAW,wBAAwB;AACzC,KAAI,SAAU,QAAO;CAErB,MAAM,UAAU,IAAI,mBAAmB;EACrC,MAAM;EACN,WAAW,4BAA4B;EACvC;EACD,CAAC;AAEF,wBAAuB,QAAQ;AAC/B,yBAAwB;AACxB,SAAQ,OAAO;AAEf,QAAO;;;;;;AAOT,MAAa,yBAA+B;AAC1C,mBAAkB,KAAK,IAAI,GAAG,kBAAkB,EAAE;AAElD,KAAI,kBAAkB,EAAG;AAGzB,CADgB,wBAAwB,EAC/B,MAAM;AACf,wBAAuB,KAAK"}
1
+ {"version":3,"file":"initEditorClient.mjs","names":[],"sources":["../../../src/core/initEditorClient.ts"],"sourcesContent":["import { default as configuration, editor } from '@intlayer/config/built';\nimport { defineIntlayerElements } from '../components';\nimport type { MessengerConfig } from './CrossFrameMessenger';\nimport { EditorStateManager } from './EditorStateManager';\nimport {\n getGlobalEditorManager,\n setGlobalEditorManager,\n} from './globalManager';\n\nexport const buildClientMessengerConfig = (): MessengerConfig => {\n return {\n allowedOrigins: [editor?.editorURL, editor?.cmsURL].filter(\n Boolean\n ) as string[],\n postMessageFn: (payload: unknown, origin: string) => {\n if (typeof window === 'undefined') return;\n\n const isInIframe = window.self !== window.top;\n\n if (!isInIframe) return;\n window.parent?.postMessage(payload, origin);\n },\n };\n};\n\n/** Reference count — tracks how many providers have called initEditorClient. */\nlet _clientRefCount = 0;\n\n/**\n * Initialize the Intlayer editor client singleton.\n * Safe to call multiple times — returns the existing manager if already initialized.\n * Increments a reference counter so nested providers don't destroy the manager\n * prematurely when the inner provider unmounts.\n */\nexport const initEditorClient = (): EditorStateManager => {\n _clientRefCount++;\n\n const existing = getGlobalEditorManager();\n if (existing) return existing;\n\n const manager = new EditorStateManager({\n mode: 'client',\n messenger: buildClientMessengerConfig(),\n configuration,\n });\n\n setGlobalEditorManager(manager);\n defineIntlayerElements();\n manager.start();\n\n return manager;\n};\n\n/**\n * Decrement the reference count and stop the global editor client singleton\n * only when the last provider unmounts.\n */\nexport const stopEditorClient = (): void => {\n _clientRefCount = Math.max(0, _clientRefCount - 1);\n\n if (_clientRefCount > 0) return;\n\n const manager = getGlobalEditorManager();\n manager?.stop();\n setGlobalEditorManager(null);\n};\n"],"mappings":";;;;;;AASA,MAAa,mCAAoD;AAC/D,QAAO;EACL,gBAAgB,CAAC,QAAQ,WAAW,QAAQ,OAAO,CAAC,OAClD,QACD;EACD,gBAAgB,SAAkB,WAAmB;AACnD,OAAI,OAAO,WAAW,YAAa;AAInC,OAAI,EAFe,OAAO,SAAS,OAAO,KAEzB;AACjB,UAAO,QAAQ,YAAY,SAAS,OAAO;;EAE9C;;;AAIH,IAAI,kBAAkB;;;;;;;AAQtB,MAAa,yBAA6C;AACxD;CAEA,MAAM,WAAW,wBAAwB;AACzC,KAAI,SAAU,QAAO;CAErB,MAAM,UAAU,IAAI,mBAAmB;EACrC,MAAM;EACN,WAAW,4BAA4B;EACvC;EACD,CAAC;AAEF,wBAAuB,QAAQ;AAC/B,yBAAwB;AACxB,SAAQ,OAAO;AAEf,QAAO;;;;;;AAOT,MAAa,yBAA+B;AAC1C,mBAAkB,KAAK,IAAI,GAAG,kBAAkB,EAAE;AAElD,KAAI,kBAAkB,EAAG;AAGzB,CADgB,wBAAwB,EAC/B,MAAM;AACf,wBAAuB,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"initEditorClient.d.ts","names":[],"sources":["../../../src/core/initEditorClient.ts"],"mappings":";;;;cAUa,0BAAA,QAAiC,eAAA;;AAA9C;;;;;cAyBa,gBAAA,QAAuB,kBAAA;;;;;cAuBvB,gBAAA"}
1
+ {"version":3,"file":"initEditorClient.d.ts","names":[],"sources":["../../../src/core/initEditorClient.ts"],"mappings":";;;;cASa,0BAAA,QAAiC,eAAA;;AAA9C;;;;;cAyBa,gBAAA,QAAuB,kBAAA;;;;;cAuBvB,gBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/editor",
3
- "version": "8.6.4",
3
+ "version": "8.6.6",
4
4
  "private": false,
5
5
  "description": "Provides the utilities to interface the application with the Intlayer editor and manipulate dictionaries",
6
6
  "keywords": [
@@ -75,10 +75,10 @@
75
75
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
76
76
  },
77
77
  "dependencies": {
78
- "@intlayer/config": "8.6.4",
79
- "@intlayer/core": "8.6.4",
80
- "@intlayer/types": "8.6.4",
81
- "@intlayer/unmerged-dictionaries-entry": "8.6.4",
78
+ "@intlayer/config": "8.6.6",
79
+ "@intlayer/core": "8.6.6",
80
+ "@intlayer/types": "8.6.6",
81
+ "@intlayer/unmerged-dictionaries-entry": "8.6.6",
82
82
  "lit": "^3.3.2"
83
83
  },
84
84
  "devDependencies": {