@contello/extension 8.21.3 → 8.21.4
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/LICENSE +21 -0
- package/dist/index.cjs +339 -344
- package/dist/index.d.cts +222 -204
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +222 -204
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +336 -313
- package/dist/index.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/channel.ts","../src/dialog-ref.ts","../src/utils.ts","../src/client.ts","../src/url-parser.ts","../src/custom-property.ts","../src/dialog.ts","../src/extension.ts"],"sourcesContent":["import type { ContelloMethods } from './methods';\nimport type { ExtensionEvent, ExtensionEventPayload } from './types';\n\nexport type Handler<REQ, RES> = (msg: REQ) => RES | Promise<RES>;\n\nlet channelIdIterator = 0;\nlet requestIdIterator = 0;\n\nexport class ExtensionChannel<OWN extends ContelloMethods, REMOTE extends ContelloMethods> {\n private targetWindow!: Window;\n private channelId!: string;\n private targetOrigin!: string;\n private isParent!: boolean;\n private handler = (event: MessageEvent) => {\n if (event.data.channelId !== this.channelId) {\n return;\n }\n\n if (this.targetOrigin === '*' || event.origin === this.targetOrigin) {\n const { channelId: requestChannelId, requestId, method } = event.data;\n\n if (requestChannelId === this.channelId) {\n if (this.params.debug) {\n console.log(this.isParent ? 'Parent received' : 'Child received', event.data);\n }\n\n if (this.handlers.has(requestId)) {\n this.handlers.get(requestId)(event.data);\n } else if (this.listeners.has(method)) {\n void (async () => {\n try {\n const responsePayload = await this.listeners.get(method)?.(event.data.payload);\n\n this.respond(event.data, responsePayload);\n } catch (error) {\n this.respondError(event.data, error);\n }\n })();\n }\n }\n }\n };\n\n handlers = new Map();\n listeners = new Map<string, Handler<any, any>>();\n\n constructor(private params: { debug: boolean }) {}\n\n private connect() {\n window.addEventListener('message', this.handler);\n }\n\n private createChannelId() {\n return `contello-channel-${++channelIdIterator}-${Math.random().toString(36).slice(2)}`;\n }\n\n private createRequestId() {\n return `${this.isParent ? 'parent' : 'child'}-request-${++requestIdIterator}-${Math.random()\n .toString(36)\n .slice(2)}`;\n }\n\n populateChannelId() {\n if (!this.channelId) {\n this.channelId = this.createChannelId();\n }\n\n return this.channelId;\n }\n\n connectParent(targetOrigin: string, channelId: string) {\n this.channelId = channelId;\n this.targetOrigin = targetOrigin;\n this.targetWindow = window.parent;\n this.isParent = false;\n this.connect();\n }\n\n connectChild(targetWindow: Window) {\n this.populateChannelId();\n this.targetWindow = targetWindow;\n this.targetOrigin = '*';\n this.isParent = true;\n this.connect();\n }\n\n getChannelId() {\n return this.channelId;\n }\n\n getIsDebug() {\n return this.params.debug;\n }\n\n getTargetOrigin() {\n return this.targetOrigin;\n }\n\n getTargetWindow() {\n return this.targetWindow;\n }\n\n disconnect() {\n window.removeEventListener('message', this.handler);\n }\n\n respond(request: ExtensionEvent, payload: ExtensionEventPayload) {\n this.send({ channelId: request.channelId, requestId: request.requestId, method: request.method, payload });\n }\n\n respondError(request: ExtensionEvent, error: any) {\n this.send({ channelId: request.channelId, requestId: request.requestId, method: request.method, error });\n }\n\n on<M extends keyof OWN>(method: M, handler: Handler<OWN[M][0], OWN[M][1]>): void {\n this.listeners.set(method as string, handler);\n }\n\n call<M extends keyof REMOTE>(method: M, message?: REMOTE[M][0]): Promise<REMOTE[M][1]> {\n return new Promise<any>((resolve, reject) => {\n const requestId = this.createRequestId();\n\n this.send({ channelId: this.channelId, requestId, method: method as string, payload: message as any });\n\n this.handlers.set(requestId, (data: ExtensionEvent) => {\n this.handlers.delete(requestId);\n\n if (data.error) {\n return reject(data.error);\n }\n\n resolve(data.payload);\n });\n });\n }\n\n send(data: ExtensionEvent) {\n this.targetWindow?.postMessage(data, this.targetOrigin);\n }\n}\n","import type { ExtensionChannel } from './channel';\nimport type { Deferred } from './utils';\n\nexport interface ContelloDialogParams<D, T> {\n channel: ExtensionChannel<any, any>;\n options: ContelloDialogOptions<D>;\n controller: {\n connected: Deferred<void>;\n ready: Deferred<void>;\n complete: Deferred<T>;\n close: () => void;\n };\n}\n\nexport interface ContelloDialogOptions<D> {\n url: string;\n width?: number;\n data?: D;\n}\n\nexport class ContelloDialogRef<D, T> {\n private _id?: string;\n readonly open: Promise<void>;\n readonly connected: Promise<void>;\n readonly ready: Promise<void>;\n readonly complete: Promise<T>;\n readonly close: () => void;\n\n constructor({ channel, options, controller }: ContelloDialogParams<D, T>) {\n this.open = (async () => {\n const { id } = await channel.call('openDialog', options);\n\n this._id = id;\n })();\n this.connected = controller.connected.promise;\n this.ready = controller.ready.promise;\n this.complete = controller.complete.promise;\n this.close = controller.close;\n }\n\n get id() {\n return this._id;\n }\n}\n","export class Deferred<T> {\n resolve!: (value?: T) => void;\n reject!: (reason?: any) => void;\n\n promise = new Promise<T>((resolve, reject) => {\n this.resolve = resolve as any;\n this.reject = reject;\n });\n}\n","import { ExtensionChannel } from './channel';\nimport { type ContelloDialogOptions, ContelloDialogRef } from './dialog-ref';\nimport type { ContelloClientChildMethods, ContelloClientParentMethods } from './methods';\nimport { Deferred } from './utils';\n\ntype ContelloEntityDetailParams = { mode: 'create' } | { mode: 'edit'; id: string } | { mode: 'clone'; id: string };\n\nexport class ContelloClient<D, O extends ContelloClientChildMethods, R extends ContelloClientParentMethods> {\n private resizeObserver?: ResizeObserver;\n private targetOrigin: string;\n private dialogs = new Map<\n ContelloDialogRef<any, any>,\n {\n connected: Deferred<void>;\n ready: Deferred<void>;\n complete: Deferred<any>;\n }\n >();\n\n protected channel: ExtensionChannel<O, R>;\n protected projectId: string;\n\n data?: D;\n\n constructor(targetOrigin: string, channelId: string, projectId: string, debug: boolean) {\n this.channel = new ExtensionChannel({ debug });\n this.channel.connectParent(targetOrigin, channelId);\n this.projectId = projectId;\n this.targetOrigin = targetOrigin;\n }\n\n private createEntityEntryUrl(referenceName: string): string {\n return `${this.createProjectUrl()}/entities/${referenceName}`;\n }\n\n private listenForResize() {\n this.resizeObserver = new ResizeObserver(() => {\n this.channel.call('resize', { height: this.getWindowHeight() });\n });\n\n this.resizeObserver.observe(document.documentElement);\n }\n\n private getWindowHeight() {\n // adapted from https://javascript.info/size-and-scroll-window\n return Math.max(document.body.scrollHeight, document.body.offsetHeight, document.body.clientHeight);\n }\n\n private getDialogController(id: string) {\n const key = this.dialogs.keys().find((dialog) => dialog.id === id);\n\n if (!key) {\n return;\n }\n\n return this.dialogs.get(key);\n }\n\n async connect() {\n const { data } = await this.channel.call('connect');\n\n this.channel.on('dialogConnect', ({ id }) => this.getDialogController(id)?.connected.resolve());\n this.channel.on('dialogReady', ({ id }) => this.getDialogController(id)?.ready.resolve());\n this.channel.on('dialogComplete', ({ id, value }) => this.getDialogController(id)?.complete.resolve(value));\n\n this.data = data;\n }\n\n ready() {\n this.listenForResize();\n\n return this.channel.call('ready', { height: this.getWindowHeight() });\n }\n\n async getAuthToken(): Promise<string> {\n const { token } = await this.channel.call('getAuthToken');\n\n return token;\n }\n\n createProjectUrl() {\n return `${this.targetOrigin}/ui/projects/${this.projectId}`;\n }\n\n createSingletonEntityUrl(referenceName: string): string {\n return this.createEntityEntryUrl(referenceName);\n }\n\n createEntityDetailUrl(referenceName: string, params: ContelloEntityDetailParams): string {\n const base = this.createEntityEntryUrl(referenceName);\n\n if (params.mode === 'create') {\n return `${base}/create`;\n }\n\n return `${base}/${params.mode}/${params.id}`;\n }\n\n /**\n * @deprecated Use createEntityDetailUrl instead\n */\n createEntityUrl(referenceName: string, entityId: string): string {\n return this.createEntityDetailUrl(referenceName, { mode: 'edit', id: entityId });\n }\n\n createExtensionUrl(\n referenceName: string,\n params?: {\n path?: string[];\n query?: { [prop: string]: string };\n },\n ): string {\n const path = params?.path?.join('/') || '';\n const query = new URLSearchParams(params?.query || {}).toString();\n\n return `${this.createProjectUrl()}/extensions/${referenceName}${path ? `/${path}` : ''}${query ? `?${query}` : ''}`;\n }\n\n navigate(url: string) {\n return this.channel.call('navigate', { url });\n }\n\n displayNotification(type: 'success' | 'error', message: string) {\n return this.channel.call('displayNotification', { type, message });\n }\n\n openDialog<D, T>(options: ContelloDialogOptions<D>): ContelloDialogRef<D, T> {\n const controller = {\n connected: new Deferred<void>(),\n ready: new Deferred<void>(),\n complete: new Deferred<T>(),\n close: () => {\n if (!this.channel) {\n throw new Error('The channel is not yet initialized');\n }\n\n this.channel.call('closeDialog', { id: dialog.id as string });\n this.dialogs.delete(dialog);\n },\n };\n\n const dialog = new ContelloDialogRef<D, T>({ channel: this.channel, options, controller });\n\n this.dialogs.set(dialog, controller);\n\n void (async () => {\n await dialog.complete;\n\n this.dialogs.delete(dialog);\n })();\n\n return dialog;\n }\n}\n","export function parseUrl(trustedOrigins: string[]) {\n const url = new URL(globalThis.location.href);\n\n const channelId = url.searchParams.get('channelId');\n const targetOrigin = url.searchParams.get('origin');\n const applicationId = url.searchParams.get('applicationId');\n\n if (!channelId || !targetOrigin || !applicationId) {\n throw new Error('Missing required URL parameters');\n }\n\n if (!trustedOrigins?.length) {\n throw new Error('No trusted origins provided');\n }\n\n if (!trustedOrigins.includes(targetOrigin)) {\n throw new Error(`Origin ${targetOrigin} is not trusted`);\n }\n\n const debug = url.searchParams.get('debug') === 'true';\n\n return { channelId, targetOrigin, applicationId, debug };\n}\n","import { ContelloClient } from './client';\nimport type { ContelloCustomPropertyChildMethods, ContelloCustomPropertyParentMethods } from './methods';\nimport { parseUrl } from './url-parser';\n\nexport type ContelloCustomPropertyValidator = (value: any) => boolean;\n\nexport interface ContelloCustomPropertyOptions {\n trustedOrigins: string[];\n validator?: () => boolean;\n newValue?: (value: any) => void;\n}\n\nexport class ContelloCustomProperty extends ContelloClient<\n void,\n ContelloCustomPropertyChildMethods,\n ContelloCustomPropertyParentMethods\n> {\n static async connect(options: ContelloCustomPropertyOptions) {\n const { targetOrigin, channelId, applicationId, debug } = parseUrl(options.trustedOrigins);\n const customProperty = new ContelloCustomProperty(targetOrigin, channelId, applicationId, debug);\n\n customProperty.validate = options.validator || (() => true);\n customProperty.newValue = options.newValue || (() => null);\n\n await customProperty.connect();\n\n return customProperty;\n }\n\n validate = () => true;\n newValue: (value: string) => void = () => null;\n\n constructor(targetOrigin: string, channelId: string, applicationId: string, debug: boolean) {\n super(targetOrigin, channelId, applicationId, debug);\n\n this.channel.on('validate', async () => {\n const valid = await Promise.resolve(this.validate());\n\n return { valid };\n });\n\n this.channel.on('newValue', async (msg) => {\n await Promise.resolve(this.newValue(msg.value));\n });\n }\n\n async getValue(): Promise<string> {\n const r = await this.channel.call('getValue');\n\n return r.value;\n }\n\n async setValue(value: string): Promise<void> {\n const valid = await Promise.resolve(this.validate());\n\n return await this.channel.call('setValue', { value, valid });\n }\n\n async getValueByPath(path: string): Promise<any> {\n const r = await this.channel.call('getValueByPath', { path });\n\n return r.value;\n }\n\n async setValueByPath(path: string, value: any): Promise<void> {\n return this.channel.call('setValueByPath', { value, path });\n }\n}\n","import { ContelloClient } from './client';\nimport { parseUrl } from './url-parser';\n\nexport class ContelloDialog<D, T> extends ContelloClient<D, any, any> {\n static async connect<D, T>({ trustedOrigins }: { trustedOrigins: string[] }) {\n const { targetOrigin, channelId, applicationId, debug } = parseUrl(trustedOrigins);\n const dialog = new ContelloDialog<D, T>(targetOrigin, channelId, applicationId, debug);\n\n await dialog.connect();\n\n return dialog;\n }\n\n constructor(targetOrigin: string, channelId: string, applicationId: string, debug: boolean) {\n super(targetOrigin, channelId, applicationId, debug);\n }\n\n close(value?: T) {\n return this.channel.call('complete', { value });\n }\n}\n","import { ContelloClient } from './client';\nimport type {\n ContelloExtensionBreadcrumb,\n ContelloExtensionChildMethods,\n ContelloExtensionParentMethods,\n} from './methods';\nimport { parseUrl } from './url-parser';\n\nexport interface ContelloExtensionOptions {\n trustedOrigins: string[];\n}\n\nexport class ContelloExtension extends ContelloClient<\n void,\n ContelloExtensionChildMethods,\n ContelloExtensionParentMethods\n> {\n static async connect({ trustedOrigins }: ContelloExtensionOptions) {\n const { targetOrigin, channelId, applicationId, debug } = parseUrl(trustedOrigins);\n const extension = new ContelloExtension(targetOrigin, channelId, applicationId, debug);\n\n await extension.connect();\n\n return extension;\n }\n\n constructor(targetOrigin: string, channelId: string, applicationId: string, debug: boolean) {\n super(targetOrigin, channelId, applicationId, debug);\n }\n\n getUrlData() {\n return this.channel.call('getUrlData');\n }\n\n setBreadcrumbs(breadcrumbs: ContelloExtensionBreadcrumb[]) {\n return this.channel.call('setBreadcrumbs', { breadcrumbs });\n }\n}\n"],"mappings":";AAKA,IAAI,oBAAoB;AACxB,IAAI,oBAAoB;AAExB,IAAa,mBAAb,MAA2F;CAsCrE;CArCpB;CACA;CACA;CACA;CACA,WAAmB,UAAwB;EACzC,IAAI,MAAM,KAAK,cAAc,KAAK,WAChC;EAGF,IAAI,KAAK,iBAAiB,OAAO,MAAM,WAAW,KAAK,cAAc;GACnE,MAAM,EAAE,WAAW,kBAAkB,WAAW,WAAW,MAAM;GAEjE,IAAI,qBAAqB,KAAK,WAAW;IACvC,IAAI,KAAK,OAAO,OACd,QAAQ,IAAI,KAAK,WAAW,oBAAoB,kBAAkB,MAAM,IAAI;IAG9E,IAAI,KAAK,SAAS,IAAI,SAAS,GAC7B,KAAK,SAAS,IAAI,SAAS,CAAC,CAAC,MAAM,IAAI;SAClC,IAAI,KAAK,UAAU,IAAI,MAAM,GAClC,CAAM,YAAY;KAChB,IAAI;MACF,MAAM,kBAAkB,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,MAAM,KAAK,OAAO;MAE7E,KAAK,QAAQ,MAAM,MAAM,eAAe;KAC1C,SAAS,OAAO;MACd,KAAK,aAAa,MAAM,MAAM,KAAK;KACrC;IACF,EAAA,CAAG;GAEP;EACF;CACF;CAEA,2BAAW,IAAI,IAAI;CACnB,4BAAY,IAAI,IAA+B;CAE/C,YAAY,QAAoC;EAA5B,KAAA,SAAA;CAA6B;CAEjD,UAAkB;EAChB,OAAO,iBAAiB,WAAW,KAAK,OAAO;CACjD;CAEA,kBAA0B;EACx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
"version": "8.21.4",
|
|
4
4
|
"description": "Client SDK for building Contello CMS extensions and custom properties",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,12 +10,6 @@
|
|
|
10
10
|
"url": "https://github.com/entwico/contello-js",
|
|
11
11
|
"directory": "packages/extension"
|
|
12
12
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsup",
|
|
15
|
-
"lint": "eslint .",
|
|
16
|
-
"lint:fix": "eslint . --fix",
|
|
17
|
-
"typecheck": "tsc --noEmit"
|
|
18
|
-
},
|
|
19
13
|
"files": [
|
|
20
14
|
"dist"
|
|
21
15
|
],
|
|
@@ -29,5 +23,11 @@
|
|
|
29
23
|
"publishConfig": {
|
|
30
24
|
"access": "public",
|
|
31
25
|
"registry": "https://registry.npmjs.org"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsdown",
|
|
29
|
+
"lint": "eslint . --cache",
|
|
30
|
+
"lint:fix": "eslint . --fix",
|
|
31
|
+
"typecheck": "tsc --noEmit"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|