@dxos/plugin-script 0.6.12-main.15a606f → 0.6.12-main.2d19bf1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/lib/browser/{ScriptContainer-7DE7USCY.mjs → ScriptContainer-M4MDQTBU.mjs} +7 -6
- package/dist/lib/browser/ScriptContainer-M4MDQTBU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CAEANETO.mjs → chunk-KXVQPS4Y.mjs} +2 -2
- package/dist/lib/browser/{chunk-MDX7ACIK.mjs → chunk-SGQHRB4P.mjs} +4 -5
- package/dist/lib/browser/chunk-SGQHRB4P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node/{ScriptContainer-J76LKPAM.cjs → ScriptContainer-KMIPKT3H.cjs} +14 -13
- package/dist/lib/node/ScriptContainer-KMIPKT3H.cjs.map +7 -0
- package/dist/lib/node/{chunk-2PZKJXNP.cjs → chunk-25PQE7FL.cjs} +6 -6
- package/dist/lib/node/{chunk-OJ77BZRH.cjs → chunk-EJC55SDD.cjs} +6 -7
- package/dist/lib/node/chunk-EJC55SDD.cjs.map +7 -0
- package/dist/lib/node/index.cjs +30 -31
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +3 -3
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +5 -5
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{ScriptContainer-F6ACEA63.mjs → ScriptContainer-EAE6L5JV.mjs} +7 -6
- package/dist/lib/node-esm/ScriptContainer-EAE6L5JV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-7BZDZF7Z.mjs → chunk-7EDYDVQH.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-TZ3Z4SII.mjs → chunk-GO7HYFM5.mjs} +4 -5
- package/dist/lib/node-esm/chunk-GO7HYFM5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -1
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -6
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +43 -42
- package/src/ScriptPlugin.tsx +1 -2
- package/src/components/ScriptContainer.tsx +3 -3
- package/src/{meta.tsx → meta.ts} +3 -3
- package/dist/lib/browser/ScriptContainer-7DE7USCY.mjs.map +0 -7
- package/dist/lib/browser/chunk-MDX7ACIK.mjs.map +0 -7
- package/dist/lib/node/ScriptContainer-J76LKPAM.cjs.map +0 -7
- package/dist/lib/node/chunk-OJ77BZRH.cjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-F6ACEA63.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TZ3Z4SII.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-CAEANETO.mjs.map → chunk-KXVQPS4Y.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-2PZKJXNP.cjs.map → chunk-25PQE7FL.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-7BZDZF7Z.mjs.map → chunk-7EDYDVQH.mjs.map} +0 -0
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var ScriptContainer_KMIPKT3H_exports = {};
|
|
30
|
+
__export(ScriptContainer_KMIPKT3H_exports, {
|
|
31
31
|
default: () => ScriptContainer_default
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(ScriptContainer_KMIPKT3H_exports);
|
|
34
34
|
var import_chunk_UZ3ZXEBF = require("./chunk-UZ3ZXEBF.cjs");
|
|
35
35
|
var import_chunk_ACLCRWDB = require("./chunk-ACLCRWDB.cjs");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var import_chunk_25PQE7FL = require("./chunk-25PQE7FL.cjs");
|
|
37
|
+
var import_chunk_EJC55SDD = require("./chunk-EJC55SDD.cjs");
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
39
|
var import_echo = require("@dxos/react-client/echo");
|
|
40
40
|
var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
@@ -65,7 +65,7 @@ var import_react_ui_editor2 = require("@dxos/react-ui-editor");
|
|
|
65
65
|
var import_util = require("@dxos/util");
|
|
66
66
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-script/src/components/DebugPanel/DebugPanel.tsx";
|
|
67
67
|
var DebugPanel = ({ classNames, functionUrl, binding: _binding, onBindingChange }) => {
|
|
68
|
-
const { t } = (0, import_react_ui2.useTranslation)(
|
|
68
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_EJC55SDD.SCRIPT_PLUGIN);
|
|
69
69
|
const bindingInputRef = (0, import_react3.useRef)(null);
|
|
70
70
|
const [binding, setBinding] = (0, import_react_ui2.useControlledValue)(_binding ?? "");
|
|
71
71
|
const handleBlur = () => {
|
|
@@ -299,7 +299,7 @@ var RobotAvatar = () => /* @__PURE__ */ import_react3.default.createElement(impo
|
|
|
299
299
|
icon: "ph--robot--regular"
|
|
300
300
|
})));
|
|
301
301
|
var Toolbar2 = ({ classNames, deployed, error, functionUrl, view, templates: templates2, onDeploy, onFormat, onViewChange, onTemplateSelect }) => {
|
|
302
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
302
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_EJC55SDD.SCRIPT_PLUGIN);
|
|
303
303
|
const [pending, setPending] = (0, import_react4.useState)(false);
|
|
304
304
|
const handleCopyLink = async () => {
|
|
305
305
|
if (!functionUrl) {
|
|
@@ -470,11 +470,11 @@ var TypescriptEditor = ({ id, env, className, initialValue, extensions, scrollTo
|
|
|
470
470
|
};
|
|
471
471
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx";
|
|
472
472
|
var ScriptEditor = ({ classNames, script, env }) => {
|
|
473
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
473
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_EJC55SDD.SCRIPT_PLUGIN);
|
|
474
474
|
const client = (0, import_react_client.useClient)();
|
|
475
475
|
const identity = (0, import_halo.useIdentity)();
|
|
476
476
|
const space = (0, import_echo2.getSpace)(script);
|
|
477
|
-
const [fn] = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(
|
|
477
|
+
const [fn] = (0, import_echo2.useQuery)(space, import_echo2.Filter.schema(import_chunk_25PQE7FL.FunctionType, (fn2) => fn2.source === script));
|
|
478
478
|
const extensions = (0, import_react2.useMemo)(() => [
|
|
479
479
|
(0, import_react_ui_editor.listener)({
|
|
480
480
|
onChange: (text) => {
|
|
@@ -590,7 +590,7 @@ var ScriptEditor = ({ classNames, script, env }) => {
|
|
|
590
590
|
if (fn) {
|
|
591
591
|
fn.version = functionVersionNumber;
|
|
592
592
|
}
|
|
593
|
-
const deployedFunction = fn ?? space.db.add((0, import_echo2.create)(
|
|
593
|
+
const deployedFunction = fn ?? space.db.add((0, import_echo2.create)(import_chunk_25PQE7FL.FunctionType, {
|
|
594
594
|
version: functionVersionNumber,
|
|
595
595
|
source: script
|
|
596
596
|
}));
|
|
@@ -654,14 +654,15 @@ var ScriptEditor = ({ classNames, script, env }) => {
|
|
|
654
654
|
}));
|
|
655
655
|
};
|
|
656
656
|
var ScriptContainer = ({ script, ...props }) => {
|
|
657
|
-
const
|
|
657
|
+
const attendableAttrs = (0, import_react_ui_attention.useAttendableAttributes)((0, import_echo.fullyQualifiedId)(script));
|
|
658
658
|
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
659
659
|
role: "none",
|
|
660
|
-
className: (0, import_react_ui_theme.mx)("flex row-span-2 w-full overflow-hidden
|
|
660
|
+
className: (0, import_react_ui_theme.mx)("flex row-span-2 w-full overflow-hidden attention-surface"),
|
|
661
|
+
...attendableAttrs
|
|
661
662
|
}, /* @__PURE__ */ import_react.default.createElement(ScriptEditor, {
|
|
662
663
|
...props,
|
|
663
664
|
script
|
|
664
665
|
}));
|
|
665
666
|
};
|
|
666
667
|
var ScriptContainer_default = ScriptContainer;
|
|
667
|
-
//# sourceMappingURL=ScriptContainer-
|
|
668
|
+
//# sourceMappingURL=ScriptContainer-KMIPKT3H.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/ScriptContainer.tsx", "../../../src/components/ScriptEditor.tsx", "../../../src/components/DebugPanel/DebugPanel.tsx", "../../../src/components/Toolbar/Toolbar.tsx", "../../../src/components/TypescriptEditor/TypescriptEditor.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\nimport { useAttendableAttributes } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { ScriptEditor, type ScriptEditorProps } from './ScriptEditor';\n\nconst ScriptContainer = ({ script, ...props }: ScriptEditorProps) => {\n const attendableAttrs = useAttendableAttributes(fullyQualifiedId(script));\n return (\n <div role='none' className={mx('flex row-span-2 w-full overflow-hidden attention-surface')} {...attendableAttrs}>\n <ScriptEditor {...props} script={script} />\n </div>\n );\n};\n\nexport default ScriptContainer;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type DID } from 'iso-did/types';\nimport { format } from 'prettier';\nimport prettierPluginEstree from 'prettier/plugins/estree';\nimport prettierPluginTypescript from 'prettier/plugins/typescript';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { log } from '@dxos/log';\nimport { useClient } from '@dxos/react-client';\nimport { create, createDocAccessor, Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { useTranslation, type ThemedClassName } from '@dxos/react-ui';\nimport { createDataExtensions, listener } from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { DebugPanel } from './DebugPanel';\nimport { type TemplateSelectProps, Toolbar, type ViewType } from './Toolbar';\nimport { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';\nimport { Bundler } from '../bundler';\nimport {\n getUserFunctionUrlInMetadata,\n publicKeyToDid,\n setUserFunctionUrlInMetadata,\n uploadWorkerFunction,\n USERFUNCTIONS_PRESET_META_KEY,\n} from '../edge';\nimport { SCRIPT_PLUGIN } from '../meta';\nimport { templates } from '../templates';\nimport { FunctionType, type ScriptType } from '../types';\n\nexport type ScriptEditorProps = ThemedClassName<{\n script: ScriptType;\n}> &\n Pick<TypescriptEditorProps, 'env'>;\n\nexport const ScriptEditor = ({ classNames, script, env }: ScriptEditorProps) => {\n const { t } = useTranslation(SCRIPT_PLUGIN);\n const client = useClient();\n const identity = useIdentity();\n const space = getSpace(script);\n const [fn] = useQuery(\n space,\n Filter.schema(FunctionType, (fn) => fn.source === script),\n );\n\n const extensions = useMemo(\n () => [\n listener({\n onChange: (text) => {\n if (script.source && script.source?.content !== text) {\n script.changed = true;\n }\n },\n }),\n createDataExtensions({\n id: script.id,\n text: script.source && createDocAccessor(script.source, ['content']),\n space,\n identity,\n }),\n ],\n [script, script.source, space, identity],\n );\n\n const [view, setView] = useState<ViewType>('editor');\n const initialValue = useMemo(() => script.source?.content, [script.source]);\n const existingFunctionUrl = fn && getUserFunctionUrlInMetadata(getMeta(fn));\n const [error, setError] = useState<string>();\n\n const handleBindingChange = useCallback(\n (binding: string) => {\n fn.binding = binding;\n },\n [fn],\n );\n\n const handleFormat = useCallback(async () => {\n if (!script.source) {\n return;\n }\n\n try {\n script.source.content = await format(script.source.content, {\n parser: 'typescript',\n plugins: [prettierPluginEstree, prettierPluginTypescript],\n semi: true,\n singleQuote: true,\n });\n } catch (err: any) {\n // TODO(wittjosiah): Show error in UI.\n log.catch(err);\n }\n }, [script.source]);\n\n const handleTemplateChange: TemplateSelectProps['onTemplateSelect'] = (id) => {\n const template = templates.find((template) => template.id === id);\n if (template) {\n script.name = template.name;\n script.source!.content = template.source;\n const metaKeys = getMeta(script).keys;\n const oldPresetIndex = metaKeys.findIndex((key) => key.source === USERFUNCTIONS_PRESET_META_KEY);\n if (oldPresetIndex >= 0) {\n metaKeys.splice(oldPresetIndex, 1);\n }\n if (template.presetId) {\n metaKeys.push({ source: USERFUNCTIONS_PRESET_META_KEY, id: template.presetId });\n }\n }\n };\n\n const handleDeploy = useCallback(async () => {\n if (!script.source || !identity || !space) {\n return;\n }\n\n setError(undefined);\n\n try {\n const existingFunctionId = existingFunctionUrl?.split('/').at(-1);\n const ownerDid = (existingFunctionUrl?.split('/').at(-2) as DID) ?? publicKeyToDid(identity.identityKey);\n\n const bundler = new Bundler({ platform: 'browser', sandboxedModules: [], remoteModules: {} });\n const buildResult = await bundler.bundle(script.source.content);\n if (buildResult.error || !buildResult.bundle) {\n throw buildResult.error;\n }\n\n const { result, functionId, functionVersionNumber, errorMessage } = await uploadWorkerFunction({\n clientConfig: client.config,\n halo: client.halo,\n ownerDid,\n functionId: existingFunctionId,\n source: buildResult.bundle,\n });\n if (result !== 'success' || functionId === undefined || functionVersionNumber === undefined) {\n throw new Error(errorMessage);\n }\n\n log.info('function uploaded', { functionId, functionVersionNumber });\n if (fn) {\n fn.version = functionVersionNumber;\n }\n\n const deployedFunction =\n fn ?? space.db.add(create(FunctionType, { version: functionVersionNumber, source: script }));\n const meta = getMeta(deployedFunction);\n script.changed = false;\n setUserFunctionUrlInMetadata(meta, `/${ownerDid}/${functionId}`);\n setView('split');\n } catch (err: any) {\n log.catch(err);\n setError(t('upload failed label'));\n }\n }, [fn, existingFunctionUrl, script, script.name, script.source]);\n\n const functionUrl = useMemo(() => {\n if (!existingFunctionUrl) {\n return;\n }\n\n const baseUrl = new URL('functions/', client.config.values.runtime?.services?.edge?.url);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = existingFunctionUrl.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n space && url.searchParams.set('spaceId', space.id);\n url.protocol = 'https';\n return url.toString();\n }, [existingFunctionUrl, space]);\n\n return (\n <div role='none' className={mx('flex flex-col w-full overflow-hidden divide-y divide-separator', classNames)}>\n <Toolbar\n deployed={Boolean(existingFunctionUrl) && !script.changed}\n functionUrl={functionUrl}\n error={error}\n view={view}\n templates={templates}\n onDeploy={handleDeploy}\n onFormat={handleFormat}\n onViewChange={setView}\n onTemplateSelect={handleTemplateChange}\n />\n\n {view !== 'preview' && (\n <TypescriptEditor\n id={script.id}\n env={env}\n initialValue={initialValue}\n extensions={extensions}\n className='flex is-full bs-full overflow-hidden ch-focus-ring-inset-over-all'\n />\n )}\n\n {view !== 'editor' && (\n <DebugPanel functionUrl={functionUrl} binding={fn?.binding} onBindingChange={handleBindingChange} />\n )}\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { log } from '@dxos/log';\nimport {\n Avatar,\n DensityProvider,\n Icon,\n Input,\n type ThemedClassName,\n Toolbar,\n useControlledValue,\n useTranslation,\n} from '@dxos/react-ui';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { SCRIPT_PLUGIN } from '../../meta';\n\ntype State = 'pending' | 'responding';\n\n/**\n * Request or response.\n */\ntype Message = { type: 'request' | 'response'; text?: string; data?: any; error?: Error };\n\nexport type DebugPanelProps = ThemedClassName<{\n functionUrl?: string;\n binding?: string;\n onBindingChange?: (binding: string) => void;\n}>;\n\nexport const DebugPanel = ({ classNames, functionUrl, binding: _binding, onBindingChange }: DebugPanelProps) => {\n const { t } = useTranslation(SCRIPT_PLUGIN);\n\n const bindingInputRef = useRef<HTMLInputElement>(null);\n const [binding, setBinding] = useControlledValue(_binding ?? '');\n const handleBlur = () => {\n onBindingChange?.(binding);\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const [input, setInput] = useState('');\n const [result, setResult] = useState('');\n const [state, setState] = useState<State | null>(null);\n\n // TODO(burdon): Persistent history -- at least for session (non-space ECHO data?)\n const [history, setHistory] = useState<Message[]>([]);\n\n const scrollerRef = useRef<HTMLDivElement>(null);\n const handleScroll = () => {\n if (scrollerRef.current) {\n scrollerRef.current.scrollTop = scrollerRef.current.scrollHeight;\n }\n };\n\n const controller = useRef<AbortController>();\n useEffect(() => {\n return () => {\n handleStop();\n };\n }, []);\n\n const handleStop = () => {\n controller.current?.abort('stop');\n controller.current = undefined;\n };\n\n const handleClear = () => {\n handleStop();\n setInput('');\n setResult('');\n setHistory([]);\n inputRef.current?.focus();\n };\n\n const handleResponse = ({ text, data, error }: { text?: string; data?: any; error?: Error } = {}) => {\n controller.current = undefined;\n setHistory((history) => [...history, { type: 'response', text, data, error } satisfies Message]);\n setResult('');\n setState(null);\n handleScroll();\n };\n\n const handleRequest = async (input: string) => {\n // Returns a promise that resolves when a value has been received.\n try {\n setState('pending');\n\n let data = null;\n // Detect JSON input.\n if (input.charAt(0) === '{') {\n try {\n const validJsonString = input.replace(/'/g, '\"').replace(/([{,]\\s*)([a-zA-Z0-9_]+)(\\s*:)/g, '$1\"$2\"$3');\n data = JSON.parse(validJsonString);\n input = JSON.stringify(data, null, 2);\n } catch (err) {\n inputRef.current?.focus();\n return;\n }\n }\n\n setInput('');\n setResult('');\n setHistory((history) => [...history, { type: 'request', text: input }]);\n setTimeout(() => {\n handleScroll();\n });\n\n // Throws DOMException when aborted.\n controller.current = new AbortController();\n const response = await fetch(functionUrl!, {\n signal: controller.current.signal,\n method: 'POST',\n body: input,\n headers: {\n 'Content-Type': data ? 'application/json' : 'text/plain',\n },\n });\n\n // Check for error.\n if (!response.ok) {\n const text = await response.text();\n handleResponse({ error: new Error(text || response.statusText || String(response.status)) });\n return;\n }\n\n // Check for JSON.\n const contentType = response.headers.get('content-type');\n if (contentType === 'application/json') {\n const data = await response.json();\n handleResponse({ data });\n return;\n }\n\n // Text (including streaming).\n setState('responding');\n let text = '';\n const reader = response.body!.getReader();\n const pump = async ({ done, value }: ReadableStreamReadResult<Uint8Array>): Promise<void> => {\n text = text + new TextDecoder().decode(value);\n if (!controller.current || done) {\n handleResponse({ text });\n return;\n }\n\n setResult(text);\n setTimeout(() => {\n handleScroll();\n });\n\n return reader.read().then(pump);\n };\n\n void reader\n .read()\n .then(pump)\n .catch((err) => {\n if (err.name !== 'AbortError') {\n log.catch(err);\n }\n });\n } catch (err: any) {\n if (err !== 'stop') {\n const error = err instanceof Error ? err : new Error(err);\n handleResponse({ error });\n log.catch(err);\n } else {\n handleResponse();\n }\n }\n };\n\n return (\n <DensityProvider density='fine'>\n <div className={mx('flex flex-col h-full overflow-hidden', classNames)}>\n {/* TODO(burdon): Replace with Thread? */}\n <div ref={scrollerRef} className='flex flex-col gap-6 h-full p-4 overflow-x-hidden overflow-y-auto'>\n <MessageThread state={state} result={result} history={history} />\n </div>\n\n <Toolbar.Root classNames='p-2'>\n <Input.Root>\n <Input.TextInput\n ref={inputRef}\n autoFocus\n placeholder={t('function request placeholder')}\n value={input}\n onChange={(ev) => setInput(ev.target.value)}\n onKeyDown={(ev) => ev.key === 'Enter' && handleRequest(input)}\n />\n </Input.Root>\n <Input.Root>\n <Input.TextInput\n ref={bindingInputRef}\n classNames='!w-[10rem]'\n placeholder={t('binding placeholder')}\n value={binding}\n onChange={(ev) => setBinding(ev.target.value.toUpperCase())}\n onBlur={handleBlur}\n />\n </Input.Root>\n <Toolbar.Button onClick={() => handleRequest(input)}>\n <Icon icon='ph--play--regular' size={4} />\n </Toolbar.Button>\n <Toolbar.Button onClick={() => (state ? handleStop() : handleClear())}>\n <Icon icon={state ? 'ph--stop--regular' : 'ph--trash--regular'} size={4} />\n </Toolbar.Button>\n </Toolbar.Root>\n </div>\n </DensityProvider>\n );\n};\n\n// TODO(burdon): Replace with thread?\n// TODO(burdon): Button to delete individual messages.\n// TODO(burdon): Button to edit/re-run question.\nconst MessageThread = ({ state, result, history }: { state: State | null; result: string; history: Message[] }) => {\n return (\n <>\n {history.map((message, i) => (\n <div key={i} className='grid grid-cols-[3rem_1fr_3rem]'>\n <div className='p-1'>{message.type === 'response' && <RobotAvatar />}</div>\n <div className='overflow-auto'>\n <MessageItem message={message} />\n </div>\n </div>\n ))}\n {result?.length > 0 && (\n <div className='grid grid-cols-[3rem_1fr_3rem]'>\n <div className='p-1'>\n {(state === 'pending' && <Icon icon='ph--spinner--regular' size={6} classNames='animate-spin' />) || (\n <Icon icon='ph--robot--regular' size={6} classNames='animate-[pulse_1s_ease-in-out_infinite]' />\n )}\n </div>\n <div className='overflow-auto'>\n <MessageItem message={{ type: 'response', text: result }} />\n </div>\n </div>\n )}\n </>\n );\n};\n\nconst MessageItem = ({ classNames, message }: ThemedClassName<{ message: Message }>) => {\n const { type, text, data, error } = message;\n const wrapper = 'p-1 px-2 rounded-lg bg-hoverSurface overflow-auto';\n return (\n <div className={mx('flex', type === 'request' ? 'ml-[8rem] justify-end' : 'mr-[8rem]', classNames)}>\n {error && <div className={mx(wrapper, 'whitespace-pre text-error')}>{String(error)}</div>}\n\n {text !== undefined && (\n <div className={mx(wrapper, type === 'request' && 'bg-primary-400 dark:bg-primary-600')}>\n {text || '\\u00D8'}\n </div>\n )}\n\n {data && (\n <SyntaxHighlighter language='json' className={mx(wrapper, 'px-8 py-2 text-xs')}>\n {JSON.stringify(data, null, 2)}\n </SyntaxHighlighter>\n )}\n </div>\n );\n};\n\nconst RobotAvatar = () => (\n <Avatar.Root size={6} variant='circle'>\n <Avatar.Frame>\n <Avatar.Icon icon='ph--robot--regular' />\n </Avatar.Frame>\n </Avatar.Root>\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport {\n DensityProvider,\n ElevationProvider,\n Icon,\n Select,\n type ThemedClassName,\n ToggleGroup,\n ToggleGroupItem,\n type ToolbarButtonProps,\n Toolbar as NaturalToolbar,\n Tooltip,\n useTranslation,\n} from '@dxos/react-ui';\n\nimport { SCRIPT_PLUGIN } from '../../meta';\nimport { type Template } from '../../templates';\n\nexport type ToolbarProps = ThemedClassName<\n {\n deployed?: boolean;\n error?: string;\n functionUrl?: string;\n onDeploy?: () => Promise<void>;\n onFormat?: () => Promise<void>;\n } & TemplateSelectProps &\n ViewSelectorProps\n>;\n\nexport const Toolbar = ({\n classNames,\n deployed,\n error,\n functionUrl,\n view,\n templates,\n onDeploy,\n onFormat,\n onViewChange,\n onTemplateSelect,\n}: ToolbarProps) => {\n const { t } = useTranslation(SCRIPT_PLUGIN);\n const [pending, setPending] = useState(false);\n\n const handleCopyLink = async () => {\n if (!functionUrl) {\n return;\n }\n\n await navigator.clipboard.writeText(functionUrl);\n };\n\n const handleDeploy = async () => {\n if (!pending) {\n setPending(true);\n await onDeploy?.();\n setPending(false);\n }\n };\n\n // TODO(burdon): Factor out common toolbar components with sheet/editor?\n return (\n <DensityProvider density='fine'>\n <ElevationProvider elevation='chrome'>\n <NaturalToolbar.Root classNames={['p-1', classNames]} style={{ contain: 'layout' }}>\n {templates && <TemplateSelect templates={templates} onTemplateSelect={onTemplateSelect} />}\n {onFormat && <ToolbarIconButton icon='ph--magic-wand--regular' text={t('format label')} onClick={onFormat} />}\n\n <div role='separator' className='grow' />\n\n {error ? (\n <Tooltip.Root>\n <Tooltip.Trigger>\n <Icon icon='ph--warning-circle--regular' size={4} />\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content>\n <Tooltip.Arrow />\n {error}\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n ) : null}\n\n {functionUrl && deployed && (\n <ToolbarIconButton icon='ph--link--regular' text={t('copy link label')} onClick={handleCopyLink} />\n )}\n\n {onDeploy && (\n <ToolbarIconButton\n icon={pending ? 'ph--spinner-gap--regular' : 'ph--cloud-arrow-up--regular'}\n classNames={[pending && 'animate-spin']}\n text={pending ? t('pending label') : t('deploy label')}\n onClick={handleDeploy}\n />\n )}\n\n <ViewSelector view={view} onViewChange={onViewChange} />\n </NaturalToolbar.Root>\n </ElevationProvider>\n </DensityProvider>\n );\n};\n\nconst ToolbarIconButton = ({\n icon,\n text,\n classNames,\n disabled,\n onClick,\n}: { icon: string; text: string } & Pick<ToolbarButtonProps, 'classNames' | 'disabled' | 'onClick'>) => {\n return (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <NaturalToolbar.Button variant='ghost' disabled={disabled} onClick={onClick}>\n <Icon icon={icon} size={4} classNames={classNames} />\n </NaturalToolbar.Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content>\n <Tooltip.Arrow />\n {text}\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n};\n\nexport type ViewType = 'editor' | 'split' | 'preview';\n\nexport type TemplateSelectProps = {\n templates?: Template[];\n onTemplateSelect?: (id: string) => void;\n};\n\nexport const TemplateSelect = ({ templates = [], onTemplateSelect }: TemplateSelectProps) => {\n return (\n <Select.Root value={''} onValueChange={onTemplateSelect}>\n <Select.TriggerButton />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n <Select.Option value={''}>Template</Select.Option>\n {templates.map(({ id, name }) => (\n <Select.Option key={id} value={id}>\n {name}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n\nexport type ViewSelectorProps = {\n view?: ViewType;\n onViewChange?: (view: ViewType) => void;\n};\n\nexport const ViewSelector = ({ view, onViewChange }: ViewSelectorProps) => {\n return (\n <ToggleGroup type='single' value={view} onValueChange={(value) => onViewChange?.(value as ViewType)}>\n <ToggleGroupItem value='editor' classNames='bg-transparent text-subdued'>\n <Icon icon='ph--code--regular' size={4} />\n </ToggleGroupItem>\n <ToggleGroupItem value='split' classNames='bg-transparent text-subdued'>\n <Icon icon='ph--square-split-vertical--regular' size={4} />\n </ToggleGroupItem>\n <ToggleGroupItem value='preview' classNames='bg-transparent text-subdued'>\n <Icon icon='ph--eye--regular' size={4} />\n </ToggleGroupItem>\n </ToggleGroup>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { javascript } from '@codemirror/lang-javascript';\nimport { type VirtualTypeScriptEnvironment } from '@typescript/vfs';\nimport { tsSync, tsFacet, tsLinter, tsAutocomplete, tsHover } from '@valtown/codemirror-ts';\nimport React from 'react';\n\nimport { useThemeContext } from '@dxos/react-ui';\nimport {\n autocomplete,\n createBasicExtensions,\n createThemeExtensions,\n editorFullWidth,\n editorGutter,\n editorMonospace,\n InputModeExtensions,\n useTextEditor,\n type UseTextEditorProps,\n} from '@dxos/react-ui-editor';\nimport { nonNullable } from '@dxos/util';\n\nexport type TypescriptEditorProps = {\n id: string;\n env?: VirtualTypeScriptEnvironment;\n} & Pick<UseTextEditorProps, 'className' | 'initialValue' | 'extensions' | 'scrollTo' | 'selection'>;\n\nexport const TypescriptEditor = ({\n id,\n env,\n className,\n initialValue,\n extensions,\n scrollTo,\n selection,\n}: TypescriptEditorProps) => {\n const { themeMode } = useThemeContext();\n const { parentRef, focusAttributes } = useTextEditor(\n () => ({\n id,\n initialValue,\n extensions: [\n extensions,\n createBasicExtensions({\n highlightActiveLine: true,\n indentWithTab: true,\n lineNumbers: true,\n lineWrapping: false,\n scrollPastEnd: true,\n }),\n createThemeExtensions({\n themeMode,\n syntaxHighlighting: true,\n slots: {\n content: { className: editorFullWidth },\n },\n }),\n editorGutter,\n // TODO(burdon): Factor out.\n [\n editorMonospace,\n javascript({ typescript: true }),\n // https://github.com/val-town/codemirror-ts\n autocomplete({ override: env ? [tsAutocomplete()] : [] }),\n env ? [tsFacet.of({ env, path: `/src/${id}.ts` }), tsSync(), tsLinter(), tsHover()] : [],\n InputModeExtensions.vscode,\n ],\n ].filter(nonNullable),\n selection,\n scrollTo,\n }),\n [id, initialValue, extensions, themeMode, selection, scrollTo],\n );\n\n return <div ref={parentRef} className={className} {...focusAttributes} />;\n};\n\nexport default TypescriptEditor;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,kBAAiC;AACjC,gCAAwC;AACxC,4BAAmB;ACHnB,sBAAuB;AACvB,oBAAiC;AACjC,wBAAqC;AACrC,IAAAA,gBAAsD;AAEtD,iBAAoB;AACpB,0BAA0B;AAC1B,IAAAC,eAA+E;AAC/E,kBAA4B;AAC5B,sBAAqD;AACrD,6BAA+C;AAC/C,IAAAC,yBAAmB;ACZnB,IAAAF,gBAAmD;AAEnD,IAAAG,cAAoB;AACpB,IAAAC,mBASO;AACP,yCAAkC;AAClC,IAAAF,yBAAmB;ACdnB,IAAAF,gBAAgC;AAEhC,IAAAI,mBAYO;ACdP,6BAA2B;AAE3B,2BAAmE;AACnE,IAAAJ,gBAAkB;AAElB,IAAAI,mBAAgC;AAChC,IAAAC,0BAUO;AACP,kBAA4B;;AFcrB,IAAMC,aAAa,CAAC,EAAEC,YAAYC,aAAaC,SAASC,UAAUC,gBAAe,MAAmB;AACzG,QAAM,EAAEC,EAAC,QAAKC,iCAAeC,mCAAAA;AAE7B,QAAMC,sBAAkBC,sBAAyB,IAAA;AACjD,QAAM,CAACP,SAASQ,UAAAA,QAAcC,qCAAmBR,YAAY,EAAA;AAC7D,QAAMS,aAAa,MAAA;AACjBR,sBAAkBF,OAAAA;EACpB;AAEA,QAAMW,eAAWJ,sBAAyB,IAAA;AAC1C,QAAM,CAACK,OAA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AAIL,IAAI,KAAKM,WAAAA,IAAeP,QAAQQ,SAAQ,CAAA;AACxD3E,aAASyE,IAAIG,aAAaC,IAAI,WAAW7E,MAAMhD,EAAE;AACjDyH,QAAIK,WAAW;AACf,WAAOL,IAAIE,SAAQ;EACrB,GAAG;IAAC7D;IAAqBd;GAAM;AAE/B,SACEzH,8BAAAA,QAAA,cAACG,OAAAA;IAAIwD,MAAK;IAAOvD,eAAWC,uBAAAA,IAAG,kEAAkEjF,UAAAA;KAC/F4E,8BAAAA,QAAA,cAACQ,UAAAA;IACC8B,UAAUkK,QAAQjE,mBAAAA,KAAwB,CAACnB,OAAOe;IAClD9M;IACAqC;IACA6E;IACAC;IACAC,UAAUU;IACVT,UAAUmG;IACVlG,cAAc2F;IACd1F,kBAAkByG;MAGnB9G,SAAS,aACRvC,8BAAAA,QAAA,cAAC4E,kBAAAA;IACCH,IAAI2C,OAAO3C;IACXI;IACAC;IACAC;IACA3E,WAAU;MAIbmC,SAAS,YACRvC,8BAAAA,QAAA,cAAC7E,YAAAA;IAAWE;IAA0BC,SAASqM,IAAIrM;IAASE,iBAAiBmN;;AAIrF;AD9LA,IAAM8D,kBAAkB,CAAC,EAAErF,QAAQ,GAAGsF,MAAAA,MAA0B;AAC9D,QAAMC,sBAAkBC,uDAAwBC,8BAAiBzF,MAAAA,CAAAA;AACjE,SACEpH,6BAAAA,QAAA,cAACG,OAAAA;IAAIwD,MAAK;IAAOvD,eAAWC,sBAAAA,IAAG,0DAAA;IAA8D,GAAGsM;KAC9F3M,6BAAAA,QAAA,cAACmH,cAAAA;IAAc,GAAGuF;IAAOtF;;AAG/B;AAEA,IAAA,0BAAeqF;",
|
|
6
|
+
"names": ["import_react", "import_echo", "import_react_ui_theme", "import_log", "import_react_ui", "import_react_ui_editor", "DebugPanel", "classNames", "functionUrl", "binding", "_binding", "onBindingChange", "t", "useTranslation", "SCRIPT_PLUGIN", "bindingInputRef", "useRef", "setBinding", "useControlledValue", "handleBlur", "inputRef", "input", "setInput", "useState", "result", "setResult", "state", "setState", "history", "setHistory", "scrollerRef", "handleScroll", "current", "scrollTop", "scrollHeight", "controller", "useEffect", "handleStop", "abort", "undefined", "handleClear", "focus", "handleResponse", "text", "data", "error", "type", "handleRequest", "charAt", "validJsonString", "replace", "JSON", "parse", "stringify", "err", "setTimeout", "AbortController", "response", "fetch", "signal", "method", "body", "headers", "ok", "Error", "statusText", "String", "status", "contentType", "get", "json", "reader", "getReader", "pump", "done", "value", "TextDecoder", "decode", "read", "then", "catch", "name", "log", "React", "DensityProvider", "density", "div", "className", "mx", "ref", "MessageThread", "Toolbar", "Root", "Input", "TextInput", "autoFocus", "placeholder", "onChange", "ev", "target", "onKeyDown", "key", "toUpperCase", "onBlur", "Button", "onClick", "Icon", "icon", "size", "map", "message", "i", "RobotAvatar", "MessageItem", "length", "wrapper", "SyntaxHighlighter", "language", "Avatar", "variant", "Frame", "deployed", "view", "templates", "onDeploy", "onFormat", "onViewChange", "onTemplateSelect", "pending", "setPending", "handleCopyLink", "navigator", "clipboard", "writeText", "handleDeploy", "ElevationProvider", "elevation", "NaturalToolbar", "style", "contain", "TemplateSelect", "ToolbarIconButton", "role", "Tooltip", "Trigger", "Portal", "Content", "Arrow", "ViewSelector", "disabled", "asChild", "Select", "onValueChange", "TriggerButton", "Viewport", "Option", "id", "ToggleGroup", "ToggleGroupItem", "TypescriptEditor", "env", "initialValue", "extensions", "scrollTo", "selection", "themeMode", "useThemeContext", "parentRef", "focusAttributes", "useTextEditor", "createBasicExtensions", "highlightActiveLine", "indentWithTab", "lineNumbers", "lineWrapping", "scrollPastEnd", "createThemeExtensions", "syntaxHighlighting", "slots", "content", "editorFullWidth", "editorGutter", "editorMonospace", "javascript", "typescript", "autocomplete", "override", "tsAutocomplete", "tsFacet", "of", "path", "tsSync", "tsLinter", "tsHover", "InputModeExtensions", "vscode", "filter", "nonNullable", "ScriptEditor", "script", "client", "useClient", "identity", "useIdentity", "space", "getSpace", "fn", "useQuery", "Filter", "schema", "FunctionType", "source", "useMemo", "listener", "changed", "createDataExtensions", "createDocAccessor", "setView", "existingFunctionUrl", "getUserFunctionUrlInMetadata", "getMeta", "setError", "handleBindingChange", "useCallback", "handleFormat", "format", "parser", "plugins", "prettierPluginEstree", "prettierPluginTypescript", "semi", "singleQuote", "handleTemplateChange", "template", "find", "metaKeys", "keys", "oldPresetIndex", "findIndex", "USERFUNCTIONS_PRESET_META_KEY", "splice", "presetId", "push", "existingFunctionId", "split", "at", "ownerDid", "publicKeyToDid", "identityKey", "bundler", "Bundler", "platform", "sandboxedModules", "remoteModules", "buildResult", "bundle", "functionId", "functionVersionNumber", "errorMessage", "uploadWorkerFunction", "clientConfig", "config", "halo", "info", "version", "deployedFunction", "db", "add", "create", "meta", "setUserFunctionUrlInMetadata", "baseUrl", "URL", "values", "runtime", "services", "edge", "url", "relativeUrl", "toString", "searchParams", "set", "protocol", "Boolean", "ScriptContainer", "props", "attendableAttrs", "useAttendableAttributes", "fullyQualifiedId"]
|
|
7
|
+
}
|
|
@@ -16,14 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_25PQE7FL_exports = {};
|
|
20
|
+
__export(chunk_25PQE7FL_exports, {
|
|
21
21
|
FunctionType: () => FunctionType,
|
|
22
22
|
ScriptAction: () => ScriptAction,
|
|
23
23
|
ScriptType: () => ScriptType
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
-
var
|
|
25
|
+
module.exports = __toCommonJS(chunk_25PQE7FL_exports);
|
|
26
|
+
var import_chunk_EJC55SDD = require("./chunk-EJC55SDD.cjs");
|
|
27
27
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
28
28
|
var import_types = require("@dxos/plugin-markdown/types");
|
|
29
29
|
var ScriptType = class extends (0, import_echo_schema.TypedObject)({
|
|
@@ -54,7 +54,7 @@ var FunctionType = class extends (0, import_echo_schema.TypedObject)({
|
|
|
54
54
|
};
|
|
55
55
|
var ScriptAction;
|
|
56
56
|
(function(ScriptAction2) {
|
|
57
|
-
ScriptAction2[ScriptAction2["CREATE"] = `${
|
|
57
|
+
ScriptAction2[ScriptAction2["CREATE"] = `${import_chunk_EJC55SDD.SCRIPT_PLUGIN}/create`] = "CREATE";
|
|
58
58
|
})(ScriptAction || (ScriptAction = {}));
|
|
59
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
60
|
0 && (module.exports = {
|
|
@@ -62,4 +62,4 @@ var ScriptAction;
|
|
|
62
62
|
ScriptAction,
|
|
63
63
|
ScriptType
|
|
64
64
|
});
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-25PQE7FL.cjs.map
|
|
@@ -16,15 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_EJC55SDD_exports = {};
|
|
20
|
+
__export(chunk_EJC55SDD_exports, {
|
|
21
21
|
SCRIPT_PLUGIN: () => SCRIPT_PLUGIN,
|
|
22
22
|
meta_default: () => meta_default
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
25
|
-
var import_app_framework = require("@dxos/app-framework");
|
|
24
|
+
module.exports = __toCommonJS(chunk_EJC55SDD_exports);
|
|
26
25
|
var SCRIPT_PLUGIN = "dxos.org/plugin/script";
|
|
27
|
-
var meta_default =
|
|
26
|
+
var meta_default = {
|
|
28
27
|
id: SCRIPT_PLUGIN,
|
|
29
28
|
name: "Scripts",
|
|
30
29
|
description: "Distributed functions.",
|
|
@@ -32,10 +31,10 @@ var meta_default = (0, import_app_framework.pluginMeta)({
|
|
|
32
31
|
"experimental"
|
|
33
32
|
],
|
|
34
33
|
icon: "ph--code--regular"
|
|
35
|
-
}
|
|
34
|
+
};
|
|
36
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
36
|
0 && (module.exports = {
|
|
38
37
|
SCRIPT_PLUGIN,
|
|
39
38
|
meta_default
|
|
40
39
|
});
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-EJC55SDD.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SCRIPT_PLUGIN = 'dxos.org/plugin/script';\n\nexport default {\n id: SCRIPT_PLUGIN,\n name: 'Scripts',\n description: 'Distributed functions.',\n tags: ['experimental'],\n icon: 'ph--code--regular',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;IAAC;;EACPC,MAAM;AACR;",
|
|
6
|
+
"names": ["SCRIPT_PLUGIN", "id", "name", "description", "tags", "icon"]
|
|
7
|
+
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -30,22 +30,21 @@ var node_exports = {};
|
|
|
30
30
|
__export(node_exports, {
|
|
31
31
|
Bundler: () => import_chunk_ACLCRWDB.Bundler,
|
|
32
32
|
Compiler: () => Compiler,
|
|
33
|
-
FunctionType: () =>
|
|
34
|
-
ScriptAction: () =>
|
|
33
|
+
FunctionType: () => import_chunk_25PQE7FL.FunctionType,
|
|
34
|
+
ScriptAction: () => import_chunk_25PQE7FL.ScriptAction,
|
|
35
35
|
ScriptContainer: () => ScriptContainer,
|
|
36
36
|
ScriptPlugin: () => ScriptPlugin,
|
|
37
37
|
ScriptSettings: () => ScriptSettings,
|
|
38
|
-
ScriptType: () =>
|
|
38
|
+
ScriptType: () => import_chunk_25PQE7FL.ScriptType,
|
|
39
39
|
default: () => src_default,
|
|
40
40
|
initializeBundler: () => import_chunk_ACLCRWDB.initializeBundler
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(node_exports);
|
|
43
43
|
var import_chunk_ACLCRWDB = require("./chunk-ACLCRWDB.cjs");
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var import_react = require("@phosphor-icons/react");
|
|
44
|
+
var import_chunk_25PQE7FL = require("./chunk-25PQE7FL.cjs");
|
|
45
|
+
var import_chunk_EJC55SDD = require("./chunk-EJC55SDD.cjs");
|
|
47
46
|
var import_esbuild = __toESM(require("esbuild-wasm/esbuild.wasm?url"));
|
|
48
|
-
var
|
|
47
|
+
var import_react = __toESM(require("react"));
|
|
49
48
|
var import_app_framework = require("@dxos/app-framework");
|
|
50
49
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
51
50
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
@@ -56,8 +55,8 @@ var import_echo = require("@dxos/react-client/echo");
|
|
|
56
55
|
var import_vfs = require("@typescript/vfs");
|
|
57
56
|
var import_typescript = __toESM(require("typescript"));
|
|
58
57
|
var import_invariant = require("@dxos/invariant");
|
|
58
|
+
var import_react2 = __toESM(require("react"));
|
|
59
59
|
var import_react3 = __toESM(require("react"));
|
|
60
|
-
var import_react4 = __toESM(require("react"));
|
|
61
60
|
var import_plugin_settings = require("@dxos/plugin-settings");
|
|
62
61
|
var import_react_client = require("@dxos/react-client");
|
|
63
62
|
var import_react_ui = require("@dxos/react-ui");
|
|
@@ -110,7 +109,7 @@ var Compiler = class {
|
|
|
110
109
|
}
|
|
111
110
|
};
|
|
112
111
|
var ScriptSettings = ({ settings }) => {
|
|
113
|
-
const { t } = (0, import_react_ui.useTranslation)(
|
|
112
|
+
const { t } = (0, import_react_ui.useTranslation)(import_chunk_EJC55SDD.SCRIPT_PLUGIN);
|
|
114
113
|
const client = (0, import_react_client.useClient)();
|
|
115
114
|
const handleAuthenticate = async () => {
|
|
116
115
|
const { identityKey } = client.halo.identity.get();
|
|
@@ -133,17 +132,17 @@ var ScriptSettings = ({ settings }) => {
|
|
|
133
132
|
}
|
|
134
133
|
]);
|
|
135
134
|
};
|
|
136
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(import_plugin_settings.SettingsValue, {
|
|
137
136
|
label: t("authenticate action label")
|
|
138
|
-
}, /* @__PURE__ */
|
|
137
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Button, {
|
|
139
138
|
onClick: handleAuthenticate
|
|
140
139
|
}, t("authenticate button label"))));
|
|
141
140
|
};
|
|
142
|
-
var ScriptContainer =
|
|
141
|
+
var ScriptContainer = import_react2.default.lazy(() => import("./ScriptContainer-KMIPKT3H.cjs"));
|
|
143
142
|
var translations_default = [
|
|
144
143
|
{
|
|
145
144
|
"en-US": {
|
|
146
|
-
[
|
|
145
|
+
[import_chunk_EJC55SDD.SCRIPT_PLUGIN]: {
|
|
147
146
|
"plugin name": "Scripts",
|
|
148
147
|
"object title placeholder": "New script",
|
|
149
148
|
"create object label": "Create script",
|
|
@@ -165,7 +164,7 @@ var translations_default = [
|
|
|
165
164
|
var ScriptPlugin = () => {
|
|
166
165
|
const compiler = new Compiler();
|
|
167
166
|
return {
|
|
168
|
-
meta:
|
|
167
|
+
meta: import_chunk_EJC55SDD.meta_default,
|
|
169
168
|
initialize: async () => {
|
|
170
169
|
await compiler.initialize();
|
|
171
170
|
compiler.setFile("/src/typings.d.ts", "declare module 'https://*';");
|
|
@@ -182,14 +181,14 @@ var ScriptPlugin = () => {
|
|
|
182
181
|
settings: {},
|
|
183
182
|
metadata: {
|
|
184
183
|
records: {
|
|
185
|
-
[
|
|
184
|
+
[import_chunk_25PQE7FL.ScriptType.typename]: {
|
|
186
185
|
placeholder: [
|
|
187
186
|
"object title placeholder",
|
|
188
187
|
{
|
|
189
|
-
ns:
|
|
188
|
+
ns: import_chunk_EJC55SDD.SCRIPT_PLUGIN
|
|
190
189
|
}
|
|
191
190
|
],
|
|
192
|
-
icon:
|
|
191
|
+
icon: "ph--code--regular",
|
|
193
192
|
// TODO(wittjosiah): Move out of metadata.
|
|
194
193
|
loadReferences: (script) => (0, import_echo.loadObjectReferences)(script, (script2) => [
|
|
195
194
|
script2.source
|
|
@@ -200,8 +199,8 @@ var ScriptPlugin = () => {
|
|
|
200
199
|
translations: translations_default,
|
|
201
200
|
echo: {
|
|
202
201
|
schema: [
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
import_chunk_25PQE7FL.ScriptType,
|
|
203
|
+
import_chunk_25PQE7FL.FunctionType
|
|
205
204
|
]
|
|
206
205
|
},
|
|
207
206
|
space: {
|
|
@@ -209,10 +208,10 @@ var ScriptPlugin = () => {
|
|
|
209
208
|
label: [
|
|
210
209
|
"create object label",
|
|
211
210
|
{
|
|
212
|
-
ns:
|
|
211
|
+
ns: import_chunk_EJC55SDD.SCRIPT_PLUGIN
|
|
213
212
|
}
|
|
214
213
|
],
|
|
215
|
-
action:
|
|
214
|
+
action: import_chunk_25PQE7FL.ScriptAction.CREATE
|
|
216
215
|
}
|
|
217
216
|
},
|
|
218
217
|
graph: {
|
|
@@ -223,7 +222,7 @@ var ScriptPlugin = () => {
|
|
|
223
222
|
return [];
|
|
224
223
|
}
|
|
225
224
|
return (0, import_plugin_graph.createExtension)({
|
|
226
|
-
id:
|
|
225
|
+
id: import_chunk_25PQE7FL.ScriptAction.CREATE,
|
|
227
226
|
filter: (node) => (0, import_plugin_graph.isActionGroup)(node) && node.id.startsWith(import_plugin_space.SpaceAction.ADD_OBJECT),
|
|
228
227
|
actions: ({ node }) => {
|
|
229
228
|
const id = node.id.split("/").at(-1);
|
|
@@ -236,12 +235,12 @@ var ScriptPlugin = () => {
|
|
|
236
235
|
}
|
|
237
236
|
return [
|
|
238
237
|
{
|
|
239
|
-
id: `${
|
|
238
|
+
id: `${import_chunk_EJC55SDD.SCRIPT_PLUGIN}/create/${node.id}`,
|
|
240
239
|
data: async () => {
|
|
241
240
|
await dispatch([
|
|
242
241
|
{
|
|
243
|
-
plugin:
|
|
244
|
-
action:
|
|
242
|
+
plugin: import_chunk_EJC55SDD.SCRIPT_PLUGIN,
|
|
243
|
+
action: import_chunk_25PQE7FL.ScriptAction.CREATE
|
|
245
244
|
},
|
|
246
245
|
{
|
|
247
246
|
action: import_plugin_space.SpaceAction.ADD_OBJECT,
|
|
@@ -258,7 +257,7 @@ var ScriptPlugin = () => {
|
|
|
258
257
|
label: [
|
|
259
258
|
"create object label",
|
|
260
259
|
{
|
|
261
|
-
ns:
|
|
260
|
+
ns: import_chunk_EJC55SDD.SCRIPT_PLUGIN
|
|
262
261
|
}
|
|
263
262
|
],
|
|
264
263
|
icon: "ph--code--regular",
|
|
@@ -274,13 +273,13 @@ var ScriptPlugin = () => {
|
|
|
274
273
|
component: ({ data, role }) => {
|
|
275
274
|
switch (role) {
|
|
276
275
|
case "settings": {
|
|
277
|
-
return data.plugin ===
|
|
276
|
+
return data.plugin === import_chunk_EJC55SDD.meta_default.id ? /* @__PURE__ */ import_react.default.createElement(ScriptSettings, {
|
|
278
277
|
settings: {}
|
|
279
278
|
}) : null;
|
|
280
279
|
}
|
|
281
280
|
case "article": {
|
|
282
|
-
if (data.object instanceof
|
|
283
|
-
return /* @__PURE__ */
|
|
281
|
+
if (data.object instanceof import_chunk_25PQE7FL.ScriptType) {
|
|
282
|
+
return /* @__PURE__ */ import_react.default.createElement(ScriptContainer, {
|
|
284
283
|
script: data.object,
|
|
285
284
|
env: compiler.environment
|
|
286
285
|
});
|
|
@@ -294,9 +293,9 @@ var ScriptPlugin = () => {
|
|
|
294
293
|
intent: {
|
|
295
294
|
resolver: (intent) => {
|
|
296
295
|
switch (intent.action) {
|
|
297
|
-
case
|
|
296
|
+
case import_chunk_25PQE7FL.ScriptAction.CREATE: {
|
|
298
297
|
return {
|
|
299
|
-
data: (0, import_echo_schema.create)(
|
|
298
|
+
data: (0, import_echo_schema.create)(import_chunk_25PQE7FL.ScriptType, {
|
|
300
299
|
source: (0, import_echo_schema.create)(import_types.TextType, {
|
|
301
300
|
content: import_chunk_ACLCRWDB.templates[0].source
|
|
302
301
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ScriptPlugin.tsx", "../../../src/compiler/compiler.ts", "../../../src/components/index.ts", "../../../src/components/ScriptSettings/ScriptSettings.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
6
|
-
"names": ["import_react", "defaultOptions", "lib", "target", "ts", "ScriptTarget", "ES2022", "Compiler", "constructor", "_options", "initialize", "_env", "_fsMap", "createDefaultMapFromCDN", "system", "createSystem", "createVirtualTypeScriptEnvironment", "environment", "invariant", "setFile", "fileName", "content", "createFile", "compile", "languageService", "getEmitOutput", "ScriptSettings", "settings", "t", "useTranslation", "SCRIPT_PLUGIN", "client", "useClient", "handleAuthenticate", "identityKey", "halo", "identity", "get", "writeCredentials", "issuer", "issuanceDate", "Date", "subject", "id", "assertion", "serverName", "serverKey", "capabilities", "React", "SettingsValue", "label", "Button", "onClick", "ScriptContainer", "lazy", "ScriptPlugin", "compiler", "meta", "initializeBundler", "wasmUrl", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "icon", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\n// @ts-ignore\nimport wasmUrl from 'esbuild-wasm/esbuild.wasm?url';\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 { initializeBundler } from './bundler';\nimport { Compiler } from './compiler';\nimport { ScriptContainer, ScriptSettings } from './components';\nimport meta, { SCRIPT_PLUGIN } from './meta';\nimport { templates } from './templates';\nimport translations from './translations';\nimport { FunctionType, ScriptType } from './types';\nimport { ScriptAction, type ScriptPluginProvides } from './types';\n\nexport const ScriptPlugin = (): PluginDefinition<ScriptPluginProvides> => {\n const compiler = new Compiler();\n\n return {\n meta,\n initialize: async () => {\n await compiler.initialize();\n // TODO(wittjosiah): Fetch types for https modules.\n compiler.setFile('/src/typings.d.ts', \"declare module 'https://*';\");\n // TODO(wittjosiah): Proper function handler types.\n // TODO(wittjosiah): Remove.\n compiler.setFile(\n '/src/runtime.ts',\n `\n export const Filter: any = {};\n export type FunctionHandler = ({ event, context }: { event: any; context: any }) => Promise<Response>;\n export const functionHandler = (handler: FunctionHandler) => handler;\n `,\n );\n await initializeBundler({ wasmUrl });\n },\n provides: {\n settings: {},\n metadata: {\n records: {\n [ScriptType.typename]: {\n placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],\n icon: '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 space: {\n onSpaceCreate: {\n label: ['create object label', { ns: SCRIPT_PLUGIN }],\n action: ScriptAction.CREATE,\n },\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: 'ph--code--regular',\n testId: 'scriptPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n case 'settings': {\n return data.plugin === meta.id ? <ScriptSettings settings={{}} /> : null;\n }\n\n case 'article': {\n if (data.object instanceof ScriptType) {\n return <ScriptContainer script={data.object} env={compiler.environment} />;\n }\n break;\n }\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: templates[0].source }) }) };\n }\n }\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n createDefaultMapFromCDN,\n createSystem,\n createVirtualTypeScriptEnvironment,\n type VirtualTypeScriptEnvironment,\n} from '@typescript/vfs';\nimport ts from 'typescript';\n\nimport { invariant } from '@dxos/invariant';\n\nconst defaultOptions: ts.CompilerOptions = {\n lib: ['DOM', 'es2022'],\n target: ts.ScriptTarget.ES2022,\n};\n\nexport class Compiler {\n private _env: VirtualTypeScriptEnvironment | undefined;\n private _fsMap: Map<string, string> | undefined;\n\n constructor(private readonly _options: ts.CompilerOptions = defaultOptions) {}\n\n async initialize() {\n if (this._env) {\n return;\n }\n\n // TODO(wittjosiah): Figure out how to get workers working in plugin packages.\n // https://github.com/val-town/codemirror-ts?tab=readme-ov-file#setup-worker\n this._fsMap = await createDefaultMapFromCDN(this._options, '5.5.4', true, ts);\n const system = createSystem(this._fsMap);\n this._env = createVirtualTypeScriptEnvironment(system, [], ts, this._options);\n }\n\n get environment() {\n invariant(this._env, 'Compiler environment not initialized.');\n return this._env;\n }\n\n setFile(fileName: string, content: string) {\n invariant(this._fsMap, 'File system map not initialized.');\n this.environment.createFile(fileName, content);\n }\n\n compile(fileName: string) {\n return this.environment.languageService.getEmitOutput(fileName);\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport * from './ScriptSettings';\n\nexport const ScriptContainer = React.lazy(() => import('./ScriptContainer'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\nimport { useClient } from '@dxos/react-client';\nimport { Button, useTranslation } from '@dxos/react-ui';\n\nimport { SCRIPT_PLUGIN } from '../../meta';\nimport { type ScriptSettingsProps } from '../../types';\n\nexport const ScriptSettings = ({ settings }: { settings: ScriptSettingsProps }) => {\n const { t } = useTranslation(SCRIPT_PLUGIN);\n const client = useClient();\n\n // TODO(burdon): Check token.\n const handleAuthenticate = async () => {\n const { identityKey } = client.halo.identity.get()!;\n await client.halo.writeCredentials([\n {\n issuer: identityKey,\n issuanceDate: new Date(),\n subject: {\n id: identityKey,\n assertion: {\n '@type': 'dxos.halo.credentials.ServiceAccess',\n serverName: 'hub.dxos.network',\n serverKey: identityKey,\n identityKey,\n capabilities: ['composer:beta'],\n },\n },\n } satisfies Credential,\n ]);\n };\n\n return (\n <>\n <SettingsValue label={t('authenticate action label')}>\n <Button onClick={handleAuthenticate}>{t('authenticate button label')}</Button>\n </SettingsValue>\n </>\n );\n};\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 placeholder': 'Function name',\n 'function request placeholder': 'Function request',\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 'format label': 'Format',\n 'toggle details label': 'Toggle details panel',\n 'authenticate action label': 'Authenticate functions service',\n 'authenticate button label': 'Authenticate',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ScriptPlugin } from './ScriptPlugin';\n\nexport default ScriptPlugin;\n\nexport * from './bundler';\nexport * from './compiler';\nexport * from './components';\nexport * from './types';\n\nexport * from './ScriptPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,qBAAoB;AACpB,mBAAkB;AAElB,2BAA0F;AAC1F,yBAAuB;AACvB,2BAAkC;AAClC,0BAAiE;AACjE,mBAAyB;AACzB,0BAA4B;AAC5B,kBAAqC;ACVrC,iBAKO;AACP,wBAAe;AAEf,uBAA0B;ACR1B,IAAAA,gBAAkB;ACAlB,IAAAA,gBAAkB;AAElB,6BAA8B;AAE9B,0BAA0B;AAC1B,sBAAuC;;AFKvC,IAAMC,iBAAqC;EACzCC,KAAK;IAAC;IAAO;;EACbC,QAAQC,kBAAAA,QAAGC,aAAaC;AAC1B;AAEO,IAAMC,WAAN,MAAMA;EAIXC,YAA6BC,WAA+BR,gBAAgB;SAA/CQ,WAAAA;EAAgD;EAE7E,MAAMC,aAAa;AACjB,QAAI,KAAKC,MAAM;AACb;IACF;AAIA,SAAKC,SAAS,UAAMC,oCAAwB,KAAKJ,UAAU,SAAS,MAAML,kBAAAA,OAAAA;AAC1E,UAAMU,aAASC,yBAAa,KAA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iBAAO;QACT;MACF;MACAuE,QAAQ;QACN4B,UAAU,CAAC5B,WAAAA;AACT,kBAAQA,OAAOV,QAAM;YACnB,KAAKC,mCAAaC,QAAQ;AACxB,qBAAO;gBAAE0B,UAAMW,2BAAOtD,kCAAY;kBAAEQ,YAAQ8C,2BAAOC,uBAAU;oBAAEjG,SAASkG,gCAAU,CAAA,EAAGhD;kBAAO,CAAA;gBAAG,CAAA;cAAG;YACpG;UACF;QACF;MACF;IACF;EACF;AACF;AKrIA,IAAA,cAAehB;",
|
|
6
|
+
"names": ["import_react", "defaultOptions", "lib", "target", "ts", "ScriptTarget", "ES2022", "Compiler", "constructor", "_options", "initialize", "_env", "_fsMap", "createDefaultMapFromCDN", "system", "createSystem", "createVirtualTypeScriptEnvironment", "environment", "invariant", "setFile", "fileName", "content", "createFile", "compile", "languageService", "getEmitOutput", "ScriptSettings", "settings", "t", "useTranslation", "SCRIPT_PLUGIN", "client", "useClient", "handleAuthenticate", "identityKey", "halo", "identity", "get", "writeCredentials", "issuer", "issuanceDate", "Date", "subject", "id", "assertion", "serverName", "serverKey", "capabilities", "React", "SettingsValue", "label", "Button", "onClick", "ScriptContainer", "lazy", "ScriptPlugin", "compiler", "meta", "initializeBundler", "wasmUrl", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "icon", "loadReferences", "script", "loadObjectReferences", "source", "translations", "echo", "schema", "FunctionType", "space", "onSpaceCreate", "action", "ScriptAction", "CREATE", "graph", "builder", "plugins", "resolvePlugin", "parseClientPlugin", "dispatch", "parseIntentPlugin", "intent", "createExtension", "filter", "node", "isActionGroup", "startsWith", "SpaceAction", "ADD_OBJECT", "actions", "split", "at", "spaceId", "objectId", "spaces", "find", "object", "db", "getObjectById", "data", "plugin", "NavigationAction", "OPEN", "properties", "testId", "surface", "component", "role", "env", "resolver", "create", "TextType", "templates"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.cjs
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var meta_exports = {};
|
|
20
20
|
__export(meta_exports, {
|
|
21
|
-
SCRIPT_PLUGIN: () =>
|
|
22
|
-
default: () =>
|
|
21
|
+
SCRIPT_PLUGIN: () => import_chunk_EJC55SDD.SCRIPT_PLUGIN,
|
|
22
|
+
default: () => import_chunk_EJC55SDD.meta_default
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(meta_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_EJC55SDD = require("./chunk-EJC55SDD.cjs");
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
28
|
SCRIPT_PLUGIN
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["meta.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n SCRIPT_PLUGIN,\n meta_default\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n SCRIPT_PLUGIN,\n meta_default\n} from \"./chunk-EJC55SDD.cjs\";\nexport {\n SCRIPT_PLUGIN,\n meta_default as default\n};\n//# sourceMappingURL=meta.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|