@myop/sdk 0.1.46 → 0.2.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/dist/bundled-declarations.d.ts +61 -0
- package/dist/cjs/{_IframeSDK.b1e6c181.js → _IframeSDK.561df75d.js} +31 -1
- package/dist/cjs/_IframeSDK.561df75d.js.map +7 -0
- package/dist/cjs/_IframeSDK.66415fd2.min.js +1 -0
- package/dist/cjs/_MyopHelpers.70503082.js +2810 -0
- package/dist/cjs/_MyopHelpers.70503082.js.map +7 -0
- package/dist/cjs/_MyopHelpers.7c81005e.min.js +1 -0
- package/dist/cjs/_WebComponentSDK.dabe5cd1.min.js +1 -0
- package/dist/cjs/{_WebComponentSDK.bf4ad0dd.js → _WebComponentSDK.fd6435d3.js} +31 -1
- package/dist/cjs/_WebComponentSDK.fd6435d3.js.map +7 -0
- package/dist/cjs/_hostSDK.9b7c3010.min.js +1 -0
- package/dist/cjs/{_hostSDK.7c59d1ae.js → _hostSDK.b1330e44.js} +31 -1
- package/dist/cjs/_hostSDK.b1330e44.js.map +7 -0
- package/dist/cjs/myop_sdk.js +14 -14
- package/dist/cjs/myop_sdk.js.map +1 -1
- package/dist/cjs/myop_sdk.min.js +1 -1
- package/dist/module/Iframe/index.js +34 -2
- package/dist/module/Iframe/index.js.map +3 -3
- package/dist/module/SDK.js +123 -4
- package/dist/module/SDK.js.map +3 -3
- package/dist/module/common/index.d.ts +46 -0
- package/dist/module/common/index.js +1 -1
- package/dist/module/common/index.js.map +2 -2
- package/dist/module/helpers/EnableV2.d.ts +12 -0
- package/dist/module/helpers/index.d.ts +1 -0
- package/dist/module/helpers/index.js +2520 -4
- package/dist/module/helpers/index.js.map +4 -4
- package/dist/module/host/index.js +34 -2
- package/dist/module/host/index.js.map +3 -3
- package/dist/module/webcomponent/index.js +34 -2
- package/dist/module/webcomponent/index.js.map +3 -3
- package/package.json +1 -1
- package/dist/cjs/_IframeSDK.71663203.min.js +0 -1
- package/dist/cjs/_IframeSDK.b1e6c181.js.map +0 -7
- package/dist/cjs/_MyopHelpers.98cae3f9.js +0 -417
- package/dist/cjs/_MyopHelpers.98cae3f9.js.map +0 -7
- package/dist/cjs/_MyopHelpers.f3e207e0.min.js +0 -1
- package/dist/cjs/_WebComponentSDK.3474ea7a.min.js +0 -1
- package/dist/cjs/_WebComponentSDK.bf4ad0dd.js.map +0 -7
- package/dist/cjs/_hostSDK.7c59d1ae.js.map +0 -7
- package/dist/cjs/_hostSDK.8b543e61.min.js +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/common/MyopElementRef.ts", "../../src/common/baseMessageHandler.ts", "../../src/common/MyopMessages.ts", "../../src/messages/index.ts", "../../src/utils/uuid.ts", "../../src/utils/utils.ts", "../../src/messages/BaseMessage.ts", "../../src/messages/BindClickMessage.ts", "../../src/messages/ChangeTextMessage.ts", "../../src/messages/ExecuteScriptMessage.ts", "../../src/messages/CustomRefMessage.ts", "../../src/messages/AddEventListenerMessage.ts", "../../src/messages/SetAttributeMessage.ts", "../../src/messages/GetElementValueMessage.ts", "../../src/messages/SetInnerHtml.ts", "../../src/messages/InitMessage.ts", "../../src/messages/CreateRefComponentMessage.ts", "../../src/messages/EnvelopedMessage.ts", "../../src/messages/DetectMyopRefsMessage.ts", "../../src/messages/GetAttributeMessage.ts", "../../src/messages/componentMessages/ExecuteComponentMethod.ts", "../../src/messages/componentMessages/SetMutationObserverMessage.ts", "../../src/messages/CleanupMessage.ts", "../../src/messages/DisposeMessage.ts", "../../src/messages/componentMessages/SetResizeObserverMessage.ts", "../../src/common/BaseMyopSDK.ts", "../../src/common/index.ts", "../../src/webcomponent/consts.ts", "../../src/webcomponent/messageHandlers/BaseWebComponentMessageHandler.ts", "../../src/consts.ts", "../../src/common/messageHandlers/helpers.ts", "../../src/webcomponent/messageHandlers/bindOnClickHandler.ts", "../../src/webcomponent/messageHandlers/changeTextHandler.ts", "../../src/webcomponent/shadowRootRef.ts", "../../src/webcomponent/messageHandlers/DetectMyopRefsMessageHandler.ts", "../../src/dynamicImport/defineDynamicImport.ts", "../../src/webcomponent/messageHandlers/setAttributeHandler.ts", "../../src/common/utils/serialization.ts", "../../src/webcomponent/messageHandlers/addEventListenerHandler.ts", "../../src/host/components/IMyopComponent.ts", "../../src/host/logMessages.ts", "../../src/host/components/myopRefComponent.ts", "../../src/host/componentCore.ts", "../../src/host/components/myopIframeComponent.ts", "../../src/host/loaders/IMyopLoader.ts", "../../src/host/loaders/iframeLoader.ts", "../../src/host/components/myopWebcomponent.ts", "../../src/host/loaders/webcomponentLoader.ts", "version:myop-sdk-version", "../../src/host/loaders/HTMLComponentLoader.ts", "../../src/helpers/CloudRepository.ts", "../../src/helpers/EnableV2.ts", "../../src/host/myopOverride.ts", "../../src/host/hostSDK.ts", "../../src/webcomponent/messageHandlers/CreateRefComponentMessageHandler.ts", "../../src/common/messageHandlers/executeScriptHandler.ts", "../../src/webcomponent/messageHandlers/executeScriptHandler.ts", "../../src/webcomponent/messageHandlers/GetElementValueHandler.ts", "../../src/webcomponent/messageHandlers/setInnerHtmlHandler.ts", "../../src/webcomponent/WebComponentSDK.ts"],
|
|
4
|
+
"sourcesContent": ["export interface IElementRef {\n myopId?: string\n htmlTagName: string\n BoundingRect?: DOMRect\n offsetTop?: number\n offsetLeft?: number\n\n type: string\n}\n\nexport class XPathElementRef implements IElementRef {\n constructor(public xPath: string,\n public htmlTagName: string,\n public BoundingRect?: DOMRect,\n public offsetTop?: number,\n public offsetLeft?: number) {\n }\n\n public readonly type: string = 'XPathElementRef'\n}\n\nexport class MyopElementRef implements IElementRef {\n constructor(public myopId: string,\n public htmlTagName: string,\n public BoundingRect?: DOMRect,\n public offsetTop?: number,\n public offsetLeft?: number) {\n\n }\n\n public readonly type: string = 'MyopElementRef'\n}\n", "import {MyopMessageKey} from \"./MyopMessages\";\nimport {BaseMyopMessage, MyopBindMessage, MyopBindReplayMessage} from \"../messages\";\nimport {CleanupHandler} from \"./index.ts\";\n\nexport type IMessageExecutorCleanup = CleanupHandler | Promise<CleanupHandler> | Promise<void> | void;\n\nexport const runExecutorCleanup = async (task: IMessageExecutorCleanup) => {\n if (typeof task === 'function') {\n // It's a function, call it\n task();\n } else if (task instanceof Promise) {\n // It's a Promise, await it\n const result = await task;\n\n if (typeof result === 'function') {\n // If the result is a function, call it\n result();\n }\n }\n // If task is void, do nothing\n}\n\ntype IMessageExecutor<T extends BaseMyopMessage> = (message: T) => IMessageExecutorCleanup;\n\ninterface IMessageHandler<T extends BaseMyopMessage> {\n messageType: MyopMessageKey\n\n executor: IMessageExecutor<T>;\n\n messageToHost: (message: MyopBindReplayMessage, replayTo?: MyopBindMessage) => void;\n}\n\nexport abstract class BaseMessageHandler<T extends BaseMyopMessage = any> implements IMessageHandler<T> {\n\n //TODO : add dispose method\n\n constructor(public messageToHost: (message: MyopBindReplayMessage, replayTo?: MyopBindMessage) => void) {\n\n }\n\n abstract messageType: MyopMessageKey\n abstract executor: IMessageExecutor<T>;\n}\n\nexport abstract class BaseContextMessageHandler<T extends BaseMyopMessage = any, E = any> extends BaseMessageHandler<T> {\n constructor(public messageToHost: (message: MyopBindReplayMessage, replayTo?: MyopBindMessage) => void, public context?: E) {\n super(messageToHost);\n }\n}\n", "type StringWithAutocomplete<T> = T | (string & Record<never, never>);\n\nexport type MyopMessageKey = StringWithAutocomplete<keyof typeof MyopMessages | keyof typeof MyopMessages.In>;\n\nexport const MyopMessages = {\n //host to component\n 'InitRequest': 'InitRequest',\n 'InitResponse': 'InitResponse',\n 'InitMessage': 'InitMessage',\n 'DisposeMessage': 'DisposeMessage',\n\n 'ChangeTextMessage': 'ChangeTextMessage',\n 'BindClickMessage': 'BindClickMessage',\n 'DetectMyopRefsMessage': 'DetectMyopRefsMessage',\n\n 'ExecuteScriptMessage': 'ExecuteScriptMessage',\n\n 'AddEventListenerMessage': 'AddEventListenerMessage',\n 'SetAttributeMessage': 'SetAttributeMessage',\n\n 'CreateRefComponentMessage': 'CreateRefComponentMessage',\n 'EnvelopedMessage': 'EnvelopedMessage',\n\n 'GetElementValueMessage': 'GetElementValueMessage',\n 'GetAttributeMessage': 'GetAttributeMessage',\n\n 'SetInnerHtml': 'SetInnerHtml',\n\n //component messages\n 'ExecuteComponentMethod': 'ExecuteComponentMethod',\n 'SetMutationObserverMessage': 'SetMutationObserverMessage',\n 'SetResizeObserverMessage': 'SetResizeObserverMessage',\n\n 'CleanupMessage': 'CleanupMessage',\n\n // external to host :\n In: {\n 'DetectedMyopRefsMessage': 'DetectedMyopRefsMessage',\n 'ClickReplayMessage': 'ClickReplayMessage',\n 'ExecuteScriptReplyMessage': 'ExecuteScriptReplyMessage',\n\n 'EventListenerCallbackMessage': 'EventListenerCallbackMessage',\n 'ElementValueReplayMessage': 'ElementValueReplayMessage',\n\n \"GetAttributeReplayMessage\": \"GetAttributeReplayMessage\",\n 'RefComponentCreatedMessage': 'RefComponentCreatedMessage',\n 'EnvelopedMessage': 'EnvelopedMessage',\n\n 'MutationObserverMessage': 'MutationObserverMessage',\n 'CleanupReplayMessage': 'CleanupReplayMessage',\n 'ResizeObserverMessage': 'ResizeObserverMessage'\n }\n}\n", "export * from './BaseMessage';\n\n//user's messages\nexport * from './BindClickMessage';\nexport * from './ChangeTextMessage';\nexport * from './ExecuteScriptMessage';\nexport * from './CustomRefMessage';\nexport * from './AddEventListenerMessage';\nexport * from './SetAttributeMessage';\nexport * from './GetElementValueMessage';\nexport * from './SetInnerHtml';\n\n//system messages\nexport * from './InitMessage';\nexport * from './CreateRefComponentMessage';\nexport * from './EnvelopedMessage';\nexport * from './DetectMyopRefsMessage';\nexport * from './GetElementValueMessage';\nexport * from './GetAttributeMessage';\n\nexport * from './componentMessages/ExecuteComponentMethod';\nexport * from './componentMessages/SetMutationObserverMessage';\nexport * from './CleanupMessage';\nexport * from './DisposeMessage';\nexport * from './componentMessages/SetResizeObserverMessage';", "//TODO : reuse from one place.\n// needs to be used in myop-sdk, myop-dashbaord, myop-server, myop-cli ..\n\nexport const uuidv4 = () => {\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, c =>\n (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)\n );\n}\n\n// Convert UUID string to bytes\nexport const uuidToBytes = (uuid: string): Uint8Array => {\n return Uint8Array.from(\n uuid.replace(/-/g, '').match(/.{1,2}/g)!.map(byte => parseInt(byte, 16))\n );\n};\n\n// Convert bytes to UUID string\nexport const bytesToUuid = (bytes: Uint8Array): string => {\n const hex = [...bytes].map(b => b.toString(16).padStart(2, '0')).join('');\n return [\n hex.slice(0, 8),\n hex.slice(8, 12),\n hex.slice(12, 16),\n hex.slice(16, 20),\n hex.slice(20)\n ].join('-');\n};\n\n// Base64 URL-safe encode\nexport const base64UrlEncode = (bytes: Uint8Array): string => {\n const base64 = btoa(String.fromCharCode(...bytes));\n return base64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n};\n\n// Base64 URL-safe decode\nexport const base64UrlDecode = (str: string): Uint8Array => {\n let base64 = str.replace(/-/g, '+').replace(/_/g, '/');\n while (base64.length % 4) base64 += '=';\n const binary = atob(base64);\n return Uint8Array.from(binary, char => char.charCodeAt(0));\n};\n\n// Compress an array of UUIDs into a short URL-safe string\nexport const compressUUIDs = (uuids: string[]): string => {\n const allBytes = uuids.flatMap(uuid => Array.from(uuidToBytes(uuid)));\n return base64UrlEncode(new Uint8Array(allBytes));\n};\n\n// Decompress from URL-safe string back to an array of UUIDs\nexport const decompressUUIDs = (encoded: string): string[] => {\n const bytes = base64UrlDecode(encoded);\n if (bytes.length % 16 !== 0) throw new Error('Invalid input length');\n\n const uuids: string[] = [];\n for (let i = 0; i < bytes.length; i += 16) {\n uuids.push(bytesToUuid(bytes.slice(i, i + 16)));\n }\n return uuids;\n};\n", "export * from './uuid.ts'\n\nexport const wait = (ms: number) => {\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "import {MyopMessageKey} from \"../common/MyopMessages\";\nimport {uuidv4} from \"../utils/utils\";\nimport {IMyopComponent} from \"../host\";\nimport {IRefConfig} from \"../common\";\n\nexport class MessageDirection {\n static down = 'down' as const\n static up = 'up' as const\n}\n\nexport type MessageDirectionOption = 'up' | 'down';\n\nexport abstract class BaseMyopMessage<T = any> {\n id = uuidv4()\n\n static create<T, U extends new (...args: ConstructorParameters<U>) => T = typeof this>(\n this: U,\n ...args: ConstructorParameters<U>\n ): InstanceType<typeof this> {\n // @ts-ignore\n return new this(...args);\n }\n\n constructor() {\n //console.log('meesage id created', this.id, document.location.href);\n }\n\n myop = true\n\n abstract messageType: MyopMessageKey | string;\n\n content?: T\n\n // TODO : cant be optional \n source?: string\n destination?: string\n\n route?: string[]\n\n ref?: Ref\n\n direction?: MessageDirectionOption\n\n cleanable: boolean = false\n\n isTypeof(msg: BaseMyopMessage): boolean {\n return msg.messageType === this.messageType\n }\n}\n\nexport abstract class MyopElementMessage<T = any> extends BaseMyopMessage<T> {\n constructor(public ref: Ref) {\n super()\n }\n}\n\nexport abstract class MyopBindReplayMessage<T = any> extends BaseMyopMessage<T> {\n constructor(public replayToHandler?: string) {\n super();\n }\n}\n\nexport abstract class MyopBindMessage<T = any, R extends MyopBindReplayMessage = any> extends BaseMyopMessage<T> {\n\n public abstract replyMessageKey: MyopMessageKey;\n\n public handlerUniqueId = uuidv4()\n\n constructor(public handler: (message: R) => void) {\n super()\n }\n}\n\nexport class Ref {\n public myop = true;\n\n public __nonProxied?: Ref;\n\n static create(selector: string, refConfig?: IRefConfig, component?: IMyopComponent) {\n let _refConfig = refConfig;\n if (!_refConfig) {\n _refConfig = {\n id: '',\n name: '',\n description: '',\n selectorType: 'id-attribute',\n selector: selector,\n behavior: {\n type: 'code'\n }\n } as IRefConfig\n }\n return new Ref(_refConfig, component);\n }\n\n constructor(public refConfig: IRefConfig, public component?: IMyopComponent) {\n this.__nonProxied = {\n ...this,\n component: null // in order to be serializable\n }\n }\n}\n", "import {MyopBindMessage, MyopBindReplayMessage, Ref} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\n\nconst ReplayMessageKey = 'ClickReplayMessage'\n\nexport class BindClickMessage extends MyopBindMessage<void, ClickReplayMessage> {\n replyMessageKey: MyopMessageKey = ReplayMessageKey\n messageType = 'BindClickMessage';\n cleanable = true;\n\n constructor(public ref: Ref, handler: (message: ClickReplayMessage) => void) {\n super(handler);\n }\n}\n\nexport class ClickReplayMessage extends MyopBindReplayMessage {\n messageType = ReplayMessageKey\n}\n\n", "import {BaseMyopMessage, Ref} from \"./BaseMessage\";\n\nexport class ChangeTextMessage extends BaseMyopMessage<string> {\n\n messageType = 'ChangeTextMessage';\n\n constructor(public ref: Ref, text: string) {\n super();\n this.content = text\n }\n}", "import {MyopBindMessage, MyopBindReplayMessage} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\nimport {RootRef} from \"../common\";\nimport {makeSerializable} from \"../common/utils/serialization.ts\";\n\nconst ReplayMessageKey = 'ExecuteScriptReplyMessage'\n\nconst functionBodyRegex = /(?:function\\s*\\w*\\s*\\([^)]*\\)\\s*\\{([\\s\\S]*?)\\}|(\\([^)]*\\)\\s*=>\\s*\\{([\\s\\S]*?)\\}))\\s*$/;\nconst expressionBodyRegex = /\\(\\s*[^)]+\\s*\\)\\s*=>\\s*(.+)/;\n\nexport const stripFunction = (content: string) => {\n let match = content.match(functionBodyRegex);\n if (match) {\n return match[1] || match[3];\n } else {\n let match = content.match(expressionBodyRegex);\n if (match)\n return match[1].trim();\n }\n}\n\nexport type scriptInputs = {\n [key: string]: string | number | boolean\n} | {};\n\nexport type scriptVars<T> = {\n send: (data: T) => void;\n // completeStream: () => void;\n rootRef: RootRef;\n makeSerializable: typeof makeSerializable\n}\n\nexport type extendedScriptVars<T, I> = {\n [K in keyof I]: I[K];\n} & scriptVars<T>\n\nexport class ExecuteScriptMessage<T = any, I extends scriptInputs = any> extends MyopBindMessage<string, ExecuteScriptReplyMessage<T>> {\n\n replyMessageKey: MyopMessageKey = ReplayMessageKey;\n messageType = 'ExecuteScriptMessage';\n script: string = ''\n\n static replierKey = 'send';\n static completeStreamKey = 'completeStream';\n\n constructor(script: (vars: extendedScriptVars<T, I>) => T, handler: (message: ExecuteScriptReplyMessage<T>) => void = () => {\n }, public scriptInputs?: I) {\n super(handler);\n this.script = script.toString();\n\n //TODO: can be remove\n this.content = script.toString()\n this.content = stripFunction(this.content);\n }\n}\n\nexport class ExecuteScriptReplyMessage<T = any> extends MyopBindReplayMessage<T> {\n\n messageType = ReplayMessageKey;\n\n constructor(public replayToHandler: string, public content: T) {\n super(replayToHandler);\n }\n}\n", "import {\n ExecuteScriptMessage,\n ExecuteScriptReplyMessage,\n extendedScriptVars,\n scriptInputs, stripFunction\n} from \"./ExecuteScriptMessage.ts\";\n\nexport type customRefScriptInputs = {\n elementId: string,\n ref?: HTMLElement,\n _script?: string,\n __scriptInputs?: Object\n};\n\nexport class CustomRefMessage<T = any, I extends scriptInputs = customRefScriptInputs> extends ExecuteScriptMessage<T, I & customRefScriptInputs> {\n\n constructor(script: (vars: extendedScriptVars<T, I & customRefScriptInputs>) => T,\n public scriptInputs: I & customRefScriptInputs,\n handler: (message: ExecuteScriptReplyMessage<T>) => void = () => {\n }) {\n\n //mock vars\n // let rootRef, elementId, _script, __scriptInputs;\n super(({rootRef, elementId, _script, __scriptInputs}) => {\n const refs = (rootRef.shadowRoot || rootRef.container).querySelectorAll(`[${'myop-id'}='${elementId}']`);\n if (refs.length) {\n // const ref = refs[0];\n\n //TODO : think about exposing \"refs\" and not only \"ref\"\n //for cases where the Ref has multiplate implementations\n\n // @ts-ignore\n __scriptInputs.ref = refs[0];\n\n const dynamicFunction = new Function(`return (${_script})(...arguments)`);\n return dynamicFunction(__scriptInputs);\n\n // @ts-ignore\n //return Function('ref', 'rootRef', ...Object.keys(__scriptInputs), _script!)(ref, rootRef, ...Object.values(__scriptInputs))\n }\n return null as T;\n }, handler);\n\n this.scriptInputs = {\n ...scriptInputs,\n //_script: stripFunction(script.toString()),\n _script: script.toString()\n };\n }\n}\n", "import {MyopBindMessage, MyopBindReplayMessage, Ref} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\nimport {Serializable, SerializableSkeleton} from \"../common/utils/serialization.ts\";\n\nconst ReplayMessageKey = 'EventListenerCallbackMessage'\n\nexport class AddEventListenerMessage<T extends keyof HTMLElementEventMap = keyof HTMLElementEventMap> extends MyopBindMessage {\n\n replyMessageKey: MyopMessageKey = ReplayMessageKey;\n messageType = 'AddEventListenerMessage';\n cleanable = true;\n serializableSkeleton: SerializableSkeleton<HTMLElementEventMap[T]> = false // {} // empty\n\n constructor(public ref: Ref, public type: T, public handler: (message: EventListenerCallbackMessage) => void) {\n super(handler)\n }\n\n withSerializableSkeleton(serializableSkeleton: SerializableSkeleton<HTMLElementEventMap[T]>) {\n this.serializableSkeleton = serializableSkeleton;\n return this;\n }\n}\n\nexport class EventListenerCallbackMessage extends MyopBindReplayMessage {\n messageType = ReplayMessageKey;\n\n constructor(public replayToHandler: string, public e: Serializable<Event>) {\n super(replayToHandler);\n this.content = {\n e\n }\n }\n}\n", "import {BaseMyopMessage, Ref,} from \"./BaseMessage\";\n\n\nexport class SetAttributeMessage extends BaseMyopMessage {\n\n messageType = 'SetAttributeMessage';\n\n constructor(public ref: Ref, public name: string, public value: string) {\n super()\n }\n}\n", "import {MyopBindMessage, MyopBindReplayMessage, Ref} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\nimport {Serializable} from \"../common/utils/serialization.ts\";\n\nconst ReplayMessageKey = 'ElementValueReplayMessage'\n\nexport class GetElementValueMessage extends MyopBindMessage<void, ElementValueReplayMessage> {\n replyMessageKey: MyopMessageKey = ReplayMessageKey\n messageType = 'GetElementValueMessage';\n\n constructor(public ref: Ref, handler: (message: ElementValueReplayMessage) => void) {\n super(handler);\n }\n}\n\nexport type FormDataEntry = {\n id?: string,\n name?: string,\n value?: InputElementValue,\n required?: boolean,\n validity?: Serializable<ValidityState>,\n myopId?: string\n}\n\nexport type InputElementFormValue = {\n formData?: { [key: string]: FormDataEntry }\n unmappedData?: FormDataEntry[]\n};\n\nexport type InputElementValue = string | InputElementFormValue | null | undefined\n\nexport class ElementValueReplayMessage extends MyopBindReplayMessage {\n messageType = ReplayMessageKey\n\n constructor(public content: InputElementValue) {\n super();\n }\n}\n\n", "import {BaseMyopMessage, Ref} from \"./BaseMessage.ts\";\n\nexport class SetInnerHtml extends BaseMyopMessage<string> {\n\n messageType = 'SetInnerHtml';\n\n constructor(public ref: Ref, innerHtml: string) {\n super();\n this.content = innerHtml\n }\n}", "import { BaseMyopMessage } from \"./BaseMessage\";\n\n// sent by host to components, contains thier id \nexport class InitMessage extends BaseMyopMessage<{ id: string }> {\n messageType = 'InitMessage';\n\n constructor(id: string) {\n super()\n this.content = { id }\n }\n\n isTypeof(msg: BaseMyopMessage): boolean {\n return msg.messageType === this.messageType\n }\n}\n\n// component notify host the it was initated \nexport class InitResponse extends InitMessage {\n messageType = 'InitResponse';\n}\n\n// component ask to host to get initated \nexport class InitRequest extends BaseMyopMessage {\n messageType = 'InitRequest';\n}\n", "import {MyopBindMessage, MyopBindReplayMessage} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\nimport {IComponentConfig, IRefConfig} from \"../common\";\nimport {loaderOptions} from \"../host/hostSDK.ts\";\n\nconst ReplayMessageKey = 'RefComponentCreatedMessage'\n\nexport class CreateRefComponentMessage extends MyopBindMessage<void, RefComponentCreatedMessage> {\n replyMessageKey: MyopMessageKey = ReplayMessageKey\n messageType = 'CreateRefComponentMessage';\n\n constructor(public refConfig: IRefConfig,\n public nestedComponentConfig: IComponentConfig,\n public options: loaderOptions,\n handler: (message: RefComponentCreatedMessage) => void,\n ) {\n super(handler);\n\n }\n}\n\nexport type NestedRef = {\n refName: string,\n componentDefinitionId: string\n}\n\nexport class RefComponentCreatedMessage extends MyopBindReplayMessage {\n messageType = ReplayMessageKey\n\n constructor(public replayToHandler: string, public nestedRefs: NestedRef[], public failed?: boolean) {\n super(replayToHandler);\n }\n}\n", "import {BaseMyopMessage} from \"./BaseMessage\";\n\nexport class EnvelopedMessage extends BaseMyopMessage {\n messageType = 'EnvelopedMessage';\n\n constructor(public destination: string, public message: BaseMyopMessage) {\n super();\n\n const innerEnvelopedMessage = (message as EnvelopedMessage);\n this.route = [destination, ...innerEnvelopedMessage.route ? innerEnvelopedMessage.route : []];\n }\n}\n", "import {BaseMyopMessage, MyopBindMessage, MyopBindReplayMessage} from \"./BaseMessage\";\nimport {IElementRef} from \"../common\";\n\nconst ReplayMessageKey = 'DetectedMyopRefsMessage'\n\nexport class DetectMyopRefsMessage extends MyopBindMessage<any, DetectedMyopRefsMessage> {\n messageType = 'DetectMyopRefsMessage'\n replyMessageKey = ReplayMessageKey;\n}\n\nexport class DetectedMyopRefsMessage extends MyopBindReplayMessage<IElementRef[]> {\n\n messageType = ReplayMessageKey;\n\n constructor(public replayToHandler: string, myopElementRefs: IElementRef[]) {\n super(replayToHandler)\n this.content = myopElementRefs;\n }\n\n isTypeof(msg: BaseMyopMessage<any>): boolean {\n return msg.messageType === this.messageType\n }\n}\n", "import {MyopBindMessage, MyopBindReplayMessage, Ref} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\n\nconst ReplayMessageKey = 'GetAttributeReplayMessage'\n\nexport class GetAttributeMessage extends MyopBindMessage<void, GetAttributeReplayMessage> {\n replyMessageKey: MyopMessageKey = ReplayMessageKey\n messageType = 'GetAttributeMessage';\n\n constructor(public ref: Ref, public name: string, handler: (message: GetAttributeReplayMessage) => void) {\n super(handler);\n }\n}\n\nexport class GetAttributeReplayMessage extends MyopBindReplayMessage {\n messageType = ReplayMessageKey\n\n constructor(public content: string | null) {\n super();\n }\n}\n\n", "import {BaseMyopMessage} from \"../BaseMessage\";\nimport {IMyopComponent} from \"../../host\";\n\ntype MethodNames<T> = {\n // [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;\n [K in keyof T]: T[K] extends () => void ? K : never;\n}[keyof T];\n\n// Define a type that allows only strings corresponding to the method names of T\ntype MethodString<T> = MethodNames<T> extends infer M ? M extends string ? M : never : never;\n\n\nexport class ExecuteComponentMethod extends BaseMyopMessage {\n messageType = 'ExecuteComponentMethod';\n\n constructor(public method: MethodString<IMyopComponent>) {\n super();\n }\n}\n", "import {BaseMyopMessage} from \"../BaseMessage\";\n\nexport class SetMutationObserverMessage extends BaseMyopMessage {\n messageType = 'SetMutationObserverMessage';\n}\n\nexport class MutationObserverMessage extends BaseMyopMessage {\n messageType = 'MutationObserverMessage';\n}", "import {MyopBindMessage, MyopBindReplayMessage} from \"./BaseMessage\";\nimport {MyopMessageKey} from \"../common/MyopMessages\";\n\nconst ReplayMessageKey = 'CleanupReplayMessage'\n\nexport class CleanupMessage extends MyopBindMessage<void, CleanupReplayMessage> {\n replyMessageKey: MyopMessageKey = ReplayMessageKey\n messageType = 'CleanupMessage';\n\n constructor(public cleanupForMessageId: string, handler: (message: CleanupReplayMessage) => void) {\n super(handler);\n }\n}\n\nexport class CleanupReplayMessage extends MyopBindReplayMessage {\n messageType = ReplayMessageKey\n\n constructor(public customCleanup: boolean) {\n super();\n }\n}\n", "import {BaseMyopMessage} from \"./BaseMessage\";\n\nexport class DisposeMessage extends BaseMyopMessage {\n messageType = 'DisposeMessage';\n}\n", "import {BaseMyopMessage} from \"../BaseMessage\";\n\nexport class SetResizeObserverMessage extends BaseMyopMessage {\n cleanable = true;\n messageType = 'SetResizeObserverMessage';\n}\n\nexport class ResizeObserverMessage extends BaseMyopMessage {\n messageType = 'ResizeObserverMessage';\n}", "import {MyopMessages} from \"./MyopMessages\";\nimport {CleanupHandler, runExecutorCleanup} from \"./index.ts\";\nimport {BaseMessageHandler} from \"./baseMessageHandler\";\nimport {\n BaseMyopMessage, CleanupMessage, CleanupReplayMessage, CreateRefComponentMessage, EnvelopedMessage,\n InitMessage,\n InitResponse,\n MessageDirection,\n MyopBindMessage,\n MyopBindReplayMessage\n} from \"../messages\";\n\nexport class HostedComponent<T = any> {\n send = (message: BaseMyopMessage) => {\n //debugger;\n }\n\n //onMessageReceived: (msg: IMyopMessage) => void;\n\n constructor(public id: string, public context?: T) {\n\n }\n}\n\nexport interface IMyopSDK {\n init: () => void;\n\n messageToHost: (message: MyopBindReplayMessage, replayTo?: MyopBindMessage) => void\n\n supportedHandlers: BaseMessageHandler[];\n\n handleIncomeMessages: (message: BaseMyopMessage) => void\n\n components: Record<string, HostedComponent>;\n}\n\n// const localHostHandledMessages = [\n// MyopMessages.InitRequest,\n// MyopMessages.InitResponse,\n// //MyopMessages.EnvelopedMessage,\n// ]\n\nexport abstract class BaseMyopSDK implements IMyopSDK {\n\n abstract messageToHost: (message: MyopBindReplayMessage, replayTo?: MyopBindMessage) => void;\n\n abstract supportedHandlers: BaseMessageHandler[];\n\n messageToHandleAfterInit: BaseMyopMessage[] = [];\n\n components: Record<string, HostedComponent> = {};\n\n alwaysPassEnvelopesToHost: boolean = false\n\n messageCleanupCache: Record<string, CleanupHandler | Promise<CleanupHandler>> | Promise<void> = {};\n\n handleIncomeMessages(event: any) {\n const eventContent = event.data ? event.data : event.detail;\n\n if (!eventContent || !eventContent.myop) {\n // not myop marked event \n return;\n } else {\n let message = eventContent as BaseMyopMessage;\n\n if (message.direction !== MessageDirection.down) {\n //console.log('message dropped in baseSDK, direction was ', event.data.direction)\n return;\n }\n\n // if (localHostHandledMessages.includes(message.messageType)) {\n // debugger;\n // //TODO : fix direction ? message will not proccess otherwise\n // window.myop.hostSDK.send(message)\n // return;\n // }\n\n if (message.messageType === MyopMessages.DisposeMessage) {\n //debugger;\n\n //TODO : should not be optional, fix and remove 'if'\n if (message.destination)\n delete this.components[message.destination]\n return;\n }\n\n // We got our id from our hostSDK\n if (message.messageType === MyopMessages.InitMessage) {\n //TODO : SDK may serve more than 1 component .. think about that\n // @ts-ignore\n const newComponentId = (message as InitMessage).content.id;\n\n if (this.components[newComponentId]) {\n //debugger;\n //throw new Error(\"rechived init message for an exsising component.\")\n return;\n }\n\n this.components[newComponentId] = new HostedComponent(newComponentId)\n this.messageToHost(new InitResponse(newComponentId));\n\n // TODO : is it true to not pass further ( to the component )\n return;\n }\n\n // for same HostSDK cases\n // when both RefComponent and realComponent hosted in the same HostSDK\n if (message.messageType === MyopMessages.EnvelopedMessage) {\n const envelopedMessage = (message as EnvelopedMessage);\n const innerMessage = envelopedMessage.message;\n message = innerMessage;\n\n if (this.alwaysPassEnvelopesToHost || this.components[message.destination!]) {\n // @ts-ignore\n const destinationComponent = myop.hostSDK.components.find(c => c.id === innerMessage.destination);\n if (destinationComponent) {\n destinationComponent.send(innerMessage);\n return;\n }\n\n // @ts-ignore\n const envelopedDestinationComponent = myop.hostSDK.components.find(c => c.id === envelopedMessage.destination);\n if (envelopedDestinationComponent) {\n envelopedDestinationComponent.send(innerMessage);\n return;\n }\n } else {\n return;\n }\n }\n\n // if(message.messageType === MyopMessages.CreateRefComponentMessage){\n // const typedMessage : CreateRefComponentMessage = message as CreateRefComponentMessage;\n // // debugger;\n // }\n if (message.messageType) {\n\n if (message.messageType === MyopMessages.CleanupMessage) {\n const typedMessage = message as CleanupMessage;\n const cleanup = this.messageCleanupCache[typedMessage.cleanupForMessageId];\n\n const cleanupMessage = new CleanupReplayMessage(!!cleanup);\n cleanupMessage.destination = message.destination;\n\n if (!!cleanup) {\n delete this.messageCleanupCache[typedMessage.cleanupForMessageId];\n runExecutorCleanup(cleanup).then(() => {\n this.messageToHost(cleanupMessage, typedMessage);\n }).catch(() => {\n //TODO : handel error?\n })\n } else {\n this.messageToHost(cleanupMessage, typedMessage);\n }\n return;\n }\n\n let actionHandlerFound = false;\n\n this.supportedHandlers.forEach(handler => {\n if (handler.messageType === message.messageType) {\n actionHandlerFound = true;\n const cleanup = handler.executor(message);\n\n if (message.cleanable && cleanup) {\n this.messageCleanupCache[message.id] = cleanup;\n }\n\n if (cleanup && !message.cleanable) {\n throw new Error(`Cleanup handler generated for non-cleanable message. \nmessageType - ${message.messageType}, handler executor was - ${handler.executor}\n\nPlease review the message definition object & message handler.\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.`)\n }\n\n if (!cleanup && message.cleanable) {\n throw new Error(`No cleanup handler generated for a cleanable message. \nmessageType - ${message.messageType}, handler executor was - ${handler.executor}\n\nPlease review the message definition object & message handler.\nTo ensure cleanup properly set 'cleanable' true at message definition and return IMessageExecutorCleanup from your handlers.`)\n }\n }\n })\n\n if (!actionHandlerFound) {\n //TODO : print with debug config only\n //console.log('no message handler was found for ', message)\n }\n } else {\n console.log('unsupported message type')\n }\n }\n }\n\n abstract init: () => void;\n}\n", "import {MyopMessageKey} from \"./MyopMessages\";\n\nexport * from './MyopElementRef';\nexport * from './baseMessageHandler';\nexport * from './BaseMyopSDK';\n\nexport type CleanupHandler = () => void\n\nexport type Dictionary<T> = { [key: string]: T; };\n\n//export type SkinLoaderType = 'IframeLoader' | 'WebComponentLoader' | 'HTMLLoader' | string;\n\nexport const SkinLoaders = {\n \"IframeLoader\": \"IframeLoader\",\n \"WebComponentLoader\": \"WebComponentLoader\",\n \"HTMLLoader\": \"HTMLLoader\",\n \"MinimizedLoader\": \"MinimizedLoader\"\n} as const;\nexport type SkinLoaderType = keyof typeof SkinLoaders;\n\nexport type PropType = 'any' | 'string' | 'number' | string; // TODO : <\nexport type RefSelectorType = 'id-attribute' | 'css-selector' | 'xpath' | string;\n\nexport const LoaderFrameworks = {\n \"react\": \"react\",\n \"vue\": \"vue\",\n \"angular\": \"angular\",\n} as const\nexport type LoaderFrameworkType = keyof typeof LoaderFrameworks;\n\nexport interface IWebComponentLoaderConfig extends ISkinLoaderConfig {\n type: \"WebComponentLoader\";\n url: string,\n tag: string,\n framework?: LoaderFrameworkType\n}\n\nexport interface IIframeLoaderConfig extends ISkinLoaderConfig {\n type: \"IframeLoader\";\n url: string\n autoHeight: boolean\n height?: string\n width?: string\n}\n\nexport const ShadowRootModeType = {\n \"open\": \"open\",\n \"closed\": \"closed\",\n \"none\": \"none\",\n \"localFrame\": \"localFrame\"\n} as const;\n\n\nexport interface IHTMLLoaderConfig extends ISkinLoaderConfig {\n type: \"HTMLLoader\";\n HTML: string;\n //TODO: rename(rootMode/customElementMode) + db migration\n shadowRootMode?: keyof typeof ShadowRootModeType;\n autoHeight?: boolean;\n height?: string;\n width?: string;\n}\n\n//for internal dashboard usage\nexport interface IMinimizedLoaderConfig extends ISkinLoaderConfig {\n type: \"MinimizedLoader\";\n}\n\ninterface DashboardObject {\n _temp_client_id?: string,\n}\n\ntype Extend<T, U> = T & U;\n\ntype ExtendRecursively<T, E> = {\n [K in keyof E]: E[K];\n} & {\n [K in keyof T]: T[K] extends object\n ? ExtendRecursively<T[K], E>\n : T[K];\n};\n\nexport type IDashboard<T> = ExtendRecursively<T, DashboardObject>;\n\nexport interface ISkinLoaderConfig {\n type: SkinLoaderType\n\n [key: string]: any; // Allows any additional properties\n}\n\nexport interface v2_IReleaseMetadata {\n environmentId: string;\n environmentIdentifier: string;\n //\n // updatedOn?: string\n // updatedBy?: string\n}\n\nexport interface v2_IVariantConfig extends v2_IMyopStoredObject {\n loader: ISkinLoaderConfig\n componentId: string;\n\n releases?: v2_IReleaseMetadata[]\n}\n\nexport interface ISkinConfig {\n id: string\n name: string\n description: string\n loader: ISkinLoaderConfig\n createdBy?: string\n createdOn?: string\n}\n\nexport interface v2_ISkinConfig extends ISkinConfig {\n componentId: string\n}\n\nexport interface IMessagePropConfig extends IPropConfig {\n type: PropType\n messageType: MyopMessageKey\n}\n\nexport interface IBindMessagePropConfig extends IPropConfig {\n type: PropType\n messageType: MyopMessageKey\n}\n\nexport const PropMessageModes = {\n \"input\": \"input\",\n \"output\": \"output\"\n} as const;\n\nexport const PropConfigBehaviorTypes = {\n \"message\": \"message\",\n \"code\": \"code\"\n} as const;\n\nexport interface IPropMessageBehaviorParam {\n value: string\n}\n\nexport interface IPropBehavior {\n type: keyof typeof PropConfigBehaviorTypes\n}\n\nexport interface IPropCodeBehavior extends IPropBehavior {\n type: \"code\"\n remap?: string\n}\n\nexport interface IPropMessageBehavior extends IPropBehavior {\n type: \"message\"\n message: MyopMessageKey\n ref: string, //TODO make it id\n params: IPropMessageBehaviorParam[]\n mode: keyof typeof PropMessageModes\n}\n\nexport interface IPropConfig {\n id: string\n name: string\n description: string\n type: PropType\n behavior: IPropBehavior\n}\n\n\nexport class RefBehaviorType {\n static code = 'code' as const\n static component = 'component' as const\n}\n\nexport type IRefBehaviorType = 'code' | 'component';\n\nexport interface IRefBehavior {\n type: IRefBehaviorType\n}\n\nexport interface IComponentRefBehavior extends IRefBehavior {\n type: 'component'\n componentId: string\n\n /**\n * @deprecated\n * Property instance is deprecated and will be removed in future versions.\n */\n instance: IComponentInstanceConfig\n}\n\nexport interface ICodeRefBehavior extends IRefBehavior {\n type: 'code'\n}\n\nexport interface IRefConfig {\n id: string\n name: string\n description: string\n selectorType: RefSelectorType\n selector: string\n behavior: IRefBehavior\n}\n\nexport interface IComponentDefinitionConfig {\n id: string;\n name: string,\n description: string,\n // props: Record<string, IPropConfig> //id - type\n // refs: Record<string, IRefConfig>,\n // skins: Record<string, ISkinConfig>\n props: IPropConfig[],\n refs: IRefConfig[],\n skins: ISkinConfig[],\n defaultSkin: number;\n\n //TODO : think about that\n //resolvedDefinitions?: IComponentDefinitionConfig[]\n //TODO : move to base class ( IStorableItem or so...)\n\n createdOn?: string\n createdBy?: string\n updatedBy?: string\n}\n\n\nexport interface v2_IBaseMyopObject {\n id: string,\n name: string,\n description: string,\n}\n\nexport interface v2_IMyopStoredObject extends v2_IBaseMyopObject {\n updatedOn?: string\n updatedBy?: string\n}\n\nexport interface v2_IComponentDefinitionConfig extends v2_IMyopStoredObject {\n variants_ids: string[],\n DTOs: v2_IDTO[],\n tags: string[],\n\n //\n variants_names: string[],\n variants_data: {\n name: string;\n id: string\n updatedOn?: string\n updatedBy?: string\n has_releases?: boolean\n }[],\n\n preview_variant: v2_IVariantConfig;\n extra?: {\n firstVariant: v2_IVariantConfig; //when new component creates at the client\n }\n}\n\nexport interface v2_IDTO extends v2_IMyopStoredObject {\n data: object\n methodName: string\n}\n\nexport interface ISkinInstanceConfig {\n id: string\n}\n\nexport interface ISkinSelectorConfig {\n type: keyof typeof SkinSelectorTypes,\n //skins: ISkinInstanceConfig[]\n}\n\nexport const SegmentType = {\n \"FunctionResult\": \"FunctionResult\",\n} as const;\n\nexport interface ISegmentInstance {\n segmentId: string;\n skinSelector: ISkinSelectorConfig\n}\n\nexport interface ISegmentDefinition {\n id: string;\n type: keyof typeof SegmentType\n}\n\nexport interface IFunctionResultsSegment extends ISegmentDefinition {\n id: string;\n type: typeof SegmentType.FunctionResult\n name: string\n description: string\n function: string\n}\n\nexport const SkinSelectorTypes = {\n \"Segmented\": \"Segmented\",\n \"Dedicated\": \"Dedicated\",\n\n /**\n * This Selector Type is not yet supported but will be added in a future release.\n * Please check the documentation for updates.\n *\n * @type {string}\n */\n \"Default\": \"Default\"\n} as const;\n\n\n/**\n * This Skin Config Type is not yet supported but will be added in a future release.\n * Please check the documentation for updates.\n *\n * @type {IDefaultSkinConfig}\n */\nexport interface IDefaultSkinConfig extends ISkinSelectorConfig {\n type: typeof SkinSelectorTypes.Default,\n}\n\nexport interface ISegmentedSkinConfig extends ISkinSelectorConfig {\n type: typeof SkinSelectorTypes.Segmented,\n segments: ISegmentInstance[]\n}\n\nexport interface IDedicatedSkinConfig extends ISkinSelectorConfig {\n type: typeof SkinSelectorTypes.Dedicated,\n\n /**\n * @deprecated Use {@link skin} instead.\n * Property skins is deprecated and will be removed in future versions.\n * Please update your code to use {@link skin} for better compatibility.\n *\n * @type {string}\n */\n skins?: ISkinInstanceConfig[] // deprecated\n skin: ISkinInstanceConfig\n}\n\nexport interface IComponentInstanceConfig {\n id: string;\n componentId: string;\n\n //TODO :\n // RefID ? to support more than 1 component from the same type in composites ?\n\n //TODO : remove\n componentName: string; // << check\n\n skinSelector: ISkinSelectorConfig\n\n // storing the nested config for ref components\n nestedComponents?: IComponentInstanceConfig[]\n\n //only on GET?\n //TODO : think about that\n resolvedExperiences?: IExperience[]\n // will include instance and def config in order to render in production\n resolvedNestedComponents?: IComponentConfig[]\n}\n\nexport const ExperienceTypes = {\n \"Segment\": \"Segment\",\n \"Promo\": \"Promo\",\n \"AB\": \"AB\"\n} as const;\n\nexport interface IExperience {\n id: string\n name: string\n description: string\n type: keyof typeof ExperienceTypes\n experiences: IExperience[]\n //stickinessFactor\n //EndDate\n}\n\n// export interface IABExperienceGroup {\n// id: string\n// name: string\n// percentage: number\n// }\n\nexport interface IABExperience extends IExperience {\n type: typeof ExperienceTypes.AB\n // groups: IABExperienceGroup[]\n experiences: IExperience[]\n percentage: number\n}\n\nexport interface IDateRange {\n id: string\n start: Date\n end: Date\n timezone: string\n}\n\nexport interface ISegmentExperience extends IExperience {\n type: keyof typeof ExperienceTypes\n segment: ISegmentDefinition\n dateRange?: IDateRange\n}\n\nexport interface IUserFlowDefinition {\n id: string;\n name: string;\n description: string;\n components: IComponentInstanceConfig[];\n origins: string[],\n experiences: IExperience[]\n branch?: string\n}\n\nexport interface IComponentConfig {\n instance: IComponentInstanceConfig\n type: IComponentDefinitionConfig\n\n // TODO : verify uniqueness (dashboard & server)\n name: string\n}\n\ninterface IBranchable {\n branch?: string\n}\n\nexport interface IUserFlow extends Omit<IUserFlowDefinition, 'components'>, IBranchable {\n components: IComponentConfig[]\n}\n\nexport class RootRef {\n constructor(public container: HTMLElement, public shadowRoot?: ShadowRoot) {\n\n }\n\n getRootDiv = () => {\n return (this.shadowRoot || this.container).querySelector('div')\n }\n\n getRoot = () => {\n return (this.shadowRoot || this.container);\n }\n}\n", "export const myopWebcomponentConsts = {\n webcomponent_message_key: 'myop_webcomponent_message'\n}\n", "import {BaseContextMessageHandler, HostedComponent} from \"../../common\";\nimport {ShadowRootRef} from \"../shadowRootRef\";\nimport {BaseMyopMessage, MyopBindMessage} from \"../../messages\";\n\nexport type MessageToHost = (message: BaseMyopMessage) => void\n\nexport abstract class BaseWebComponentMessageHandler<T extends BaseMyopMessage = any> extends BaseContextMessageHandler<T, Record<string, HostedComponent<ShadowRootRef>>> {\n\n abstract messageType: string\n\n constructor(messageToHost: any, public context: Record<string, HostedComponent<ShadowRootRef>>) {\n super(messageToHost);\n }\n\n abstract innerExecutor: (event: T, shadowRootRef: ShadowRootRef, messageToHost: MessageToHost) => void;\n\n executor = (event: T) => {\n //debugger;\n if (event.destination) {\n const destination = event.destination;\n if (this.context[destination].context) {\n\n // patch the source id, think about that ?\n const _messageToHost = (message: BaseMyopMessage, replayTo?: MyopBindMessage) => {\n this.messageToHost({\n ...message,\n source: event.destination ? event.destination : event.source,\n destination: event.source ? event.source : event.destination\n } as BaseMyopMessage, replayTo)\n }\n\n return this.innerExecutor(event, this.context[destination].context, _messageToHost);\n } else {\n debugger;\n }\n } else {\n debugger;\n }\n }\n}\n", "export const myopAttributes = {\n id: 'myop-id'\n}\n", "import {myopAttributes} from \"../../consts.ts\";\nimport {Ref} from \"../../messages\";\n\nexport const getElementsByRef = (ref: Ref, el: ParentNode) => {\n return el.querySelectorAll(`[${myopAttributes.id}='${ref.refConfig.selector}']`);\n}\n\nexport const getFirstElementByRef = (ref: Ref, el: ParentNode) => {\n const elements = getElementsByRef(ref, el);\n if (elements.length) {\n return elements.item(0);\n }\n return null;\n}", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {BindClickMessage, ClickReplayMessage, MyopBindMessage} from \"../../messages\";\nimport {ShadowRootRef} from \"../shadowRootRef\";\nimport {BaseWebComponentMessageHandler, MessageToHost} from \"./BaseWebComponentMessageHandler\";\nimport {getElementsByRef} from \"../../common/messageHandlers/helpers\";\n\nexport class BindOnClickHandler extends BaseWebComponentMessageHandler<BindClickMessage> {\n\n messageType = MyopMessages.BindClickMessage;\n\n innerExecutor = (event: BindClickMessage, shadowRootRef: ShadowRootRef, messageToHost: MessageToHost) => {\n const items = getElementsByRef(event.ref, shadowRootRef.shadowRoot)\n const cleanupTasks: any[] = [];\n\n items.forEach(item => {\n const handler = () => {\n messageToHost(new ClickReplayMessage(event.handlerUniqueId));\n };\n\n item.addEventListener('click', handler);\n cleanupTasks.push(() => {\n item.removeEventListener('click', handler);\n })\n })\n\n return () => {\n cleanupTasks.forEach(task => task());\n }\n }\n}\n", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {ShadowRootRef} from \"../shadowRootRef\";\nimport {BaseWebComponentMessageHandler} from \"./BaseWebComponentMessageHandler\";\nimport {MyopElementMessage} from \"../../messages\";\nimport {getElementsByRef} from \"../../common/messageHandlers/helpers\";\n\nexport class ChangeTextHandler extends BaseWebComponentMessageHandler<MyopElementMessage> {\n\n messageType = MyopMessages.ChangeTextMessage;\n\n innerExecutor = (event: MyopElementMessage, shadowRootRef: ShadowRootRef) => {\n const items = getElementsByRef(event.ref, shadowRootRef.shadowRoot);\n items.forEach(item => {\n item.textContent = event.content;\n })\n }\n}\n", "import {RootRef} from \"../common\";\n\nexport class ShadowRootRef extends RootRef {\n constructor(public container: HTMLElement, public shadowRoot: ShadowRoot) {\n super(container, shadowRoot);\n }\n}\n", "import {MyopElementRef} from \"../../common\";\nimport {myopAttributes} from \"../../consts\";\nimport {BaseWebComponentMessageHandler} from \"./BaseWebComponentMessageHandler\";\nimport {ShadowRootRef} from \"../shadowRootRef\";\nimport {DetectedMyopRefsMessage, DetectMyopRefsMessage} from \"../../messages\";\nimport {MyopMessages} from \"../../common/MyopMessages\";\n\nexport class DetectMyopRefsMessageHandler extends BaseWebComponentMessageHandler<DetectMyopRefsMessage> {\n innerExecutor = (event: DetectMyopRefsMessage, shadowRootRef: ShadowRootRef) => {\n\n //debugger;\n const allMyopItems = shadowRootRef.shadowRoot.querySelectorAll(`[${myopAttributes.id}]`);\n\n let myopRefs: MyopElementRef[] = [];\n\n allMyopItems.forEach(item => {\n\n // TODO : take that back to the dashboard?\n //console.log(item, item.getBoundingClientRect());\n\n const myopId = item.getAttribute(myopAttributes.id);\n\n if (myopId) {\n //console.log('wc rect', item.parentElement.getBoundingClientRect(), item.getBoundingClientRect())\n // @ts-ignore\n myopRefs.push(new MyopElementRef(myopId, item.tagName, item.getBoundingClientRect(), item.offsetTop, item.offsetLeft))\n }\n })\n\n this.messageToHost(new DetectedMyopRefsMessage(event.handlerUniqueId, myopRefs))\n };\n\n messageType = MyopMessages.DetectMyopRefsMessage;\n\n\n}\n", "export const __federation__ = \"__federation__\"\nexport const onLoadKey = \"onLoad\"\nexport const moduleInstanceKey = \"moduleInstance\"\n\nexport const defineDynamicImport = (globalName: string, module: any) => {\n // @ts-ignore\n if (window[__federation__] && window[__federation__][globalName] && window[__federation__][globalName][onLoadKey]) {\n // @ts-ignore\n window[__federation__][globalName][onLoadKey]({[globalName]: module})\n } else {\n //console.log('__federation__ loader not defined for module', module);\n }\n}", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {SetAttributeMessage} from \"../../messages\";\nimport {BaseWebComponentMessageHandler} from \"./BaseWebComponentMessageHandler.ts\";\nimport {ShadowRootRef} from \"../shadowRootRef.ts\";\nimport {getElementsByRef} from \"../../common/messageHandlers/helpers\";\n\nexport class setAttributeHandler extends BaseWebComponentMessageHandler<SetAttributeMessage> {\n\n messageType = MyopMessages.SetAttributeMessage;\n\n innerExecutor = (event: SetAttributeMessage, shadowRootRef: ShadowRootRef) => {\n const items = getElementsByRef(event.ref, shadowRootRef.shadowRoot);\n items.forEach(item => {\n item.setAttribute(event.name, event.value)\n })\n }\n}\n", "export type Serializable<T> =\n T extends Function ? never : // Exclude functions\n T extends Array<infer U> ? Serializable<U>[] : // Handle arrays\n T extends object ? {\n [K in keyof T as T[K] extends Function ? never : K]: Serializable<T[K]>\n } : T; // Handle objects\n\nconst isPrimitive = (value) => {\n return value !== Object(value);\n}\n\nconst isFunction = (value) => {\n return typeof value === 'function';\n}\n\nexport const containsPrimitivesOnly = (obj) => {\n if (isPrimitive(obj)) {\n return true;\n }\n\n if (isFunction(obj)) {\n return false\n }\n\n if (Object.getPrototypeOf(obj)) {\n return false\n }\n\n for (const key in obj) {\n const value = obj[key];\n if (typeof value === 'object') {\n // Recursively check if it's a nested object\n if (!containsPrimitivesOnly(value)) {\n return false;\n }\n } else if (isPrimitive(value)) {\n continue; // It's a primitive, so we can skip it\n } else {\n return false; // Found a non-primitive value\n }\n }\n\n return true; // All values are primitives or nested objects with primitives\n}\n\n// currently support root level only\n// {x: 1, y : 'a', z : ()=>{...}, inner : { x: 1 , y : 'a'} }\n// {x: 1, y : 'a'}\n//https://developer.mozilla.org/en-US/docs/Glossary/Falsy\nexport type SerializableSkeleton<T> = Partial<Record<keyof T, boolean | Partial<Record<string, boolean>>>> | boolean;\n\nexport const makeSerializable = <T>(\n obj: T,\n skeleton: SerializableSkeleton<T> = {},\n includeFalsyKeys: boolean = true, // TODO : use that arg\n seen: WeakMap<object, Serializable<any>> = new WeakMap()\n): Serializable<T> => {\n\n if (isPrimitive(obj)) {\n return obj as Serializable<T>; // Directly return primitive values\n }\n\n if (Array.isArray(obj)) {\n if (seen.has(obj)) {\n return seen.get(obj)!; // Return the already processed object\n }\n\n // Handle array serialization\n const serializableArray: Serializable<any>[] = [];\n seen.set(obj, serializableArray); // Store the array in seen\n\n for (let index = 0; index < obj.length; index++) {\n const element = obj[index];\n serializableArray[index] = makeSerializable(element, skeleton, includeFalsyKeys, seen);\n }\n return serializableArray as Serializable<T>;\n }\n\n if (obj !== null && typeof obj === 'object') {\n // Check for cyclic references\n if (seen.has(obj)) {\n return seen.get(obj)!; // Return the already processed object\n }\n const serializableObject: Partial<Serializable<T>> = {};\n seen.set(obj, serializableObject); // Store the object in seen\n\n for (const key in obj) {\n // Check if the key is in the skeleton and if it's a valid key to serialize\n\n const keyInSkeleton = typeof skeleton == \"boolean\" ? skeleton : skeleton[key];\n\n if (keyInSkeleton) {\n if (keyInSkeleton === true) {\n // If the skeleton indicates to serialize this key\n if (includeFalsyKeys ? obj[key] !== undefined : obj[key]) {\n // @ts-ignore\n serializableObject[key] = makeSerializable(obj[key], true, includeFalsyKeys, seen);\n }\n } else if (typeof keyInSkeleton === 'object') {\n // If the skeleton indicates nested keys to serialize\n // @ts-ignore\n serializableObject[key] = makeSerializable(obj[key], keyInSkeleton, includeFalsyKeys, seen);\n }\n }\n }\n return serializableObject as Serializable<T>;\n }\n\n return {} as any; // Return an empty object for other cases\n}\n", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {\n AddEventListenerMessage,\n EventListenerCallbackMessage,\n} from \"../../messages\";\nimport {BaseWebComponentMessageHandler, MessageToHost} from \"./BaseWebComponentMessageHandler.ts\";\nimport {ShadowRootRef} from \"../shadowRootRef.ts\";\nimport {getElementsByRef} from \"../../common/messageHandlers/helpers\";\nimport {makeSerializable} from \"../../common/utils/serialization.ts\";\n\nexport class AddEventListenerHandler extends BaseWebComponentMessageHandler<AddEventListenerMessage> {\n\n messageType = MyopMessages.AddEventListenerMessage;\n\n innerExecutor = (event: AddEventListenerMessage, shadowRootRef: ShadowRootRef, messageToHost: MessageToHost) => {\n\n const items = getElementsByRef(event.ref, shadowRootRef.shadowRoot);\n const cleanupTasks: (() => void)[] = [];\n\n items.forEach(item => {\n const handler = (e) => {\n // in fact when running in WebComponent we can transfer the original e\n // currently using makeSerializable for nested cases, think about that\n messageToHost(new EventListenerCallbackMessage(event.handlerUniqueId, makeSerializable(e, event.serializableSkeleton)));\n };\n\n item.addEventListener(event.type, handler);\n\n cleanupTasks.push(() => {\n item.removeEventListener(event.type, handler);\n })\n });\n\n return () => {\n cleanupTasks.forEach(task => task())\n }\n }\n}\n", "import {MyopMessageKey, MyopMessages} from \"../../common/MyopMessages\";\nimport {\n BaseMyopMessage,\n DisposeMessage, ExecuteComponentMethod, MessageDirection,\n CleanupMessage, CleanupReplayMessage,\n MyopBindMessage,\n MyopBindReplayMessage, Ref\n} from \"../../messages\";\nimport {CleanupHandler, IComponentDefinitionConfig} from \"../../common\";\nimport {HostSDK, loaderOptions} from \"../hostSDK.ts\";\n\n//TODO : change IMyopComponent to ref specific impl\ntype RefTypes = {\n [key: string]: IMyopComponent | Ref\n};\n\nexport interface IMyopComponent<P = any, R = any> {\n\n id: string;\n\n isInitiated: boolean;\n\n markedForDisposed: boolean;\n\n setInitiated: () => void\n\n componentDefinition: IComponentDefinitionConfig\n\n container: HTMLElement\n\n //ref components can be element-less\n element?: HTMLElement\n\n send: (msg: BaseMyopMessage) => CleanupHandler\n\n bind(messageType: MyopMessageKey, handler: () => boolean): void;\n\n bind<T extends BaseMyopMessage>(messageType: MyopMessageKey, handler: (message: T) => boolean): void;\n\n // boolean returned value = handled or not\n onMessageReceived: (msg: BaseMyopMessage) => boolean\n\n initiated: () => Promise<any>;\n\n dispose: () => void\n\n hide(): void;\n\n show(): void;\n\n inspect(): void;\n\n parent?: IMyopComponent;\n\n props: P\n\n refs: R\n}\n\nfunction isInheritFrom(obj: any, baseClass: any) {\n if (!obj) {\n return false;\n }\n\n const proto = Object.getPrototypeOf(obj);\n\n if (!proto) {\n return false;\n }\n\n if (proto.constructor.name === baseClass.name) {\n return true;\n }\n return isInheritFrom(proto, baseClass);\n}\n\n// TODO : move : \ntype messageHandler<T> = (message: T) => boolean;\n\nexport abstract class BaseMyopComponent<P = any, R extends RefTypes = RefTypes> implements IMyopComponent<P> {\n id: string = ''\n\n messageHandlers: Record<string, messageHandler<any>[]> = {};\n\n element?: HTMLElement\n\n protected constructor(public componentDefinition: IComponentDefinitionConfig, public container: HTMLElement, options?: loaderOptions) {\n this.id = options?.id || HostSDK.Instance().assignId(componentDefinition);\n const timeout = options?.timeout ? options?.timeout : 5 * 1000;\n setTimeout(() => {\n if (!this.isInitiated && this._whenInitiatedReject && !this._markedForDisposed) {\n this._whenInitiatedReject(`timeout_${timeout} ${this.id}`);\n }\n }, timeout);\n\n // TODO : auto inspect, control from config\n this.initiated().then(() => {\n // @ts-ignore\n if (window.myop.hostSDK.inspected) {\n this.inspect()\n }\n });\n }\n\n _markedForDisposed: boolean = false;\n\n get markedForDisposed(): boolean {\n return this._markedForDisposed;\n }\n\n set markedForDisposed(value: boolean) {\n if (this._markedForDisposed) {\n throw new Error('InvalidOperationException: The component is already in the process of being disposed. Dispose operation cannot be performed again until the current disposal process is complete.')\n }\n this._markedForDisposed = value;\n }\n\n abstract hide(): void;\n\n abstract show(): void;\n\n abstract inspect(): CleanupHandler;\n\n //TODO: use bindWhen with return true predicate ...\n bind = <T extends BaseMyopMessage>(messageType: string, handler: (message: T) => boolean) => {\n if (!this.messageHandlers[messageType]) {\n this.messageHandlers[messageType] = []\n }\n\n // handle duplicate registration\n if (!this.messageHandlers[messageType].includes(handler)) {\n this.messageHandlers[messageType].push(handler);\n }\n }\n\n bindWhen = <T extends BaseMyopMessage>(messageType: string, predicate: (message: T) => boolean, handler: (message: T) => void): CleanupHandler => {\n if (!handler) {\n throw new Error('can\\'t use component.bindWhen without an handler');\n }\n\n if (!this.messageHandlers[messageType]) {\n this.messageHandlers[messageType] = []\n }\n\n const handlers = this.messageHandlers[messageType];\n\n const predicateWrappedHandler = (e: T) => {\n if (predicate(e)) {\n handler(e);\n return true;\n }\n return false;\n };\n\n //TODO : handle duplicate registration ?\n handlers.push(predicateWrappedHandler);\n\n return () => {\n const index = handlers.indexOf(predicateWrappedHandler);\n if (index > -1) {\n handlers.splice(index, 1);\n }\n }\n }\n\n onMessageReceived(incomeMessage: BaseMyopMessage): boolean {\n //console.log('onMessageReceived', document.location.href, incomeMessage, this);\n //TODO : handel special evets ? like initRes ?\n if (incomeMessage.messageType === MyopMessages.ExecuteComponentMethod) {\n const typedMessage = (incomeMessage as ExecuteComponentMethod);\n\n //keeping this.method() so that context will saved\n if ((this as any)[typedMessage.method]) {\n (this as any)[typedMessage.method](typedMessage.content);\n } else {\n console.log(`method not found ${typedMessage.method} on component`, this)\n }\n\n return true;\n }\n\n const handlers = this.messageHandlers[incomeMessage.messageType];\n if (handlers && handlers.length) {\n let handled = false;\n\n handlers.forEach(handler => {\n handled = handled || handler(incomeMessage)\n })\n return handled;\n } else {\n //TODO : console only when debug config\n //console.log('no handlers found for ', incomeMessage)\n }\n return false;\n }\n\n setInitiated = () => {\n this.isInitiated = true;\n\n if (this._whenInitiatedResolve)\n this._whenInitiatedResolve();\n }\n\n isInitiated: boolean = false;\n\n _whenInitiatedResolve?: (value?: any) => any;\n _whenInitiatedReject?: (value?: any) => any;\n\n _whenInitiated: Promise<any> = new Promise((resolve, reject) => {\n this._whenInitiatedResolve = resolve;\n this._whenInitiatedReject = reject;\n });\n\n initiated = () => {\n return this._whenInitiated;\n }\n\n private sendCleanupMessage(message: CleanupMessage): void {\n message.source = this.id;\n message.destination = this.id;\n message.direction = MessageDirection.down;\n\n const cleanupHandler = this.bindWhen(message.replyMessageKey, (msg: MyopBindReplayMessage) => {\n return msg.replayToHandler === message.handlerUniqueId\n }, (m: CleanupReplayMessage) => {\n message.handler(m);\n cleanupHandler();\n });\n\n const handler = message.handler;\n // @ts-ignore\n delete message.handler\n\n this.send(message);\n\n message.handler = handler;\n }\n\n send(message: BaseMyopMessage): CleanupHandler {\n //messages that exetracted from envelope already have source in them\n if (!message.source)\n message.source = this.id;\n\n if (!message.destination)\n message.destination = this.id;\n\n message.direction = MessageDirection.down;\n\n let cleanupHandler;\n // TODO : fix heavy op..\n // if (isInheritFrom(message, MyopBindMessage)) {\n // @ts-ignore\n if (message.handler) {\n const typedMessage = (message as MyopBindMessage);\n cleanupHandler = this.bindWhen(typedMessage.replyMessageKey, (msg: MyopBindReplayMessage) => {\n return msg.replayToHandler === typedMessage.handlerUniqueId\n }, typedMessage.handler);\n\n // @ts-ignore\n delete message.handler\n }\n\n //TODO: think about that\n if (message.ref) {\n // serializable\n message.ref = message.ref.__nonProxied || message.ref;\n }\n\n if (message.cleanable) {\n return () => {\n this.sendCleanupMessage(new CleanupMessage(message.id, (replay) => {\n //TODO : log replay?\n }));\n\n if (cleanupHandler) {\n cleanupHandler()\n }\n };\n } else {\n return () => {\n }\n }\n }\n\n dispose(): void {\n this.markedForDisposed = true;\n\n if (!this.isInitiated) {\n //TODO : use sdk.logger\n //console.log('disposing before isInitiated', this.id);\n return;\n }\n console.log('disposing component', this.id);\n\n // //TODO : implement dispose flow\n // Object.keys(this.refs).forEach(refKey=>{\n // this.refs[refKey].dispose();\n // });\n\n //TODO : check if there is any time for the o\n // ther side to proccess to message before die ?\n //notify the other side SDK\n this.send(new DisposeMessage())\n\n const onDisposeHandlers = this.messageHandlers['onDispose']\n if (onDisposeHandlers) {\n onDisposeHandlers.forEach(disposeHandler => {\n //TODO : send null or fix the type ?\n disposeHandler(null);\n })\n }\n\n //console.log(this.container);\n //this.container.innerHTML = '';\n this.messageHandlers = {}\n this.id += '_disposed';\n this.isInitiated = false;\n }\n\n props: P = {} as unknown as P;\n refs: R = {} as unknown as R;\n}\n", "export const Errors = {\n notSerializableRefCall: (prop, arg) => {\n throw new Error(`\nThe input provided to '${prop.toString()}' is not serializable. Serialization is required to ensure that the data can be safely transferred to the skin implementation. \nThe following types of data are considered non-serializable and cannot be processed:\n\n- Functions\n- DOM elements\n- Class instances\n- Circular references\n- Symbols\n- BigInt values\n\nIn the following execution we detected :\n~~~~~~~~\n${arg} \n~~~~~~~~\nas not serializable.\n\nTo resolve this issue, please ensure that all inputs passed to '${prop.toString()}' are in a serializable format.\nThis typically includes primitive types (strings, numbers, booleans), arrays, and plain objects. \nIf you need to include complex data types, consider converting them to a serializable structure before passing them to the function.\nOr use Myop message that support it: CustomRefMessage, AddEventListenerMessage or ExecuteScriptMessage.\n\nSuggested Fix:\n1. Remove or replace non-serializable values from your input.\n2. If using objects, ensure they do not contain any functions or circular references.\n3. Convert any class instances to plain objects or JSON-compatible formats.\n4. Use dedicated Myop message.\n\nFor more details on serialization and Myop message examples, refer to https://docs.myop.dev\\.\n\n`);\n }\n}\n\n", "import {BaseMyopComponent, IMyopComponent} from \"./IMyopComponent\";\nimport {BaseMyopMessage, ExecuteComponentMethod} from \"../../messages\";\nimport {IComponentDefinitionConfig} from \"../../common\";\nimport {EnvelopedMessage} from \"../../messages/EnvelopedMessage\";\nimport {loaderOptions} from \"../hostSDK.ts\";\n\nexport class MyopRefComponent extends BaseMyopComponent {\n\n constructor(public componentDefinition: IComponentDefinitionConfig, public parent: IMyopComponent, options?: loaderOptions) {\n //TODO : check parentComponent.container...\n super(componentDefinition, parent.container, options);\n }\n\n hide() {\n //this.send(new ExecuteComponentMethod(arguments.callee.name));\n this.send(new ExecuteComponentMethod('hide'));\n }\n\n show() {\n this.send(new ExecuteComponentMethod('show'));\n }\n\n inspect() {\n //TODO : support real cleanup\n //console.log('ref inspect called, creating ExecuteComponentMethod inspect', document.location.href, this.id);\n return this.send(new ExecuteComponentMethod('inspect'));\n }\n\n setHeightBasedOnDocumentElement() {\n // @ts-ignore\n this.send(new ExecuteComponentMethod('setHeightBasedOnDocumentElement'));\n }\n\n setHeightBasedOnScrollHeight() {\n // @ts-ignore\n this.send(new ExecuteComponentMethod('setHeightBasedOnScrollHeight'));\n }\n\n onMessageReceived(incomeMessage: BaseMyopMessage): boolean {\n // if (incomeMessage.messageType === 'MutationObserverMessage') {\n // debugger;\n // this.setHeightBasedOnScrollHeight();\n // return true;\n // }\n return super.onMessageReceived(incomeMessage);\n }\n\n\n send = (message: BaseMyopMessage) => {\n //console.log('ref message sending ', message);\n // @ts-ignore\n const handler = message.handler\n const cleanupHandler = super.send(message);\n\n // this.id will be available on the nested component\n this.parent.send(new EnvelopedMessage(this.id, message));\n\n // @ts-ignore\n message.handler = handler\n return cleanupHandler;\n };\n\n dispose = () => {\n if (this.isInitiated)\n this.send(new ExecuteComponentMethod('dispose'));\n super.dispose();\n }\n}\n", "//type AConstructorTypeOf<T> = new (...args: any[]) => T;\nimport {IMyopComponent} from \"./components/IMyopComponent\";\nimport {CreateRefComponentMessage, CustomRefMessage, Ref} from \"../messages\";\nimport * as messages from \"../messages\";\nimport {\n CleanupHandler, IComponentConfig,\n type IComponentDefinitionConfig,\n IComponentRefBehavior, IHTMLLoaderConfig, IPropCodeBehavior,\n IPropConfig, ISkinConfig, PropConfigBehaviorTypes,\n RefBehaviorType, ShadowRootModeType, SkinLoaders, SkinLoaderType\n} from \"../common\";\nimport {containsPrimitivesOnly} from \"../common/utils/serialization\";\nimport {Errors} from \"./logMessages\";\nimport {MyopRefComponent} from \"./components/myopRefComponent\";\nimport {loaderOptions} from \"./hostSDK\";\n\ntype componentDefinitionProps = IComponentDefinitionConfig['props']\n\nconst createDebugTitle = (text: string, top: number, componentDefinitionConfig: IComponentDefinitionConfig) => {\n const titleEl = document.createElement('a');\n titleEl.textContent = text;\n titleEl.style.position = 'relative';\n titleEl.style.padding = '0 5px';\n titleEl.style.fontSize = '14px';\n titleEl.style['top'] = '0';\n titleEl.style.top = `${top}px`;\n //titleEl.style.left = '50%';\n titleEl.style.transform = 'translateX(-50%)';\n titleEl.target = '_blank';\n titleEl.href = `https://dashboard.myop.dev/dashboard/component/${componentDefinitionConfig.id}`\n\n return titleEl;\n};\n\nexport const setDebugStyle = (id: string,\n type: string,\n top: number,\n container: HTMLElement,\n componentElement: HTMLElement,\n componentDefinitionConfig: IComponentDefinitionConfig\n): CleanupHandler => {\n //#007BFF (blue) or #FF5722 (orange)\n //#4CAF50 (green) or #FFC107 (amber)\n // const topText = createDebugTitle(`${id} : ${type}`, top, componentDefinitionConfig);\n const topText = createDebugTitle(`${componentDefinitionConfig.name} : ${type}`, top, componentDefinitionConfig);\n container.insertBefore(topText, componentElement);\n componentElement.style.border = '1px solid #007BFF';\n componentElement.style.display = 'block';\n\n return () => {\n componentElement.style.border = 'unset';\n container.removeChild(topText);\n }\n}\n\nconst reportError = (propConfig: IPropConfig, propName: string, component: IMyopComponent<any, any>) => {\n if (!propConfig) {\n\n console.error(\n // throw new Error(\n `Error: Undefined Prop\\n\\n` +\n `It looks like you've tried to use a prop that hasn't been defined.\\n` +\n `Please check the prop name for any typos or ensure that it is properly defined in the component's prop list.\\n\\n` +\n `Prop Name: ${propName}\\n` +\n `Component: ${component.componentDefinition.name}, ID: ${component.componentDefinition.id}\\n\\n` +\n `For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/${component.componentDefinition.id} or consult the developer guide.`\n );\n return true\n }\n return false\n}\n\nconst reportUnsupported = (propConfig: IPropConfig, propName: string, component: IMyopComponent<any, any>) => {\n console.error(\n `Error: Code Prop Not Supported\\n\\n` +\n `Currently, code props are only supported in local frame components.\\n` +\n `\u26A0\uFE0F This is a work in progress feature \u2014 code props will be supported in upcoming versions.\\n\\n` +\n `In the meantime, you can use message props.\\n\\n` +\n `Prop Name: ${propName}\\n` +\n `Component: ${component.componentDefinition.name}, ID: ${component.componentDefinition.id}\\n\\n` +\n `For more information, refer to the component page https://dashboard.myop.dev/dashboard/component/${component.componentDefinition.id} or consult the developer guide.`\n );\n}\n\nexport const connectProps = <T extends componentDefinitionProps>(component: IMyopComponent, propsConfig: IPropConfig[], selectedSkin: ISkinConfig) => {\n\n const propsMap = propsConfig.reduce((previousValue, currentValue) => {\n return {\n ...previousValue,\n [currentValue.name]: {...currentValue}\n }\n }, {});\n\n const propsHandler = {\n get: (_: IMyopComponent, prop: string) => {\n // @ts-ignore\n const propConfig = propsMap[prop];\n\n if (reportError(propConfig, prop, component)) {\n return false;\n }\n\n if (propConfig.behavior.type === PropConfigBehaviorTypes.code) {\n\n if (selectedSkin.loader.type === SkinLoaders.HTMLLoader) {\n const typedLoader = selectedSkin.loader as IHTMLLoaderConfig;\n // for local frame component\n if (typedLoader.shadowRootMode === ShadowRootModeType.localFrame) {\n const typedPropBehavior = propConfig.behavior as IPropCodeBehavior;\n // @ts-ignore\n return component.element.contentWindow[typedPropBehavior.remap || prop]\n }\n }\n\n reportUnsupported(propConfig, prop, component);\n return false;\n }\n\n if (propConfig.mode === 'output') {\n return new Promise((resolve) => {\n const messageParams: any[] = [];\n //TODO : turn it into config\n if (propConfig.behavior.ref) {\n messageParams.push(Ref.create(propConfig.behavior.ref));\n }\n\n messageParams.push((data: any) => {\n resolve(data);\n });\n\n if (propConfig.behavior.params) {\n messageParams.push(...propConfig.behavior.params);\n }\n\n // @ts-ignore\n const messageCtor = messages[propConfig.behavior.message];\n\n component.send(new messageCtor(...messageParams));\n })\n }\n return null\n },\n set: (_: IMyopComponent, prop: string, value: any) => {\n // @ts-ignore\n const propConfig = propsMap[prop];\n\n if (reportError(propConfig, prop, component)) {\n return false;\n }\n\n if (propConfig.behavior.type === PropConfigBehaviorTypes.code) {\n if (selectedSkin.loader.type === SkinLoaders.HTMLLoader) {\n const typedLoader = selectedSkin.loader as IHTMLLoaderConfig;\n // for local frame component\n if (typedLoader.shadowRootMode === ShadowRootModeType.localFrame) {\n const typedPropBehavior = propConfig.behavior as IPropCodeBehavior;\n // @ts-ignore\n component.element.contentWindow[typedPropBehavior.remap || prop] = value;\n\n return true\n }\n }\n\n reportUnsupported(propConfig, prop, component);\n return false;\n } else {\n //if(propConfig.behavior === PropConfigBehaviorTypes.message)\n if (propConfig.mode === 'input') {\n //TODO : support multi behaviors\n\n if (propConfig.behavior.type === 'message') {\n const messageParams: any[] = [];\n //TODO : turn it into config\n if (propConfig.behavior.ref) {\n messageParams.push(Ref.create(propConfig.behavior.ref));\n }\n messageParams.push(value);\n if (propConfig.behavior.params) {\n messageParams.push(...propConfig.behavior.params);\n }\n\n // @ts-ignore\n const messageCtor = messages[propConfig.behavior.message];\n component.send(new messageCtor(...messageParams));\n return true\n } else {\n throw new Error(\n `Error: Unsupported Behavior\\n\\n` +\n `The 'behavior' field provided is not supported.\\n` +\n `Component: ${component.componentDefinition.name}, ID: ${component.componentDefinition.id}\\n\\n` +\n `Prop Name: ${prop}\\n` +\n `Behavior Field: ${propConfig.behavior.type}\\n\\n` +\n `Check the documentation for valid behavior options.`\n );\n\n return false\n }\n }\n }\n return false\n }\n }\n\n component.props = {};\n component.props = new Proxy(component.props, propsHandler);\n\n return component as (Omit<IMyopComponent, 'props'> & {\n props: propTypes<T>\n })\n}\n\nexport const createRefProxy = (target: Ref, component: IMyopComponent) => {\n return new Proxy(target, {\n get(target, prop) {\n\n // if (prop === '__nonProxied') {\n // return target;\n // }\n\n // @ts-ignore\n if (target[prop]) {\n // @ts-ignore\n return target[prop];\n }\n\n // @ts-ignore\n const getterFunction = (...args) => {\n return new Promise((resolve) => {\n args.forEach(arg => {\n if (!containsPrimitivesOnly(arg)) {\n Errors.notSerializableRefCall(prop, arg);\n }\n });\n component.send(new CustomRefMessage(({ref, propName, functionArgs, makeSerializable}) => {\n if (ref) {\n // @ts-ignore\n const value = ref[propName];\n if (typeof value === 'function') {\n // @ts-ignore\n return makeSerializable(ref[propName](...functionArgs), true) // Invoke the function and return its result\n } else {\n // @ts-ignore\n return makeSerializable(value, true); // Return the property value\n }\n }\n return null;\n },\n {\n //TODO : turn it to config\n elementId: target.refConfig.selector,\n propName: prop,\n functionArgs: args\n },\n (msg) => {\n resolve(msg.content);\n }))\n });\n };\n\n //TODO: we can implement things like auto serialization and binding functions here\n //getterFunction.test = '123';\n\n return getterFunction;\n\n //return Reflect.get(target, prop);\n },\n set(target, prop: string, value) {\n component.send(new CustomRefMessage(({ref, propName, propValue}) => {\n if (ref)\n // @ts-ignore\n ref[propName] = propValue;\n },\n {\n //TODO : fix that\n elementId: target.refConfig.selector,\n propValue: value,\n propName: prop\n },\n (msg) => {\n //TODO : log?\n }))\n return true;\n },\n });\n}\n\nexport const createRefComponent = async <T extends IMyopComponent = IMyopComponent>(ref: Ref, componentConfig: IComponentConfig, components: IMyopComponent[], options?: loaderOptions): Promise<T> => {\n const component = ref.component;\n if (!component)\n throw new Error('cant createRefComponent with detached ref');\n\n //console.log('createRefComponent called', ref, componentConfig);\n\n return new Promise(async (resolve, reject) => {\n const refComponent = new MyopRefComponent(componentConfig.type, component, options);\n components.push(refComponent);\n\n //for cases where ref components define in the component config\n // we need to wait for the root component the be initiated before interacting with it\n await component.initiated();\n\n\n //TODO :\n const timeout = setTimeout(() => {\n //reject('timeout?');\n reject('timeout');\n }, 5000);\n\n component.send(new CreateRefComponentMessage(ref.refConfig,\n componentConfig,\n {\n ...options ? options : {},\n id: refComponent.id,\n _hasParent: true\n },\n async (message) => {\n\n //TODO : check if timeout already passed\n clearTimeout(timeout);\n\n if (message.failed) {\n //TODO :\n reject('CreateRefComponentMessage failed');\n return;\n }\n\n const implementationComponent = components.find(c => c.id == refComponent.id);\n\n //same memory env, same HostSDK\n if (implementationComponent !== refComponent) {\n //TODO : clean refComponent ?\n\n component.refs[ref.refConfig.name] = implementationComponent;\n resolve(implementationComponent as unknown as T);\n return;\n } else {\n refComponent.setInitiated()\n component.refs[ref.refConfig.name] = refComponent;\n }\n\n //TODO : here >\n //TODO : what about reapters ?! dynamic ?!\n // const exsistingRefComponent = component.refs[ref.refConfig.name] as MyopRefComponent;\n // if (exsistingRefComponent.id && exsistingRefComponent.parent) {\n // component.refs[ref.refConfig.name] = [component.refs[ref.refConfig.name], refComponent];\n // } else if (Array.isArray(component.refs[ref.refConfig.name])) {\n // component.refs[ref.refConfig.name].push(refComponent)\n // } else {\n // component.refs[ref.refConfig.name] = refComponent; //hostSDK.components.find(c => c.id === refComponent.id)!;\n // }\n\n //TODO : in webcomponent case the same id will alreday be here, which is good !\n // name:\n // id\n // componentDefinitionId\n\n // for inner components inside ref component :\n message.nestedRefs.forEach(nestedRefConfig => {\n const nestedComponentDefinition = componentConfig.instance.resolvedNestedComponents!.find(c => c.type.id === nestedRefConfig.componentDefinitionId)!.type;\n //const nestedComponentDefinition = component.componentDefinition.resolvedDefinitions?.find(def => def.id === nestedRefConfig.componentDefinitionId)!;\n // const refConfig = componentConfig.type.refs.find(r => r.name === nestedRefConfig.refName);\n // if (!refConfig) {\n // throw new Error('no refConfig found for nested ref');\n // }\n\n //debugger;\n\n const nestedComponent = new MyopRefComponent(nestedComponentDefinition, refComponent);\n nestedComponent.setInitiated();\n refComponent.refs[nestedRefConfig.refName] = nestedComponent;\n components.push(nestedComponent);\n });\n\n\n try {\n await connectRefs(refComponent, componentConfig, components, true);\n\n //TODO :use config check for auto-hight and convert type properly\n // @ts-ignore\n if (component.setHeightBasedOnScrollHeight)\n // @ts-ignore\n component.setHeightBasedOnScrollHeight();\n\n resolve(refComponent as unknown as T);\n } catch (e) {\n //debugger\n reject(e);\n // throw e\n }\n }));\n })\n}\n\nexport const connectRefs = async (component: IMyopComponent, componentConfig: IComponentConfig, components: IMyopComponent[], withoutRefComponents: boolean = false) => {\n\n if (!component.refs)\n component.refs = {};\n\n const waitFor = Object.values(component.componentDefinition.refs).map(ref => {\n return new Promise<void>(async (resolve, reject) => {\n if (ref.behavior.type == RefBehaviorType.component) {\n // component.refs[ref.name] =\n\n if (withoutRefComponents) {\n resolve();\n return;\n }\n\n // component.\n //TODO : change to get it from the flow\n let refComponentId = (ref.behavior as IComponentRefBehavior).componentId;\n if (!refComponentId)\n refComponentId = (ref.behavior as IComponentRefBehavior).instance.componentId\n\n // if (!component.componentDefinition.resolvedDefinitions) {\n // reject(new Error('componentConfig provided without resolvedDefinitions check the config object'));\n // //throw new Error('componentConfig provided without resolvedDefinitions check the config object');\n // }\n // const componentDefinitionConfig = component.componentDefinition.resolvedDefinitions!.find(compdef => compdef.id === refComponentId)!;\n // //const componentDefinitionConfig = await getComponentDefinitionConfig(componentInstanceConfig.componentId);\n //\n // if (!componentDefinitionConfig) {\n // reject(new Error('componentConfig provided without resolvedDefinitions check the config object'));\n // return;\n // }\n\n //TODO: if we have the same component more than once we will need instance id here ...\n const nestedComponentConfig = componentConfig.instance.resolvedNestedComponents?.find(nestedComponent => nestedComponent.type.id === refComponentId);\n\n if (!nestedComponentConfig) {\n throw new Error('componentConfig provided without nestedComponentConfig check the config object');\n return;\n }\n\n //const componentInstanceConfig = componentConfig.instance.nestedComponents?.find(componentInstace => componentInstace.componentId === componentDefinitionConfig.id);\n // if(!componentDefinitionConfig){\n // throw new Error('TODO TODO TODO ');\n // return;\n // }\n\n //TODO :think about that :\n // componentDefinitionConfig.resolvedDefinitions = component.componentDefinition.resolvedDefinitions;\n // const nestedComponentConfig: IComponentConfig = {\n // instance: nestedComponentConfig.instance!,\n // type: nestedComponentConfig.type,\n // name: nestedComponentConfig.name\n // }\n\n const _ref = Ref.create('', ref, component);\n\n try {\n //console.log('nested !! createRefComponent called');\n const nestedComponent = await createRefComponent(_ref, nestedComponentConfig!, components)\n //TDOO : put that ref component somewhere?\n\n // debugger;\n component.refs[ref.name] = nestedComponent;\n\n resolve();\n } catch (e) {\n reject(e);\n }\n } else {\n try {\n const __nonProxied = Ref.create('', ref, component);\n component.refs[ref.name] = createRefProxy(__nonProxied, component);\n resolve();\n } catch (e) {\n //alert('?')\n }\n }\n })\n })\n try {\n await Promise.all(waitFor);\n } catch (e) {\n //debugger\n throw e;\n }\n\n}\n\nexport type propTypes<T extends componentDefinitionProps> = {\n [Property in keyof T]:\n T[Property] extends { mode: 'input' } ?\n T[Property]['type'] :\n Promise<T[Property]['type']>\n}\n\nexport const exec = async (getter: any) => {\n return await getter()\n}\n\nexport const actAs = <T>(ref: Ref) => {\n return ref as unknown as FunctionifyRef<T>\n}\n\nexport type FunctionifyRef<T = any> = {\n [K in keyof T]: T[K] extends (...args: infer A) => infer R // If it's a function\n ? (...args: A) => Promise<R> // Convert it to a promised function\n : T[K]\n};\n", "import {BaseMyopComponent} from \"./IMyopComponent\";\nimport {\n BaseMyopMessage,\n ExecuteComponentMethod,\n ExecuteScriptMessage, MessageDirection\n} from \"../../messages\";\nimport {CleanupHandler, IComponentDefinitionConfig, IIframeLoaderConfig, ISkinConfig} from \"../../common\";\nimport {setDebugStyle} from \"../componentCore\";\nimport {MyopMessages} from \"../../common/MyopMessages.ts\";\nimport {loaderOptions} from \"../hostSDK.ts\";\n\nexport class MyopIframeComponent extends BaseMyopComponent {\n\n constructor(public componentConfig: IComponentDefinitionConfig, skin: ISkinConfig, public container: HTMLElement, private IframeElement: HTMLIFrameElement, options?: loaderOptions) {\n super(componentConfig, container, options)\n\n if ((skin.loader as IIframeLoaderConfig).autoHeight) {\n this.initiated().then(() => {\n this.setHeightBasedOnScrollHeight();\n })\n }\n this.element = this.IframeElement;\n // this.IframeElement.addEventListener('error', () => {\n // if (this._whenInitiatedReject)\n // this._whenInitiatedReject(`IframeElement error`);\n // });\n }\n\n cleanupInspect?: CleanupHandler;\n\n inspect() {\n // TODO : use better check for inspect mode\n if (this.cleanupInspect) {\n //console.log('inspect call more than once');\n return this.cleanupInspect\n }\n this.cleanupInspect = setDebugStyle(this.id, 'MyopIframeComponent', 10, this.container, this.IframeElement, this.componentDefinition);\n return () => {\n this.cleanupInspect!();\n this.cleanupInspect = undefined;\n };\n }\n\n hide() {\n this.IframeElement.style.opacity = '0';\n this.IframeElement.style.position = 'absolute'\n this.IframeElement.style.pointerEvents = 'none'\n this.IframeElement.style.visibility = 'hidden';\n }\n\n show() {\n this.IframeElement.style.opacity = '1';\n this.IframeElement.style.position = 'unset'\n this.IframeElement.style.pointerEvents = 'all'\n this.IframeElement.style.visibility = 'visible';\n }\n\n setHeightBasedOnDocumentElement = () => {\n const cleanupHandler = this.send(new ExecuteScriptMessage(() => {\n return window.document.documentElement.scrollHeight;\n }, (ret) => {\n this.IframeElement.style.height = `${ret.content}px`;\n cleanupHandler();\n }));\n }\n\n observeSizeBasedOnDocumentElement = () => {\n const cleanupHandler = this.send(new ExecuteScriptMessage(({send}) => {\n const {height, width} = document.documentElement.getBoundingClientRect();\n\n const observer = new ResizeObserver(() => {\n const {height, width} = document.documentElement.getBoundingClientRect();\n send({height, width});\n });\n observer.observe(document.documentElement);\n observer.observe(document.body);\n\n return {height, width}\n }, (ret) => {\n this.IframeElement.style.width = `${ret.content.width}px`;\n this.IframeElement.style.height = `${ret.content.height}px`;\n }));\n\n return cleanupHandler;\n }\n\n setSizeBasedOnDocumentElement = () => {\n const cleanupHandler = this.send(new ExecuteScriptMessage(() => {\n const {height, width} = document.documentElement.getBoundingClientRect();\n return {height, width}\n }, (ret) => {\n this.IframeElement.style.width = `${ret.content.width}px`;\n this.IframeElement.style.height = `${ret.content.height}px`;\n cleanupHandler();\n }));\n }\n\n setHeightBasedOnScrollHeight = () => {\n const cleanupHandler = this.send(new ExecuteScriptMessage(() => {\n // @ts-ignore\n // return window.document.body.scrollHeight + 'px';\n\n\n //TODO: fix that hack, keep the function in right format while minified :(\n const noOp = () => {\n // No operation performed\n return 0;\n }\n // To ensure it's not optimized away, you can call it at least once\n let x = noOp();\n x++;\n x--;\n\n //return `${window.document.body.offsetHeight}px`;\n\n //TODO : check that +1 ?\n return Math.max(Math.max(\n window.document.body.clientHeight,\n window.document.body.scrollHeight)\n , window.document.body.offsetHeight) + x + 'px'\n\n }, (ret) => {\n this.IframeElement.style.height = ret.content;\n cleanupHandler();\n }));\n }\n\n send = (message: BaseMyopMessage): CleanupHandler => {\n let message_ = {...message} as BaseMyopMessage;\n //TODO : ?!?! should it be here ?\n if (message_.messageType === MyopMessages.ExecuteComponentMethod) {\n const typedMessage = (message_ as ExecuteComponentMethod)\n this[typedMessage.method]();\n return () => {\n }\n }\n\n //TODO : fix that hack :(\n // @ts-ignore\n //const handler = message.handler\n\n message_.direction = MessageDirection.down;\n const cleanupHandler = super.send(message_);\n this.IframeElement?.contentWindow?.postMessage(message_, '*');\n\n // @ts-ignore\n //message.handler = handler\n\n return cleanupHandler;\n };\n\n onMessageReceived(incomeMessage: BaseMyopMessage): boolean {\n if (incomeMessage.messageType === MyopMessages.In.MutationObserverMessage\n || incomeMessage.messageType === MyopMessages.In.ResizeObserverMessage) {\n this.setHeightBasedOnScrollHeight();\n //debugger\n //this.setHeightBasedOnDocumentElement();\n return true;\n }\n\n return super.onMessageReceived(incomeMessage);\n }\n\n dispose = () => {\n if (this.cleanupInspect)\n this.cleanupInspect();\n\n super.dispose();\n this.IframeElement.parentNode!.removeChild(this.IframeElement);\n }\n}\n", "import {IMyopComponent} from \"../components/IMyopComponent\";\nimport {loaderOptions} from \"../hostSDK\";\nimport {IComponentDefinitionConfig, ISkinConfig, SkinLoaderType} from \"../../common\";\n\nexport interface IMyopLoader {\n type: SkinLoaderType;\n load: (componentDefinition: IComponentDefinitionConfig, skin: ISkinConfig, container: HTMLElement, options?: loaderOptions) => Promise<IMyopComponent>;\n}\n\nexport abstract class BaseMyopLoader implements IMyopLoader {\n abstract type: SkinLoaderType;\n abstract load: (componentDefinition: IComponentDefinitionConfig, skin: ISkinConfig, container: HTMLElement, options?: loaderOptions) => Promise<IMyopComponent>;\n\n appendChild = (container: HTMLElement, element: HTMLElement, options?: loaderOptions,) => {\n if (options?.relative) {\n if (options.relative.direction === 'before') {\n return container.insertBefore(element, options.relative.child);\n }\n\n if (options.relative.direction === 'after') {\n const nextSibling = options.relative.child?.nextSibling;\n return container.insertBefore(element, nextSibling ? nextSibling : null);\n }\n } else {\n return container.appendChild(element);\n }\n }\n}\n", "import {MyopIframeComponent} from \"../components/myopIframeComponent\";\nimport {BaseMyopLoader} from \"./IMyopLoader\";\nimport {uuidv4} from \"../../utils/utils\";\nimport {loaderOptions} from \"../hostSDK\";\nimport {IComponentDefinitionConfig, IIframeLoaderConfig, ISkinConfig, SkinLoaders} from \"../../common\";\n\nconst addQueryParam = (url: string, param: string, value: string) => {\n // Create a URL object\n const urlObj = new URL(url);\n\n // Add the query parameter\n urlObj.searchParams.append(param, value);\n\n // Return the updated URL\n return urlObj.toString();\n}\n\nexport class MyopIframeLoader extends BaseMyopLoader {\n type = SkinLoaders.IframeLoader\n\n // @ts-ignore\n load = async (componentDefinition: IComponentDefinitionConfig, skin: ISkinConfig, container: HTMLElement, options?: loaderOptions) => {\n let IframeElement: HTMLIFrameElement;\n\n const typedLoaderConfig = (skin.loader as IIframeLoaderConfig);\n\n if (container?.nodeName === \"IFRAME\") {\n console.log('needs to load into an exsisting Iframe...', typedLoaderConfig.url, container);\n\n IframeElement = (container as HTMLIFrameElement)\n IframeElement.src = typedLoaderConfig.url\n } else {\n const uniqId = uuidv4();\n const domId = `myop-comp-${uniqId}`\n\n // console.log('needs to create new Iframe...', domId, typedLoaderConfig.url, container);\n IframeElement = document.createElement('iframe');\n\n // TODO : do it only with flag ?\n if (!container.querySelector('[id^=\"myop-comp-\"]'))\n container.innerHTML = '';\n\n //TODO : check that :\n if (options?.hidden) {\n IframeElement.style.visibility = 'hidden';\n }\n\n IframeElement = this.appendChild(container, IframeElement, options) as HTMLIFrameElement;\n\n // in order to handle issue to load iframe inside an iframe with the same url\n let url2load = (skin.loader as IIframeLoaderConfig).url;\n //const uniqUrl = url2load === document.location.href ? addQueryParam(url2load, \"_m\", domId) : url2load\n if (options?._hasParent)\n url2load = addQueryParam(url2load, \"_myop-comp\", uniqId);\n\n //TODO : handle 'style' attr merge here\n let elementAttributesString = '';\n if (options?.elementAttributes)\n elementAttributesString = Object.entries(options?.elementAttributes)\n .map(([key, value]) => {\n if (value === '' || value === null || value === undefined) {\n return key;\n }\n return `${key}=\"${String(value)}\"`;\n })\n .join(' ');\n\n IframeElement.outerHTML = `<iframe \n id=\"${domId}\"\n style=\"\n padding: 0;\n margin: 0;\n height: ${typedLoaderConfig.autoHeight || !typedLoaderConfig.height ? '' : typedLoaderConfig.height}; \n width : 100%;\n overflow: hidden;\n border: none;\n opacity: ${options?.hidden ? '0' : '1'};\n position: ${options?.hidden ? 'absolute' : 'static'};\n pointer-events: ${options?.hidden ? 'none' : 'all'};\n \"\n src=\"${url2load}\"\n ${elementAttributesString}\n ></iframe>`;\n\n IframeElement = container.querySelector(`#${domId}`) as HTMLIFrameElement;\n\n // IframeElement = document.getElementById(domId) as HTMLIFrameElement;\n //NO : IframeElement = container.lastElementChild as HTMLIFrameElement;\n }\n\n return new MyopIframeComponent(componentDefinition, skin, container, IframeElement, options);\n }\n}\n", "import {myopWebcomponentConsts} from \"../../webcomponent/consts\";\nimport {BaseMyopComponent} from \"./IMyopComponent\";\nimport {BaseMyopMessage} from \"../../messages\";\nimport {CleanupHandler, IComponentDefinitionConfig, ISkinConfig} from \"../../common\";\nimport {setDebugStyle} from \"../componentCore\";\nimport {loaderOptions} from \"../hostSDK\";\n\nexport class MyopWebComponent extends BaseMyopComponent {\n\n constructor(componentDefinition: IComponentDefinitionConfig, skin: ISkinConfig, public container: HTMLElement, private customElement: HTMLElement, options?: loaderOptions) {\n super(componentDefinition, container , options);\n this.element = customElement;\n }\n\n cleanupInspect: CleanupHandler = () => {\n }\n\n inspect() {\n this.cleanupInspect = setDebugStyle(this.id, 'MyopWebComponent', 0, this.container, this.customElement, this.componentDefinition);\n return this.cleanupInspect;\n }\n\n hide() {\n this.customElement.style.opacity = '0';\n this.customElement.style.position = 'absolute'\n this.customElement.style.pointerEvents = 'none'\n this.customElement.style.visibility = 'hidden';\n this.customElement.style.height = '0'\n this.customElement.style.width = '0'\n }\n\n show() {\n this.customElement.style.opacity = '1';\n this.customElement.style.position = 'unset'\n this.customElement.style.pointerEvents = 'all'\n this.customElement.style.visibility = 'visible';\n this.customElement.style.height = '';\n this.customElement.style.width = '';\n }\n\n send = (message: BaseMyopMessage<any>) => {\n let message_ = {...message} as BaseMyopMessage;\n\n //TODO : can be done without cloning?\n // @ts-ignore\n //const handler = message_.handler\n const cleanupHandler = super.send(message_);\n\n const msg = new CustomEvent<BaseMyopMessage>(myopWebcomponentConsts.webcomponent_message_key, {\n // @ts-ignore\n detail: message_,\n // bubbles: true,\n // cancelable: false,\n // composed: true\n })\n\n //this.container.dispatchEvent(msg)\n\n //sending data from host to the component\n try {\n this.customElement.dispatchEvent(msg)\n // if (this.customElement.children.length > 0) {\n // } else {\n // this.customElement.children[0].dispatchEvent(msg)\n // }\n } catch (e) {\n console.log('error while trying to dispatchEvent', e);\n }\n\n // @ts-ignore\n //message.handler = handler\n\n return cleanupHandler;\n }\n\n dispose = () => {\n super.dispose();\n this.customElement.parentNode?.removeChild(this.customElement);\n }\n}\n", "import {MyopWebComponent} from \"../components/myopWebcomponent\";\nimport {BaseMyopLoader} from \"./IMyopLoader\";\nimport {loaderOptions} from \"../hostSDK.ts\";\nimport {uuidv4, wait} from \"../../utils/utils.ts\";\nimport {IComponentDefinitionConfig, ISkinConfig, IWebComponentLoaderConfig, SkinLoaders} from \"../../common\";\n\nconst seen: Record<string, Promise<void>> = {};\n\nexport class WebcomponentLoader extends BaseMyopLoader {\n\n type = SkinLoaders.WebComponentLoader\n\n load = async (componentDefinition: IComponentDefinitionConfig, skin: ISkinConfig, container: HTMLElement, options?: loaderOptions) => {\n\n const loaderConfig = (skin.loader as IWebComponentLoaderConfig);\n\n if (!seen[loaderConfig.url]) {\n // await import( /* @vite-ignore */ webComponentLoadUrl);\n // console.log('module loaded');\n seen[loaderConfig.url] = new Promise((resolve, reject) => {\n const webComponentLoadUrl = loaderConfig.url\n const script = document.createElement('script');\n script.type = 'module';\n script.src = webComponentLoadUrl;\n script.onload = () => {\n resolve();\n }\n\n script.onerror = () => {\n reject();\n }\n document.head.appendChild(script);\n })\n } else {\n console.log('Module alreday loaded or in loading process');\n }\n\n await seen[loaderConfig.url];\n\n //TODO : add retry mechanism in fail case.\n\n //TODO : fix that hack, should fix the race condition for loaded modules\n await wait(1);\n\n let domId = `myop-comp-${uuidv4()}`\n const element = document.createElement(loaderConfig.tag);\n\n // TODO : do it only with flag ?\n if (!container.querySelector('[id^=\"myop-comp-\"]'))\n container.innerHTML = '';\n\n //element.style.visibility = 'hidden';\n element.id = domId;\n\n if (options?.hidden) {\n element.style.opacity = '0';\n element.style.position = 'absolute'\n element.style.height = '0'\n element.style.width = '0'\n element.style.pointerEvents = 'none'\n element.style.visibility = 'hidden';\n }\n\n // if (container.id.startsWith('myop-comp-')) {\n // // in place replacement\n // container.replaceWith(element);\n // //container = element.parentElement!;\n // } else {\n // container.appendChild(element);\n // }\n\n if(options?._environment){\n // @ts-ignore\n element._myopEnvironment = options?._environment;\n }\n\n this.appendChild(container, element, options);\n //element.innerHTML = `<${loaderConfig.tag} />`;\n return new MyopWebComponent(componentDefinition, skin, container, element, options);\n }\n\n}\n", "export default '0.2.1';", "import {MyopWebComponent} from \"../components/myopWebcomponent\";\nimport {BaseMyopLoader} from \"./IMyopLoader\";\nimport {loaderOptions} from \"../hostSDK.ts\";\nimport {uuidv4} from \"../../utils/utils.ts\";\nimport {\n IComponentDefinitionConfig,\n IHTMLLoaderConfig,\n ISkinConfig, ShadowRootModeType,\n SkinLoaders\n} from \"../../common\";\nimport {WebComponentSDK} from \"../../webcomponent\";\nimport {MyopIframeComponent} from \"../components/myopIframeComponent.ts\";\n//import {getWebcomponentModule} from \"../../SDK.ts\";\n\nconst seen: string[] = [];\nlet sdk;\nconst getInitiatedSdk = async () => {\n if (!sdk) {\n //const {WebComponentSDK} = await getWebcomponentModule()\n sdk = new WebComponentSDK();\n sdk.init();\n }\n return sdk;\n}\n\nfunction createHTMLElementConstructor(htmlString: string, ShadowRootMode?: keyof typeof ShadowRootModeType): new () => HTMLElement {\n return class extends HTMLElement {\n\n connectedCallback() {\n const mode = ShadowRootMode === ShadowRootModeType.open ? 'open' : 'closed';\n const shadow = this.attachShadow({mode});\n getInitiatedSdk().then((sdk) => {\n sdk.connectedCallback(this, shadow);\n shadow.innerHTML = htmlString\n })\n }\n };\n}\n\nconst createCustomWebComponent = (componentName: string, html: string, ShadowRootMode?: keyof typeof ShadowRootModeType) => {\n customElements.define(componentName, createHTMLElementConstructor(html, ShadowRootMode));\n console.log(`define('${componentName}') was called, web component ready to use`);\n}\n\nconst toWebComponentName = (str) => {\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2') // Add hyphen before uppercase letters\n .replace(/(\\d+)/g, '-$1') // Add hyphen before digits\n .toLowerCase(); // Convert to lowercase\n}\n\nconst toCustomElementName = (name: string) => {\n name = toWebComponentName(name);\n return name.replace(/_/g, '-');\n}\n\nlet parser: DOMParser; // = new DOMParser();\n\nexport class HTMLComponentLoader extends BaseMyopLoader {\n\n type = SkinLoaders.HTMLLoader\n\n load = async (componentDefinition: IComponentDefinitionConfig, skin: ISkinConfig, container: HTMLElement, options?: loaderOptions) => {\n\n const loaderConfig = (skin.loader as IHTMLLoaderConfig);\n let domId = `myop-comp-${uuidv4()}`\n let element;\n\n if (loaderConfig.shadowRootMode === ShadowRootModeType.localFrame) {\n const uniqId = uuidv4();\n const domId = `myop-comp-${uniqId}`\n\n // console.log('needs to create new Iframe...', domId, typedLoaderConfig.url, container);\n let IframeElement = document.createElement('iframe');\n\n // TODO : do it only with flag ?\n if (!container.querySelector('[id^=\"myop-comp-\"]'))\n container.innerHTML = '';\n\n if (options?.hidden) {\n IframeElement.style.visibility = 'hidden';\n }\n\n IframeElement = this.appendChild(container, IframeElement, options) as HTMLIFrameElement;\n IframeElement.id = domId;\n IframeElement.setAttribute('style', `\n padding: 0;\n margin: 0;\n overflow: hidden;\n border: none;\n opacity: ${options?.hidden ? '0' : '1'};\n width: 100%;\n height: 100%;\n position: ${options?.hidden ? 'absolute' : 'static'};\n pointer-events: ${options?.hidden ? 'none' : 'all'};\n `);\n // height: ${typedLoaderConfig.autoHeight || !typedLoaderConfig.height ? '' : typedLoaderConfig.height};\n\n container.appendChild(IframeElement);\n\n // Write content into the iframe\n //@ts-ignore\n const doc = IframeElement.contentDocument || IframeElement.contentWindow.document;\n doc.open();\n\n\n let HTML2Render = loaderConfig.HTML;\n\n if (options?._inspection) {\n //inject inspection script for props detection\n const parser = new DOMParser();\n const _doc = parser.parseFromString(loaderConfig.HTML, 'text/html');\n\n // TODO : part of AI components, think about that, document it.\n const myop_preview_script = _doc.getElementById('myop_preview');\n myop_preview_script?.removeAttribute('type');\n\n // Parse the injected HTML string into a node\n const temp = _doc.implementation.createHTMLDocument();\n temp.body.innerHTML = `<script>\n const beforeKeysWindow = new Set(Object.keys(window));\n window.myopState = {\n beforeKeysWindow,\n };\n </script>`;\n\n const node = temp.body.firstChild;\n\n if (node && _doc.head) {\n _doc.head.insertBefore(_doc.importNode(node, true), _doc.head.firstChild);\n }\n\n HTML2Render = _doc.documentElement.outerHTML;\n }\n\n //\n // debugger;\n // const parser = new DOMParser();\n // const _doc = parser.parseFromString(loaderConfig.HTML, 'text/html');\n // const x = _doc.getElementById('myop_preview');\n //\n // if(x){\n // x.remove();\n // HTML2Render = _doc.documentElement.outerHTML;\n // }\n // console.log(x);\n // debugger;\n\n\n doc.writeln(HTML2Render);\n\n // window.__federation__ =\n // { ...window.__federation__,\n // //TODO : get from ENV at build time,\n // // inject value to module at build time\n // // today we doing so just for the CJS version\n // __public_path__ :'https://cdn.myop.dev/sdk/next'\n // ,...${JSON.stringify(\n // // @ts-ignore\n // window.__federation__)\n // }\n // };\n\n doc.writeln(`<script src=\"${window.myop.__ROOT_SDK_PUBLIC_URL__}\"></script>\n <script>\n \n window.__federation__.__public_path__ = window.__federation__.__public_path__;\n \n const __myop_init = async () => {\n const {IframeSDK} = (await window.myop.rootSDK.getIframeModule());\n const sdk = new IframeSDK()\n sdk.init();\n }\n \n __myop_init().then();\n \n </script>`);\n\n doc.close();\n\n // TODO : control from dashboard\n // (skin.loader as IIframeLoaderConfig).autoHeight = true;\n\n const comp = new MyopIframeComponent(componentDefinition, skin, container, IframeElement, options);\n\n if (loaderConfig.autoHeight) {\n IframeElement.onload = () => {\n comp.observeSizeBasedOnDocumentElement();\n };\n }\n // // @ts-ignore\n // comp.props._global = comp.element.contentWindow;\n return comp;\n\n }\n\n if (loaderConfig.shadowRootMode === ShadowRootModeType.none) {\n // parser = parser ? parser : new DOMParser();\n // const doc = parser.parseFromString(loaderConfig.HTML, 'text/html');\n // element = doc.body.firstChild;\n //element.setAttribute('id', domId);\n\n const template = document.createElement('template');\n template.innerHTML = loaderConfig.HTML;//.trim();\n element = template.content.firstElementChild;\n\n // const firstElement = template.content.firstElementChild;\n // const z = firstElement ? firstElement.tagName.toLowerCase() : null;\n // debugger;\n // console.log(template, firstElement, z)\n // element = firstElement\n\n // const container = document.createElement('tbody');\n // debugger;\n // container.innerHTML = loaderConfig.HTML;\n // element = container.firstElementChild;\n\n getInitiatedSdk().then((sdk) => {\n sdk.connectedCallback(element, element);\n })\n } else {\n const customElementName = toCustomElementName(componentDefinition.name + skin.id);\n\n //TODO : support redefine !\n if (!seen.includes(customElementName)) {\n createCustomWebComponent(customElementName, loaderConfig.HTML, loaderConfig.shadowRootMode);\n seen.push(customElementName);\n }\n element = document.createElement(customElementName);\n }\n // TODO : do it only with flag ?\n if (!container.querySelector('[id^=\"myop-comp-\"]'))\n container.innerHTML = '';\n\n //element.style.visibility = 'hidden';\n element.id = domId;\n\n if (options?.hidden) {\n element.style.opacity = '0';\n element.style.position = 'absolute'\n element.style.height = '0'\n element.style.width = '0'\n element.style.pointerEvents = 'none'\n element.style.visibility = 'hidden';\n }\n\n // if (container.id.startsWith('myop-comp-')) {\n // // in place replacement\n // container.replaceWith(element);\n // //container = element.parentElement!;\n // } else {\n // container.appendChild(element);\n // }\n\n this.appendChild(container, element, options);\n\n //element.innerHTML = `<${customElementName} />`;\n return new MyopWebComponent(componentDefinition, skin, container, element, options);\n }\n}\n", "import {IUserFlow} from \"../common\";\n\n/**\n *\n * ## Overview\n *\n * The `CloudRepository` class serves as a centralized data access layer for retrieving user flows and components from the Myop.dev cloud service. It implements a singleton pattern and provides caching mechanisms to optimize API calls and improve performance.\n *\n * ## Class Structure\n *\n * ### Constructor\n *\n * ```typescript\n * constructor(private _baseUrl = 'https://cloud.myop.dev')\n * ```\n *\n * **Parameters:**\n * - `_baseUrl` (optional): The base URL for the Myop.dev cloud API. Defaults to `'https://cloud.myop.dev'`\n *\n * ### Static Properties\n *\n * #### Main\n * ```typescript\n * static Main = new CloudRepository();\n * ```\n *\n * A singleton instance of the `CloudRepository` class that can be used throughout the application without creating multiple instances.\n *\n * ### Private Properties\n *\n * #### userFlows\n * ```typescript\n * private userFlows: Record<string, Promise<IUserFlow>> = {};\n * ```\n *\n * A cache object that stores promises for user flows, indexed by flow ID. This prevents duplicate API calls for the same flow and ensures consistent data retrieval.\n *\n * #### _baseUrl\n * ```typescript\n * private _baseUrl: string\n * ```\n *\n * The base URL for the cloud API endpoints, set during construction.\n *\n * ## Methods\n *\n * ### fetchFlow(flowId: string)\n *\n * Retrieves a complete user flow from the cloud repository, including all resolved components.\n *\n * **Parameters:**\n * - `flowId`: The unique identifier for the user flow to retrieve\n *\n * **Returns:**\n * - `Promise<IUserFlow>`: A promise that resolves to the complete user flow object\n *\n * **Behavior:**\n * - Implements request caching to avoid duplicate API calls for the same flow ID\n * - Makes a GET request to `/flow?id={flowId}&resolve=components`\n * - Automatically resolves component references within the flow\n * - Stores the promise in the cache for future use\n *\n * **Example Usage:**\n * ```typescript\n * const flow = await CloudRepository.Main.fetchFlow('my-flow-id');\n * console.log(flow.components);\n * ```\n *\n * ### fetchComponent(componentId: string, flowId: string)\n *\n * Retrieves a specific component from within a user flow.\n *\n * **Parameters:**\n * - `componentId`: The unique identifier for the component to retrieve\n * - `flowId`: The unique identifier for the user flow containing the component\n *\n * **Returns:**\n * - `Promise<Component | undefined>`: A promise that resolves to the component object if found, or undefined if not found\n *\n * **Behavior:**\n * - First fetches the complete flow using `fetchFlow()`\n * - Searches through the flow's components array to find the matching component\n * - Uses the component's `type.id` property for matching\n *\n * **Example Usage:**\n * ```typescript\n * const component = await CloudRepository.Main.fetchComponent('button-component', 'my-flow-id');\n * if (component) {\n * console.log('Component found:', component);\n * } else {\n * console.log('Component not found in flow');\n * }\n * ```\n *\n * ## API Integration\n *\n * ### Endpoint Structure\n *\n * The class integrates with the following Myop.dev cloud API endpoint:\n *\n * ```\n * GET {baseUrl}/flow?id={flowId}&resolve=components\n * ```\n *\n * **Query Parameters:**\n * - `id`: The flow identifier\n * - `resolve=components`: Instructs the API to include resolved component data in the response\n *\n * ### Response Format\n *\n * The API is expected to return a JSON response with the following structure:\n *\n * ```json\n * {\n * \"item\": {\n * // IUserFlow object with resolved components\n * \"components\": [\n * {\n * \"type\": {\n * \"id\": \"component-id\"\n * }\n * // ... other component properties\n * }\n * ]\n * // ... other flow properties\n * }\n * }\n * ```\n *\n * ## Caching Strategy\n *\n * The `CloudRepository` implements a promise-based caching mechanism:\n *\n * 1. **Cache Key**: Flow ID is used as the cache key\n * 2. **Cache Value**: Promises are cached rather than resolved values to handle concurrent requests\n * 3. **Cache Duration**: Cache persists for the lifetime of the repository instance\n * 4. **Cache Invalidation**: No automatic cache invalidation is implemented\n *\n * ## Error Handling\n *\n * - Network errors and API failures are propagated through promise rejection\n * - No specific error handling or retry logic is implemented at the repository level\n * - Consumers should implement appropriate error handling when calling repository methods\n *\n * ## Usage Patterns\n *\n * ### Singleton Access\n * ```typescript\n * import { CloudRepository } from './path/to/CloudRepository';\n *\n * // Use the singleton instance\n * const flow = await CloudRepository.Main.fetchFlow('flow-id');\n * ```\n *\n * ### Custom Instance\n * ```typescript\n * // Create a custom instance with different base URL\n * const customRepo = new CloudRepository('https://custom-api.example.com');\n * const flow = await customRepo.fetchFlow('flow-id');\n * ```\n *\n * ### Component Retrieval\n * ```typescript\n * // Get a specific component from a flow\n * const component = await CloudRepository.Main.fetchComponent('component-id', 'flow-id');\n * ```\n *\n * ## Dependencies\n *\n * - **IUserFlow**: Interface imported from `../common` that defines the structure of user flow objects\n * - **Fetch API**: Uses the native `fetch` function for HTTP requests\n *\n * ## Performance Considerations\n *\n * - **Caching**: Prevents duplicate API calls for the same flow ID\n * - **Promise Caching**: Handles concurrent requests efficiently by caching promises\n * - **Component Resolution**: The `resolve=components` parameter ensures components are fully resolved in a single API call\n *\n * ## Future Enhancements\n *\n * The class structure suggests planned functionality that could be implemented:\n *\n * - **Component Caching**: The commented `components` property indicates potential individual component caching\n * - **Cache Invalidation**: Methods to clear or refresh cached data\n * - **Error Retry Logic**: Automatic retry mechanisms for failed requests\n * - **Batch Operations**: Methods to fetch multiple flows or components in a single request\n *\n */\nexport class CloudRepository {\n static Main = new CloudRepository();\n\n private userFlows: Record<string, Promise<IUserFlow>> = {};\n\n // private components: Record<string, Promise<IUserFlow>> = {};\n\n constructor(private _baseUrl = 'https://cloud.myop.dev') {\n }\n\n async fetchComponent(componentId: string, flowId?: string) {\n if (flowId) {\n const flow = await this.fetchFlow(flowId);\n return flow.components.find(c => c.type.id === componentId);\n }else{\n const flow = await this.fetchAutoFlow(componentId);\n return flow.components[0];\n }\n }\n\n async fetchAutoFlow(componentId: string) {\n if (!this.userFlows[componentId]) {\n // eslint-disable-next-line no-async-promise-executor\n this.userFlows[componentId] = new Promise(\n async (resolve, reject) => {\n try {\n const res = await fetch(\n `${this._baseUrl}/flow?id=${componentId}&auto=true`\n );\n const json = await res.json();\n resolve(json.item);\n } catch (e) {\n reject(e);\n }\n }\n );\n }\n\n return await this.userFlows[componentId];\n }\n\n\n async fetchFlow(flowId: string) {\n if (!this.userFlows[flowId]) {\n // eslint-disable-next-line no-async-promise-executor\n this.userFlows[flowId] = new Promise(\n async (resolve, reject) => {\n try {\n const res = await fetch(\n `${this._baseUrl}/flow?id=${flowId}&resolve=components`\n );\n const json = await res.json();\n resolve(json.item);\n } catch (e) {\n reject(e);\n }\n }\n );\n }\n\n return await this.userFlows[flowId];\n }\n}\n", "import {hostSDK} from '../host';\nimport {\n IComponentConfig,\n IComponentDefinitionConfig,\n IComponentInstanceConfig, IDedicatedSkinConfig,\n IPropConfig,\n ISkinConfig,\n PropConfigBehaviorTypes,\n v2_IVariantConfig\n} from \"../common\";\nimport {loaderOptions} from \"../host/hostSDK.ts\";\n\nexport class v2_CloudRepository {\n static Main = new v2_CloudRepository();\n\n private variants: Record<string, Promise<v2_IVariantConfig>> = {};\n\n constructor(private _baseUrl = 'https://cloud.myop.dev') {\n }\n\n async fetchComponent(componentId: string, environmentIdentifier?: string) {\n if (!this.variants[componentId]) {\n // eslint-disable-next-line no-async-promise-executor\n this.variants[componentId] = new Promise(\n async (resolve, reject) => {\n try {\n const res = await fetch(\n `${this._baseUrl}/consume?id=${componentId}&env=${environmentIdentifier}`\n );\n const json = await res.json();\n resolve(json.item);\n } catch (e) {\n reject(e);\n }\n }\n );\n }\n\n return await this.variants[componentId];\n }\n\n}\n\nexport const enableV2 = (environmentIdentifier: string, cloudRepository?: v2_CloudRepository) => {\n const _cloudRepository = cloudRepository ? cloudRepository : new v2_CloudRepository();\n\n return {\n loadComponent: async (componentId: string, container: HTMLElement, options?: loaderOptions) => {\n const config = await _cloudRepository.fetchComponent(componentId, environmentIdentifier)\n\n //@ts-ignore\n if (!config.consume_variant || !config.consume_variant.length) {\n console.warn(\n `[Myop Warning] Component \"${componentId}\" has no implementation for environment \"${environmentIdentifier}\".`\n );\n }\n\n const componentConfig = {\n instance: {\n id: 'auto',\n componentId: config.componentId,\n componentName: config.name,\n\n skinSelector: {\n type: 'Dedicated',\n skin: {\n id: 'skin_auto_v2_converted'\n }\n } as IDedicatedSkinConfig\n\n } as IComponentInstanceConfig,\n type: {\n id: config.id,\n name: config.name,\n description: config.description,\n props: [\n {\n id: 'in_auto_v2_converted',\n name: 'myop_init_interface',\n type: 'any',\n behavior: {\n type: PropConfigBehaviorTypes.code\n }\n } as IPropConfig,\n\n {\n id: 'out_auto_v2_converted',\n name: 'myop_cta_handler',\n type: 'any',\n behavior: {\n type: PropConfigBehaviorTypes.code\n }\n } as IPropConfig\n ],\n refs: [],\n skins: [\n {\n id: 'skin_auto_v2_converted',\n name: 'auto_v2_converted',\n description: '',\n //TODO : handle empty :\n // @ts-ignore\n loader: config.consume_variant[0].loader\n } as ISkinConfig\n ],\n defaultSkin: 0\n } as IComponentDefinitionConfig,\n name: config.name\n } as IComponentConfig;\n\n return await hostSDK.loadComponent(componentConfig, container, options);\n }\n }\n}\n", "import {decompressUUIDs} from \"../utils/uuid.ts\";\nimport {CloudRepository} from \"../helpers\";\nimport {\n ExperienceTypes,\n IComponentConfig, IDedicatedSkinConfig,\n ISegmentedSkinConfig,\n ISegmentExperience, ISkinInstanceConfig,\n SkinSelectorTypes\n} from \"../common\";\n\nexport const checkMyopOverride = async (componentConfig: IComponentConfig): Promise<IComponentConfig | null> => {\n try {\n //TODO: support disabling the mechanism\n const url = new URL(window.location.href);\n const params = new URLSearchParams(url.search);\n const myopOverride = params.get('myopOverride');\n if (myopOverride) {\n const [source, ...uuids] = decompressUUIDs(myopOverride);\n\n switch (source) {\n case 'component': {\n const [componentId, skinId] = uuids;\n const componentToOverride = await CloudRepository.Main.fetchComponent(componentId);\n if (componentToOverride) {\n // todo: check fetchAutoFlow. Looks like only one skin is returned\n const skin = componentToOverride.type.skins.find(skin => skin.id === skinId);\n if (skin) {\n // todo: for now just set skin id. Check the cloud implementation\n\n componentToOverride.instance.skinSelector = {\n type: SkinSelectorTypes.Dedicated,\n skin: {\n id: skinId\n } as ISkinInstanceConfig\n\n } as IDedicatedSkinConfig;\n\n return componentToOverride\n }\n }\n }\n break;\n // case 'flow': {\n default : {\n // const [flowId, experimentId] = uuids;\n const [flowId, experimentId] = decompressUUIDs(myopOverride);\n const flow = await CloudRepository.Main.fetchFlow(flowId);\n const componentToOverride = flow.components.find(c => c.type.id === componentConfig.type.id);\n if (componentToOverride) {\n if (componentToOverride.instance.skinSelector.type === SkinSelectorTypes.Segmented) {\n\n if (componentToOverride.instance.resolvedExperiences) {\n const resolvedExperience = componentToOverride.instance.resolvedExperiences.find(e => e.id === experimentId);\n\n if (resolvedExperience?.type === ExperienceTypes.Segment) {\n\n const typedResolvedExperience = resolvedExperience as ISegmentExperience\n\n const typedSkinSelector = componentToOverride.instance.skinSelector as ISegmentedSkinConfig\n const segment = typedSkinSelector.segments.find(s => s.segmentId === typedResolvedExperience.segment.id);\n if (segment) {\n componentToOverride.instance.skinSelector = segment?.skinSelector;\n return componentToOverride;\n }\n }\n }\n }\n }\n }\n break;\n }\n }\n } finally {\n return null;\n }\n}", "/**\n * @packageDocumentation\n * The Host SDK is designed for integration within the host application that serves as the container for Myop components.<br/><br/>\n * It provides essential functionalities and APIs for registering, managing, and communicating with Myop components.<br/><br/>\n * This SDK enables seamless embedding of independently developed components into the host application, ensuring smooth interoperability and consistent user experience across various Myop component implementations.\n */\nimport {defineDynamicImport} from \"../dynamicImport/defineDynamicImport\";\nimport {IMyopLoader} from \"./loaders/IMyopLoader\";\nimport {IMyopComponent} from \"./components/IMyopComponent\";\nimport {MyopMessages} from \"../common/MyopMessages\";\nimport {\n BaseMyopMessage,\n EnvelopedMessage, ExecuteComponentMethod,\n InitMessage,\n InitResponse, MessageDirection, Ref\n} from \"../messages\";\nimport {MyopIframeLoader} from \"./loaders/iframeLoader\";\nimport {WebcomponentLoader} from \"./loaders/webcomponentLoader\";\nimport type {IframeSDK} from \"../Iframe\";\nimport {connectProps, connectRefs, createRefComponent} from \"./componentCore\";\nimport {\n ExperienceTypes,\n IComponentConfig,\n IComponentDefinitionConfig,\n IDedicatedSkinConfig, IExperience, IFunctionResultsSegment, ISegmentedSkinConfig, ISegmentExperience,\n ISkinConfig, ISkinSelectorConfig, SkinSelectorTypes,\n\n\n} from \"../common\";\n// @ts-ignore handled by custom esbuild plugin\nimport version from \"myop-sdk-version\";\nimport {HTMLComponentLoader} from \"./loaders/HTMLComponentLoader\";\nimport {checkMyopOverride} from \"./myopOverride.ts\";\n\ninterface componentLoaderCreator {\n new(loaders: IMyopLoader[]): any;\n}\n\n// const getComponentDefinitionConfig = async (id: string) => {\n// const res = await fetch(`http://localhost:3000/component?id=${id}`);\n// const componentDef: IComponentDefinitionConfig = (await res.json()).item;\n// return componentDef\n// }\n\n//const __ROOT_SDK_PUBLIC_URL__ = 'https://dfdlk2p1m187v.cloudfront.net/myop_sdk.min.js'\nconst __ROOT_SDK_PUBLIC_URL__ = 'https://cdn.myop.dev/sdk/next/myop_sdk.min.js'\n\n/**\n * The Host SDK is designed for integration within the host application that serves as the container for Myop components.<br/><br/>\n * It provides essential functionalities and APIs for registering, managing, and communicating with Myop components.<br/><br/>\n * This SDK enables seamless embedding of independently developed components into the host application, ensuring smooth interoperability and consistent user experience across various Myop component implementations.\n */\nexport class HostSDK {\n static Instance = () => window.myop.hostSDK;\n\n components2init: IMyopComponent[] = [];\n components: IMyopComponent[] = [];\n componentsLoaders: IMyopLoader[] = [];\n\n public initiated: boolean = false;\n\n public version = version;\n\n type2InstanceCount: Record<string, number> = {};\n public assignId = (componentDefinition: IComponentDefinitionConfig) => {\n if (!this.type2InstanceCount[componentDefinition.id]) {\n this.type2InstanceCount[componentDefinition.id] = 0;\n }\n return `${componentDefinition.id}_${++this.type2InstanceCount[componentDefinition.id]}`;\n }\n\n //TODO : fix the inspect implementation inside refComponent\n //then inspected maybe can be dropped\n private inspected = false;\n public inspect = () => {\n if (this.inspected)\n return;\n\n this.inspected = true;\n\n this.components.forEach(component => {\n if (component.inspect) {\n component.inspect()\n }\n })\n }\n\n private incomingMessageHandler = (event: MessageEvent<BaseMyopMessage>) => {\n //console.log('incomingMessageHandler GOT ', event)\n //TODO : if (event.origin !== \"http://example.org:8080\") return;\n if (event.origin === document.location.origin) {\n //console.log('I Know that !!!');\n // return;\n }\n //console.log(\"event on host side \", event);\n\n if (event.data.myop) {\n if (event.data.direction !== MessageDirection.up && event.data.messageType !== MyopMessages.EnvelopedMessage) {\n //console.log('message dropped in hostsdk, direction was ', event.data.direction)\n return;\n }\n // console.log(\"event on host side \", event);\n\n const myopMessage: BaseMyopMessage = event.data;\n\n if (myopMessage.messageType === MyopMessages.InitRequest) {\n this.components2init.forEach(component => {\n component.send(new InitMessage(component.id))\n });\n return;\n }\n\n if (myopMessage.messageType === MyopMessages.InitResponse) {\n // remove from components 2 init\n // @ts-ignore\n this.components2init = this.components2init.filter(component => component.id !== (myopMessage as InitResponse).content.id)\n\n const initiatedComponent = this.components.find(component => component.id === (myopMessage as InitResponse).content?.id);\n initiatedComponent?.setInitiated()\n //initiatedComponent?.parent?.setInitiated();\n // TODO : is it true to not pass further ( to the component )\n return;\n }\n\n if (myopMessage.messageType === MyopMessages.EnvelopedMessage) {\n //debugger;\n const typedMessage = myopMessage as EnvelopedMessage\n const refComponent = this.components.find(component => component.id === typedMessage.destination);\n\n if (refComponent) {\n if (typedMessage.direction === MessageDirection.down) {\n if (typedMessage.message.messageType === ExecuteComponentMethod.name) {\n refComponent.onMessageReceived(typedMessage.message)\n } else {\n //\n typedMessage.message.route = typedMessage.route;\n refComponent.send(typedMessage.message);\n }\n return;\n }\n } else {\n const innerComponent = this.components.find(component => component.id === typedMessage.message.destination);\n if (innerComponent) {\n innerComponent.send(typedMessage.message)\n } else {\n // TODO : log ?\n }\n }\n // @ts-ignore\n //component.refs.body.onMessageReceived(myopMessage.message);\n\n return;\n }\n\n const component = this.components.find(component => component.id === myopMessage.destination);\n\n if (!component) {\n //no in mem component\n //pass to parent HostSDK to try process there\n if (window.myop.IframeSDK) {\n window.myop.IframeSDK.messageToHost(myopMessage);\n }\n return;\n }\n\n if (component) {\n if (component.onMessageReceived(myopMessage)) {\n return;\n } else {\n //not processed in onMessageReceived\n //pass to parent HostSDK to try process there\n if (window.myop.IframeSDK)\n window.myop.IframeSDK.messageToHost(myopMessage);\n }\n }\n }\n\n // event.source.postMessage(\n // \"hi there yourself! the secret response \" + \"is: rheeeeet!\",\n // event.origin,\n // );\n }\n\n public send = (message: BaseMyopMessage) => {\n const syntheticEvent = new MessageEvent<BaseMyopMessage>('',\n {data: message}\n )\n\n this.incomingMessageHandler(syntheticEvent);\n }\n\n public init = (customComponentLoaderCreators?: componentLoaderCreator[]) => {\n if (this.initiated) {\n throw new Error('hostSDK already initiated');\n }\n\n const basicLoaders = [\n new MyopIframeLoader(),\n new WebcomponentLoader(),\n new HTMLComponentLoader()\n ];\n\n this.componentsLoaders = [\n ...basicLoaders\n ];\n\n if (customComponentLoaderCreators) {\n //debugger;\n const loaderByType: Record<string, IMyopLoader> = {};\n\n customComponentLoaderCreators.forEach(customComponentLoaderCreator => {\n const customLoader = new customComponentLoaderCreator(this.componentsLoaders);\n loaderByType[customLoader.type] = customLoader;\n })\n\n this.componentsLoaders.forEach(loader => {\n if (!loaderByType[loader.type])\n loaderByType[loader.type] = loader;\n })\n\n this.componentsLoaders = Object.values(loaderByType);\n }\n\n // Incomming messages from IFrames\n window.addEventListener(\n \"message\",\n this.incomingMessageHandler,\n false,\n );\n\n console.log('myop hostSDK initiated', document.location.href);\n this.initiated = true;\n }\n\n private _getSkinIdBySkinSelector = async (skinSelector: ISkinSelectorConfig, experiences: IExperience[] = [], hooks?: loaderHooks): Promise<string> => {\n async function asyncFind<T>(\n array: T[],\n predicate: (item: T) => Promise<boolean>\n ): Promise<T | undefined> {\n for (const item of array) {\n if (await predicate(item)) {\n return item;\n }\n }\n return undefined; // Return undefined if no match is found\n }\n\n switch (skinSelector.type) {\n // @ts-ignore\n case \"DedicatedSkin\" : //backward compatibility\n case SkinSelectorTypes.Dedicated: {\n let selectedSkinId = (skinSelector as IDedicatedSkinConfig).skin?.id\n || (skinSelector as IDedicatedSkinConfig).skins![0].id;\n\n return selectedSkinId;\n }\n break;\n case SkinSelectorTypes.Segmented: {\n const typedSkinSelector = (skinSelector as ISegmentedSkinConfig)\n const segment = await asyncFind(typedSkinSelector.segments, async segment => {\n if (segment.segmentId === 'Default') {\n return true;\n }\n\n const experience = experiences.find(experience => {\n if (experience.type === ExperienceTypes.Segment) {\n return (experience as ISegmentExperience).segment.id === segment.segmentId\n }\n return false;\n });\n\n if (!experience) {\n throw new Error(\"experience not found\");\n }\n\n const typedExperience = experience as ISegmentExperience;\n const typedSegment = (typedExperience.segment as IFunctionResultsSegment)\n\n const segmentFunction = (hooks ? hooks : {})[typedSegment.function];\n if (segmentFunction) {\n const results = await segmentFunction();\n return results;\n } else {\n console.warn(`segmentId:${segment.segmentId}, ${typedSegment.function} function not provided !`)\n }\n\n return false;\n });\n\n if (segment)\n return this._getSkinIdBySkinSelector(segment.skinSelector, experiences);\n else {\n debugger;\n }\n }\n break;\n default: {\n debugger;\n }\n }\n return '' //TODO\n }\n\n private runSkinSelector = async (componentConfig: IComponentConfig, hooks?: loaderHooks) => {\n const skinId = await this._getSkinIdBySkinSelector(componentConfig.instance.skinSelector, componentConfig.instance.resolvedExperiences, hooks);\n return componentConfig.type.skins.find(skin => skin.id === skinId);\n }\n\n public loaderHooks?: loaderHooks;\n\n public loadComponent = async <T extends IMyopComponent = IMyopComponent>(componentConfig: IComponentConfig, container?: HTMLElement | Ref, options?: loaderOptions):\n Promise<T> => {\n\n if (!container) {\n debugger;\n throw new Error('no container was found for this component');\n }\n\n const overriddenConfig = await checkMyopOverride(componentConfig);\n if (overriddenConfig) {\n //TODO : log\n componentConfig = overriddenConfig;\n }\n\n // // @ts-ignore\n // if (!container.__nonProxied) {\n // const refComponent = (container as unknown as MyopRefComponent);\n // //if we got loadComponent over MyopRefComponent\n // if (refComponent.id && refComponent.parent) {\n // return this.loadComponent(componentConfig, refComponent.ref, options);\n //\n // // let rootComponent: IMyopComponent = refComponent;\n // // while(!rootComponent.element && rootComponent.parent){\n // // rootComponent = rootComponent.parent\n // // }\n // //\n // // rootComponent.element\n // // //what now ?\n // }\n // }\n\n const hooks = {...(this.loaderHooks ?? {}), ...(options?.hooks ?? {})};\n\n const ref = container as Ref;\n if (ref.myop) {\n if (ref.component) {\n\n componentConfig = {...componentConfig};\n componentConfig.instance = {\n ...componentConfig.instance\n }\n\n let selectedSkin = await this.runSkinSelector(componentConfig, hooks)!\n if (!selectedSkin) {\n throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");\n }\n\n if (options?.hooks?.afterSkinSelected) {\n selectedSkin = await options.hooks.afterSkinSelected({...selectedSkin});\n }\n\n componentConfig.instance.skinSelector = {\n type: SkinSelectorTypes.Dedicated,\n skin: selectedSkin\n // skins: [selectedSkin]\n } as IDedicatedSkinConfig\n\n if (options) {\n options = {...options}\n delete options.hooks\n }\n\n const refComponent = await createRefComponent<T>(ref, componentConfig, this.components, options);\n\n //TODO : connect refs and props insode createRefComponent, elsewhere its not really <T>\n return refComponent;\n } else {\n throw new Error('load component got a detached ref.')\n }\n }\n\n container = container as HTMLElement;\n\n /**\n *\n * choose skin on runtime ...\n * componentConfig.instance.skinSelector.type\n */\n\n let selectedSkin = await this.runSkinSelector(componentConfig, hooks)!\n\n if (!selectedSkin) {\n throw new Error(\"runSkinSelector failed to choose skin, check the provided config\");\n }\n\n if (options?.hooks?.afterSkinSelected) {\n selectedSkin = await options.hooks.afterSkinSelected({...selectedSkin});\n }\n const componentLoader = this.componentsLoaders.find(loader => loader.type === selectedSkin.loader.type);\n\n if (!componentLoader) {\n debugger;\n throw new Error(`no loader \"${selectedSkin.loader.type}\" was found for component`);\n }\n\n //for loaded webcomponent modules to following line creates a race condition with the init message flow\n let component = await componentLoader.load(componentConfig.type, selectedSkin, container, options);\n\n // TODO : when this is not true ?\n if (!component.isInitiated)\n this.components2init.push(component)\n\n component.bind('onDispose', () => {\n //console.log('component dispose', component);\n this.components = this.components.filter(c => c !== component)\n this.components2init = this.components2init.filter(c => c !== component)\n return true;\n })\n\n this.components.push(component);\n\n // true by default\n if (!options || options.connectProps !== false) {\n //TODO : make type field conditional type infer \"string\" > string, \"number\" > number, etc...\n component = connectProps(component, componentConfig.type.props, selectedSkin);\n }\n\n try {\n //TODO : make optional?\n //TODO : fix issues with timeout and wrong ref names from config vs current skin\n await connectRefs(component, componentConfig, this.components);\n } catch (e) {\n throw e;\n //debugger;\n // TOOD : throw ?\n }\n if (!options?.skipInit)\n await component.initiated();\n\n return component as T;\n }\n\n public navigate = async <T extends IMyopComponent = IMyopComponent>(component: IMyopComponent, newComponentConfig: IComponentConfig, options?: navigationOptions) => {\n if (component.parent) {\n throw new Error('Navigating on remote ref components is not implemented yet');\n }\n\n //component.markedForDisposed = true;\n\n // if (options?.inplace) {\n // if (component.element) {\n // let newComponent = await this.loadComponent<T>(newComponentConfig, component.element);\n // await newComponent.initiated();\n //\n // if (options.init)\n // await options.init(newComponent);\n //\n // return newComponent;\n // } else {\n // throw new Error('...')\n // }\n // }\n\n if (options?.staged) {\n //const selectedSkin = this.runSkinSelector(newComponentConfig)\n let newComponent = await this.loadComponent<T>(newComponentConfig, component.container, {\n hidden: true,\n relative: {direction: 'after', child: component.element!},\n ...options\n });\n\n if (options.init)\n await options.init(newComponent);\n\n newComponent.show();\n component.dispose();\n return newComponent;\n } else {\n const nextSibling = component.element!.nextSibling;\n\n component.dispose();\n return this.loadComponent<T>(newComponentConfig, component.container, {\n relative: {\n direction: \"before\",\n child: nextSibling,\n },\n ...options\n });\n }\n }\n}\n\nexport type navigationOptions = {\n staged?: boolean,\n //inplace?: boolean,\n init?: (component: IMyopComponent) => Promise<void>\n skipInit?: boolean\n} & loaderOptions\n\ntype relativeLoadConfigDirection = 'before' | 'after';\n\n\nexport type loaderHooks = {\n afterSkinSelected?: (selectedSkin: ISkinConfig) => Promise<ISkinConfig>\n} &\n // segmentation hooks\n ({ [key: string]: () => Promise<boolean> | boolean } | {})\n\n//TODO: support serializable version of that object\nexport interface relativeLoadConfig {\n //If this is null, then newNode is inserted at the end of node's child nodes.\n //https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore\n child: ChildNode | null\n direction: relativeLoadConfigDirection\n}\n\nexport interface IEnvironment {\n [key: string]: any\n}\n\ntype ElementAttributes = {\n [key: string]: string | number | boolean | undefined | null;\n};\n\nexport interface loaderOptions {\n id?: string\n hidden?: boolean\n connectProps?: boolean\n timeout?: number\n skipInit?: boolean\n relative?: relativeLoadConfig\n hooks?: loaderHooks\n elementAttributes?: ElementAttributes\n _environment?: IEnvironment\n _hasParent?: boolean\n _inspection?: boolean\n}\n\nif (!window.myop) {\n // @ts-ignore\n window.myop = {\n __ROOT_SDK_PUBLIC_URL__\n };\n}\n\nif (!window.myop.hostSDK) {\n const _hostSDK = new HostSDK();\n //TODO: enable lazy init?\n _hostSDK.init();\n\n if (!window.myop) {\n // @ts-ignore\n window.myop = {\n __ROOT_SDK_PUBLIC_URL__\n };\n }\n window.myop.hostSDK = _hostSDK;\n}\n\n// @ts-ignore\nexport const hostSDK: HostSDK = window.myop.hostSDK;\n\ndefineDynamicImport('hostSDK', hostSDK);\n\ndeclare global {\n interface Window {\n myop: {\n __ROOT_SDK_PUBLIC_URL__: string,\n hostSDK: HostSDK,\n IframeSDK: InstanceType<typeof IframeSDK>\n }\n }\n}\n", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {myopAttributes} from \"../../consts\";\nimport {HostSDK} from \"../../host/hostSDK\";\nimport {CreateRefComponentMessage, RefComponentCreatedMessage} from \"../../messages/CreateRefComponentMessage\";\nimport {BaseWebComponentMessageHandler, MessageToHost} from \"./BaseWebComponentMessageHandler\";\nimport {ShadowRootRef} from \"../shadowRootRef\";\nimport {IMyopComponent} from \"../../host\";\n\nexport class CreateRefComponentMessageHandler extends BaseWebComponentMessageHandler<CreateRefComponentMessage> {\n\n messageType = MyopMessages.CreateRefComponentMessage;\n\n innerExecutor = (event: CreateRefComponentMessage, shadowRootRef: ShadowRootRef, messageToHost: MessageToHost) => {\n\n const createRef = async () => {\n //const allItems = shadowRootRef.shadowRoot.querySelectorAll<HTMLElement>(`[${myopAttributes.id}='${event.ref?.refConfig.selector}']`);\n const allItems = shadowRootRef.shadowRoot.querySelectorAll<HTMLElement>(`[${myopAttributes.id}='${event.refConfig.selector}']`);\n\n if (allItems.length === 1) {\n const hostSDK = HostSDK.Instance();\n\n const refComponent = hostSDK.components.find(c => c.id === event.options.id)!;\n if (refComponent) {\n ////>>>>\n refComponent.dispose();\n } else {\n // console.log(`failed to find ${event.options.id} in mem scope`, hostSDK);\n }\n //we have the ref component in our HostSDK (same memory when using webcomponent)\n // refComponent.parent = implementationComponent;\n //delete the ref component\n const index = hostSDK.components.indexOf(refComponent);\n if (index !== -1) {\n hostSDK.components.splice(index, 1);\n //console.log('createRefComponent called removed temp ref component');\n } else {\n //console.log('createRefComponent called using temp ref component');\n }\n\n const implementationComponent = await hostSDK.loadComponent(event.nestedComponentConfig,\n allItems.item(0),\n event.options)\n\n //TODO : no need this, pass options from parent\n //implementationComponent.id = event.predefinedId;\n //refComponent.id += '.';\n\n //TODO : not really needed ?\n // await implementationComponent.initiated();\n\n const nestedRefConfig: any[] = [];\n\n Object.keys(implementationComponent.refs).forEach(refName => {\n let ref = implementationComponent.refs[refName];\n ref = ref.__nonProxied || ref;\n\n if ((ref as IMyopComponent).componentDefinition) {\n nestedRefConfig.push({\n refName,\n componentDefinitionId: (ref as IMyopComponent).componentDefinition.id,\n });\n }\n })\n\n messageToHost(new RefComponentCreatedMessage(event.handlerUniqueId, nestedRefConfig));\n } else {\n console.error('CreateRefComponentMessageHandler - DOM element not found')\n this.messageToHost(new RefComponentCreatedMessage(event.handlerUniqueId, [], true));\n\n debugger;\n }\n }\n\n createRef().then()\n //returning undefined so it won't act as a cleanup\n }\n}\n", "import {ExecuteScriptMessage} from \"../../messages\";\nimport {RootRef} from \"../../common\";\nimport {makeSerializable} from \"../utils/serialization.ts\";\n\nexport const ExecuteScriptHandlerExecutor = (event: ExecuteScriptMessage, replier: (data: any) => void, rootRef: RootRef) => {\n const __scriptInputs = event.scriptInputs ? event.scriptInputs : {}\n __scriptInputs.makeSerializable = makeSerializable;\n\n __scriptInputs.send = replier;\n __scriptInputs.rootRef = rootRef;\n __scriptInputs.__scriptInputs = __scriptInputs;\n\n const dynamicFunction = new Function(`return (${event.script})(...arguments)`);\n const ret = dynamicFunction(__scriptInputs);\n\n // const dynamicFunction = Function('send', 'rootRef','__scriptInputs', ...Object.keys(__scriptInputs), event.content ? event.content : '')\n //const ret = dynamicFunction(replier, rootRef, __scriptInputs, ...Object.values(__scriptInputs));\n replier(ret);\n}\n", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {ExecuteScriptMessage, ExecuteScriptReplyMessage} from \"../../messages\";\nimport {BaseWebComponentMessageHandler, MessageToHost} from \"./BaseWebComponentMessageHandler.ts\";\nimport {ShadowRootRef} from \"../shadowRootRef.ts\";\nimport {ExecuteScriptHandlerExecutor} from \"../../common/messageHandlers/executeScriptHandler.ts\";\n\nexport class ExecuteScriptHandler extends BaseWebComponentMessageHandler<ExecuteScriptMessage> {\n messageType = MyopMessages.ExecuteScriptMessage\n\n innerExecutor = (event: ExecuteScriptMessage, shadowRootRef: ShadowRootRef, messageToHost: MessageToHost) => {\n const replier = (data: any) => {\n messageToHost(new ExecuteScriptReplyMessage(event.handlerUniqueId, data));\n };\n\n ExecuteScriptHandlerExecutor(event, replier, shadowRootRef);\n }\n}\n", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {ElementValueReplayMessage, FormDataEntry, GetElementValueMessage, InputElementValue,} from \"../../messages\";\nimport {BaseWebComponentMessageHandler, MessageToHost} from \"./BaseWebComponentMessageHandler.ts\";\nimport {ShadowRootRef} from \"../shadowRootRef.ts\";\nimport {getElementsByRef} from \"../../common/messageHandlers/helpers\";\nimport {myopAttributes} from \"../../consts.ts\";\nimport {makeSerializable} from \"../../common/utils/serialization.ts\";\n\nconst getInputValue = (element): InputElementValue => {\n if (!element) return null;\n\n // Check if it's a form\n if (element.tagName === 'FORM') {\n const formData = new FormData(element);\n const dataObject: InputElementValue = {\n formData: {},\n unmappedData: []\n };\n\n // Manually add elements without names\n const elements = element.querySelectorAll('input, select, textarea');\n let autoNameIndexer = -1;\n\n elements.forEach(element => {\n if (typeof element.value === 'string') {\n const myopId = element.getAttribute(myopAttributes.id);\n let key = element.getAttribute('name');\n\n // `_${(++autoNameIndexer)}`\n\n const nodeData: FormDataEntry = {\n id: element.id,\n name: key,\n value: getInputValue(element),\n required: element.required,\n validity: makeSerializable(element.validity, true),\n myopId,\n };\n\n if (!key) {\n dataObject.unmappedData!.push(nodeData);\n } else {\n if (dataObject.formData![key]) {\n if (dataObject.formData![key].value) {\n dataObject.unmappedData!.push(nodeData);\n } else {\n dataObject.unmappedData!.push(dataObject.formData![key]);\n dataObject.formData![key] = nodeData\n }\n } else {\n dataObject.formData![key] = nodeData\n }\n }\n }\n });\n\n return dataObject;\n }\n\n // Check if it's a checkbox or radio button\n if (element.type === 'checkbox' || element.type === 'radio') {\n return element.checked ? element.value : null;\n }\n\n // Handle input and textarea elements\n if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {\n return element.value;\n }\n\n // Handle select elements (dropdowns)\n if (element.tagName === 'SELECT') {\n return element.value;\n }\n\n // Handle editable divs (contentEditable)\n if (element.isContentEditable) {\n return element.innerText || element.textContent;\n }\n\n // If it's an unsupported element type\n return null;\n}\n\nexport class GetElementValueHandler extends BaseWebComponentMessageHandler<GetElementValueMessage> {\n\n messageType = MyopMessages.GetElementValueMessage;\n\n innerExecutor = (event: GetElementValueMessage, shadowRootRef: ShadowRootRef, messageToHost: MessageToHost) => {\n const items = getElementsByRef(event.ref, shadowRootRef.shadowRoot);\n items.forEach(item => {\n // @ts-ignore\n messageToHost(new ElementValueReplayMessage(getInputValue(item)), event);\n })\n }\n}\n", "import {MyopMessages} from \"../../common/MyopMessages\";\nimport {SetInnerHtml} from \"../../messages\";\nimport {ShadowRootRef} from \"../shadowRootRef\";\nimport {BaseWebComponentMessageHandler} from \"./BaseWebComponentMessageHandler\";\nimport {MyopElementMessage} from \"../../messages\";\nimport {getElementsByRef} from \"../../common/messageHandlers/helpers\";\n\nexport class SetInnerHtmlHandler extends BaseWebComponentMessageHandler<SetInnerHtml> {\n\n messageType = MyopMessages.SetInnerHtml;\n\n innerExecutor = (event: MyopElementMessage, shadowRootRef: ShadowRootRef) => {\n const items = getElementsByRef(event.ref, shadowRootRef.shadowRoot);\n items.forEach(item => {\n item.innerHTML = event.content;\n })\n }\n}\n", "/**\n * @packageDocumentation\n * The Webcomponent SDK is tailored for using Myop components packaged as separate bundles and exposed as web components.<br/>\n * Developers importing this SDK can leverage APIs and utilities specifically crafted to support the lifecycle management and communication patterns required for web components within the Myop architecture.<br/>\n * This SDK promotes reusability and encapsulation, enabling developers to build modular, self-contained components that can be seamlessly integrated into the host application's DOM structure.\n *\n *\n * Once loaded the `RootSDK`, you can load the `IframeSDK`\n * ```js\n * const {WebComponentSDK} = (await window.myop.rootSDK.getWebcomponentModule());\n * ```\n * or\n * ```ts\n * import {getWebcomponentModule} from '@myop/sdk';\n * const {WebComponentSDK} = (await getWebcomponentModule());\n * ```\n * or\n * ```ts\n * import {WebComponentSDK} from '@myop/sdk/webcomponent';\n * ```\n *\n */\nimport {BaseMyopSDK} from \"../common\";\nimport {MyopMessages} from \"../common/MyopMessages\";\nimport {myopWebcomponentConsts} from \"./consts\";\nimport {BaseWebComponentMessageHandler} from \"./messageHandlers/BaseWebComponentMessageHandler\";\nimport {BindOnClickHandler} from \"./messageHandlers/bindOnClickHandler\";\nimport {ChangeTextHandler} from \"./messageHandlers/changeTextHandler\";\nimport {ShadowRootRef} from \"./shadowRootRef\";\nimport {DetectMyopRefsMessageHandler} from \"./messageHandlers/DetectMyopRefsMessageHandler\";\nimport {defineDynamicImport} from \"../dynamicImport/defineDynamicImport\";\nimport {\n BaseMyopMessage,\n InitMessage,\n InitRequest,\n MessageDirection,\n MyopBindMessage,\n MyopBindReplayMessage\n} from \"../messages\";\nimport {setAttributeHandler} from \"./messageHandlers/setAttributeHandler.ts\";\nimport {AddEventListenerHandler} from \"./messageHandlers/addEventListenerHandler.ts\";\nimport {CreateRefComponentMessageHandler} from \"./messageHandlers/CreateRefComponentMessageHandler.ts\";\nimport {ExecuteScriptHandler} from \"./messageHandlers/executeScriptHandler.ts\";\nimport {GetElementValueHandler} from \"./messageHandlers/GetElementValueHandler.ts\";\nimport {SetInnerHtmlHandler} from \"./messageHandlers/setInnerHtmlHandler.ts\";\n\n/**\n * The Webcomponent SDK is tailored for using Myop components packaged as separate bundles and exposed as web components.<br/>\n * Developers importing this SDK can leverage APIs and utilities specifically crafted to support the lifecycle management and communication patterns required for web components within the Myop architecture.<br/>\n * This SDK promotes reusability and encapsulation, enabling developers to build modular, self-contained components that can be seamlessly integrated into the host application's DOM structure.\n *\n *\n * Once loaded the `Root SDK`, you can load the `IframeSDK`\n * ```js\n * const {WebComponentSDK} = (await window.myop.rootSDK.getWebcomponentModule());\n * ```\n * or\n * ```ts\n * import {getWebcomponentModule} from '@myop/sdk';\n * const {WebComponentSDK} = (await getWebcomponentModule());\n * ```\n *\n */\nexport class WebComponentSDK extends BaseMyopSDK {\n\n alwaysPassEnvelopesToHost = true;\n\n //when new web component created.\n connectedCallback = (container: HTMLElement, shadow: ShadowRoot) => {\n container.addEventListener(myopWebcomponentConsts.webcomponent_message_key, (e: any) => {\n //debugger;\n const eventContent = e.data ? e.data : e.detail;\n if (!eventContent || !eventContent.myop) {\n debugger;\n throw new Error('recvied webcomponent_message with wrong type')\n } else {\n const message = eventContent as BaseMyopMessage;\n\n //TODO : send container / compoennt identifier for multil components support\n this.handleIncomeMessages(e)\n\n if (message.messageType === MyopMessages.InitMessage) {\n // @ts-ignore\n const newComponentId = (message as InitMessage).content.id;\n this.components[newComponentId].context = new ShadowRootRef(container, shadow)\n\n // this.supportedHandlers.forEach(handler => {\n // handler.context = this.shadowRoots;\n // });\n }\n }\n })\n\n //TODO : fix that hack. race condition with host.load when module loaded\n setTimeout(() => {\n this.messageToHost(new InitRequest())\n }, 1)\n }\n\n messageToHost = (message: MyopBindReplayMessage, replayTo?: MyopBindMessage) => {\n message.direction = MessageDirection.up\n //message.replayToHandler = replayTo?.handlerUniqueId;\n\n if (!message.replayToHandler && replayTo?.handlerUniqueId)\n message.replayToHandler = replayTo.handlerUniqueId\n\n window.myop.hostSDK.send(message)\n }\n\n supportedHandlers: BaseWebComponentMessageHandler[] = [\n new ChangeTextHandler(this.messageToHost, this.components),\n new SetInnerHtmlHandler(this.messageToHost, this.components),\n new BindOnClickHandler(this.messageToHost, this.components),\n new DetectMyopRefsMessageHandler(this.messageToHost, this.components),\n new setAttributeHandler(this.messageToHost, this.components),\n new AddEventListenerHandler(this.messageToHost, this.components),\n new ExecuteScriptHandler(this.messageToHost, this.components),\n new GetElementValueHandler(this.messageToHost, this.components),\n //\n new CreateRefComponentMessageHandler(this.messageToHost, this.components)\n ];\n\n public init = () => {\n //this.myComponentId\n //this.handleIncomeMessages\n }\n}\n\ndefineDynamicImport('WebComponentSDK', WebComponentSDK);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,IAAM,iBAAN,MAA4C;AAAA,EAC/C,YAAmB,QACA,aACA,cACA,WACA,YAAqB;AAJrB;AACA;AACA;AACA;AACA;AAInB,wBAAgB,QAAe;AAAA,EAF/B;AAGJ;;;ACzBO,IAAM,qBAAqB,OAAO,SAAkC;AACvE,MAAI,OAAO,SAAS,YAAY;AAE5B,SAAK;AAAA,EACT,WAAW,gBAAgB,SAAS;AAEhC,UAAM,SAAS,MAAM;AAErB,QAAI,OAAO,WAAW,YAAY;AAE9B,aAAO;AAAA,IAC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A;AAAA,MAE9D,IAAI,iCAAiC,KAAK,eAAe,KAAK,UAAU;AAAA,IAC5E;AAEA,wBAAO,QAAO,MAAM;AAAA,IAGpB;AAAA;AACJ;AAEA,oBAAoB,mBAAmB,eAAe;",
|
|
6
|
+
"names": ["ReplayMessageKey", "match", "scriptInputs", "scriptInputs", "ReplayMessageKey", "ReplayMessageKey", "ReplayMessageKey", "ReplayMessageKey", "ReplayMessageKey", "ReplayMessageKey", "seen", "target", "makeSerializable", "height", "width", "seen", "sdk", "domId", "sdk", "seen", "skin", "component", "segment", "experience", "selectedSkin", "hostSDK", "element"]
|
|
7
|
+
}
|