@teambit/preview 1.0.1212 → 1.0.1214
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/artifacts/ui-bundle/asset-manifest.json +6 -6
- package/artifacts/ui-bundle/static/js/{main.b9707b18.cjs → main.71c70d31.cjs} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -18
- package/dist/index.js.map +1 -1
- package/dist/{preview-1791563417062.js → preview-1791624541512.js} +2 -2
- package/dist/preview.main.runtime.d.ts +3 -13
- package/dist/preview.main.runtime.js.map +1 -1
- package/dist/preview.preview.runtime.js +1 -8
- package/dist/preview.preview.runtime.js.map +1 -1
- package/package.json +19 -19
- package/preview.preview.runtime.tsx +1 -2
- package/dist/events/click-inside-an-iframe.d.ts +0 -12
- package/dist/events/click-inside-an-iframe.js +0 -32
- package/dist/events/click-inside-an-iframe.js.map +0 -1
- package/dist/events/index.d.ts +0 -1
- package/dist/events/index.js +0 -18
- package/dist/events/index.js.map +0 -1
- package/events/click-inside-an-iframe.ts +0 -17
- package/events/index.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_harmony","_componentId","_crossFetch","_interopRequireDefault","_lodash","_exceptions","_preview","_events","_renderingContext","_fetchComponentAspects","_lruCache","_previewModules","_htmlUtils","_sizeEvent","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PreviewPreview","constructor","pubsub","previewSlot","renderingContextSlot","debounce","isReady","render","catch","err","console","error","Promise","resolve","_setupPromise","PREVIEW_MODULES","onSet","add","rootExt","window","document","body","style","width","previewName","componentId","envId","getLocation","name","getDefault","isDev","preview","getPreview","PreviewNotFound","includesAll","all","include","map","inclPreviewName","includedPreview","undefined","inclPreviewModule","getPreviewModule","selectPreviewModel","fullName","query","getQuery","onlyOverview","getParam","includes","filter","module","isObject","keysWithoutDefault","keys","key","defaultKeys","intersection","length","componentAspects","getComponentAspects","toString","previewModule","getRenderingContext","reportSize","setViewport","setFullScreen","LRUCache","max","ttl","cached","componentAspectsCache","get","result","fetchComponentAspects","set","registerClickPubSub","addEventListener","timestamp","Date","now","clickEvent","assign","pub","PreviewAspect","id","ClickInsideAnIframeEvent","has","includedReady","every","included","fullScreen","root","getElementById","height","viewPort","maxWidth","parent","measure","documentElement","prevHeight","scrollHeight","scrollWidth","publish","SizeEvent","debounced","resizedObserver","ResizeObserver","observe","compShortId","relevantModel","Error","componentMap","componentPreviews","fetchComponentPreview","loadComponentPreviews","component","metadata","modulesMap","componentMapMetadata","previewFile","allFiles","fetchComponentPreviewFiles","file","endsWith","addComponentFileElement","loadPreviewScript","previewBundleFileName","addComponentFileScriptElement","addComponentFileLinkElement","previewAssetsRoute","stringId","url","res","crossFetch","status","parsed","json","isBundledWithEnv","files","previewRoute","src","loadScript","href","loadLink","globalId","toStringWithoutVersion","componentPreview","registerPreview","register","aspectsFilter","RenderingContext","registerRenderContext","renderContext","previews","values","defaultOne","find","previewCandidate","param","params","URLSearchParams","withoutHash","location","hash","substring","after","split","before","ComponentID","tryFromString","provider","config","rerenderOnPreviewModulesUpdated","exports","PreviewRuntime","PubsubAspect","Slot","withType","addRuntime"],"sources":["preview.preview.runtime.tsx"],"sourcesContent":["import type { PubsubPreview } from '@teambit/pubsub';\nimport { PubsubAspect } from '@teambit/pubsub';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { ComponentID } from '@teambit/component-id';\n// Using cross-fetch here instead of @pnpm/node-fetch\n// which is crucial in this context as preview operates from the frontend where proxy and CA cert handling are not required\n// Reverting to cross-fetch restores correct handling of relative URLs, ensuring that previews render correctly\nimport crossFetch from 'cross-fetch';\nimport { debounce, intersection, isObject } from 'lodash';\n\nimport { PreviewNotFound } from './exceptions';\nimport type { PreviewType } from './preview-type';\nimport { PreviewAspect, PreviewRuntime } from './preview.aspect';\nimport { ClickInsideAnIframeEvent } from './events';\nimport type { ModuleFile, PreviewModule } from './types/preview-module';\nimport { RenderingContext } from './rendering-context';\nimport { fetchComponentAspects } from './gql/fetch-component-aspects';\nimport { LRUCache } from 'lru-cache';\nimport { PREVIEW_MODULES } from './preview-modules';\nimport { loadScript, loadLink } from './html-utils';\nimport { SizeEvent } from './size-event';\n\n// forward linkModules() for generate-link.ts\nexport { linkModules } from './preview-modules';\n\nexport type PreviewSlot = SlotRegistry<PreviewType>;\n\nexport type RenderingContextOptions = { aspectsFilter?: string[] };\nexport type RenderingContextProvider = (options: RenderingContextOptions) => { [key: string]: any };\nexport type RenderingContextSlot = SlotRegistry<RenderingContextProvider>;\n\nexport class PreviewPreview {\n constructor(\n /**\n * register to pubsub\n */\n private pubsub: PubsubPreview,\n\n /**\n * preview slot.\n */\n private previewSlot: PreviewSlot,\n\n private renderingContextSlot: RenderingContextSlot\n ) {\n this.registerClickPubSub();\n }\n\n private rerenderOnPreviewModulesUpdated = debounce(() => {\n if (!this.isReady()) return;\n void this.render().catch((err) => {\n // eslint-disable-next-line no-console\n console.error('[preview.preview] failed re-rendering after preview module update', err);\n });\n }, 30);\n\n private registerClickPubSub() {\n window.addEventListener('click', (e) => {\n const timestamp = Date.now();\n const clickEvent = Object.assign({}, e);\n this.pubsub.pub(PreviewAspect.id, new ClickInsideAnIframeEvent(timestamp, clickEvent));\n });\n }\n\n private isDev = false;\n\n private isReady() {\n const { previewName } = this.getLocation();\n const name = previewName || this.getDefault();\n\n if (!PREVIEW_MODULES.has(name)) return false;\n const preview = this.getPreview(name);\n if (!preview) return false;\n const includedReady = preview.include?.every((included) => PREVIEW_MODULES.has(included)) ?? true;\n if (!includedReady) return false;\n\n return true;\n }\n\n private _setupPromise?: Promise<void>;\n setup = () => {\n if (this.isReady()) return Promise.resolve();\n\n this._setupPromise ??= new Promise((resolve) => {\n PREVIEW_MODULES.onSet.add(() => {\n if (this.isReady()) resolve();\n });\n });\n\n return this._setupPromise;\n };\n\n /**\n * render the preview.\n */\n render = async (rootExt?: string) => {\n // fit content always.\n window.document.body.style.width = 'fit-content';\n\n const { previewName, componentId, envId } = this.getLocation();\n const name = previewName || this.getDefault();\n if (rootExt) this.isDev = rootExt === 'teambit.workspace/workspace';\n\n const preview = this.getPreview(name);\n if (!preview || !componentId) {\n throw new PreviewNotFound(previewName);\n }\n\n const includesAll = await Promise.all(\n (preview.include || []).map(async (inclPreviewName) => {\n const includedPreview = this.getPreview(inclPreviewName);\n if (!includedPreview) return undefined;\n\n const inclPreviewModule = await this.getPreviewModule(inclPreviewName, componentId);\n return includedPreview.selectPreviewModel?.(componentId.fullName, inclPreviewModule);\n })\n );\n\n const query = this.getQuery();\n const onlyOverview = this.getParam(query, 'onlyOverview');\n\n const includes =\n onlyOverview === 'true'\n ? []\n : includesAll\n .filter((module) => !!module)\n .map((module) => {\n if (!module.default || !isObject(module.default)) return module;\n // This aims to handle use cases where we have package.json with type:\"module\" in the root\n // in that case sometime we might get the props both under default and in the object root\n const keysWithoutDefault = Object.keys(module).filter((key) => key !== 'default');\n const defaultKeys = Object.keys(module.default);\n if (intersection(keysWithoutDefault, defaultKeys).length === defaultKeys.length) return module.default;\n return module;\n });\n\n // during build / tag, the component is isolated, so all aspects are relevant, and do not require filtering\n const componentAspects = this.isDev ? await this.getComponentAspects(componentId.toString()) : undefined;\n const previewModule = await this.getPreviewModule(name, componentId);\n const render = preview.render(\n componentId,\n envId || '',\n previewModule,\n includes,\n this.getRenderingContext(componentAspects)\n );\n\n this.reportSize();\n this.setViewport();\n this.setFullScreen();\n return render;\n };\n\n setFullScreen() {\n const query = this.getQuery();\n const fullScreen = this.getParam(query, 'fullscreen');\n\n if (!fullScreen) return;\n\n const root = window.document.getElementById('root');\n\n if (root) {\n root.style.height = '100vh';\n }\n }\n\n setViewport() {\n const query = this.getQuery();\n const viewPort = this.getParam(query, 'viewport');\n if (!viewPort) {\n window.document.body.style.width = '100%';\n return;\n }\n\n window.document.body.style.maxWidth = `${viewPort}px`;\n }\n\n reportSize() {\n if (!window?.parent || !window?.document) return;\n // In Preview, the <body> is always exactly as tall as the iframe viewport, not as tall as the content.\n // by measuring the scrollHeight of the root element, we can get the height of the content.\n const measure = () => {\n const root = window.document.getElementById('root') ?? window.document.documentElement;\n const prevHeight = root.style.height;\n // set height auto to make the browser calculate the natural block formatting height\n // scrollHeight of an element that has height: 100% reports the viewport height, not the content height\n root.style.height = 'auto';\n const height = root.scrollHeight;\n const width = root.scrollWidth;\n // restore the previous height so nothing visually changes within the same tick\n root.style.height = prevHeight;\n return { width, height };\n };\n const publish = () => {\n const { width, height } = measure();\n this.pubsub.pub(PreviewAspect.id, new SizeEvent({ width, height }));\n };\n // publish right away so the parent gets the first real size as soon as possible\n publish();\n // publish dimension changes when the content size actually changes\n const debounced = debounce(publish, 100);\n const resizedObserver = new ResizeObserver(debounced);\n resizedObserver.observe(window.document.documentElement);\n const root = window.document.getElementById('root');\n if (root) resizedObserver.observe(root);\n }\n\n async getPreviewModule(previewName: string, id: ComponentID): Promise<PreviewModule> {\n const compShortId = id.fullName;\n\n const relevantModel = PREVIEW_MODULES.get(previewName);\n if (!relevantModel) throw new Error(`[preview.preview] missing preview \"${previewName}\"`);\n if (relevantModel.componentMap[compShortId]) return relevantModel;\n\n const componentPreviews = await this.fetchComponentPreview(id, previewName);\n PREVIEW_MODULES.loadComponentPreviews(compShortId, componentPreviews);\n\n const component = componentPreviews[previewName];\n const metadata = componentPreviews[`${previewName}_metadata`];\n\n return {\n modulesMap: relevantModel.modulesMap,\n componentMap: {\n [id.fullName]: component,\n },\n componentMapMetadata: {\n [id.fullName]: metadata,\n },\n };\n }\n\n async fetchComponentPreview(id: ComponentID, name: string): Promise<Record<string, ModuleFile[]>> {\n let previewFile: string | undefined;\n const allFiles = await this.fetchComponentPreviewFiles(id, name);\n // It's a component bundled with the env\n if (allFiles === null) return {};\n\n await Promise.all(\n allFiles.map((file) => {\n // We want to run the preview file always last\n if (file.endsWith('-preview.js')) {\n previewFile = file;\n return undefined;\n }\n\n return this.addComponentFileElement(id, file);\n })\n );\n\n if (!previewFile) return {};\n return this.loadPreviewScript(id, name, previewFile);\n }\n\n private addComponentFileElement(id: ComponentID, previewBundleFileName: string) {\n if (previewBundleFileName.endsWith('.js')) {\n return this.addComponentFileScriptElement(id, previewBundleFileName);\n }\n\n // TODO - should we load assets other than .css / .js?\n // if (previewBundleFileName.endsWith('.css')) {\n this.addComponentFileLinkElement(id, previewBundleFileName).catch((err) => {\n throw new Error(\n `[preview.preview] failed loading asset \"${previewBundleFileName}\". Error - \"${err?.toString()}\"`\n );\n });\n\n // do NOT await non js assets, as they might never load (like images), and not critical for rendering.\n return undefined;\n }\n\n private async fetchComponentPreviewFiles(id: ComponentID, previewName: string): Promise<string[] | null> {\n const previewAssetsRoute = `~aspect/preview-assets`;\n const stringId = id.toString();\n const url = `/api/${stringId}/${previewAssetsRoute}`;\n\n const res = await crossFetch(url);\n if (res.status >= 400) {\n throw new PreviewNotFound(previewName);\n }\n const parsed = await res.json();\n // This is component bundled with the env, no reason to bring the files, as they will be the files of the env\n if (parsed.isBundledWithEnv) {\n return null;\n }\n if (!parsed.files || !parsed.files.length) {\n throw new PreviewNotFound(previewName);\n }\n return parsed.files;\n }\n\n private addComponentFileScriptElement(id: ComponentID, previewBundleFileName: string) {\n const previewRoute = `~aspect/component-preview`;\n const stringId = id.toString();\n const src = `/api/${stringId}/${previewRoute}/${previewBundleFileName}`;\n return loadScript({ src });\n }\n\n private addComponentFileLinkElement(id: ComponentID, previewBundleFileName: string) {\n const stringId = id.toString();\n const previewRoute = `~aspect/component-preview`;\n const href = `/api/${stringId}/${previewRoute}/${previewBundleFileName}`;\n return loadLink({ href });\n }\n\n private async loadPreviewScript(id: ComponentID, previewName: string, previewBundleFileName: string) {\n const previewRoute = `~aspect/component-preview`;\n const src = `/api/${id.toString()}/${previewRoute}/${previewBundleFileName}`;\n await loadScript({ src });\n\n // TODO - replace with jsonp\n const globalId = `${id.toStringWithoutVersion()}-preview`;\n const componentPreview = window[globalId];\n if (!componentPreview) throw new PreviewNotFound(previewName);\n\n return componentPreview as Record<string, ModuleFile[]>;\n }\n\n // Use LRU cache directly with TTL for component aspects\n private componentAspectsCache = new LRUCache<string, any>({\n max: 100,\n ttl: 12 * 60 * 60 * 1000, // 12 hours\n });\n\n private getComponentAspects = async (componentId: string) => {\n const cached = this.componentAspectsCache.get(componentId);\n if (cached) {\n return cached;\n }\n\n const result = await fetchComponentAspects(componentId);\n this.componentAspectsCache.set(componentId, result);\n return result;\n };\n\n /**\n * register a new preview.\n */\n registerPreview(preview: PreviewType) {\n this.previewSlot.register(preview);\n return this;\n }\n\n /**\n * get the preview rendering context.\n */\n getRenderingContext(aspectsFilter?: string[]) {\n return new RenderingContext(this.renderingContextSlot, { aspectsFilter });\n }\n\n /**\n * allows aspects to add rendering contexts.\n * render context is available through all preview definitions.\n */\n registerRenderContext(renderContext: RenderingContextProvider) {\n this.renderingContextSlot.register(renderContext);\n return this;\n }\n\n getDefault() {\n const previews = this.previewSlot.values();\n const defaultOne = previews.find((previewCandidate) => previewCandidate.default);\n\n return defaultOne?.name || previews[0].name;\n }\n\n private getPreview(previewName: string): undefined | PreviewType {\n const previews = this.previewSlot.values();\n const preview = previews.find((previewCandidate) => previewCandidate.name === previewName);\n\n return preview;\n }\n\n getParam(query: string, param: string) {\n const params = new URLSearchParams(query);\n return params.get(param);\n }\n\n getQuery() {\n const withoutHash = window.location.hash.substring(1);\n const [, after] = withoutHash.split('?');\n return after;\n }\n\n private getLocation() {\n const withoutHash = window.location.hash.substring(1);\n const [before, after] = withoutHash.split('?');\n\n return {\n previewName: this.getParam(after, 'preview'),\n envId: this.getParam(after, 'env'),\n componentId: ComponentID.tryFromString(before),\n };\n }\n\n static runtime = PreviewRuntime;\n\n static dependencies = [PubsubAspect];\n\n static slots = [Slot.withType<PreviewType>(), Slot.withType<RenderingContextProvider>()];\n\n static async provider(\n [pubsub]: [PubsubPreview],\n config,\n [previewSlot, renderingContextSlot]: [PreviewSlot, RenderingContextSlot]\n ) {\n const preview = new PreviewPreview(pubsub, previewSlot, renderingContextSlot);\n\n window.addEventListener('bit-preview-modules-updated', () => {\n preview.rerenderOnPreviewModulesUpdated();\n });\n\n window.addEventListener('hashchange', () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n preview.render();\n });\n\n return preview;\n }\n}\n\nPreviewAspect.addRuntime(PreviewPreview);\n"],"mappings":";;;;;;;;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MAAAT,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1
|
+
{"version":3,"names":["_pubsub","data","require","_harmony","_componentId","_crossFetch","_interopRequireDefault","_lodash","_exceptions","_preview","_renderingContext","_fetchComponentAspects","_lruCache","_previewModules","_htmlUtils","_sizeEvent","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PreviewPreview","constructor","pubsub","previewSlot","renderingContextSlot","debounce","isReady","render","catch","err","console","error","Promise","resolve","_setupPromise","PREVIEW_MODULES","onSet","add","rootExt","window","document","body","style","width","previewName","componentId","envId","getLocation","name","getDefault","isDev","preview","getPreview","PreviewNotFound","includesAll","all","include","map","inclPreviewName","includedPreview","undefined","inclPreviewModule","getPreviewModule","selectPreviewModel","fullName","query","getQuery","onlyOverview","getParam","includes","filter","module","isObject","keysWithoutDefault","keys","key","defaultKeys","intersection","length","componentAspects","getComponentAspects","toString","previewModule","getRenderingContext","reportSize","setViewport","setFullScreen","LRUCache","max","ttl","cached","componentAspectsCache","get","result","fetchComponentAspects","set","registerClickPubSub","addEventListener","timestamp","Date","now","clickEvent","assign","pub","PreviewAspect","id","ClickInsideAnIframeEvent","has","includedReady","every","included","fullScreen","root","getElementById","height","viewPort","maxWidth","parent","measure","documentElement","prevHeight","scrollHeight","scrollWidth","publish","SizeEvent","debounced","resizedObserver","ResizeObserver","observe","compShortId","relevantModel","Error","componentMap","componentPreviews","fetchComponentPreview","loadComponentPreviews","component","metadata","modulesMap","componentMapMetadata","previewFile","allFiles","fetchComponentPreviewFiles","file","endsWith","addComponentFileElement","loadPreviewScript","previewBundleFileName","addComponentFileScriptElement","addComponentFileLinkElement","previewAssetsRoute","stringId","url","res","crossFetch","status","parsed","json","isBundledWithEnv","files","previewRoute","src","loadScript","href","loadLink","globalId","toStringWithoutVersion","componentPreview","registerPreview","register","aspectsFilter","RenderingContext","registerRenderContext","renderContext","previews","values","defaultOne","find","previewCandidate","param","params","URLSearchParams","withoutHash","location","hash","substring","after","split","before","ComponentID","tryFromString","provider","config","rerenderOnPreviewModulesUpdated","exports","PreviewRuntime","PubsubAspect","Slot","withType","addRuntime"],"sources":["preview.preview.runtime.tsx"],"sourcesContent":["import type { PubsubPreview } from '@teambit/pubsub';\nimport { PubsubAspect, ClickInsideAnIframeEvent } from '@teambit/pubsub';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport { ComponentID } from '@teambit/component-id';\n// Using cross-fetch here instead of @pnpm/node-fetch\n// which is crucial in this context as preview operates from the frontend where proxy and CA cert handling are not required\n// Reverting to cross-fetch restores correct handling of relative URLs, ensuring that previews render correctly\nimport crossFetch from 'cross-fetch';\nimport { debounce, intersection, isObject } from 'lodash';\n\nimport { PreviewNotFound } from './exceptions';\nimport type { PreviewType } from './preview-type';\nimport { PreviewAspect, PreviewRuntime } from './preview.aspect';\nimport type { ModuleFile, PreviewModule } from './types/preview-module';\nimport { RenderingContext } from './rendering-context';\nimport { fetchComponentAspects } from './gql/fetch-component-aspects';\nimport { LRUCache } from 'lru-cache';\nimport { PREVIEW_MODULES } from './preview-modules';\nimport { loadScript, loadLink } from './html-utils';\nimport { SizeEvent } from './size-event';\n\n// forward linkModules() for generate-link.ts\nexport { linkModules } from './preview-modules';\n\nexport type PreviewSlot = SlotRegistry<PreviewType>;\n\nexport type RenderingContextOptions = { aspectsFilter?: string[] };\nexport type RenderingContextProvider = (options: RenderingContextOptions) => { [key: string]: any };\nexport type RenderingContextSlot = SlotRegistry<RenderingContextProvider>;\n\nexport class PreviewPreview {\n constructor(\n /**\n * register to pubsub\n */\n private pubsub: PubsubPreview,\n\n /**\n * preview slot.\n */\n private previewSlot: PreviewSlot,\n\n private renderingContextSlot: RenderingContextSlot\n ) {\n this.registerClickPubSub();\n }\n\n private rerenderOnPreviewModulesUpdated = debounce(() => {\n if (!this.isReady()) return;\n void this.render().catch((err) => {\n // eslint-disable-next-line no-console\n console.error('[preview.preview] failed re-rendering after preview module update', err);\n });\n }, 30);\n\n private registerClickPubSub() {\n window.addEventListener('click', (e) => {\n const timestamp = Date.now();\n const clickEvent = Object.assign({}, e);\n this.pubsub.pub(PreviewAspect.id, new ClickInsideAnIframeEvent(timestamp, clickEvent));\n });\n }\n\n private isDev = false;\n\n private isReady() {\n const { previewName } = this.getLocation();\n const name = previewName || this.getDefault();\n\n if (!PREVIEW_MODULES.has(name)) return false;\n const preview = this.getPreview(name);\n if (!preview) return false;\n const includedReady = preview.include?.every((included) => PREVIEW_MODULES.has(included)) ?? true;\n if (!includedReady) return false;\n\n return true;\n }\n\n private _setupPromise?: Promise<void>;\n setup = () => {\n if (this.isReady()) return Promise.resolve();\n\n this._setupPromise ??= new Promise((resolve) => {\n PREVIEW_MODULES.onSet.add(() => {\n if (this.isReady()) resolve();\n });\n });\n\n return this._setupPromise;\n };\n\n /**\n * render the preview.\n */\n render = async (rootExt?: string) => {\n // fit content always.\n window.document.body.style.width = 'fit-content';\n\n const { previewName, componentId, envId } = this.getLocation();\n const name = previewName || this.getDefault();\n if (rootExt) this.isDev = rootExt === 'teambit.workspace/workspace';\n\n const preview = this.getPreview(name);\n if (!preview || !componentId) {\n throw new PreviewNotFound(previewName);\n }\n\n const includesAll = await Promise.all(\n (preview.include || []).map(async (inclPreviewName) => {\n const includedPreview = this.getPreview(inclPreviewName);\n if (!includedPreview) return undefined;\n\n const inclPreviewModule = await this.getPreviewModule(inclPreviewName, componentId);\n return includedPreview.selectPreviewModel?.(componentId.fullName, inclPreviewModule);\n })\n );\n\n const query = this.getQuery();\n const onlyOverview = this.getParam(query, 'onlyOverview');\n\n const includes =\n onlyOverview === 'true'\n ? []\n : includesAll\n .filter((module) => !!module)\n .map((module) => {\n if (!module.default || !isObject(module.default)) return module;\n // This aims to handle use cases where we have package.json with type:\"module\" in the root\n // in that case sometime we might get the props both under default and in the object root\n const keysWithoutDefault = Object.keys(module).filter((key) => key !== 'default');\n const defaultKeys = Object.keys(module.default);\n if (intersection(keysWithoutDefault, defaultKeys).length === defaultKeys.length) return module.default;\n return module;\n });\n\n // during build / tag, the component is isolated, so all aspects are relevant, and do not require filtering\n const componentAspects = this.isDev ? await this.getComponentAspects(componentId.toString()) : undefined;\n const previewModule = await this.getPreviewModule(name, componentId);\n const render = preview.render(\n componentId,\n envId || '',\n previewModule,\n includes,\n this.getRenderingContext(componentAspects)\n );\n\n this.reportSize();\n this.setViewport();\n this.setFullScreen();\n return render;\n };\n\n setFullScreen() {\n const query = this.getQuery();\n const fullScreen = this.getParam(query, 'fullscreen');\n\n if (!fullScreen) return;\n\n const root = window.document.getElementById('root');\n\n if (root) {\n root.style.height = '100vh';\n }\n }\n\n setViewport() {\n const query = this.getQuery();\n const viewPort = this.getParam(query, 'viewport');\n if (!viewPort) {\n window.document.body.style.width = '100%';\n return;\n }\n\n window.document.body.style.maxWidth = `${viewPort}px`;\n }\n\n reportSize() {\n if (!window?.parent || !window?.document) return;\n // In Preview, the <body> is always exactly as tall as the iframe viewport, not as tall as the content.\n // by measuring the scrollHeight of the root element, we can get the height of the content.\n const measure = () => {\n const root = window.document.getElementById('root') ?? window.document.documentElement;\n const prevHeight = root.style.height;\n // set height auto to make the browser calculate the natural block formatting height\n // scrollHeight of an element that has height: 100% reports the viewport height, not the content height\n root.style.height = 'auto';\n const height = root.scrollHeight;\n const width = root.scrollWidth;\n // restore the previous height so nothing visually changes within the same tick\n root.style.height = prevHeight;\n return { width, height };\n };\n const publish = () => {\n const { width, height } = measure();\n this.pubsub.pub(PreviewAspect.id, new SizeEvent({ width, height }));\n };\n // publish right away so the parent gets the first real size as soon as possible\n publish();\n // publish dimension changes when the content size actually changes\n const debounced = debounce(publish, 100);\n const resizedObserver = new ResizeObserver(debounced);\n resizedObserver.observe(window.document.documentElement);\n const root = window.document.getElementById('root');\n if (root) resizedObserver.observe(root);\n }\n\n async getPreviewModule(previewName: string, id: ComponentID): Promise<PreviewModule> {\n const compShortId = id.fullName;\n\n const relevantModel = PREVIEW_MODULES.get(previewName);\n if (!relevantModel) throw new Error(`[preview.preview] missing preview \"${previewName}\"`);\n if (relevantModel.componentMap[compShortId]) return relevantModel;\n\n const componentPreviews = await this.fetchComponentPreview(id, previewName);\n PREVIEW_MODULES.loadComponentPreviews(compShortId, componentPreviews);\n\n const component = componentPreviews[previewName];\n const metadata = componentPreviews[`${previewName}_metadata`];\n\n return {\n modulesMap: relevantModel.modulesMap,\n componentMap: {\n [id.fullName]: component,\n },\n componentMapMetadata: {\n [id.fullName]: metadata,\n },\n };\n }\n\n async fetchComponentPreview(id: ComponentID, name: string): Promise<Record<string, ModuleFile[]>> {\n let previewFile: string | undefined;\n const allFiles = await this.fetchComponentPreviewFiles(id, name);\n // It's a component bundled with the env\n if (allFiles === null) return {};\n\n await Promise.all(\n allFiles.map((file) => {\n // We want to run the preview file always last\n if (file.endsWith('-preview.js')) {\n previewFile = file;\n return undefined;\n }\n\n return this.addComponentFileElement(id, file);\n })\n );\n\n if (!previewFile) return {};\n return this.loadPreviewScript(id, name, previewFile);\n }\n\n private addComponentFileElement(id: ComponentID, previewBundleFileName: string) {\n if (previewBundleFileName.endsWith('.js')) {\n return this.addComponentFileScriptElement(id, previewBundleFileName);\n }\n\n // TODO - should we load assets other than .css / .js?\n // if (previewBundleFileName.endsWith('.css')) {\n this.addComponentFileLinkElement(id, previewBundleFileName).catch((err) => {\n throw new Error(\n `[preview.preview] failed loading asset \"${previewBundleFileName}\". Error - \"${err?.toString()}\"`\n );\n });\n\n // do NOT await non js assets, as they might never load (like images), and not critical for rendering.\n return undefined;\n }\n\n private async fetchComponentPreviewFiles(id: ComponentID, previewName: string): Promise<string[] | null> {\n const previewAssetsRoute = `~aspect/preview-assets`;\n const stringId = id.toString();\n const url = `/api/${stringId}/${previewAssetsRoute}`;\n\n const res = await crossFetch(url);\n if (res.status >= 400) {\n throw new PreviewNotFound(previewName);\n }\n const parsed = await res.json();\n // This is component bundled with the env, no reason to bring the files, as they will be the files of the env\n if (parsed.isBundledWithEnv) {\n return null;\n }\n if (!parsed.files || !parsed.files.length) {\n throw new PreviewNotFound(previewName);\n }\n return parsed.files;\n }\n\n private addComponentFileScriptElement(id: ComponentID, previewBundleFileName: string) {\n const previewRoute = `~aspect/component-preview`;\n const stringId = id.toString();\n const src = `/api/${stringId}/${previewRoute}/${previewBundleFileName}`;\n return loadScript({ src });\n }\n\n private addComponentFileLinkElement(id: ComponentID, previewBundleFileName: string) {\n const stringId = id.toString();\n const previewRoute = `~aspect/component-preview`;\n const href = `/api/${stringId}/${previewRoute}/${previewBundleFileName}`;\n return loadLink({ href });\n }\n\n private async loadPreviewScript(id: ComponentID, previewName: string, previewBundleFileName: string) {\n const previewRoute = `~aspect/component-preview`;\n const src = `/api/${id.toString()}/${previewRoute}/${previewBundleFileName}`;\n await loadScript({ src });\n\n // TODO - replace with jsonp\n const globalId = `${id.toStringWithoutVersion()}-preview`;\n const componentPreview = window[globalId];\n if (!componentPreview) throw new PreviewNotFound(previewName);\n\n return componentPreview as Record<string, ModuleFile[]>;\n }\n\n // Use LRU cache directly with TTL for component aspects\n private componentAspectsCache = new LRUCache<string, any>({\n max: 100,\n ttl: 12 * 60 * 60 * 1000, // 12 hours\n });\n\n private getComponentAspects = async (componentId: string) => {\n const cached = this.componentAspectsCache.get(componentId);\n if (cached) {\n return cached;\n }\n\n const result = await fetchComponentAspects(componentId);\n this.componentAspectsCache.set(componentId, result);\n return result;\n };\n\n /**\n * register a new preview.\n */\n registerPreview(preview: PreviewType) {\n this.previewSlot.register(preview);\n return this;\n }\n\n /**\n * get the preview rendering context.\n */\n getRenderingContext(aspectsFilter?: string[]) {\n return new RenderingContext(this.renderingContextSlot, { aspectsFilter });\n }\n\n /**\n * allows aspects to add rendering contexts.\n * render context is available through all preview definitions.\n */\n registerRenderContext(renderContext: RenderingContextProvider) {\n this.renderingContextSlot.register(renderContext);\n return this;\n }\n\n getDefault() {\n const previews = this.previewSlot.values();\n const defaultOne = previews.find((previewCandidate) => previewCandidate.default);\n\n return defaultOne?.name || previews[0].name;\n }\n\n private getPreview(previewName: string): undefined | PreviewType {\n const previews = this.previewSlot.values();\n const preview = previews.find((previewCandidate) => previewCandidate.name === previewName);\n\n return preview;\n }\n\n getParam(query: string, param: string) {\n const params = new URLSearchParams(query);\n return params.get(param);\n }\n\n getQuery() {\n const withoutHash = window.location.hash.substring(1);\n const [, after] = withoutHash.split('?');\n return after;\n }\n\n private getLocation() {\n const withoutHash = window.location.hash.substring(1);\n const [before, after] = withoutHash.split('?');\n\n return {\n previewName: this.getParam(after, 'preview'),\n envId: this.getParam(after, 'env'),\n componentId: ComponentID.tryFromString(before),\n };\n }\n\n static runtime = PreviewRuntime;\n\n static dependencies = [PubsubAspect];\n\n static slots = [Slot.withType<PreviewType>(), Slot.withType<RenderingContextProvider>()];\n\n static async provider(\n [pubsub]: [PubsubPreview],\n config,\n [previewSlot, renderingContextSlot]: [PreviewSlot, RenderingContextSlot]\n ) {\n const preview = new PreviewPreview(pubsub, previewSlot, renderingContextSlot);\n\n window.addEventListener('bit-preview-modules-updated', () => {\n preview.rerenderOnPreviewModulesUpdated();\n });\n\n window.addEventListener('hashchange', () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n preview.render();\n });\n\n return preview;\n }\n}\n\nPreviewAspect.addRuntime(PreviewPreview);\n"],"mappings":";;;;;;;;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAA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CAAC,CAAC;IAEF,OAAOwB,OAAO;EAChB;AACF;AAAC+I,OAAA,CAAA9K,cAAA,GAAAA,cAAA;AAAAlB,eAAA,CAnYYkB,cAAc,aA2WR+K,yBAAc;AAAAjM,eAAA,CA3WpBkB,cAAc,kBA6WH,CAACgL,sBAAY,CAAC;AAAAlM,eAAA,CA7WzBkB,cAAc,WA+WV,CAACiL,eAAI,CAACC,QAAQ,CAAc,CAAC,EAAED,eAAI,CAACC,QAAQ,CAA2B,CAAC,CAAC;AAsB1F9F,wBAAa,CAAC+F,UAAU,CAACnL,cAAc,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/preview",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1214",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/preview/preview",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.preview",
|
|
8
8
|
"name": "preview",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1214"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"mime": "2.5.2",
|
|
@@ -35,11 +35,14 @@
|
|
|
35
35
|
"@teambit/preview.ui.component-preview": "1.0.43",
|
|
36
36
|
"@teambit/harmony.modules.runtimes": "0.0.4",
|
|
37
37
|
"@teambit/toolbox.path.to-windows-compatible-path": "0.0.518",
|
|
38
|
+
"@teambit/cli": "0.0.1412",
|
|
38
39
|
"@teambit/legacy.constants": "0.0.49",
|
|
40
|
+
"@teambit/pubsub": "1.0.1213",
|
|
39
41
|
"@teambit/harmony": "0.4.12",
|
|
40
42
|
"@teambit/toolbox.crypto.sha1": "0.0.24",
|
|
41
43
|
"@teambit/harmony.modules.harmony-root-generator": "0.0.49",
|
|
42
44
|
"@teambit/legacy.logger": "0.0.67",
|
|
45
|
+
"@teambit/component.sources": "0.0.233",
|
|
43
46
|
"@teambit/toolbox.path.path": "0.0.26",
|
|
44
47
|
"@teambit/preview.modules.preview-modules": "1.0.3",
|
|
45
48
|
"@teambit/component-id": "1.2.5",
|
|
@@ -53,23 +56,20 @@
|
|
|
53
56
|
"@teambit/mdx.modules.mdx-v3-options": "0.0.3",
|
|
54
57
|
"@teambit/rspack.modules.generate-asset-manifest": "0.0.21",
|
|
55
58
|
"@teambit/webpack.modules.exclude-node-modules-js": "0.0.1",
|
|
56
|
-
"@teambit/builder": "1.0.
|
|
57
|
-
"@teambit/bundler": "1.0.
|
|
58
|
-
"@teambit/component": "1.0.
|
|
59
|
-
"@teambit/aspect-loader": "1.0.
|
|
60
|
-
"@teambit/dependency-resolver": "1.0.
|
|
61
|
-
"@teambit/envs": "1.0.
|
|
62
|
-
"@teambit/
|
|
63
|
-
"@teambit/
|
|
64
|
-
"@teambit/
|
|
65
|
-
"@teambit/
|
|
66
|
-
"@teambit/
|
|
67
|
-
"@teambit/
|
|
68
|
-
"@teambit/
|
|
69
|
-
"@teambit/
|
|
70
|
-
"@teambit/workspace": "1.0.1212",
|
|
71
|
-
"@teambit/compiler": "1.0.1212",
|
|
72
|
-
"@teambit/webpack": "1.0.1212"
|
|
59
|
+
"@teambit/builder": "1.0.1214",
|
|
60
|
+
"@teambit/bundler": "1.0.1214",
|
|
61
|
+
"@teambit/component": "1.0.1214",
|
|
62
|
+
"@teambit/aspect-loader": "1.0.1214",
|
|
63
|
+
"@teambit/dependency-resolver": "1.0.1214",
|
|
64
|
+
"@teambit/envs": "1.0.1214",
|
|
65
|
+
"@teambit/ui": "1.0.1214",
|
|
66
|
+
"@teambit/isolator": "1.0.1214",
|
|
67
|
+
"@teambit/pkg": "1.0.1214",
|
|
68
|
+
"@teambit/scope": "1.0.1214",
|
|
69
|
+
"@teambit/watcher": "1.0.1214",
|
|
70
|
+
"@teambit/workspace": "1.0.1214",
|
|
71
|
+
"@teambit/compiler": "1.0.1214",
|
|
72
|
+
"@teambit/webpack": "1.0.1214"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/mime": "2.0.3",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PubsubPreview } from '@teambit/pubsub';
|
|
2
|
-
import { PubsubAspect } from '@teambit/pubsub';
|
|
2
|
+
import { PubsubAspect, ClickInsideAnIframeEvent } from '@teambit/pubsub';
|
|
3
3
|
import type { SlotRegistry } from '@teambit/harmony';
|
|
4
4
|
import { Slot } from '@teambit/harmony';
|
|
5
5
|
import { ComponentID } from '@teambit/component-id';
|
|
@@ -12,7 +12,6 @@ import { debounce, intersection, isObject } from 'lodash';
|
|
|
12
12
|
import { PreviewNotFound } from './exceptions';
|
|
13
13
|
import type { PreviewType } from './preview-type';
|
|
14
14
|
import { PreviewAspect, PreviewRuntime } from './preview.aspect';
|
|
15
|
-
import { ClickInsideAnIframeEvent } from './events';
|
|
16
15
|
import type { ModuleFile, PreviewModule } from './types/preview-module';
|
|
17
16
|
import { RenderingContext } from './rendering-context';
|
|
18
17
|
import { fetchComponentAspects } from './gql/fetch-component-aspects';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BitBaseEvent } from '@teambit/pubsub';
|
|
2
|
-
declare class ClickInsideAnIframeEventData {
|
|
3
|
-
private clickEvent;
|
|
4
|
-
constructor(clickEvent: any);
|
|
5
|
-
}
|
|
6
|
-
export declare class ClickInsideAnIframeEvent extends BitBaseEvent<ClickInsideAnIframeEventData> {
|
|
7
|
-
readonly timestamp: number;
|
|
8
|
-
readonly clickEvent: any;
|
|
9
|
-
static readonly TYPE = "click-inside-an-iframe";
|
|
10
|
-
constructor(timestamp: number | undefined, clickEvent: any);
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ClickInsideAnIframeEvent = void 0;
|
|
7
|
-
function _pubsub() {
|
|
8
|
-
const data = require("@teambit/pubsub");
|
|
9
|
-
_pubsub = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable max-classes-per-file */
|
|
17
|
-
class ClickInsideAnIframeEventData {
|
|
18
|
-
constructor(clickEvent) {
|
|
19
|
-
this.clickEvent = clickEvent;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
class ClickInsideAnIframeEvent extends _pubsub().BitBaseEvent {
|
|
23
|
-
constructor(timestamp = Date.now(), clickEvent) {
|
|
24
|
-
super(ClickInsideAnIframeEvent.TYPE, '0.0.1', timestamp, new ClickInsideAnIframeEventData(clickEvent));
|
|
25
|
-
this.timestamp = timestamp;
|
|
26
|
-
this.clickEvent = clickEvent;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.ClickInsideAnIframeEvent = ClickInsideAnIframeEvent;
|
|
30
|
-
_defineProperty(ClickInsideAnIframeEvent, "TYPE", 'click-inside-an-iframe');
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=click-inside-an-iframe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_pubsub","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ClickInsideAnIframeEventData","constructor","clickEvent","ClickInsideAnIframeEvent","BitBaseEvent","timestamp","Date","now","TYPE","exports"],"sources":["click-inside-an-iframe.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { BitBaseEvent } from '@teambit/pubsub';\n\nclass ClickInsideAnIframeEventData {\n constructor(private clickEvent: any) {}\n}\n\nexport class ClickInsideAnIframeEvent extends BitBaseEvent<ClickInsideAnIframeEventData> {\n static readonly TYPE = 'click-inside-an-iframe';\n\n constructor(\n readonly timestamp = Date.now(),\n readonly clickEvent\n ) {\n super(ClickInsideAnIframeEvent.TYPE, '0.0.1', timestamp, new ClickInsideAnIframeEventData(clickEvent));\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA,KAD/C;AAGA,MAAMgB,4BAA4B,CAAC;EACjCC,WAAWA,CAASC,UAAe,EAAE;IAAA,KAAjBA,UAAe,GAAfA,UAAe;EAAG;AACxC;AAEO,MAAMC,wBAAwB,SAASC,sBAAY,CAA+B;EAGvFH,WAAWA,CACAI,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EACtBL,UAAU,EACnB;IACA,KAAK,CAACC,wBAAwB,CAACK,IAAI,EAAE,OAAO,EAAEH,SAAS,EAAE,IAAIL,4BAA4B,CAACE,UAAU,CAAC,CAAC;IAAC,KAH9FG,SAAS,GAATA,SAAS;IAAA,KACTH,UAAU,GAAVA,UAAU;EAGrB;AACF;AAACO,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAAAtB,eAAA,CATYsB,wBAAwB,UACZ,wBAAwB","ignoreList":[]}
|
package/dist/events/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './click-inside-an-iframe';
|
package/dist/events/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _clickInsideAnIframe = require("./click-inside-an-iframe");
|
|
7
|
-
Object.keys(_clickInsideAnIframe).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _clickInsideAnIframe[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _clickInsideAnIframe[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/events/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_clickInsideAnIframe","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export * from './click-inside-an-iframe';\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { BitBaseEvent } from '@teambit/pubsub';
|
|
3
|
-
|
|
4
|
-
class ClickInsideAnIframeEventData {
|
|
5
|
-
constructor(private clickEvent: any) {}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class ClickInsideAnIframeEvent extends BitBaseEvent<ClickInsideAnIframeEventData> {
|
|
9
|
-
static readonly TYPE = 'click-inside-an-iframe';
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
12
|
-
readonly timestamp = Date.now(),
|
|
13
|
-
readonly clickEvent
|
|
14
|
-
) {
|
|
15
|
-
super(ClickInsideAnIframeEvent.TYPE, '0.0.1', timestamp, new ClickInsideAnIframeEventData(clickEvent));
|
|
16
|
-
}
|
|
17
|
-
}
|
package/events/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './click-inside-an-iframe';
|