angular-intlayer 8.3.3 → 8.4.0-canary.0
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/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -1
- package/dist/cjs/editor/ContentSelector.component.cjs +9 -0
- package/dist/cjs/editor/ContentSelector.component.cjs.map +1 -0
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +1 -1
- package/dist/esm/editor/ContentSelector.component.mjs +9 -0
- package/dist/esm/editor/ContentSelector.component.mjs.map +1 -0
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/plugins.mjs +1 -1
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
- package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/client/useLocale.d.ts +3 -3
- package/dist/types/client/useLocaleStorage.d.ts +5 -5
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/editor/ContentSelector.component.d.ts +9 -0
- package/dist/types/editor/ContentSelector.component.d.ts.map +1 -0
- package/dist/types/editor/useEditor.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/UI/ContentSelector.component.cjs +0 -20
- package/dist/cjs/UI/ContentSelector.component.cjs.map +0 -1
- package/dist/cjs/editor/ContentSelectorWrapper.component.cjs +0 -11
- package/dist/cjs/editor/ContentSelectorWrapper.component.cjs.map +0 -1
- package/dist/cjs/editor/EditedContentRenderer.component.cjs +0 -2
- package/dist/cjs/editor/EditedContentRenderer.component.cjs.map +0 -1
- package/dist/cjs/editor/EditorSelectorRenderer.component.cjs +0 -14
- package/dist/cjs/editor/EditorSelectorRenderer.component.cjs.map +0 -1
- package/dist/cjs/editor/communicator.cjs +0 -2
- package/dist/cjs/editor/communicator.cjs.map +0 -1
- package/dist/cjs/editor/configuration.cjs +0 -2
- package/dist/cjs/editor/configuration.cjs.map +0 -1
- package/dist/cjs/editor/createSharedComposable.cjs +0 -2
- package/dist/cjs/editor/createSharedComposable.cjs.map +0 -1
- package/dist/cjs/editor/dictionariesRecord.cjs +0 -2
- package/dist/cjs/editor/dictionariesRecord.cjs.map +0 -1
- package/dist/cjs/editor/editedContent.cjs +0 -2
- package/dist/cjs/editor/editedContent.cjs.map +0 -1
- package/dist/cjs/editor/editorEnabled.cjs +0 -2
- package/dist/cjs/editor/editorEnabled.cjs.map +0 -1
- package/dist/cjs/editor/editorLocale.cjs +0 -2
- package/dist/cjs/editor/editorLocale.cjs.map +0 -1
- package/dist/cjs/editor/focusDictionary.cjs +0 -2
- package/dist/cjs/editor/focusDictionary.cjs.map +0 -1
- package/dist/cjs/editor/index.cjs +0 -1
- package/dist/cjs/editor/installIntlayerEditor.cjs +0 -2
- package/dist/cjs/editor/installIntlayerEditor.cjs.map +0 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +0 -2
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs.map +0 -1
- package/dist/cjs/editor/useCrossFrameState.cjs +0 -2
- package/dist/cjs/editor/useCrossFrameState.cjs.map +0 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs +0 -2
- package/dist/cjs/editor/useCrossURLPathState.cjs.map +0 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +0 -2
- package/dist/cjs/editor/useEditedContentRenderer.cjs.map +0 -1
- package/dist/cjs/editor/useIframeClickInterceptor.cjs +0 -2
- package/dist/cjs/editor/useIframeClickInterceptor.cjs.map +0 -1
- package/dist/esm/UI/ContentSelector.component.mjs +0 -20
- package/dist/esm/UI/ContentSelector.component.mjs.map +0 -1
- package/dist/esm/editor/ContentSelectorWrapper.component.mjs +0 -11
- package/dist/esm/editor/ContentSelectorWrapper.component.mjs.map +0 -1
- package/dist/esm/editor/EditedContentRenderer.component.mjs +0 -2
- package/dist/esm/editor/EditedContentRenderer.component.mjs.map +0 -1
- package/dist/esm/editor/EditorSelectorRenderer.component.mjs +0 -14
- package/dist/esm/editor/EditorSelectorRenderer.component.mjs.map +0 -1
- package/dist/esm/editor/communicator.mjs +0 -2
- package/dist/esm/editor/communicator.mjs.map +0 -1
- package/dist/esm/editor/configuration.mjs +0 -2
- package/dist/esm/editor/configuration.mjs.map +0 -1
- package/dist/esm/editor/createSharedComposable.mjs +0 -2
- package/dist/esm/editor/createSharedComposable.mjs.map +0 -1
- package/dist/esm/editor/dictionariesRecord.mjs +0 -2
- package/dist/esm/editor/dictionariesRecord.mjs.map +0 -1
- package/dist/esm/editor/editedContent.mjs +0 -2
- package/dist/esm/editor/editedContent.mjs.map +0 -1
- package/dist/esm/editor/editorEnabled.mjs +0 -2
- package/dist/esm/editor/editorEnabled.mjs.map +0 -1
- package/dist/esm/editor/editorLocale.mjs +0 -2
- package/dist/esm/editor/editorLocale.mjs.map +0 -1
- package/dist/esm/editor/focusDictionary.mjs +0 -2
- package/dist/esm/editor/focusDictionary.mjs.map +0 -1
- package/dist/esm/editor/index.mjs +0 -1
- package/dist/esm/editor/installIntlayerEditor.mjs +0 -2
- package/dist/esm/editor/installIntlayerEditor.mjs.map +0 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +0 -2
- package/dist/esm/editor/useCrossFrameMessageListener.mjs.map +0 -1
- package/dist/esm/editor/useCrossFrameState.mjs +0 -2
- package/dist/esm/editor/useCrossFrameState.mjs.map +0 -1
- package/dist/esm/editor/useCrossURLPathState.mjs +0 -2
- package/dist/esm/editor/useCrossURLPathState.mjs.map +0 -1
- package/dist/esm/editor/useEditedContentRenderer.mjs +0 -2
- package/dist/esm/editor/useEditedContentRenderer.mjs.map +0 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs +0 -2
- package/dist/esm/editor/useIframeClickInterceptor.mjs.map +0 -1
- package/dist/types/UI/ContentSelector.component.d.ts +0 -34
- package/dist/types/UI/ContentSelector.component.d.ts.map +0 -1
- package/dist/types/editor/ContentSelectorWrapper.component.d.ts +0 -24
- package/dist/types/editor/ContentSelectorWrapper.component.d.ts.map +0 -1
- package/dist/types/editor/EditedContentRenderer.component.d.ts +0 -24
- package/dist/types/editor/EditedContentRenderer.component.d.ts.map +0 -1
- package/dist/types/editor/EditorSelectorRenderer.component.d.ts +0 -17
- package/dist/types/editor/EditorSelectorRenderer.component.d.ts.map +0 -1
- package/dist/types/editor/communicator.d.ts +0 -32
- package/dist/types/editor/communicator.d.ts.map +0 -1
- package/dist/types/editor/configuration.d.ts +0 -5
- package/dist/types/editor/configuration.d.ts.map +0 -1
- package/dist/types/editor/createSharedComposable.d.ts +0 -16
- package/dist/types/editor/createSharedComposable.d.ts.map +0 -1
- package/dist/types/editor/dictionariesRecord.d.ts +0 -19
- package/dist/types/editor/dictionariesRecord.d.ts.map +0 -1
- package/dist/types/editor/editedContent.d.ts +0 -23
- package/dist/types/editor/editedContent.d.ts.map +0 -1
- package/dist/types/editor/editorEnabled.d.ts +0 -20
- package/dist/types/editor/editorEnabled.d.ts.map +0 -1
- package/dist/types/editor/editorLocale.d.ts +0 -6
- package/dist/types/editor/editorLocale.d.ts.map +0 -1
- package/dist/types/editor/focusDictionary.d.ts +0 -27
- package/dist/types/editor/focusDictionary.d.ts.map +0 -1
- package/dist/types/editor/index.d.ts +0 -5
- package/dist/types/editor/installIntlayerEditor.d.ts +0 -22
- package/dist/types/editor/installIntlayerEditor.d.ts.map +0 -1
- package/dist/types/editor/useCrossFrameMessageListener.d.ts +0 -15
- package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +0 -1
- package/dist/types/editor/useCrossFrameState.d.ts +0 -26
- package/dist/types/editor/useCrossFrameState.d.ts.map +0 -1
- package/dist/types/editor/useCrossURLPathState.d.ts +0 -21
- package/dist/types/editor/useCrossURLPathState.d.ts.map +0 -1
- package/dist/types/editor/useEditedContentRenderer.d.ts +0 -21
- package/dist/types/editor/useEditedContentRenderer.d.ts.map +0 -1
- package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -14
- package/dist/types/editor/useIframeClickInterceptor.d.ts.map +0 -1
- package/dist/types/intlayer/dist/types/index.d.ts +0 -3
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useCommunicator as e}from"./communicator.mjs";import{useCrossFrameMessageListener as t}from"./useCrossFrameMessageListener.mjs";import{signal as n}from"@angular/core";const r=new Map,i=(e,t)=>typeof e==`function`?e(t):e,a=e=>e==null?e:JSON.parse(JSON.stringify(e)),o=(o,s,c={emit:!0,receive:!0})=>{if(r.has(o)){let{state:e,setState:t,postState:n}=r.get(o);return[e,t,n]}let{emit:l=!0,receive:u=!0}=c,d=n(i(s)),{postMessage:f,senderId:p}=e()??{},m=e=>{!l||typeof f!=`function`||e===void 0||f({type:`${o}/post`,data:e,senderId:p})},h=e=>{let t=a(i(e,d()));d.set(t),m(t)},g=()=>{typeof f==`function`&&f({type:`${o}/post`,data:d(),senderId:p})};return m(d()),u&&typeof f==`function`&&d()===void 0&&f({type:`${o}/get`,senderId:p}),t(`${o}/post`,u?e=>{d.set(e)}:void 0),t(`${o}/get`,l?(e,t)=>{l&&t!==p&&m(d())}:void 0),r.set(o,{state:d,setState:h,postState:g}),[d,h,g]};export{o as useCrossFrameState};
|
|
2
|
-
//# sourceMappingURL=useCrossFrameState.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameState.mjs","names":[],"sources":["../../../src/editor/useCrossFrameState.ts"],"sourcesContent":["import { type Signal, signal } from '@angular/core';\nimport type { MessageKey } from '@intlayer/editor';\nimport { useCommunicator } from './communicator';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\nexport type CrossFrameStateOptions = {\n /** Whether to broadcast state changes to other instances (default: true) */\n emit?: boolean;\n /** Whether to listen for state updates from other instances (default: true) */\n receive?: boolean;\n};\n\nconst crossFrameStateCache = new Map<\n string,\n {\n state: Signal<any>;\n setState: (v: any | ((prev: any) => any)) => void;\n postState: () => void;\n }\n>();\n\n/**\n * Utility to resolve either a value or an updater function (mirrors React's `setState`).\n */\nconst resolveState = <S>(\n state: S | ((prev?: S) => S) | undefined,\n prevState?: S\n): S | undefined => {\n if (typeof state === 'function') {\n return (state as (prev?: S) => S)(prevState);\n }\n return state as S;\n};\n\n/**\n * Creates a plain object copy that can be safely serialized\n * for postMessage communication\n */\nconst toSerializable = <T>(obj: T): T => {\n if (obj === null || obj === undefined) return obj;\n // Using parse/stringify for a quick deep clone to remove reactivity\n return JSON.parse(JSON.stringify(obj));\n};\n\n/**\n * Angular replacement for Vue's cross-frame state composable.\n * It synchronises a reactive value across frames/windows via the `postMessage` API.\n *\n * @template S The type of the state being synchronised.\n * @param key Unique key identifying this state channel.\n * @param initialState Initial value (or lazy factory) for the state.\n * @param options Control flags for emitting/receiving updates.\n *\n * @returns `[stateSignal, setState, postState]`\n * - `stateSignal` – Angular `Signal<S | undefined>` holding the current state.\n * - `setState` – Setter with the same API as React's `setState`.\n * - `postState` – Manually broadcast the current state (useful after mutations outside `setState`).\n */\nexport const useCrossFrameState = <S>(\n key: `${MessageKey}`,\n initialState?: S | (() => S),\n options: CrossFrameStateOptions = { emit: true, receive: true }\n): [\n Signal<S | undefined>,\n (v: S | ((prev: S | undefined) => S)) => void,\n () => void,\n] => {\n if (crossFrameStateCache.has(key)) {\n // Return the existing instance\n const { state, setState, postState } = crossFrameStateCache.get(key)!;\n return [state, setState, postState];\n }\n\n const { emit = true, receive = true } = options;\n\n /**\n * Internal reactive state using Angular signals.\n * We resolve the initial value here to avoid one extra render (same idea as in the React version).\n */\n const stateSignal = signal<S | undefined>(resolveState<S>(initialState));\n\n // Get communicator within injection context\n const { postMessage, senderId } = useCommunicator() ?? {};\n\n /**\n * Broadcast the given value if emitting is allowed and the communicator is ready.\n */\n const broadcastState = (value: S | undefined) => {\n if (\n !emit ||\n typeof postMessage !== 'function' ||\n typeof value === 'undefined'\n )\n return;\n postMessage({\n type: `${key}/post`,\n data: value,\n senderId,\n });\n };\n\n /**\n * Setter that mirrors React's `setState` signature (supports value or updater fn).\n */\n const setState = (valueOrUpdater: S | ((prev: S | undefined) => S)) => {\n const next = resolveState<S>(valueOrUpdater as any, stateSignal());\n const serialised = toSerializable(next);\n stateSignal.set(serialised);\n broadcastState(serialised);\n };\n\n /**\n * Manually broadcast the current state to peers.\n */\n const postState = () => {\n if (typeof postMessage !== 'function') return;\n postMessage({\n type: `${key}/post`,\n data: stateSignal(),\n senderId,\n });\n };\n\n // Emit the initial state (if any) right away so that peers can pick it up.\n broadcastState(stateSignal());\n\n // If we are in receive mode but have no state yet, ask peers for theirs.\n if (\n receive &&\n typeof postMessage === 'function' &&\n typeof stateSignal() === 'undefined'\n ) {\n postMessage({ type: `${key}/get`, senderId });\n }\n\n /* ───────────────────── Incoming messages ───────────────────── */\n\n // 1. Updates posted by other frames\n useCrossFrameMessageListener<S>(\n `${key}/post`,\n receive\n ? (data) => {\n stateSignal.set(data);\n }\n : undefined\n );\n\n // 2. Requests from peers asking for our current value\n const handleGetMessage = (_: unknown, originSenderId?: string) => {\n if (!emit) return;\n if (originSenderId === senderId) return; // Don't respond to our own request\n broadcastState(stateSignal());\n };\n\n useCrossFrameMessageListener(\n `${key}/get`,\n emit ? handleGetMessage : undefined\n );\n\n // Cache this instance\n crossFrameStateCache.set(key, { state: stateSignal, setState, postState });\n\n return [stateSignal as Signal<S | undefined>, setState, postState];\n};\n"],"mappings":"8KAYA,MAAM,EAAuB,IAAI,IAY3B,GACJ,EACA,IAEI,OAAO,GAAU,WACX,EAA0B,EAAU,CAEvC,EAOH,EAAqB,GACrB,GAAQ,KAAkC,EAEvC,KAAK,MAAM,KAAK,UAAU,EAAI,CAAC,CAiB3B,GACX,EACA,EACA,EAAkC,CAAE,KAAM,GAAM,QAAS,GAAM,GAK5D,CACH,GAAI,EAAqB,IAAI,EAAI,CAAE,CAEjC,GAAM,CAAE,QAAO,WAAU,aAAc,EAAqB,IAAI,EAAI,CACpE,MAAO,CAAC,EAAO,EAAU,EAAU,CAGrC,GAAM,CAAE,OAAO,GAAM,UAAU,IAAS,EAMlC,EAAc,EAAsB,EAAgB,EAAa,CAAC,CAGlE,CAAE,cAAa,YAAa,GAAiB,EAAI,EAAE,CAKnD,EAAkB,GAAyB,CAE7C,CAAC,GACD,OAAO,GAAgB,YAChB,IAAU,QAGnB,EAAY,CACV,KAAM,GAAG,EAAI,OACb,KAAM,EACN,WACD,CAAC,EAME,EAAY,GAAqD,CAErE,IAAM,EAAa,EADN,EAAgB,EAAuB,GAAa,CAAC,CAC3B,CACvC,EAAY,IAAI,EAAW,CAC3B,EAAe,EAAW,EAMtB,MAAkB,CAClB,OAAO,GAAgB,YAC3B,EAAY,CACV,KAAM,GAAG,EAAI,OACb,KAAM,GAAa,CACnB,WACD,CAAC,EA0CJ,OAtCA,EAAe,GAAa,CAAC,CAI3B,GACA,OAAO,GAAgB,YAChB,GAAa,GAAK,QAEzB,EAAY,CAAE,KAAM,GAAG,EAAI,MAAO,WAAU,CAAC,CAM/C,EACE,GAAG,EAAI,OACP,EACK,GAAS,CACR,EAAY,IAAI,EAAK,EAEvB,IAAA,GACL,CASD,EACE,GAAG,EAAI,MACP,GARwB,EAAY,IAA4B,CAC3D,GACD,IAAmB,GACvB,EAAe,GAAa,CAAC,EAKH,IAAA,GAC3B,CAGD,EAAqB,IAAI,EAAK,CAAE,MAAO,EAAa,WAAU,YAAW,CAAC,CAEnE,CAAC,EAAsC,EAAU,EAAU"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useCrossFrameState as e}from"./useCrossFrameState.mjs";import{DestroyRef as t,inject as n}from"@angular/core";import{MessageKey as r}from"@intlayer/editor";const i=(t,n)=>e(r.INTLAYER_URL_CHANGE,t,n),a=e=>{let[r,a]=i(e,{emit:!0,receive:!1}),o,s,c=()=>a(window.location.pathname);try{let e=n(t,{optional:!0});if(e&&typeof window<`u`){o=history.pushState,s=history.replaceState;let t=e=>(...t)=>{e.apply(history,t),window.dispatchEvent(new Event(`locationchange`))};history.pushState=t(o),history.replaceState=t(s),window.addEventListener(`locationchange`,c),window.addEventListener(`popstate`,c),window.addEventListener(`hashchange`,c),c(),e.onDestroy(()=>{window.removeEventListener(`locationchange`,c),window.removeEventListener(`popstate`,c),window.removeEventListener(`hashchange`,c),o&&(history.pushState=o),s&&(history.replaceState=s)})}}catch{console.warn(`useCrossURLPathSetter called outside injection context; URL path synchronization may not be available.`)}return[r,a]};export{a as useCrossURLPathSetter,i as useCrossURLPathState};
|
|
2
|
-
//# sourceMappingURL=useCrossURLPathState.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossURLPathState.mjs","names":[],"sources":["../../../src/editor/useCrossURLPathState.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { MessageKey } from '@intlayer/editor';\nimport { useCrossFrameState } from './useCrossFrameState';\n\n/**\n * Hook to create and manage a cross-frame synchronized URL path state\n * @param initial - The initial URL path\n * @param opts - Options for controlling emit and receive behavior\n * @returns A tuple containing [state signal, setState function, forceSync function]\n */\nexport const useCrossURLPathState = (\n initial?: string,\n opts?: Parameters<typeof useCrossFrameState>[2]\n) => useCrossFrameState<string>(MessageKey.INTLAYER_URL_CHANGE, initial, opts);\n\n/**\n * Hook for host applications to push URL path changes into the shared state\n * This also monkey patches history methods to capture navigation events\n * @param initial - The initial URL path\n * @returns A tuple containing [state signal, setState function]\n */\nexport const useCrossURLPathSetter = (initial?: string) => {\n const [state, setState] = useCrossURLPathState(initial, {\n emit: true,\n receive: false,\n });\n\n // Original history methods\n let originalPushState: typeof history.pushState;\n let originalReplaceState: typeof history.replaceState;\n\n // Function to update state with current pathname\n const update = () => setState(window.location.pathname);\n\n // Use Angular's DestroyRef for cleanup instead of Vue lifecycle hooks\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef && typeof window !== 'undefined') {\n // Save original methods\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n\n /**\n * Wraps a history function to dispatch a custom event when called\n * @param fn - The history function to wrap\n * @returns The wrapped function\n */\n const wrap =\n (fn: typeof history.pushState) =>\n (...args: Parameters<typeof history.pushState>) => {\n fn.apply(history, args);\n window.dispatchEvent(new Event('locationchange'));\n };\n\n // Patch history methods\n history.pushState = wrap(originalPushState);\n history.replaceState = wrap(originalReplaceState);\n\n // Add event listeners\n window.addEventListener('locationchange', update);\n window.addEventListener('popstate', update);\n window.addEventListener('hashchange', update);\n\n // Initialize immediately\n update();\n\n // Clean up on destroy\n destroyRef.onDestroy(() => {\n window.removeEventListener('locationchange', update);\n window.removeEventListener('popstate', update);\n window.removeEventListener('hashchange', update);\n\n // Restore original history methods\n if (originalPushState) history.pushState = originalPushState;\n if (originalReplaceState) history.replaceState = originalReplaceState;\n });\n }\n } catch {\n console.warn(\n 'useCrossURLPathSetter called outside injection context; ' +\n 'URL path synchronization may not be available.'\n );\n }\n\n return [state, setState] as const;\n};\n"],"mappings":"mKAUA,MAAa,GACX,EACA,IACG,EAA2B,EAAW,oBAAqB,EAAS,EAAK,CAQjE,EAAyB,GAAqB,CACzD,GAAM,CAAC,EAAO,GAAY,EAAqB,EAAS,CACtD,KAAM,GACN,QAAS,GACV,CAAC,CAGE,EACA,EAGE,MAAe,EAAS,OAAO,SAAS,SAAS,CAGvD,GAAI,CACF,IAAM,EAAa,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,CAEzD,GAAI,GAAc,OAAO,OAAW,IAAa,CAE/C,EAAoB,QAAQ,UAC5B,EAAuB,QAAQ,aAO/B,IAAM,EACH,IACA,GAAG,IAA+C,CACjD,EAAG,MAAM,QAAS,EAAK,CACvB,OAAO,cAAc,IAAI,MAAM,iBAAiB,CAAC,EAIrD,QAAQ,UAAY,EAAK,EAAkB,CAC3C,QAAQ,aAAe,EAAK,EAAqB,CAGjD,OAAO,iBAAiB,iBAAkB,EAAO,CACjD,OAAO,iBAAiB,WAAY,EAAO,CAC3C,OAAO,iBAAiB,aAAc,EAAO,CAG7C,GAAQ,CAGR,EAAW,cAAgB,CACzB,OAAO,oBAAoB,iBAAkB,EAAO,CACpD,OAAO,oBAAoB,WAAY,EAAO,CAC9C,OAAO,oBAAoB,aAAc,EAAO,CAG5C,IAAmB,QAAQ,UAAY,GACvC,IAAsB,QAAQ,aAAe,IACjD,OAEE,CACN,QAAQ,KACN,yGAED,CAGH,MAAO,CAAC,EAAO,EAAS"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__decorate as e}from"../_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.mjs";import{Injectable as t,InjectionToken as n,computed as r,inject as i}from"@angular/core";const a=new n(`editedContentActions`);let o=class{useEditedContentRenderer(e,t,n){let o=i(a,{optional:!0});return r(()=>o?.getEditedContentValue(e,t)??n)}};o=e([t({providedIn:`root`})],o);const s=(e,t,n)=>i(o).useEditedContentRenderer(e,t,n);export{a as EDITED_CONTENT_ACTIONS_TOKEN,o as EditedContentRendererService,s as useEditedContentRenderer};
|
|
2
|
-
//# sourceMappingURL=useEditedContentRenderer.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEditedContentRenderer.mjs","names":[],"sources":["../../../src/editor/useEditedContentRenderer.ts"],"sourcesContent":["import {\n computed,\n Injectable,\n InjectionToken,\n inject,\n type Signal,\n} from '@angular/core';\nimport type { KeyPath } from '@intlayer/types/keyPath';\n\nexport interface EditedContentActions {\n getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;\n}\n\nexport const EDITED_CONTENT_ACTIONS_TOKEN =\n new InjectionToken<EditedContentActions | null>('editedContentActions');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EditedContentRendererService {\n /**\n * Mirrors the React hook one-for-one.\n */\n useEditedContentRenderer(\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n ): Signal<unknown> {\n const editedContentContext = inject(EDITED_CONTENT_ACTIONS_TOKEN, {\n optional: true,\n });\n\n return computed(() => {\n const edited = editedContentContext?.getEditedContentValue(\n dictionaryKey,\n keyPath\n ) as string | undefined;\n\n return edited ?? fallback;\n });\n }\n}\n\n/**\n * Standalone function that can be used like the Vue composable\n */\nexport const useEditedContentRenderer = (\n dictionaryKey: string,\n keyPath: KeyPath[],\n fallback: unknown\n): Signal<unknown> => {\n const service = inject(EditedContentRendererService);\n return service.useEditedContentRenderer(dictionaryKey, keyPath, fallback);\n};\n"],"mappings":"qLAaA,MAAa,EACX,IAAI,EAA4C,uBAAuB,CAKlE,IAAA,EAAA,KAAmC,CAIxC,yBACE,EACA,EACA,EACiB,CACjB,IAAM,EAAuB,EAAO,EAA8B,CAChE,SAAU,GACX,CAAC,CAEF,OAAO,MACU,GAAsB,sBACnC,EACA,EACD,EAEgB,EACjB,QAvBL,EAAW,CACV,WAAY,OACb,CAAC,CAAA,CAAA,EAAA,CA4BF,MAAa,GACX,EACA,EACA,IAEgB,EAAO,EAA6B,CACrC,yBAAyB,EAAe,EAAS,EAAS"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createSharedComposable as e}from"./createSharedComposable.mjs";import{useCrossFrameMessageListener as t}from"./useCrossFrameMessageListener.mjs";import{DestroyRef as n,inject as r}from"@angular/core";import{MessageKey as i,mergeIframeClick as a}from"@intlayer/editor";const o=e(()=>{let e=t(i.INTLAYER_IFRAME_CLICKED),a=()=>{e()};try{let e=r(n,{optional:!0});e&&typeof window<`u`&&(window.addEventListener(`mousedown`,a),e.onDestroy(()=>window.removeEventListener(`mousedown`,a)))}catch{console.warn(`useIframeClickInterceptor called outside injection context; event listener setup may not be available.`)}}),s=e(()=>{o(),t(i.INTLAYER_IFRAME_CLICKED,a)});export{o as useIframeClickInterceptor,s as useIframeClickMerger};
|
|
2
|
-
//# sourceMappingURL=useIframeClickInterceptor.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIframeClickInterceptor.mjs","names":[],"sources":["../../../src/editor/useIframeClickInterceptor.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { MessageKey, mergeIframeClick } from '@intlayer/editor';\nimport { createSharedComposable } from './createSharedComposable';\nimport { useCrossFrameMessageListener } from './useCrossFrameMessageListener';\n\n/* ─────────────────────────────────────────────\n 1. \"Interceptor\" – send a postMessage when\n the editor iframe itself is clicked.\n────────────────────────────────────────────── */\n/**\n * Hook that intercepts clicks in the iframe and sends them to the parent window\n * This allows the parent window to know when the iframe is clicked\n */\nexport const useIframeClickInterceptor = createSharedComposable(() => {\n const postMessage = useCrossFrameMessageListener<undefined>(\n MessageKey.INTLAYER_IFRAME_CLICKED\n );\n\n const handler = () => {\n postMessage();\n };\n\n // Use Angular's DestroyRef for cleanup instead of Vue's lifecycle hooks\n try {\n const destroyRef = inject(DestroyRef, { optional: true });\n\n if (destroyRef && typeof window !== 'undefined') {\n // Set up event listener immediately\n window.addEventListener('mousedown', handler);\n\n // Clean up on destroy\n destroyRef.onDestroy(() =>\n window.removeEventListener('mousedown', handler)\n );\n }\n } catch {\n console.warn(\n 'useIframeClickInterceptor called outside injection context; ' +\n 'event listener setup may not be available.'\n );\n }\n});\n\n/**\n * Hook for the parent window to listen for iframe clicks and merge them\n * This makes iframe clicks behave as if they happened in the parent window\n */\nexport const useIframeClickMerger = createSharedComposable(() => {\n useIframeClickInterceptor();\n\n useCrossFrameMessageListener<MessageEvent>(\n MessageKey.INTLAYER_IFRAME_CLICKED,\n mergeIframeClick\n );\n});\n"],"mappings":"mRAaA,MAAa,EAA4B,MAA6B,CACpE,IAAM,EAAc,EAClB,EAAW,wBACZ,CAEK,MAAgB,CACpB,GAAa,EAIf,GAAI,CACF,IAAM,EAAa,EAAO,EAAY,CAAE,SAAU,GAAM,CAAC,CAErD,GAAc,OAAO,OAAW,MAElC,OAAO,iBAAiB,YAAa,EAAQ,CAG7C,EAAW,cACT,OAAO,oBAAoB,YAAa,EAAQ,CACjD,OAEG,CACN,QAAQ,KACN,yGAED,GAEH,CAMW,EAAuB,MAA6B,CAC/D,GAA2B,CAE3B,EACE,EAAW,wBACX,EACD,EACD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
//#region src/UI/ContentSelector.component.d.ts
|
|
4
|
-
declare class ContentSelectorComponent implements OnInit, OnDestroy {
|
|
5
|
-
onClickOutside?: () => void;
|
|
6
|
-
pressDuration?: number;
|
|
7
|
-
isSelecting?: boolean;
|
|
8
|
-
click: EventEmitter<MouseEvent>;
|
|
9
|
-
press: EventEmitter<void>;
|
|
10
|
-
containerRef: ElementRef<HTMLSpanElement>;
|
|
11
|
-
private isHovered;
|
|
12
|
-
private isSelectingState;
|
|
13
|
-
private pressTimerRef;
|
|
14
|
-
private readonly isSelectingComputed;
|
|
15
|
-
private readonly isStringSlot;
|
|
16
|
-
ngOnInit(): void;
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
onDocumentMouseDown(event: MouseEvent): void;
|
|
19
|
-
private handleOnLongPress;
|
|
20
|
-
private startPressTimer;
|
|
21
|
-
private clearPressTimer;
|
|
22
|
-
handleMouseDown(): void;
|
|
23
|
-
handleMouseUp(): void;
|
|
24
|
-
private handleClickOutside;
|
|
25
|
-
handleClick(e: MouseEvent): void;
|
|
26
|
-
handleBlur(): void;
|
|
27
|
-
onMouseEnter(): void;
|
|
28
|
-
getContainerStyle(): {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { ContentSelectorComponent };
|
|
34
|
-
//# sourceMappingURL=ContentSelector.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelector.component.d.ts","names":[],"sources":["../../../src/UI/ContentSelector.component.ts"],"mappings":";;;cAyCa,wBAAA,YAAoC,MAAA,EAAQ,SAAA;EAC9C,cAAA;EACA,aAAA;EACA,WAAA;EAEC,KAAA,EAAK,YAAA,CAAA,UAAA;EACL,KAAA,EAAK,YAAA;EAGf,YAAA,EAAe,UAAA,CAAW,eAAA;EAAA,QAElB,SAAA;EAAA,QACA,gBAAA;EAAA,QACA,aAAA;EAAA,iBAES,mBAAA;EAAA,iBAIA,YAAA;EAMjB,QAAA,CAAA;EAIA,WAAA,CAAA;EAKA,mBAAA,CAAoB,KAAA,EAAO,UAAA;EAAA,QAInB,iBAAA;EAAA,QAKA,eAAA;EAAA,QAMA,eAAA;EAOR,eAAA,CAAA;EAKA,aAAA,CAAA;EAAA,QAKQ,kBAAA;EAUR,WAAA,CAAY,CAAA,EAAG,UAAA;EAQf,UAAA,CAAA;EAIA,YAAA,CAAA;EAIA,iBAAA,CAAA;IAAA,CAAwB,GAAA;EAAA;AAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _angular_core0 from "@angular/core";
|
|
2
|
-
import { NodeProps } from "@intlayer/core/interpreter";
|
|
3
|
-
|
|
4
|
-
//#region src/editor/ContentSelectorWrapper.component.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Combine your NodeProps (which include dictionaryKey & keyPath)
|
|
7
|
-
* with any other div-like attributes.
|
|
8
|
-
*/
|
|
9
|
-
interface ContentSelectorWrapperProps extends NodeProps {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
}
|
|
12
|
-
declare class ContentSelectorWrapperComponent {
|
|
13
|
-
dictionaryKey: string;
|
|
14
|
-
keyPath: any[];
|
|
15
|
-
private focusDictionary;
|
|
16
|
-
private editorEnabled;
|
|
17
|
-
constructor();
|
|
18
|
-
isSelected: _angular_core0.Signal<boolean>;
|
|
19
|
-
enabled: _angular_core0.Signal<boolean>;
|
|
20
|
-
handleSelect(): void;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ContentSelectorWrapperComponent, ContentSelectorWrapperProps };
|
|
24
|
-
//# sourceMappingURL=ContentSelectorWrapper.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.component.d.ts","names":[],"sources":["../../../src/editor/ContentSelectorWrapper.component.ts"],"mappings":";;;;;;;AAcA;UAAiB,2BAAA,SAAoC,SAAA;EAAA,CAClD,GAAA;AAAA;AAAA,cAkBU,+BAAA;EACF,aAAA;EACA,OAAA;EAAA,QAGD,eAAA;EAAA,QACA,aAAA;;EAOR,UAAA,EAb0C,cAAA,CAahC,MAAA;EASV,OAAA,EATU,cAAA,CASH,MAAA;EAGP,YAAA,CAAA;AAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as _angular_core0 from "@angular/core";
|
|
2
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
3
|
-
import { KeyPath } from "@intlayer/types/keyPath";
|
|
4
|
-
|
|
5
|
-
//#region src/editor/EditedContentRenderer.component.d.ts
|
|
6
|
-
interface EditedContentRendererProps {
|
|
7
|
-
dictionaryKey: string;
|
|
8
|
-
keyPath: KeyPath[];
|
|
9
|
-
locale?: Locale;
|
|
10
|
-
}
|
|
11
|
-
declare class EditedContentRendererComponent {
|
|
12
|
-
dictionaryKey: string;
|
|
13
|
-
keyPath: KeyPath[];
|
|
14
|
-
locale?: Locale;
|
|
15
|
-
private fallback;
|
|
16
|
-
private rawContent;
|
|
17
|
-
/**
|
|
18
|
-
* Object → getContent → string, same as the React version.
|
|
19
|
-
*/
|
|
20
|
-
renderedContent: _angular_core0.Signal<string>;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { EditedContentRendererComponent, EditedContentRendererProps };
|
|
24
|
-
//# sourceMappingURL=EditedContentRenderer.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditedContentRenderer.component.d.ts","names":[],"sources":["../../../src/editor/EditedContentRenderer.component.ts"],"mappings":";;;;;UAQiB,0BAAA;EACf,aAAA;EACA,OAAA,EAAS,OAAA;EACT,MAAA,GAAS,MAAA;AAAA;AAAA,cASE,8BAAA;EACF,aAAA;EACA,OAAA,EAAU,OAAA;EACV,MAAA,GAAS,MAAA;EAAA,QAEV,QAAA;EAAA,QAEA,UAAA;EAhBC;;;EA2BT,eAAA,EAfwB,cAAA,CAeT,MAAA;AAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NodeProps } from "@intlayer/core/interpreter";
|
|
2
|
-
|
|
3
|
-
//#region src/editor/EditorSelectorRenderer.component.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Combine your NodeProps (which include dictionaryKey & keyPath)
|
|
6
|
-
* with any other div-like attributes.
|
|
7
|
-
*/
|
|
8
|
-
interface EditorSelectorRendererProps extends NodeProps {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
declare class EditorSelectorRendererComponent {
|
|
12
|
-
dictionaryKey: string;
|
|
13
|
-
keyPath: any[];
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { EditorSelectorRendererComponent, EditorSelectorRendererProps };
|
|
17
|
-
//# sourceMappingURL=EditorSelectorRenderer.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorSelectorRenderer.component.d.ts","names":[],"sources":["../../../src/editor/EditorSelectorRenderer.component.ts"],"mappings":";;;;;AAUA;;UAAiB,2BAAA,SAAoC,SAAA;EAAA,CAClD,GAAA;AAAA;AAAA,cAyBU,+BAAA;EACF,aAAA;EACA,OAAA;AAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Injector } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
//#region src/editor/communicator.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Interface defining a cross-frame communicator
|
|
6
|
-
*/
|
|
7
|
-
type Communicator = {
|
|
8
|
-
postMessage: typeof window.postMessage;
|
|
9
|
-
allowedOrigins?: string[];
|
|
10
|
-
senderId: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Configuration options for the communicator
|
|
14
|
-
*/
|
|
15
|
-
type CommunicatorOptions = Omit<Communicator, 'senderId'>;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a communicator client
|
|
18
|
-
* @param options - Options for configuring the communicator
|
|
19
|
-
*/
|
|
20
|
-
declare const createCommunicator: (options?: CommunicatorOptions) => Communicator;
|
|
21
|
-
/**
|
|
22
|
-
* Helper to install the Intlayer communicator into the injector
|
|
23
|
-
*/
|
|
24
|
-
declare const installCommunicator: (_injector: Injector, options?: CommunicatorOptions) => void;
|
|
25
|
-
/**
|
|
26
|
-
* Hook to access the communicator
|
|
27
|
-
* @returns The communicator instance
|
|
28
|
-
*/
|
|
29
|
-
declare const useCommunicator: () => Communicator;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { Communicator, CommunicatorOptions, createCommunicator, installCommunicator, useCommunicator };
|
|
32
|
-
//# sourceMappingURL=communicator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"communicator.d.ts","names":[],"sources":["../../../src/editor/communicator.ts"],"mappings":";;;;;AAQA;KAAY,YAAA;EACV,WAAA,SAAoB,MAAA,CAAO,WAAA;EAC3B,cAAA;EACA,QAAA;AAAA;;;;KAMU,mBAAA,GAAsB,IAAA,CAAK,YAAA;;AAAvC;;;cA4Ba,kBAAA,GACX,OAAA,GAAS,mBAAA,KAAiD,YAAA;;AAD5D;;cAiBa,mBAAA,GACX,SAAA,EAAW,QAAA,EACX,OAAA,GAAS,mBAAA;;;;;cAYE,eAAA,QAAsB,YAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","names":[],"sources":["../../../src/editor/configuration.ts"],"mappings":";cAMa,gBAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/editor/createSharedComposable.d.ts
|
|
2
|
-
type AnyFn = (...args: any[]) => any;
|
|
3
|
-
type SharedComposableReturn<T extends AnyFn = AnyFn> = T;
|
|
4
|
-
/**
|
|
5
|
-
* Angular replacement for Vue's tryOnScopeDispose
|
|
6
|
-
* Uses Angular's DestroyRef to handle cleanup when the injection context is destroyed
|
|
7
|
-
*/
|
|
8
|
-
declare function tryOnScopeDispose(fn: () => void): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Angular equivalent of Vue's createSharedComposable
|
|
11
|
-
* Creates a singleton pattern for services/composables
|
|
12
|
-
*/
|
|
13
|
-
declare const createSharedComposable: <Fn extends AnyFn>(composable: Fn) => SharedComposableReturn<Fn>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { SharedComposableReturn, createSharedComposable, tryOnScopeDispose };
|
|
16
|
-
//# sourceMappingURL=createSharedComposable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSharedComposable.d.ts","names":[],"sources":["../../../src/editor/createSharedComposable.ts"],"mappings":";KAEK,KAAA,OAAY,IAAA;AAAA,KAEL,sBAAA,WAAiC,KAAA,GAAQ,KAAA,IAAS,CAAA;;;;;iBAM9C,iBAAA,CAAkB,EAAA;;;;;cAkBrB,sBAAA,cAAqC,KAAA,EAChD,UAAA,EAAY,EAAA,KACX,sBAAA,CAAuB,EAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from "@angular/core";
|
|
2
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
-
|
|
4
|
-
//#region src/editor/dictionariesRecord.d.ts
|
|
5
|
-
type DictionaryContent = Record<Dictionary['key'], Dictionary>;
|
|
6
|
-
type DictionariesRecordClient = {
|
|
7
|
-
localeDictionaries: Signal<DictionaryContent>;
|
|
8
|
-
setLocaleDictionaries: (newValue: DictionaryContent) => void;
|
|
9
|
-
setLocaleDictionary: (dictionary: Dictionary) => void;
|
|
10
|
-
};
|
|
11
|
-
declare const createDictionaryRecordClient: () => DictionariesRecordClient;
|
|
12
|
-
/**
|
|
13
|
-
* Helper to install the provider into the injector
|
|
14
|
-
*/
|
|
15
|
-
declare const installDictionariesRecord: (_injector: Injector) => void;
|
|
16
|
-
declare const useDictionariesRecord: () => void;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { DictionaryContent, createDictionaryRecordClient, installDictionariesRecord, useDictionariesRecord };
|
|
19
|
-
//# sourceMappingURL=dictionariesRecord.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionariesRecord.d.ts","names":[],"sources":["../../../src/editor/dictionariesRecord.ts"],"mappings":";;;;KAWY,iBAAA,GAAoB,MAAA,CAAO,UAAA,SAAmB,UAAA;AAAA,KAErD,wBAAA;EACH,kBAAA,EAAoB,MAAA,CAAO,iBAAA;EAC3B,qBAAA,GAAwB,QAAA,EAAU,iBAAA;EAClC,mBAAA,GAAsB,UAAA,EAAY,UAAA;AAAA;AAAA,cAGvB,4BAAA,QAA4B,wBAAA;;;;cA8B5B,yBAAA,GAA6B,SAAA,EAAW,QAAA;AAAA,cAOxC,qBAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from "@angular/core";
|
|
2
|
-
import { ContentNode, Dictionary, LocalDictionaryId } from "@intlayer/types/dictionary";
|
|
3
|
-
import { KeyPath } from "@intlayer/types/keyPath";
|
|
4
|
-
|
|
5
|
-
//#region src/editor/editedContent.d.ts
|
|
6
|
-
type EditedContent = Record<Dictionary['key'], Dictionary>;
|
|
7
|
-
type EditedContentClient = {
|
|
8
|
-
editedContent: Signal<EditedContent>;
|
|
9
|
-
setEditedContent: (editedContent: EditedContent) => void;
|
|
10
|
-
getEditedContentValue: (localDictionaryIdOrKey: LocalDictionaryId | Dictionary['key'] | string, keyPath: KeyPath[]) => ContentNode | undefined;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Creates an edited content client
|
|
14
|
-
*/
|
|
15
|
-
declare const createEditedContentClient: () => EditedContentClient;
|
|
16
|
-
/**
|
|
17
|
-
* Helper to install the edited content into the injector
|
|
18
|
-
*/
|
|
19
|
-
declare const installEditedContent: (_injector: Injector) => void;
|
|
20
|
-
declare const useEditedContent: () => EditedContentClient;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { EditedContent, createEditedContentClient, installEditedContent, useEditedContent };
|
|
23
|
-
//# sourceMappingURL=editedContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editedContent.d.ts","names":[],"sources":["../../../src/editor/editedContent.ts"],"mappings":";;;;;KAQY,aAAA,GAAgB,MAAA,CAAO,UAAA,SAAmB,UAAA;AAAA,KAEjD,mBAAA;EACH,aAAA,EAAe,MAAA,CAAO,aAAA;EACtB,gBAAA,GAAmB,aAAA,EAAe,aAAA;EAClC,qBAAA,GACE,sBAAA,EAAwB,iBAAA,GAAoB,UAAA,kBAC5C,OAAA,EAAS,OAAA,OACN,WAAA;AAAA;;;;cAaM,yBAAA,QAAyB,mBAAA;;;;cAuDzB,oBAAA,GAAwB,SAAA,EAAW,QAAA;AAAA,cAOnC,gBAAA,QAAgB,mBAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
//#region src/editor/editorEnabled.d.ts
|
|
4
|
-
type EditorEnabledStateProps = {
|
|
5
|
-
wrapperEnabled: Signal<boolean>;
|
|
6
|
-
isInIframe: Signal<boolean>;
|
|
7
|
-
enabled: Signal<boolean>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Creates an editor wrapperEnabled client
|
|
11
|
-
*/
|
|
12
|
-
declare const createEditorEnabledClient: () => EditorEnabledStateProps;
|
|
13
|
-
/**
|
|
14
|
-
* Helper to install the editor wrapperEnabled state into the injector
|
|
15
|
-
*/
|
|
16
|
-
declare const installEditorEnabled: (_injector: Injector) => void;
|
|
17
|
-
declare const useEditorEnabled: () => EditorEnabledStateProps;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { EditorEnabledStateProps, createEditorEnabledClient, installEditorEnabled, useEditorEnabled };
|
|
20
|
-
//# sourceMappingURL=editorEnabled.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editorEnabled.d.ts","names":[],"sources":["../../../src/editor/editorEnabled.ts"],"mappings":";;;KAcY,uBAAA;EACV,cAAA,EAAgB,MAAA;EAChB,UAAA,EAAY,MAAA;EACZ,OAAA,EAAS,MAAA;AAAA;;;;cAaE,yBAAA,QAAyB,uBAAA;;;;cAqBzB,oBAAA,GAAwB,SAAA,EAAW,QAAA;AAAA,cAOnC,gBAAA,QAAgB,uBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editorLocale.d.ts","names":[],"sources":["../../../src/editor/editorLocale.ts"],"mappings":";;cAQa,eAAA,QAAe,gBAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Injector, Signal } from "@angular/core";
|
|
2
|
-
import { KeyPath } from "@intlayer/types/keyPath";
|
|
3
|
-
|
|
4
|
-
//#region src/editor/focusDictionary.d.ts
|
|
5
|
-
type FileContent = {
|
|
6
|
-
dictionaryKey: string;
|
|
7
|
-
keyPath?: KeyPath[];
|
|
8
|
-
dictionaryPath?: string;
|
|
9
|
-
};
|
|
10
|
-
type FocusDictionaryClient = {
|
|
11
|
-
focusedContent: Signal<FileContent | null>;
|
|
12
|
-
setFocusedContent: (focussedContent: FileContent | null) => void;
|
|
13
|
-
setFocusedContentKeyPath: (keyPath: KeyPath[]) => void;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Creates a focus dictionary client
|
|
17
|
-
*/
|
|
18
|
-
declare const createFocusDictionaryClient: () => FocusDictionaryClient;
|
|
19
|
-
/**
|
|
20
|
-
* Helper to install the focus dictionary into the injector
|
|
21
|
-
*/
|
|
22
|
-
declare const installFocusDictionary: (_injector: Injector) => void;
|
|
23
|
-
/** consumer */
|
|
24
|
-
declare const useFocusDictionary: () => FocusDictionaryClient;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { FileContent, createFocusDictionaryClient, installFocusDictionary, useFocusDictionary };
|
|
27
|
-
//# sourceMappingURL=focusDictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focusDictionary.d.ts","names":[],"sources":["../../../src/editor/focusDictionary.ts"],"mappings":";;;;KAMY,WAAA;EACV,aAAA;EACA,OAAA,GAAU,OAAA;EACV,cAAA;AAAA;AAAA,KAGG,qBAAA;EACH,cAAA,EAAgB,MAAA,CAAO,WAAA;EACvB,iBAAA,GAAoB,eAAA,EAAiB,WAAA;EACrC,wBAAA,GAA2B,OAAA,EAAS,OAAA;AAAA;;;AALpC;cAgBW,2BAAA,QAA2B,qBAAA;;;;cA2B3B,sBAAA,GAA0B,SAAA,EAAW,QAAA;;cAQrC,kBAAA,QAAkB,qBAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ContentSelectorWrapperComponent } from "./ContentSelectorWrapper.component.js";
|
|
2
|
-
import { EditedContentRendererComponent } from "./EditedContentRenderer.component.js";
|
|
3
|
-
import { EditorSelectorRendererComponent } from "./EditorSelectorRenderer.component.js";
|
|
4
|
-
import { installIntlayerEditor } from "./installIntlayerEditor.js";
|
|
5
|
-
export { ContentSelectorWrapperComponent, EditedContentRendererComponent, EditorSelectorRendererComponent, installIntlayerEditor };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Injector } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
//#region src/editor/installIntlayerEditor.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Angular-side replacement for the former <IntlayerEditorProvider> React component.
|
|
6
|
-
*
|
|
7
|
-
* Call **once** in your Angular application's bootstrap function or main module:
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { bootstrapApplication } from '@angular/platform-browser';
|
|
11
|
-
* import { AppComponent } from './app/app.component';
|
|
12
|
-
* import { installIntlayerEditor } from 'angular-intlayer';
|
|
13
|
-
*
|
|
14
|
-
* bootstrapApplication(AppComponent).then(appRef => {
|
|
15
|
-
* installIntlayerEditor(appRef.injector);
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare const installIntlayerEditor: (injector: Injector) => void;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { installIntlayerEditor };
|
|
22
|
-
//# sourceMappingURL=installIntlayerEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installIntlayerEditor.d.ts","names":[],"sources":["../../../src/editor/installIntlayerEditor.ts"],"mappings":";;;;;AA8CA;;;;;;;;;;;;;cAAa,qBAAA,GAAyB,QAAA,EAAU,QAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MessageKey } from "@intlayer/editor";
|
|
2
|
-
|
|
3
|
-
//#region src/editor/useCrossFrameMessageListener.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* useCrossFrameMessageListener
|
|
6
|
-
*
|
|
7
|
-
* @template S - type of the message payload
|
|
8
|
-
* @param key message type we care about
|
|
9
|
-
* @param onEventTriggered optional callback when a matching message arrives
|
|
10
|
-
* @returns postMessage(data?) helper scoped to this key
|
|
11
|
-
*/
|
|
12
|
-
declare const useCrossFrameMessageListener: <S>(key: `${MessageKey}` | `${MessageKey}/post` | `${MessageKey}/get`, onEventTriggered?: (data: S) => void) => (data?: S) => void;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { useCrossFrameMessageListener };
|
|
15
|
-
//# sourceMappingURL=useCrossFrameMessageListener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameMessageListener.d.ts","names":[],"sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"mappings":";;;;;AAmEA;;;;;;cAAa,4BAAA,MACX,GAAA,KAAQ,UAAA,QAAkB,UAAA,aAAuB,UAAA,QACjD,gBAAA,IAAoB,IAAA,EAAM,CAAA,eAAU,IAAA,GA8BD,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Signal } from "@angular/core";
|
|
2
|
-
import { MessageKey } from "@intlayer/editor";
|
|
3
|
-
|
|
4
|
-
//#region src/editor/useCrossFrameState.d.ts
|
|
5
|
-
type CrossFrameStateOptions = {
|
|
6
|
-
/** Whether to broadcast state changes to other instances (default: true) */emit?: boolean; /** Whether to listen for state updates from other instances (default: true) */
|
|
7
|
-
receive?: boolean;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Angular replacement for Vue's cross-frame state composable.
|
|
11
|
-
* It synchronises a reactive value across frames/windows via the `postMessage` API.
|
|
12
|
-
*
|
|
13
|
-
* @template S The type of the state being synchronised.
|
|
14
|
-
* @param key Unique key identifying this state channel.
|
|
15
|
-
* @param initialState Initial value (or lazy factory) for the state.
|
|
16
|
-
* @param options Control flags for emitting/receiving updates.
|
|
17
|
-
*
|
|
18
|
-
* @returns `[stateSignal, setState, postState]`
|
|
19
|
-
* - `stateSignal` – Angular `Signal<S | undefined>` holding the current state.
|
|
20
|
-
* - `setState` – Setter with the same API as React's `setState`.
|
|
21
|
-
* - `postState` – Manually broadcast the current state (useful after mutations outside `setState`).
|
|
22
|
-
*/
|
|
23
|
-
declare const useCrossFrameState: <S>(key: `${MessageKey}`, initialState?: S | (() => S), options?: CrossFrameStateOptions) => [Signal<S | undefined>, (v: S | ((prev: S | undefined) => S)) => void, () => void];
|
|
24
|
-
//#endregion
|
|
25
|
-
export { CrossFrameStateOptions, useCrossFrameState };
|
|
26
|
-
//# sourceMappingURL=useCrossFrameState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameState.d.ts","names":[],"sources":["../../../src/editor/useCrossFrameState.ts"],"mappings":";;;;KAKY,sBAAA;8EAEV,IAAA,YAFgC;EAIhC,OAAA;AAAA;;AAiDF;;;;;;;;;;;;;cAAa,kBAAA,MACX,GAAA,KAAQ,UAAA,IACR,YAAA,GAAe,CAAA,UAAW,CAAA,GAC1B,OAAA,GAAS,sBAAA,MAET,MAAA,CAAO,CAAA,gBACN,CAAA,EAAG,CAAA,KAAM,IAAA,EAAM,CAAA,iBAAkB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useCrossFrameState } from "./useCrossFrameState.js";
|
|
2
|
-
import * as _angular_core0 from "@angular/core";
|
|
3
|
-
|
|
4
|
-
//#region src/editor/useCrossURLPathState.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Hook to create and manage a cross-frame synchronized URL path state
|
|
7
|
-
* @param initial - The initial URL path
|
|
8
|
-
* @param opts - Options for controlling emit and receive behavior
|
|
9
|
-
* @returns A tuple containing [state signal, setState function, forceSync function]
|
|
10
|
-
*/
|
|
11
|
-
declare const useCrossURLPathState: (initial?: string, opts?: Parameters<typeof useCrossFrameState>[2]) => [_angular_core0.Signal<string>, (v: string | ((prev: string) => string)) => void, () => void];
|
|
12
|
-
/**
|
|
13
|
-
* Hook for host applications to push URL path changes into the shared state
|
|
14
|
-
* This also monkey patches history methods to capture navigation events
|
|
15
|
-
* @param initial - The initial URL path
|
|
16
|
-
* @returns A tuple containing [state signal, setState function]
|
|
17
|
-
*/
|
|
18
|
-
declare const useCrossURLPathSetter: (initial?: string) => readonly [_angular_core0.Signal<string>, (v: string | ((prev: string) => string)) => void];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { useCrossURLPathSetter, useCrossURLPathState };
|
|
21
|
-
//# sourceMappingURL=useCrossURLPathState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossURLPathState.d.ts","names":[],"sources":["../../../src/editor/useCrossURLPathState.ts"],"mappings":";;;;;;;AAUA;;;cAAa,oBAAA,GACX,OAAA,WACA,IAAA,GAAO,UAAA,QAAkB,kBAAA,UAAR,cAAA,CAA8B,MAAA,WAAA,CAAA,aAAA,IAAA;;;;;;;cASpC,qBAAA,GAAyB,OAAA,wBAiErC,cAAA,CAjEqD,MAAA,WAAA,CAAA,aAAA,IAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, Signal } from "@angular/core";
|
|
2
|
-
import { KeyPath } from "@intlayer/types/keyPath";
|
|
3
|
-
|
|
4
|
-
//#region src/editor/useEditedContentRenderer.d.ts
|
|
5
|
-
interface EditedContentActions {
|
|
6
|
-
getEditedContentValue(dictionaryKey: string, keyPath: KeyPath[]): unknown;
|
|
7
|
-
}
|
|
8
|
-
declare const EDITED_CONTENT_ACTIONS_TOKEN: InjectionToken<EditedContentActions>;
|
|
9
|
-
declare class EditedContentRendererService {
|
|
10
|
-
/**
|
|
11
|
-
* Mirrors the React hook one-for-one.
|
|
12
|
-
*/
|
|
13
|
-
useEditedContentRenderer(dictionaryKey: string, keyPath: KeyPath[], fallback: unknown): Signal<unknown>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Standalone function that can be used like the Vue composable
|
|
17
|
-
*/
|
|
18
|
-
declare const useEditedContentRenderer: (dictionaryKey: string, keyPath: KeyPath[], fallback: unknown) => Signal<unknown>;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { EDITED_CONTENT_ACTIONS_TOKEN, EditedContentActions, EditedContentRendererService, useEditedContentRenderer };
|
|
21
|
-
//# sourceMappingURL=useEditedContentRenderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEditedContentRenderer.d.ts","names":[],"sources":["../../../src/editor/useEditedContentRenderer.ts"],"mappings":";;;;UASiB,oBAAA;EACf,qBAAA,CAAsB,aAAA,UAAuB,OAAA,EAAS,OAAA;AAAA;AAAA,cAG3C,4BAAA,EAA4B,cAAA,CAAA,oBAAA;AAAA,cAM5B,4BAAA;EATkD;;;EAa7D,wBAAA,CACE,aAAA,UACA,OAAA,EAAS,OAAA,IACT,QAAA,YACC,MAAA;AAAA;;;AAdL;cAiCa,wBAAA,GACX,aAAA,UACA,OAAA,EAAS,OAAA,IACT,QAAA,cACC,MAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/editor/useIframeClickInterceptor.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Hook that intercepts clicks in the iframe and sends them to the parent window
|
|
4
|
-
* This allows the parent window to know when the iframe is clicked
|
|
5
|
-
*/
|
|
6
|
-
declare const useIframeClickInterceptor: () => void;
|
|
7
|
-
/**
|
|
8
|
-
* Hook for the parent window to listen for iframe clicks and merge them
|
|
9
|
-
* This makes iframe clicks behave as if they happened in the parent window
|
|
10
|
-
*/
|
|
11
|
-
declare const useIframeClickMerger: () => void;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { useIframeClickInterceptor, useIframeClickMerger };
|
|
14
|
-
//# sourceMappingURL=useIframeClickInterceptor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIframeClickInterceptor.d.ts","names":[],"sources":["../../../src/editor/useIframeClickInterceptor.ts"],"mappings":";;AAaA;;;cAAa,yBAAA;;AAkCb;;;cAAa,oBAAA"}
|