@dxos/plugin-script 0.6.8-staging.c55b37f → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ScriptPlugin.tsx", "../../../src/components/index.ts", "../../../src/translations.ts", "../../../src/compiler/compiler.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Code, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { parseIntentPlugin, type PluginDefinition, resolvePlugin, NavigationAction } from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { TextType } from '@dxos/plugin-markdown/types';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { loadObjectReferences } from '@dxos/react-client/echo';\n\nimport { ScriptEditor } from './components';\nimport meta, { SCRIPT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { FunctionType, ScriptType } from './types';\nimport { ScriptAction, type ScriptPluginProvides } from './types';\n\nexport type ScriptPluginProps = {\n containerUrl: string;\n};\n\nexport const ScriptPlugin = ({ containerUrl }: ScriptPluginProps): PluginDefinition<ScriptPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ScriptType.typename]: {\n placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),\n },\n },\n },\n translations,\n echo: {\n schema: [ScriptType, FunctionType],\n },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n if (!client || !dispatch) {\n return [];\n }\n\n return createExtension({\n id: ScriptAction.CREATE,\n filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${SCRIPT_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create object label', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n testId: 'scriptPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n stack: {\n creators: [\n {\n id: 'create-stack-section-script',\n testId: 'scriptPlugin.createSectionSpaceScript',\n type: ['plugin name', { ns: SCRIPT_PLUGIN }],\n label: ['create stack section label', { ns: SCRIPT_PLUGIN }],\n icon: (props: any) => <Code {...props} />,\n intent: {\n plugin: SCRIPT_PLUGIN,\n action: ScriptAction.CREATE,\n },\n },\n ],\n },\n surface: {\n component: ({ data, role }) => {\n if (role && !['article', 'section'].includes(role)) {\n return null;\n }\n\n if (data.object instanceof ScriptType) {\n return <ScriptEditor script={data.object} role={role} />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case ScriptAction.CREATE: {\n return { data: create(ScriptType, { source: create(TextType, { content: example }) }) };\n }\n }\n },\n },\n },\n };\n};\n\n// TODO(burdon): Import.\nconst example = [\n 'export default {',\n ' async fetch(request, env, ctx) {',\n \" return new Response('Hello World, from ScriptPlugin!');\",\n ' }',\n '}',\n '',\n].join('\\n');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport const ScriptEditor = React.lazy(() => import('./ScriptEditor'));\nexport const TypescriptEditor = React.lazy(() => import('./TypescriptEditor'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SCRIPT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SCRIPT_PLUGIN]: {\n 'plugin name': 'Scripts',\n 'object title placeholder': 'New script',\n 'create object label': 'Create script',\n 'create stack section label': 'Create script',\n 'binding label': 'Binding',\n 'binding placeholder': 'Enter binding',\n 'edit binding label': 'Edit binding',\n 'deploy label': 'Deploy',\n 'deployed label': 'Current version of the script is deployed',\n 'upload failed label': 'Upload failed',\n 'copy link label': 'Copy function link',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type BuildOptions } from 'esbuild';\nimport { build, initialize, type BuildResult } from 'esbuild-wasm';\n\nimport { subtleCrypto } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\n\nexport type Import = {\n moduleUrl: string;\n defaultImport: boolean;\n namedImports: string[];\n};\n\nexport type CompilerResult = {\n timestamp: number;\n sourceHash: Buffer;\n imports?: Import[];\n bundle?: string;\n error?: any;\n};\n\nexport type CompilerOptions = {\n platform: BuildOptions['platform'];\n providedModules: string[];\n};\n\nlet initialized: Promise<void>;\nexport const initializeCompiler = async (options: { wasmURL: string }) => {\n await (initialized ??= initialize({\n wasmURL: options.wasmURL,\n }));\n};\n\n/**\n * ESBuild compiler.\n */\nexport class Compiler {\n constructor(private readonly _options: CompilerOptions) {}\n\n async compile(source: string): Promise<CompilerResult> {\n const { providedModules, ...options } = this._options;\n\n const createResult = async (result?: Partial<CompilerResult>) => {\n return {\n timestamp: Date.now(),\n sourceHash: Buffer.from(await subtleCrypto.digest('SHA-256', Buffer.from(source))),\n ...result,\n };\n };\n\n if (this._options.platform === 'browser') {\n invariant(initialized, 'Compiler not initialized.');\n await initialized;\n }\n\n const imports = analyzeSourceFileImports(source);\n\n // https://esbuild.github.io/api/#build\n try {\n const result = await build({\n ...options,\n metafile: true,\n write: false,\n entryPoints: ['memory:main.tsx'],\n bundle: true,\n format: 'esm',\n plugins: [\n {\n name: 'memory',\n setup: (build) => {\n build.onResolve({ filter: /^memory:/ }, ({ path }) => {\n return { path: path.split(':')[1], namespace: 'memory' };\n });\n\n build.onLoad({ filter: /.*/, namespace: 'memory' }, ({ path }) => {\n const imports = [\"import React from 'react';\"];\n if (path === 'main.tsx') {\n return {\n contents: [...imports, source].join('\\n'),\n loader: 'tsx',\n };\n }\n });\n\n for (const module of providedModules) {\n build.onResolve({ filter: new RegExp(`^${module}$`) }, ({ path }) => {\n return { path, namespace: 'injected-module' };\n });\n }\n\n build.onLoad({ filter: /.*/, namespace: 'injected-module' }, ({ path }) => {\n const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];\n return {\n contents: `\n const { ${namedImports.join(',')} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];\n export { ${namedImports.join(',')} };\n export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;\n `,\n loader: 'tsx',\n };\n });\n },\n },\n ],\n });\n\n return await createResult({\n imports: this.analyzeImports(result),\n bundle: result.outputFiles![0].text,\n });\n } catch (err) {\n return await createResult({ error: err });\n }\n }\n\n // TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.\n analyzeImports(result: BuildResult): Import[] {\n invariant(result.outputFiles);\n\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);\n return Object.values(result.metafile!.outputs)[0].imports.map((entry): Import => {\n const namedImports: string[] = [];\n\n const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);\n if (parsedImport?.[2]) {\n NAMED_IMPORTS_REGEX.lastIndex = 0;\n const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);\n if (namedImportsMatch) {\n namedImportsMatch[1].split(',').forEach((importName) => {\n namedImports.push(importName.trim());\n });\n }\n }\n\n return {\n moduleUrl: entry.path,\n defaultImport: !!parsedImport?.[1],\n namedImports,\n };\n });\n }\n\n analyzeSourceFileImports(code: string) {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]?.split(',').map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n }\n}\n\n// https://regex101.com/r/FEN5ks/1\n// https://stackoverflow.com/a/73265022\n// $1 = default import name (can be non-existent)\n// $2 = destructured exports (can be non-existent)\n// $3 = wildcard import name (can be non-existent)\n// $4 = module identifier\n// $5 = quotes used (either ' or \")\nconst IMPORT_REGEX =\n /import(?:(?:(?:[ \\n\\t]+([^ *\\n\\t{},]+)[ \\n\\t]*(?:,|[ \\n\\t]+))?([ \\n\\t]*{(?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+})?[ \\n\\t]*)|[ \\n\\t]*\\*[ \\n\\t]*as[ \\n\\t]+([^ \\n\\t{}]+)[ \\n\\t]+)from[ \\n\\t]*(?:['\"])([^'\"\\n]+)(['\"])/gm;\n\nconst NAMED_IMPORTS_REGEX = /[ \\n\\t]*{((?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+)}[ \\n\\t]*/gm;\n\nconst allMatches = (regex: RegExp, str: string) => {\n regex.lastIndex = 0;\n\n let match;\n const matches = [];\n while ((match = regex.exec(str))) {\n matches.push(match);\n }\n\n return matches;\n};\n\ntype ParsedImport = {\n defaultImportName?: string;\n namedImports: string[];\n wildcardImportName?: string;\n moduleIdentifier: string;\n quotes: string;\n};\n\nconst analyzeSourceFileImports = (code: string): ParsedImport[] => {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]\n ?.trim()\n .slice(1, -1)\n .split(',')\n .map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ScriptPlugin } from './ScriptPlugin';\n\nexport default ScriptPlugin;\n\nexport * from './compiler';\nexport * from './components';\nexport * from './types';\n\nexport * from './ScriptPlugin';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,SAASA,YAA4B;AACrC,OAAOC,YAAW;AAElB,SAASC,mBAA0CC,eAAeC,wBAAwB;AAC1F,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAA2BC,iBAAiBC,qBAAqB;AACjE,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,4BAA4B;;;ACTrC,OAAOC,WAAW;AAEX,IAAMC,eAAeC,MAAMC,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC7C,IAAMC,mBAAmBF,MAAMC,KAAK,MAAM,OAAO,iCAAA,CAAA;;;ACDxD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,aAAAA,GAAgB;QACf,eAAe;QACf,4BAA4B;QAC5B,uBAAuB;QACvB,8BAA8B;QAC9B,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,mBAAmB;MACrB;IACF;EACF;;;;AFEK,IAAMC,eAAe,CAAC,EAAEC,aAAY,MAAqB;AAC9D,SAAO;IACLC;IACAC,UAAU;MACRC,UAAU;QACRC,SAAS;UACP,CAACC,WAAWC,QAAQ,GAAG;YACrBC,aAAa;cAAC;cAA4B;gBAAEC,IAAIC;cAAc;;YAC9DC,MAAM,CAACC,UAAqB,gBAAAC,OAAA,cAACC,MAASF,KAAAA;YACtCG,YAAY;;YAEZC,gBAAgB,CAACC,WAAuBC,qBAAqBD,QAAQ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AM,CAACC,UAAqB,gBAAAC,OAAA,cAACC,MAASF,KAAAA;oBACtCG,YAAY;oBACZgD,QAAQ;kBACV;gBACF;;YAEJ;UACF,CAAA;QACF;MACF;MACAC,OAAO;QACLC,UAAU;UACR;YACE/B,IAAI;YACJ6B,QAAQ;YACRG,MAAM;cAAC;cAAe;gBAAEzD,IAAIC;cAAc;;YAC1CoD,OAAO;cAAC;cAA8B;gBAAErD,IAAIC;cAAc;;YAC1DC,MAAM,CAACC,UAAe,gBAAAC,OAAA,cAACC,MAASF,KAAAA;YAChCoB,QAAQ;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Code, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { parseIntentPlugin, type PluginDefinition, resolvePlugin, NavigationAction } from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { TextType } from '@dxos/plugin-markdown/types';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { loadObjectReferences } from '@dxos/react-client/echo';\n\nimport { ScriptEditor } from './components';\nimport meta, { SCRIPT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { FunctionType, ScriptType } from './types';\nimport { ScriptAction, type ScriptPluginProvides } from './types';\n\nexport type ScriptPluginProps = {\n containerUrl: string;\n};\n\nexport const ScriptPlugin = ({ containerUrl }: ScriptPluginProps): PluginDefinition<ScriptPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ScriptType.typename]: {\n placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),\n },\n },\n },\n translations,\n echo: {\n schema: [ScriptType, FunctionType],\n },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n if (!client || !dispatch) {\n return [];\n }\n\n return createExtension({\n id: ScriptAction.CREATE,\n filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${SCRIPT_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create object label', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n testId: 'scriptPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n stack: {\n creators: [\n {\n id: 'create-stack-section-script',\n testId: 'scriptPlugin.createSectionSpaceScript',\n type: ['plugin name', { ns: SCRIPT_PLUGIN }],\n label: ['create stack section label', { ns: SCRIPT_PLUGIN }],\n icon: (props: any) => <Code {...props} />,\n intent: { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n },\n ],\n },\n surface: {\n component: ({ data, role }) => {\n if (role && !['article', 'section'].includes(role)) {\n return null;\n }\n\n if (data.object instanceof ScriptType) {\n return <ScriptEditor script={data.object} role={role} />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case ScriptAction.CREATE: {\n return { data: create(ScriptType, { source: create(TextType, { content: example }) }) };\n }\n }\n },\n },\n },\n };\n};\n\n// TODO(burdon): Import.\nconst example = [\n 'export default {',\n ' async fetch(request, env, ctx) {',\n \" return new Response('Hello World, from ScriptPlugin!');\",\n ' }',\n '}',\n '',\n].join('\\n');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport const ScriptEditor = React.lazy(() => import('./ScriptEditor'));\nexport const TypescriptEditor = React.lazy(() => import('./TypescriptEditor'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SCRIPT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SCRIPT_PLUGIN]: {\n 'plugin name': 'Scripts',\n 'object title placeholder': 'New script',\n 'create object label': 'Create script',\n 'create stack section label': 'Create script',\n 'binding label': 'Binding',\n 'binding placeholder': 'Enter binding',\n 'edit binding label': 'Edit binding',\n 'deploy label': 'Deploy',\n 'deployed label': 'Current version of the script is deployed',\n 'upload failed label': 'Upload failed',\n 'copy link label': 'Copy function link',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type BuildOptions } from 'esbuild';\nimport { build, initialize, type BuildResult } from 'esbuild-wasm';\n\nimport { subtleCrypto } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\n\nexport type Import = {\n moduleUrl: string;\n defaultImport: boolean;\n namedImports: string[];\n};\n\nexport type CompilerResult = {\n timestamp: number;\n sourceHash: Buffer;\n imports?: Import[];\n bundle?: string;\n error?: any;\n};\n\nexport type CompilerOptions = {\n platform: BuildOptions['platform'];\n providedModules: string[];\n};\n\nlet initialized: Promise<void>;\nexport const initializeCompiler = async (options: { wasmURL: string }) => {\n await (initialized ??= initialize({\n wasmURL: options.wasmURL,\n }));\n};\n\n/**\n * ESBuild compiler.\n */\nexport class Compiler {\n constructor(private readonly _options: CompilerOptions) {}\n\n async compile(source: string): Promise<CompilerResult> {\n const { providedModules, ...options } = this._options;\n\n const createResult = async (result?: Partial<CompilerResult>) => {\n return {\n timestamp: Date.now(),\n sourceHash: Buffer.from(await subtleCrypto.digest('SHA-256', Buffer.from(source))),\n ...result,\n };\n };\n\n if (this._options.platform === 'browser') {\n invariant(initialized, 'Compiler not initialized.');\n await initialized;\n }\n\n const imports = analyzeSourceFileImports(source);\n\n // https://esbuild.github.io/api/#build\n try {\n const result = await build({\n ...options,\n metafile: true,\n write: false,\n entryPoints: ['memory:main.tsx'],\n bundle: true,\n format: 'esm',\n plugins: [\n {\n name: 'memory',\n setup: (build) => {\n build.onResolve({ filter: /^memory:/ }, ({ path }) => {\n return { path: path.split(':')[1], namespace: 'memory' };\n });\n\n build.onLoad({ filter: /.*/, namespace: 'memory' }, ({ path }) => {\n const imports = [\"import React from 'react';\"];\n if (path === 'main.tsx') {\n return {\n contents: [...imports, source].join('\\n'),\n loader: 'tsx',\n };\n }\n });\n\n for (const module of providedModules) {\n build.onResolve({ filter: new RegExp(`^${module}$`) }, ({ path }) => {\n return { path, namespace: 'injected-module' };\n });\n }\n\n build.onLoad({ filter: /.*/, namespace: 'injected-module' }, ({ path }) => {\n const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];\n return {\n contents: `\n const { ${namedImports.join(',')} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];\n export { ${namedImports.join(',')} };\n export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;\n `,\n loader: 'tsx',\n };\n });\n },\n },\n ],\n });\n\n return await createResult({\n imports: this.analyzeImports(result),\n bundle: result.outputFiles![0].text,\n });\n } catch (err) {\n return await createResult({ error: err });\n }\n }\n\n // TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.\n analyzeImports(result: BuildResult): Import[] {\n invariant(result.outputFiles);\n\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);\n return Object.values(result.metafile!.outputs)[0].imports.map((entry): Import => {\n const namedImports: string[] = [];\n\n const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);\n if (parsedImport?.[2]) {\n NAMED_IMPORTS_REGEX.lastIndex = 0;\n const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);\n if (namedImportsMatch) {\n namedImportsMatch[1].split(',').forEach((importName) => {\n namedImports.push(importName.trim());\n });\n }\n }\n\n return {\n moduleUrl: entry.path,\n defaultImport: !!parsedImport?.[1],\n namedImports,\n };\n });\n }\n\n analyzeSourceFileImports(code: string) {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]?.split(',').map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n }\n}\n\n// https://regex101.com/r/FEN5ks/1\n// https://stackoverflow.com/a/73265022\n// $1 = default import name (can be non-existent)\n// $2 = destructured exports (can be non-existent)\n// $3 = wildcard import name (can be non-existent)\n// $4 = module identifier\n// $5 = quotes used (either ' or \")\nconst IMPORT_REGEX =\n /import(?:(?:(?:[ \\n\\t]+([^ *\\n\\t{},]+)[ \\n\\t]*(?:,|[ \\n\\t]+))?([ \\n\\t]*{(?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+})?[ \\n\\t]*)|[ \\n\\t]*\\*[ \\n\\t]*as[ \\n\\t]+([^ \\n\\t{}]+)[ \\n\\t]+)from[ \\n\\t]*(?:['\"])([^'\"\\n]+)(['\"])/gm;\n\nconst NAMED_IMPORTS_REGEX = /[ \\n\\t]*{((?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+)}[ \\n\\t]*/gm;\n\nconst allMatches = (regex: RegExp, str: string) => {\n regex.lastIndex = 0;\n\n let match;\n const matches = [];\n while ((match = regex.exec(str))) {\n matches.push(match);\n }\n\n return matches;\n};\n\ntype ParsedImport = {\n defaultImportName?: string;\n namedImports: string[];\n wildcardImportName?: string;\n moduleIdentifier: string;\n quotes: string;\n};\n\nconst analyzeSourceFileImports = (code: string): ParsedImport[] => {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]\n ?.trim()\n .slice(1, -1)\n .split(',')\n .map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ScriptPlugin } from './ScriptPlugin';\n\nexport default ScriptPlugin;\n\nexport * from './compiler';\nexport * from './components';\nexport * from './types';\n\nexport * from './ScriptPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,SAASA,YAA4B;AACrC,OAAOC,YAAW;AAElB,SAASC,mBAA0CC,eAAeC,wBAAwB;AAC1F,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAA2BC,iBAAiBC,qBAAqB;AACjE,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,4BAA4B;;;ACTrC,OAAOC,WAAW;AAEX,IAAMC,eAAeC,MAAMC,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC7C,IAAMC,mBAAmBF,MAAMC,KAAK,MAAM,OAAO,iCAAA,CAAA;;;ACDxD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,aAAAA,GAAgB;QACf,eAAe;QACf,4BAA4B;QAC5B,uBAAuB;QACvB,8BAA8B;QAC9B,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,mBAAmB;MACrB;IACF;EACF;;;;AFEK,IAAMC,eAAe,CAAC,EAAEC,aAAY,MAAqB;AAC9D,SAAO;IACLC;IACAC,UAAU;MACRC,UAAU;QACRC,SAAS;UACP,CAACC,WAAWC,QAAQ,GAAG;YACrBC,aAAa;cAAC;cAA4B;gBAAEC,IAAIC;cAAc;;YAC9DC,MAAM,CAACC,UAAqB,gBAAAC,OAAA,cAACC,MAASF,KAAAA;Y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AAA;MAC1Bc,QAAQd,QAAQ,CAAA;IAClB;EACF,CAAA;AACF;;;AC3MA,IAAA,cAAeoB;",
|
|
6
6
|
"names": ["Code", "React", "parseIntentPlugin", "resolvePlugin", "NavigationAction", "create", "parseClientPlugin", "createExtension", "isActionGroup", "TextType", "SpaceAction", "loadObjectReferences", "React", "ScriptEditor", "React", "lazy", "TypescriptEditor", "SCRIPT_PLUGIN", "ScriptPlugin", "containerUrl", "meta", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "SCRIPT_PLUGIN", "icon", "props", "React", "Code", "iconSymbol", "loadReferences", "script", "loadObjectReferences", "source", "translations", "echo", "schema", "FunctionType", "graph", "builder", "plugins", "client", "resolvePlugin", "parseClientPlugin", "dispatch", "parseIntentPlugin", "intent", "createExtension", "id", "ScriptAction", "CREATE", "filter", "node", "isActionGroup", "startsWith", "SpaceAction", "ADD_OBJECT", "actions", "split", "at", "spaceId", "objectId", "space", "spaces", "get", "find", "object", "db", "getObjectById", "target", "data", "plugin", "action", "NavigationAction", "OPEN", "properties", "label", "testId", "stack", "creators", "type", "surface", "component", "role", "includes", "ScriptEditor", "resolver", "create", "TextType", "content", "example", "join", "build", "initialize", "subtleCrypto", "invariant", "initialized", "initializeCompiler", "options", "wasmURL", "Compiler", "constructor", "_options", "compile", "source", "providedModules", "createResult", "result", "timestamp", "Date", "now", "sourceHash", "Buffer", "from", "digest", "platform", "imports", "analyzeSourceFileImports", "metafile", "write", "entryPoints", "bundle", "format", "plugins", "name", "setup", "onResolve", "filter", "path", "split", "namespace", "onLoad", "contents", "join", "loader", "module", "RegExp", "namedImports", "find", "entry", "moduleIdentifier", "JSON", "stringify", "analyzeImports", "outputFiles", "text", "err", "error", "parsedImports", "allMatches", "IMPORT_REGEX", "Object", "values", "outputs", "map", "parsedImport", "capture", "NAMED_IMPORTS_REGEX", "lastIndex", "namedImportsMatch", "exec", "forEach", "importName", "push", "trim", "moduleUrl", "defaultImport", "code", "defaultImportName", "wildcardImportName", "quotes", "regex", "str", "match", "matches", "slice", "ScriptPlugin"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytes":10228,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytes":1702,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytes":2750,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytes":14123,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytes":907,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/functions.ts","kind":"import-statement","original":"./functions"},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytes":1964,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytes":18081,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytes":7342,"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytes":2909,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytes":1612,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytes":600,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/types/script.ts","kind":"import-statement","original":"./script"},{"path":"packages/plugins/experimental/plugin-script/src/types/types.tsx","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytes":15542,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx","kind":"import-statement","original":"./Toolbar"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"import-statement","original":"./TypescriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/edge/index.ts","kind":"import-statement","original":"../edge"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytes":1121,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","kind":"dynamic-import","original":"./ScriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"dynamic-import","original":"./TypescriptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytes":2462,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytes":19150,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-script/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytes":23524,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts","kind":"import-statement","original":"./compiler"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytes":1062,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"},{"path":"packages/plugins/experimental/plugin-script/src/compiler/index.ts","kind":"import-statement","original":"./compiler"},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-script/dist/lib/browser/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/edge/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs","kind":"import-statement"}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/plugins/experimental/plugin-script/src/edge/index.ts","inputs":{},"bytes":398},"packages/plugins/experimental/plugin-script/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21306},"packages/plugins/experimental/plugin-script/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-7XICKICQ.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-PIRIDDUS.mjs","kind":"dynamic-import"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Compiler","FunctionType","ScriptAction","ScriptEditor","ScriptPlugin","ScriptType","TypescriptEditor","default","initializeCompiler"],"entryPoint":"packages/plugins/experimental/plugin-script/src/index.ts","inputs":{"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytesInOutput":5058},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytesInOutput":187},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytesInOutput":612},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytesInOutput":5832},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytesInOutput":32}},"bytes":12494},"packages/plugins/experimental/plugin-script/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"}],"exports":["SCRIPT_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/meta.tsx","inputs":{},"bytes":161},"packages/plugins/experimental/plugin-script/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"}],"exports":["FunctionType","ScriptAction","ScriptType"],"entryPoint":"packages/plugins/experimental/plugin-script/src/types/index.ts","inputs":{},"bytes":210},"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-PIRIDDUS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-PIRIDDUS.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs","kind":"import-statement"}],"exports":["TypescriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","inputs":{},"bytes":212},"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-7XICKICQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17783},"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-7XICKICQ.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ScriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","inputs":{"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytesInOutput":3929},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytesInOutput":5100}},"bytes":9692},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14620},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs":{"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytesInOutput":221},"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytesInOutput":2132},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytesInOutput":3324},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytesInOutput":425}},"bytes":6731},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2276},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"exports":["FunctionType","ScriptAction","ScriptType"],"inputs":{"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytesInOutput":673},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytesInOutput":167}},"bytes":1134},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["SCRIPT_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytesInOutput":430}},"bytes":579},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3777},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs":{"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TypescriptEditor","TypescriptEditor_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytesInOutput":1776}},"bytes":1963}}}
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytes":10228,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytes":1702,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytes":2750,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytes":14123,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytes":907,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/functions.ts","kind":"import-statement","original":"./functions"},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytes":1964,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytes":18081,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytes":7342,"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytes":2909,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytes":1612,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytes":600,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/types/script.ts","kind":"import-statement","original":"./script"},{"path":"packages/plugins/experimental/plugin-script/src/types/types.tsx","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytes":15542,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx","kind":"import-statement","original":"./Toolbar"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"import-statement","original":"./TypescriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/edge/index.ts","kind":"import-statement","original":"../edge"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytes":1121,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","kind":"dynamic-import","original":"./ScriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"dynamic-import","original":"./TypescriptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytes":2462,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytes":19090,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-script/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytes":23524,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts","kind":"import-statement","original":"./compiler"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytes":1062,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"},{"path":"packages/plugins/experimental/plugin-script/src/compiler/index.ts","kind":"import-statement","original":"./compiler"},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-script/dist/lib/browser/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/edge/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs","kind":"import-statement"}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/plugins/experimental/plugin-script/src/edge/index.ts","inputs":{},"bytes":398},"packages/plugins/experimental/plugin-script/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21262},"packages/plugins/experimental/plugin-script/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-7XICKICQ.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-PIRIDDUS.mjs","kind":"dynamic-import"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Compiler","FunctionType","ScriptAction","ScriptEditor","ScriptPlugin","ScriptType","TypescriptEditor","default","initializeCompiler"],"entryPoint":"packages/plugins/experimental/plugin-script/src/index.ts","inputs":{"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytesInOutput":5058},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytesInOutput":187},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytesInOutput":612},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytesInOutput":5832},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytesInOutput":32}},"bytes":12494},"packages/plugins/experimental/plugin-script/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"}],"exports":["SCRIPT_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/meta.tsx","inputs":{},"bytes":161},"packages/plugins/experimental/plugin-script/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"}],"exports":["FunctionType","ScriptAction","ScriptType"],"entryPoint":"packages/plugins/experimental/plugin-script/src/types/index.ts","inputs":{},"bytes":210},"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-PIRIDDUS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-PIRIDDUS.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs","kind":"import-statement"}],"exports":["TypescriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","inputs":{},"bytes":212},"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-7XICKICQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17783},"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-7XICKICQ.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ScriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","inputs":{"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytesInOutput":3929},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytesInOutput":5100}},"bytes":9692},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14620},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-SK3L274X.mjs":{"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytesInOutput":221},"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytesInOutput":2132},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytesInOutput":3324},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytesInOutput":425}},"bytes":6731},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2276},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-ZGCETT2W.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"exports":["FunctionType","ScriptAction","ScriptType"],"inputs":{"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytesInOutput":673},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytesInOutput":167}},"bytes":1134},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["SCRIPT_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytesInOutput":430}},"bytes":579},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3777},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-D4O723CR.mjs":{"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TypescriptEditor","TypescriptEditor_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytesInOutput":1776}},"bytes":1963}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ScriptPlugin.tsx", "../../../src/components/index.ts", "../../../src/translations.ts", "../../../src/compiler/compiler.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Code, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { parseIntentPlugin, type PluginDefinition, resolvePlugin, NavigationAction } from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { TextType } from '@dxos/plugin-markdown/types';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { loadObjectReferences } from '@dxos/react-client/echo';\n\nimport { ScriptEditor } from './components';\nimport meta, { SCRIPT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { FunctionType, ScriptType } from './types';\nimport { ScriptAction, type ScriptPluginProvides } from './types';\n\nexport type ScriptPluginProps = {\n containerUrl: string;\n};\n\nexport const ScriptPlugin = ({ containerUrl }: ScriptPluginProps): PluginDefinition<ScriptPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ScriptType.typename]: {\n placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),\n },\n },\n },\n translations,\n echo: {\n schema: [ScriptType, FunctionType],\n },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n if (!client || !dispatch) {\n return [];\n }\n\n return createExtension({\n id: ScriptAction.CREATE,\n filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${SCRIPT_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create object label', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n testId: 'scriptPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n stack: {\n creators: [\n {\n id: 'create-stack-section-script',\n testId: 'scriptPlugin.createSectionSpaceScript',\n type: ['plugin name', { ns: SCRIPT_PLUGIN }],\n label: ['create stack section label', { ns: SCRIPT_PLUGIN }],\n icon: (props: any) => <Code {...props} />,\n intent: {\n plugin: SCRIPT_PLUGIN,\n action: ScriptAction.CREATE,\n },\n },\n ],\n },\n surface: {\n component: ({ data, role }) => {\n if (role && !['article', 'section'].includes(role)) {\n return null;\n }\n\n if (data.object instanceof ScriptType) {\n return <ScriptEditor script={data.object} role={role} />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case ScriptAction.CREATE: {\n return { data: create(ScriptType, { source: create(TextType, { content: example }) }) };\n }\n }\n },\n },\n },\n };\n};\n\n// TODO(burdon): Import.\nconst example = [\n 'export default {',\n ' async fetch(request, env, ctx) {',\n \" return new Response('Hello World, from ScriptPlugin!');\",\n ' }',\n '}',\n '',\n].join('\\n');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport const ScriptEditor = React.lazy(() => import('./ScriptEditor'));\nexport const TypescriptEditor = React.lazy(() => import('./TypescriptEditor'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SCRIPT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SCRIPT_PLUGIN]: {\n 'plugin name': 'Scripts',\n 'object title placeholder': 'New script',\n 'create object label': 'Create script',\n 'create stack section label': 'Create script',\n 'binding label': 'Binding',\n 'binding placeholder': 'Enter binding',\n 'edit binding label': 'Edit binding',\n 'deploy label': 'Deploy',\n 'deployed label': 'Current version of the script is deployed',\n 'upload failed label': 'Upload failed',\n 'copy link label': 'Copy function link',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type BuildOptions } from 'esbuild';\nimport { build, initialize, type BuildResult } from 'esbuild-wasm';\n\nimport { subtleCrypto } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\n\nexport type Import = {\n moduleUrl: string;\n defaultImport: boolean;\n namedImports: string[];\n};\n\nexport type CompilerResult = {\n timestamp: number;\n sourceHash: Buffer;\n imports?: Import[];\n bundle?: string;\n error?: any;\n};\n\nexport type CompilerOptions = {\n platform: BuildOptions['platform'];\n providedModules: string[];\n};\n\nlet initialized: Promise<void>;\nexport const initializeCompiler = async (options: { wasmURL: string }) => {\n await (initialized ??= initialize({\n wasmURL: options.wasmURL,\n }));\n};\n\n/**\n * ESBuild compiler.\n */\nexport class Compiler {\n constructor(private readonly _options: CompilerOptions) {}\n\n async compile(source: string): Promise<CompilerResult> {\n const { providedModules, ...options } = this._options;\n\n const createResult = async (result?: Partial<CompilerResult>) => {\n return {\n timestamp: Date.now(),\n sourceHash: Buffer.from(await subtleCrypto.digest('SHA-256', Buffer.from(source))),\n ...result,\n };\n };\n\n if (this._options.platform === 'browser') {\n invariant(initialized, 'Compiler not initialized.');\n await initialized;\n }\n\n const imports = analyzeSourceFileImports(source);\n\n // https://esbuild.github.io/api/#build\n try {\n const result = await build({\n ...options,\n metafile: true,\n write: false,\n entryPoints: ['memory:main.tsx'],\n bundle: true,\n format: 'esm',\n plugins: [\n {\n name: 'memory',\n setup: (build) => {\n build.onResolve({ filter: /^memory:/ }, ({ path }) => {\n return { path: path.split(':')[1], namespace: 'memory' };\n });\n\n build.onLoad({ filter: /.*/, namespace: 'memory' }, ({ path }) => {\n const imports = [\"import React from 'react';\"];\n if (path === 'main.tsx') {\n return {\n contents: [...imports, source].join('\\n'),\n loader: 'tsx',\n };\n }\n });\n\n for (const module of providedModules) {\n build.onResolve({ filter: new RegExp(`^${module}$`) }, ({ path }) => {\n return { path, namespace: 'injected-module' };\n });\n }\n\n build.onLoad({ filter: /.*/, namespace: 'injected-module' }, ({ path }) => {\n const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];\n return {\n contents: `\n const { ${namedImports.join(',')} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];\n export { ${namedImports.join(',')} };\n export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;\n `,\n loader: 'tsx',\n };\n });\n },\n },\n ],\n });\n\n return await createResult({\n imports: this.analyzeImports(result),\n bundle: result.outputFiles![0].text,\n });\n } catch (err) {\n return await createResult({ error: err });\n }\n }\n\n // TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.\n analyzeImports(result: BuildResult): Import[] {\n invariant(result.outputFiles);\n\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);\n return Object.values(result.metafile!.outputs)[0].imports.map((entry): Import => {\n const namedImports: string[] = [];\n\n const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);\n if (parsedImport?.[2]) {\n NAMED_IMPORTS_REGEX.lastIndex = 0;\n const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);\n if (namedImportsMatch) {\n namedImportsMatch[1].split(',').forEach((importName) => {\n namedImports.push(importName.trim());\n });\n }\n }\n\n return {\n moduleUrl: entry.path,\n defaultImport: !!parsedImport?.[1],\n namedImports,\n };\n });\n }\n\n analyzeSourceFileImports(code: string) {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]?.split(',').map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n }\n}\n\n// https://regex101.com/r/FEN5ks/1\n// https://stackoverflow.com/a/73265022\n// $1 = default import name (can be non-existent)\n// $2 = destructured exports (can be non-existent)\n// $3 = wildcard import name (can be non-existent)\n// $4 = module identifier\n// $5 = quotes used (either ' or \")\nconst IMPORT_REGEX =\n /import(?:(?:(?:[ \\n\\t]+([^ *\\n\\t{},]+)[ \\n\\t]*(?:,|[ \\n\\t]+))?([ \\n\\t]*{(?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+})?[ \\n\\t]*)|[ \\n\\t]*\\*[ \\n\\t]*as[ \\n\\t]+([^ \\n\\t{}]+)[ \\n\\t]+)from[ \\n\\t]*(?:['\"])([^'\"\\n]+)(['\"])/gm;\n\nconst NAMED_IMPORTS_REGEX = /[ \\n\\t]*{((?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+)}[ \\n\\t]*/gm;\n\nconst allMatches = (regex: RegExp, str: string) => {\n regex.lastIndex = 0;\n\n let match;\n const matches = [];\n while ((match = regex.exec(str))) {\n matches.push(match);\n }\n\n return matches;\n};\n\ntype ParsedImport = {\n defaultImportName?: string;\n namedImports: string[];\n wildcardImportName?: string;\n moduleIdentifier: string;\n quotes: string;\n};\n\nconst analyzeSourceFileImports = (code: string): ParsedImport[] => {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]\n ?.trim()\n .slice(1, -1)\n .split(',')\n .map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ScriptPlugin } from './ScriptPlugin';\n\nexport default ScriptPlugin;\n\nexport * from './compiler';\nexport * from './components';\nexport * from './types';\n\nexport * from './ScriptPlugin';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqC;AACrC,IAAAA,gBAAkB;AAElB,2BAA0F;AAC1F,yBAAuB;AACvB,2BAAkC;AAClC,0BAAiE;AACjE,mBAAyB;AACzB,0BAA4B;AAC5B,kBAAqC;ACTrC,IAAAA,gBAAkB;AEClB,0BAAoD;AAEpD,oBAA6B;AAC7B,uBAA0B;AFFnB,IAAMC,eAAeC,cAAAA,QAAMC,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC7C,IAAMC,mBAAmBF,cAAAA,QAAMC,KAAK,MAAM,OAAO,iCAAA,CAAA;ACDxD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,mCAAAA,GAAgB;QACf,eAAe;QACf,4BAA4B;QAC5B,uBAAuB;QACvB,8BAA8B;QAC9B,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,mBAAmB;MACrB;IACF;EACF;;AFEK,IAAMC,eAAe,CAAC,EAAEC,aAAY,MAAqB;AAC9D,SAAO;IACLC,MAAAA;IACAC,UAAU;MACRC,UAAU;QACRC,SAAS;UACP,CAACC,iCAAWC,QAAQ,GAAG;YACrBC,aAAa;cAAC;cAA4B;gBAAEC,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M;0BAAED;wBAAO;sBAAE;sBACnD;wBAAEG,QAAQC,sCAAiBC;sBAAK;qBACjC;kBACH;kBACAC,YAAY;oBACVC,OAAO;sBAAC;sBAAuB;wBAAEnD,IAAIV;sBAAc;;oBACnDW,MAAM,CAACC,UAAqBf,8BAAAA,QAAA,cAACgB,mBAASD,KAAAA;oBACtCE,YAAY;oBACZgD,QAAQ;kBACV;gBACF;;YAEJ;UACF,CAAA;QACF;MACF;MACAC,OAAO;QACLC,UAAU;UACR;YACE/B,IAAI;YACJ6B,QAAQ;YACRG,MAAM;cAAC;cAAe;gBAAEvD,IAAIV;cAAc;;YAC1C6D,OAAO;cAAC;cAA8B;gBAAEnD,IAAIV;cAAc;;YAC1DW,MAAM,CAACC,UAAef,8BAAAA,QAAA,cAACgB,mBAASD,KAAAA;YAChCmB,QAAQ;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Code, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { parseIntentPlugin, type PluginDefinition, resolvePlugin, NavigationAction } from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { TextType } from '@dxos/plugin-markdown/types';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { loadObjectReferences } from '@dxos/react-client/echo';\n\nimport { ScriptEditor } from './components';\nimport meta, { SCRIPT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { FunctionType, ScriptType } from './types';\nimport { ScriptAction, type ScriptPluginProvides } from './types';\n\nexport type ScriptPluginProps = {\n containerUrl: string;\n};\n\nexport const ScriptPlugin = ({ containerUrl }: ScriptPluginProps): PluginDefinition<ScriptPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ScriptType.typename]: {\n placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),\n },\n },\n },\n translations,\n echo: {\n schema: [ScriptType, FunctionType],\n },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n if (!client || !dispatch) {\n return [];\n }\n\n return createExtension({\n id: ScriptAction.CREATE,\n filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${SCRIPT_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create object label', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n testId: 'scriptPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n stack: {\n creators: [\n {\n id: 'create-stack-section-script',\n testId: 'scriptPlugin.createSectionSpaceScript',\n type: ['plugin name', { ns: SCRIPT_PLUGIN }],\n label: ['create stack section label', { ns: SCRIPT_PLUGIN }],\n icon: (props: any) => <Code {...props} />,\n intent: { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n },\n ],\n },\n surface: {\n component: ({ data, role }) => {\n if (role && !['article', 'section'].includes(role)) {\n return null;\n }\n\n if (data.object instanceof ScriptType) {\n return <ScriptEditor script={data.object} role={role} />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case ScriptAction.CREATE: {\n return { data: create(ScriptType, { source: create(TextType, { content: example }) }) };\n }\n }\n },\n },\n },\n };\n};\n\n// TODO(burdon): Import.\nconst example = [\n 'export default {',\n ' async fetch(request, env, ctx) {',\n \" return new Response('Hello World, from ScriptPlugin!');\",\n ' }',\n '}',\n '',\n].join('\\n');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport const ScriptEditor = React.lazy(() => import('./ScriptEditor'));\nexport const TypescriptEditor = React.lazy(() => import('./TypescriptEditor'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SCRIPT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SCRIPT_PLUGIN]: {\n 'plugin name': 'Scripts',\n 'object title placeholder': 'New script',\n 'create object label': 'Create script',\n 'create stack section label': 'Create script',\n 'binding label': 'Binding',\n 'binding placeholder': 'Enter binding',\n 'edit binding label': 'Edit binding',\n 'deploy label': 'Deploy',\n 'deployed label': 'Current version of the script is deployed',\n 'upload failed label': 'Upload failed',\n 'copy link label': 'Copy function link',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type BuildOptions } from 'esbuild';\nimport { build, initialize, type BuildResult } from 'esbuild-wasm';\n\nimport { subtleCrypto } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\n\nexport type Import = {\n moduleUrl: string;\n defaultImport: boolean;\n namedImports: string[];\n};\n\nexport type CompilerResult = {\n timestamp: number;\n sourceHash: Buffer;\n imports?: Import[];\n bundle?: string;\n error?: any;\n};\n\nexport type CompilerOptions = {\n platform: BuildOptions['platform'];\n providedModules: string[];\n};\n\nlet initialized: Promise<void>;\nexport const initializeCompiler = async (options: { wasmURL: string }) => {\n await (initialized ??= initialize({\n wasmURL: options.wasmURL,\n }));\n};\n\n/**\n * ESBuild compiler.\n */\nexport class Compiler {\n constructor(private readonly _options: CompilerOptions) {}\n\n async compile(source: string): Promise<CompilerResult> {\n const { providedModules, ...options } = this._options;\n\n const createResult = async (result?: Partial<CompilerResult>) => {\n return {\n timestamp: Date.now(),\n sourceHash: Buffer.from(await subtleCrypto.digest('SHA-256', Buffer.from(source))),\n ...result,\n };\n };\n\n if (this._options.platform === 'browser') {\n invariant(initialized, 'Compiler not initialized.');\n await initialized;\n }\n\n const imports = analyzeSourceFileImports(source);\n\n // https://esbuild.github.io/api/#build\n try {\n const result = await build({\n ...options,\n metafile: true,\n write: false,\n entryPoints: ['memory:main.tsx'],\n bundle: true,\n format: 'esm',\n plugins: [\n {\n name: 'memory',\n setup: (build) => {\n build.onResolve({ filter: /^memory:/ }, ({ path }) => {\n return { path: path.split(':')[1], namespace: 'memory' };\n });\n\n build.onLoad({ filter: /.*/, namespace: 'memory' }, ({ path }) => {\n const imports = [\"import React from 'react';\"];\n if (path === 'main.tsx') {\n return {\n contents: [...imports, source].join('\\n'),\n loader: 'tsx',\n };\n }\n });\n\n for (const module of providedModules) {\n build.onResolve({ filter: new RegExp(`^${module}$`) }, ({ path }) => {\n return { path, namespace: 'injected-module' };\n });\n }\n\n build.onLoad({ filter: /.*/, namespace: 'injected-module' }, ({ path }) => {\n const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];\n return {\n contents: `\n const { ${namedImports.join(',')} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];\n export { ${namedImports.join(',')} };\n export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;\n `,\n loader: 'tsx',\n };\n });\n },\n },\n ],\n });\n\n return await createResult({\n imports: this.analyzeImports(result),\n bundle: result.outputFiles![0].text,\n });\n } catch (err) {\n return await createResult({ error: err });\n }\n }\n\n // TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.\n analyzeImports(result: BuildResult): Import[] {\n invariant(result.outputFiles);\n\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);\n return Object.values(result.metafile!.outputs)[0].imports.map((entry): Import => {\n const namedImports: string[] = [];\n\n const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);\n if (parsedImport?.[2]) {\n NAMED_IMPORTS_REGEX.lastIndex = 0;\n const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);\n if (namedImportsMatch) {\n namedImportsMatch[1].split(',').forEach((importName) => {\n namedImports.push(importName.trim());\n });\n }\n }\n\n return {\n moduleUrl: entry.path,\n defaultImport: !!parsedImport?.[1],\n namedImports,\n };\n });\n }\n\n analyzeSourceFileImports(code: string) {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]?.split(',').map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n }\n}\n\n// https://regex101.com/r/FEN5ks/1\n// https://stackoverflow.com/a/73265022\n// $1 = default import name (can be non-existent)\n// $2 = destructured exports (can be non-existent)\n// $3 = wildcard import name (can be non-existent)\n// $4 = module identifier\n// $5 = quotes used (either ' or \")\nconst IMPORT_REGEX =\n /import(?:(?:(?:[ \\n\\t]+([^ *\\n\\t{},]+)[ \\n\\t]*(?:,|[ \\n\\t]+))?([ \\n\\t]*{(?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+})?[ \\n\\t]*)|[ \\n\\t]*\\*[ \\n\\t]*as[ \\n\\t]+([^ \\n\\t{}]+)[ \\n\\t]+)from[ \\n\\t]*(?:['\"])([^'\"\\n]+)(['\"])/gm;\n\nconst NAMED_IMPORTS_REGEX = /[ \\n\\t]*{((?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+)}[ \\n\\t]*/gm;\n\nconst allMatches = (regex: RegExp, str: string) => {\n regex.lastIndex = 0;\n\n let match;\n const matches = [];\n while ((match = regex.exec(str))) {\n matches.push(match);\n }\n\n return matches;\n};\n\ntype ParsedImport = {\n defaultImportName?: string;\n namedImports: string[];\n wildcardImportName?: string;\n moduleIdentifier: string;\n quotes: string;\n};\n\nconst analyzeSourceFileImports = (code: string): ParsedImport[] => {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]\n ?.trim()\n .slice(1, -1)\n .split(',')\n .map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ScriptPlugin } from './ScriptPlugin';\n\nexport default ScriptPlugin;\n\nexport * from './compiler';\nexport * from './components';\nexport * from './types';\n\nexport * from './ScriptPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqC;AACrC,IAAAA,gBAAkB;AAElB,2BAA0F;AAC1F,yBAAuB;AACvB,2BAAkC;AAClC,0BAAiE;AACjE,mBAAyB;AACzB,0BAA4B;AAC5B,kBAAqC;ACTrC,IAAAA,gBAAkB;AEClB,0BAAoD;AAEpD,oBAA6B;AAC7B,uBAA0B;AFFnB,IAAMC,eAAeC,cAAAA,QAAMC,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC7C,IAAMC,mBAAmBF,cAAAA,QAAMC,KAAK,MAAM,OAAO,iCAAA,CAAA;ACDxD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,mCAAAA,GAAgB;QACf,eAAe;QACf,4BAA4B;QAC5B,uBAAuB;QACvB,8BAA8B;QAC9B,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,mBAAmB;MACrB;IACF;EACF;;AFEK,IAAMC,eAAe,CAAC,EAAEC,aAAY,MAAqB;AAC9D,SAA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,GAAG,EAAC,EACV9G,MAAM,GAAA,EACNyF,IAAI,CAACQ,eAAeA,WAAWE,KAAI,CAAA;MACtCK,oBAAoBb,QAAQ,CAAA;MAC5BhB,kBAAkBgB,QAAQ,CAAA;MAC1Bc,QAAQd,QAAQ,CAAA;IAClB;EACF,CAAA;AACF;AC3MA,IAAA,cAAerI;",
|
|
6
6
|
"names": ["import_react", "ScriptEditor", "React", "lazy", "TypescriptEditor", "SCRIPT_PLUGIN", "ScriptPlugin", "containerUrl", "meta", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "icon", "props", "Code", "iconSymbol", "loadReferences", "script", "loadObjectReferences", "source", "translations", "echo", "schema", "FunctionType", "graph", "builder", "plugins", "client", "resolvePlugin", "parseClientPlugin", "dispatch", "parseIntentPlugin", "intent", "createExtension", "id", "ScriptAction", "CREATE", "filter", "node", "isActionGroup", "startsWith", "SpaceAction", "ADD_OBJECT", "actions", "split", "at", "spaceId", "objectId", "space", "spaces", "get", "find", "object", "db", "getObjectById", "target", "data", "plugin", "action", "NavigationAction", "OPEN", "properties", "label", "testId", "stack", "creators", "type", "surface", "component", "role", "includes", "resolver", "create", "TextType", "content", "example", "join", "initialized", "initializeCompiler", "options", "initialize", "wasmURL", "Compiler", "constructor", "_options", "compile", "providedModules", "createResult", "result", "timestamp", "Date", "now", "sourceHash", "Buffer", "from", "subtleCrypto", "digest", "platform", "invariant", "imports", "analyzeSourceFileImports", "build", "metafile", "write", "entryPoints", "bundle", "format", "name", "setup", "onResolve", "path", "namespace", "onLoad", "contents", "loader", "module", "RegExp", "namedImports", "entry", "moduleIdentifier", "JSON", "stringify", "analyzeImports", "outputFiles", "text", "err", "error", "parsedImports", "allMatches", "IMPORT_REGEX", "Object", "values", "outputs", "map", "parsedImport", "capture", "NAMED_IMPORTS_REGEX", "lastIndex", "namedImportsMatch", "exec", "forEach", "importName", "push", "trim", "moduleUrl", "defaultImport", "code", "defaultImportName", "wildcardImportName", "quotes", "regex", "str", "match", "matches", "slice"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytes":10228,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytes":1702,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytes":2750,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytes":14123,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytes":907,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/functions.ts","kind":"import-statement","original":"./functions"},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytes":1964,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytes":18081,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytes":7342,"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytes":2909,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytes":1612,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytes":600,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/types/script.ts","kind":"import-statement","original":"./script"},{"path":"packages/plugins/experimental/plugin-script/src/types/types.tsx","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytes":15542,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx","kind":"import-statement","original":"./Toolbar"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"import-statement","original":"./TypescriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/edge/index.ts","kind":"import-statement","original":"../edge"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytes":1121,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","kind":"dynamic-import","original":"./ScriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"dynamic-import","original":"./TypescriptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytes":2462,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytes":19150,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-script/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytes":23524,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts","kind":"import-statement","original":"./compiler"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytes":1062,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"},{"path":"packages/plugins/experimental/plugin-script/src/compiler/index.ts","kind":"import-statement","original":"./compiler"},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-script/dist/lib/node/edge/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/edge/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs","kind":"import-statement"}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/plugins/experimental/plugin-script/src/edge/index.ts","inputs":{},"bytes":398},"packages/plugins/experimental/plugin-script/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21306},"packages/plugins/experimental/plugin-script/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs","kind":"dynamic-import"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Compiler","FunctionType","ScriptAction","ScriptEditor","ScriptPlugin","ScriptType","TypescriptEditor","default","initializeCompiler"],"entryPoint":"packages/plugins/experimental/plugin-script/src/index.ts","inputs":{"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytesInOutput":5058},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytesInOutput":187},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytesInOutput":612},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytesInOutput":5832},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytesInOutput":32}},"bytes":12494},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"}],"exports":["SCRIPT_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/meta.tsx","inputs":{},"bytes":161},"packages/plugins/experimental/plugin-script/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"}],"exports":["FunctionType","ScriptAction","ScriptType"],"entryPoint":"packages/plugins/experimental/plugin-script/src/types/index.ts","inputs":{},"bytes":210},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs","kind":"import-statement"}],"exports":["TypescriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","inputs":{},"bytes":212},"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17783},"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ScriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","inputs":{"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytesInOutput":3929},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytesInOutput":5100}},"bytes":9692},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14620},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs":{"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytesInOutput":221},"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytesInOutput":2132},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytesInOutput":3324},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytesInOutput":425}},"bytes":6731},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2276},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"exports":["FunctionType","ScriptAction","ScriptType"],"inputs":{"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytesInOutput":673},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytesInOutput":167}},"bytes":1134},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["SCRIPT_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytesInOutput":430}},"bytes":579},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3777},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs":{"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TypescriptEditor","TypescriptEditor_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytesInOutput":1776}},"bytes":1963}}}
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytes":10228,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytes":1702,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytes":2750,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytes":14123,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytes":907,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/functions.ts","kind":"import-statement","original":"./functions"},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytes":1964,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytes":18081,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytes":7342,"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytes":2909,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytes":1612,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytes":600,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/types/script.ts","kind":"import-statement","original":"./script"},{"path":"packages/plugins/experimental/plugin-script/src/types/types.tsx","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytes":15542,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx","kind":"import-statement","original":"./Toolbar"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"import-statement","original":"./TypescriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/edge/index.ts","kind":"import-statement","original":"../edge"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytes":1121,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","kind":"dynamic-import","original":"./ScriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"dynamic-import","original":"./TypescriptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytes":2462,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytes":19090,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-script/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytes":23524,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts","kind":"import-statement","original":"./compiler"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytes":1062,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"},{"path":"packages/plugins/experimental/plugin-script/src/compiler/index.ts","kind":"import-statement","original":"./compiler"},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-script/dist/lib/node/edge/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/edge/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs","kind":"import-statement"}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/plugins/experimental/plugin-script/src/edge/index.ts","inputs":{},"bytes":398},"packages/plugins/experimental/plugin-script/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21262},"packages/plugins/experimental/plugin-script/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs","kind":"dynamic-import"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Compiler","FunctionType","ScriptAction","ScriptEditor","ScriptPlugin","ScriptType","TypescriptEditor","default","initializeCompiler"],"entryPoint":"packages/plugins/experimental/plugin-script/src/index.ts","inputs":{"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytesInOutput":5058},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytesInOutput":187},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytesInOutput":612},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytesInOutput":5832},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytesInOutput":32}},"bytes":12494},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"}],"exports":["SCRIPT_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/meta.tsx","inputs":{},"bytes":161},"packages/plugins/experimental/plugin-script/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"}],"exports":["FunctionType","ScriptAction","ScriptType"],"entryPoint":"packages/plugins/experimental/plugin-script/src/types/index.ts","inputs":{},"bytes":210},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs","kind":"import-statement"}],"exports":["TypescriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","inputs":{},"bytes":212},"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17783},"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ScriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","inputs":{"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytesInOutput":3929},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytesInOutput":5100}},"bytes":9692},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14620},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs":{"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytesInOutput":221},"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytesInOutput":2132},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytesInOutput":3324},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytesInOutput":425}},"bytes":6731},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2276},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"exports":["FunctionType","ScriptAction","ScriptType"],"inputs":{"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytesInOutput":673},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytesInOutput":167}},"bytes":1134},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["SCRIPT_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytesInOutput":430}},"bytes":579},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3777},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs":{"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TypescriptEditor","TypescriptEditor_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytesInOutput":1776}},"bytes":1963}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptPlugin.d.ts","sourceRoot":"","sources":["../../../src/ScriptPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAqB,KAAK,gBAAgB,EAAmC,MAAM,qBAAqB,CAAC;AAYhH,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,YAAY,qBAAsB,iBAAiB,KAAG,gBAAgB,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ScriptPlugin.d.ts","sourceRoot":"","sources":["../../../src/ScriptPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAqB,KAAK,gBAAgB,EAAmC,MAAM,qBAAqB,CAAC;AAYhH,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,YAAY,qBAAsB,iBAAiB,KAAG,gBAAgB,CAAC,oBAAoB,CAkGvG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-script",
|
|
3
|
-
"version": "0.6.8
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "Braneframe notebook plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -67,29 +67,29 @@
|
|
|
67
67
|
"esbuild-wasm": "^0.16.14",
|
|
68
68
|
"iso-did": "^1.6.0",
|
|
69
69
|
"lodash.get": "^4.4.2",
|
|
70
|
-
"@dxos/app-framework": "0.6.8
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/client
|
|
74
|
-
"@dxos/debug": "0.6.8
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/invariant": "0.6.8
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/plugin-client": "0.6.8
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/plugin-
|
|
82
|
-
"@dxos/plugin-
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/plugin-
|
|
85
|
-
"@dxos/plugin-
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/rpc-tunnel": "0.6.8
|
|
92
|
-
"@dxos/util": "0.6.8
|
|
70
|
+
"@dxos/app-framework": "0.6.8",
|
|
71
|
+
"@dxos/client-protocol": "0.6.8",
|
|
72
|
+
"@dxos/crypto": "0.6.8",
|
|
73
|
+
"@dxos/client": "0.6.8",
|
|
74
|
+
"@dxos/debug": "0.6.8",
|
|
75
|
+
"@dxos/echo-schema": "0.6.8",
|
|
76
|
+
"@dxos/invariant": "0.6.8",
|
|
77
|
+
"@dxos/keys": "0.6.8",
|
|
78
|
+
"@dxos/log": "0.6.8",
|
|
79
|
+
"@dxos/plugin-client": "0.6.8",
|
|
80
|
+
"@dxos/plugin-explorer": "0.6.8",
|
|
81
|
+
"@dxos/plugin-graph": "0.6.8",
|
|
82
|
+
"@dxos/plugin-space": "0.6.8",
|
|
83
|
+
"@dxos/async": "0.6.8",
|
|
84
|
+
"@dxos/plugin-markdown": "0.6.8",
|
|
85
|
+
"@dxos/plugin-stack": "0.6.8",
|
|
86
|
+
"@dxos/plugin-theme": "0.6.8",
|
|
87
|
+
"@dxos/protocols": "0.6.8",
|
|
88
|
+
"@dxos/react-client": "0.6.8",
|
|
89
|
+
"@dxos/rpc": "0.6.8",
|
|
90
|
+
"@dxos/react-ui-editor": "0.6.8",
|
|
91
|
+
"@dxos/rpc-tunnel": "0.6.8",
|
|
92
|
+
"@dxos/util": "0.6.8"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -99,20 +99,20 @@
|
|
|
99
99
|
"react": "~18.2.0",
|
|
100
100
|
"react-dom": "~18.2.0",
|
|
101
101
|
"vite": "^5.3.4",
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/react-ui-theme": "0.6.8
|
|
102
|
+
"@dxos/echo-generator": "0.6.8",
|
|
103
|
+
"@dxos/random": "0.6.8",
|
|
104
|
+
"@dxos/react-ui": "0.6.8",
|
|
105
|
+
"@dxos/react-ui-mosaic": "0.6.8",
|
|
106
|
+
"@dxos/storybook-utils": "0.6.8",
|
|
107
|
+
"@dxos/react-ui-theme": "0.6.8"
|
|
108
108
|
},
|
|
109
109
|
"optionalDependencies": {
|
|
110
110
|
"@phosphor-icons/react": "^2.1.5",
|
|
111
111
|
"react": "^18.0.0",
|
|
112
112
|
"react-dom": "^18.0.0",
|
|
113
|
-
"@dxos/react-ui": "0.6.8
|
|
114
|
-
"@dxos/react-ui-mosaic": "0.6.8
|
|
115
|
-
"@dxos/react-ui-theme": "0.6.8
|
|
113
|
+
"@dxos/react-ui": "0.6.8",
|
|
114
|
+
"@dxos/react-ui-mosaic": "0.6.8",
|
|
115
|
+
"@dxos/react-ui-theme": "0.6.8"
|
|
116
116
|
},
|
|
117
117
|
"publishConfig": {
|
|
118
118
|
"access": "public"
|
package/src/ScriptPlugin.tsx
CHANGED
|
@@ -93,10 +93,7 @@ export const ScriptPlugin = ({ containerUrl }: ScriptPluginProps): PluginDefinit
|
|
|
93
93
|
type: ['plugin name', { ns: SCRIPT_PLUGIN }],
|
|
94
94
|
label: ['create stack section label', { ns: SCRIPT_PLUGIN }],
|
|
95
95
|
icon: (props: any) => <Code {...props} />,
|
|
96
|
-
intent: {
|
|
97
|
-
plugin: SCRIPT_PLUGIN,
|
|
98
|
-
action: ScriptAction.CREATE,
|
|
99
|
-
},
|
|
96
|
+
intent: { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },
|
|
100
97
|
},
|
|
101
98
|
],
|
|
102
99
|
},
|