@dxos/plugin-script 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.0
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/PLUGIN.mdl +93 -17
- package/README.md +1 -1
- package/dist/lib/Notebook.mjs +4 -5
- package/dist/lib/Notebook.mjs.map +1 -1
- package/dist/lib/ScriptCapabilities.mjs.map +1 -1
- package/dist/lib/ScriptOperation.mjs +1 -1
- package/dist/lib/ScriptOperation.mjs.map +1 -1
- package/dist/lib/ScriptOperationHandlerSet.mjs.map +1 -1
- package/dist/lib/ScriptSkill.mjs +1 -1
- package/dist/lib/ScriptSkill.mjs.map +1 -1
- package/dist/lib/capabilities.browser.mjs +51 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +17 -7
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs +16 -4
- package/dist/lib/capabilities.node.mjs.map +1 -1
- package/dist/lib/capabilities.tauri.mjs +51 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +1 -1
- package/dist/lib/capabilities.workerd.mjs.map +1 -1
- package/dist/lib/chunk-DeploymentDialog.mjs +12 -9
- package/dist/lib/chunk-DeploymentDialog.mjs.map +1 -1
- package/dist/lib/chunk-NotebookArticle.mjs +37 -36
- package/dist/lib/chunk-NotebookArticle.mjs.map +1 -1
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-ScriptArticle.mjs +14 -15
- package/dist/lib/chunk-ScriptArticle.mjs.map +1 -1
- package/dist/lib/chunk-ScriptProperties.mjs +91 -94
- package/dist/lib/chunk-ScriptProperties.mjs.map +1 -1
- package/dist/lib/chunk-ScriptSettings.mjs +11 -8
- package/dist/lib/chunk-ScriptSettings.mjs.map +1 -1
- package/dist/lib/chunk-TestContainer.mjs +5 -5
- package/dist/lib/chunk-TestContainer.mjs.map +1 -1
- package/dist/lib/chunk-app-graph-builder.mjs +2 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-compiler.mjs +87 -4
- package/dist/lib/chunk-compiler.mjs.map +1 -1
- package/dist/lib/chunk-create-object.mjs +1 -1
- package/dist/lib/chunk-create-script.mjs.map +1 -1
- package/dist/lib/chunk-create.mjs +4 -4
- package/dist/lib/chunk-create.mjs.map +1 -1
- package/dist/lib/chunk-definitions.mjs +246 -0
- package/dist/lib/chunk-definitions.mjs.map +1 -0
- package/dist/lib/chunk-delete.mjs +2 -2
- package/dist/lib/chunk-delete.mjs.map +1 -1
- package/dist/lib/chunk-deploy.mjs +16 -12
- package/dist/lib/chunk-deploy.mjs.map +1 -1
- package/dist/lib/chunk-errors.mjs +8 -0
- package/dist/lib/chunk-errors.mjs.map +1 -0
- package/dist/lib/chunk-functions.mjs +66 -246
- package/dist/lib/chunk-functions.mjs.map +1 -1
- package/dist/lib/chunk-inspect-invocations.mjs +3 -3
- package/dist/lib/chunk-inspect-invocations.mjs.map +1 -1
- package/dist/lib/chunk-install-function.mjs +11 -11
- package/dist/lib/chunk-install-function.mjs.map +1 -1
- package/dist/lib/chunk-invoke.mjs +6 -6
- package/dist/lib/chunk-invoke.mjs.map +1 -1
- package/dist/lib/chunk-operation-handler.mjs +16 -2
- package/dist/lib/chunk-operation-handler.mjs.map +1 -1
- package/dist/lib/chunk-query-deployed-functions.mjs +5 -6
- package/dist/lib/chunk-query-deployed-functions.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +14 -10
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-read.mjs +4 -3
- package/dist/lib/chunk-read.mjs.map +1 -1
- package/dist/lib/chunk-settings.mjs +2 -2
- package/dist/lib/chunk-settings.mjs.map +1 -1
- package/dist/lib/chunk-skill-definition.mjs +1 -1
- package/dist/lib/chunk-templates.mjs +3 -3
- package/dist/lib/chunk-update.mjs +4 -3
- package/dist/lib/chunk-update.mjs.map +1 -1
- package/dist/lib/components.mjs +114 -123
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/hooks.mjs +96 -16
- package/dist/lib/hooks.mjs.map +1 -1
- package/dist/lib/index.mjs +5 -3
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/ns/ScriptFunction.mjs +12 -0
- package/dist/lib/ns/ScriptFunction.mjs.map +1 -0
- package/dist/lib/ns/Templates.mjs +11 -0
- package/dist/lib/ns/Templates.mjs.map +1 -0
- package/dist/lib/testing.mjs +1 -1
- package/dist/lib/translations.mjs +2 -1
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/ScriptFunction.d.ts +2 -0
- package/dist/types/src/ScriptFunction.d.ts.map +1 -0
- package/dist/types/src/Templates.d.ts +2 -0
- package/dist/types/src/Templates.d.ts.map +1 -0
- package/dist/types/src/capabilities/ScriptSurfaces.d.ts.map +1 -1
- package/dist/types/src/capabilities/compiler.d.ts +2 -1
- package/dist/types/src/capabilities/compiler.d.ts.map +1 -1
- package/dist/types/src/capabilities/errors.d.ts +33 -0
- package/dist/types/src/capabilities/errors.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/browser.d.ts +12 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/tauri.d.ts +12 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/compiler/index.d.ts +1 -1
- package/dist/types/src/compiler/index.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts +3 -3
- package/dist/types/src/components/NotebookStack/NotebookCell.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookMenu.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts +4 -4
- package/dist/types/src/components/NotebookStack/NotebookStack.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts +10 -0
- package/dist/types/src/components/NotebookStack/NotebookStack.stories.d.ts.map +1 -1
- package/dist/types/src/components/NotebookStack/index.d.ts +2 -2
- package/dist/types/src/components/NotebookStack/index.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +2 -2
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts +10 -0
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/index.d.ts +1 -1
- package/dist/types/src/components/ScriptToolbar/index.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/TestPanel.d.ts +2 -2
- package/dist/types/src/components/TestPanel/TestPanel.d.ts.map +1 -1
- package/dist/types/src/components/TestPanel/index.d.ts +1 -1
- package/dist/types/src/components/TestPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts +2 -2
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts +1 -1
- package/dist/types/src/components/TypescriptEditor/TypescriptEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TypescriptEditor/index.d.ts +1 -1
- package/dist/types/src/components/TypescriptEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts +10 -0
- package/dist/types/src/containers/DeploymentDialog/DeploymentDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeploymentDialog/index.d.ts +1 -1
- package/dist/types/src/containers/DeploymentDialog/index.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts +1 -1
- package/dist/types/src/containers/NotebookArticle/NotebookArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/NotebookArticle/index.d.ts +1 -1
- package/dist/types/src/containers/NotebookArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts +10 -0
- package/dist/types/src/containers/ScriptArticle/ScriptArticle.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptArticle/index.d.ts +1 -1
- package/dist/types/src/containers/ScriptArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/FunctionBinding.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/FunctionPublishing.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts +10 -0
- package/dist/types/src/containers/ScriptProperties/ScriptProperties.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/SkillEditor.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptProperties/index.d.ts +1 -1
- package/dist/types/src/containers/ScriptProperties/index.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts +2 -2
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts +11 -1
- package/dist/types/src/containers/ScriptSettings/ScriptSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ScriptSettings/index.d.ts +1 -1
- package/dist/types/src/containers/ScriptSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/TestContainer/index.d.ts +1 -1
- package/dist/types/src/containers/TestContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/hooks/deploy.d.ts +3 -3
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +6 -6
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts +1 -1
- package/dist/types/src/hooks/useCompiler.d.ts.map +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts +1 -1
- package/dist/types/src/hooks/useCreateAndDeployScriptTemplates.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarState.d.ts +2 -2
- package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +5 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/notebook/compute-graph.d.ts +3 -3
- package/dist/types/src/notebook/compute-graph.d.ts.map +1 -1
- package/dist/types/src/notebook/index.d.ts +1 -1
- package/dist/types/src/notebook/index.d.ts.map +1 -1
- package/dist/types/src/operations/ScriptOperationHandlerSet.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/skills/ScriptSkill.d.ts.map +1 -1
- package/dist/types/src/skills/functions/definitions.d.ts +8 -6
- package/dist/types/src/skills/functions/definitions.d.ts.map +1 -1
- package/dist/types/src/skills/functions/deploy.d.ts +4 -2
- package/dist/types/src/skills/functions/deploy.d.ts.map +1 -1
- package/dist/types/src/skills/functions/errors.d.ts +33 -0
- package/dist/types/src/skills/functions/errors.d.ts.map +1 -0
- package/dist/types/src/skills/functions/index.d.ts +1 -1
- package/dist/types/src/skills/functions/index.d.ts.map +1 -1
- package/dist/types/src/skills/functions/install-function.d.ts +3 -2
- package/dist/types/src/skills/functions/install-function.d.ts.map +1 -1
- package/dist/types/src/skills/functions/invoke.d.ts +2 -2
- package/dist/types/src/skills/functions/invoke.d.ts.map +1 -1
- package/dist/types/src/skills/functions/query-deployed-functions.d.ts +2 -2
- package/dist/types/src/skills/functions/query-deployed-functions.d.ts.map +1 -1
- package/dist/types/src/skills/index.d.ts +1 -1
- package/dist/types/src/skills/index.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -2
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +10 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Notebook.d.ts.map +1 -1
- package/dist/types/src/types/ScriptCapabilities.d.ts +3 -3
- package/dist/types/src/types/ScriptCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +5 -5
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts +6 -3
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/dist/types/src/util/functions.d.ts +1 -1
- package/dist/types/src/util/functions.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -96
- package/src/ScriptFunction.ts +7 -0
- package/src/Templates.ts +7 -0
- package/src/capabilities/ScriptSurfaces.tsx +19 -10
- package/src/capabilities/app-graph-builder.ts +2 -0
- package/src/capabilities/compiler.ts +6 -5
- package/src/capabilities/errors.ts +8 -0
- package/src/capabilities/gen/browser.ts +62 -0
- package/src/capabilities/gen/node.ts +10 -10
- package/src/capabilities/gen/tauri.ts +62 -0
- package/src/capabilities/gen/workerd.ts +4 -4
- package/src/capabilities/index.ts +11 -11
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.ts +4 -4
- package/src/capabilities/settings.ts +2 -2
- package/src/compiler/compiler.browser.test.ts +1 -1
- package/src/compiler/index.ts +1 -1
- package/src/components/NotebookStack/NotebookCell.tsx +35 -29
- package/src/components/NotebookStack/NotebookMenu.tsx +27 -26
- package/src/components/NotebookStack/NotebookStack.stories.tsx +3 -3
- package/src/components/NotebookStack/NotebookStack.tsx +20 -17
- package/src/components/NotebookStack/index.ts +2 -2
- package/src/components/ScriptToolbar/ScriptToolbar.stories.tsx +5 -5
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +14 -15
- package/src/components/ScriptToolbar/index.ts +1 -1
- package/src/components/TestPanel/TestPanel.tsx +29 -23
- package/src/components/TestPanel/index.ts +1 -1
- package/src/components/TypescriptEditor/TypescriptEditor.stories.tsx +10 -8
- package/src/components/TypescriptEditor/TypescriptEditor.tsx +11 -7
- package/src/components/TypescriptEditor/index.ts +1 -1
- package/src/components/index.ts +4 -5
- package/src/containers/DeploymentDialog/DeploymentDialog.stories.tsx +5 -7
- package/src/containers/DeploymentDialog/DeploymentDialog.tsx +18 -15
- package/src/containers/DeploymentDialog/index.ts +1 -1
- package/src/containers/NotebookArticle/NotebookArticle.stories.tsx +6 -6
- package/src/containers/NotebookArticle/NotebookArticle.tsx +25 -21
- package/src/containers/NotebookArticle/index.ts +1 -1
- package/src/containers/ScriptArticle/ScriptArticle.stories.tsx +3 -3
- package/src/containers/ScriptArticle/ScriptArticle.tsx +13 -11
- package/src/containers/ScriptArticle/index.ts +1 -1
- package/src/containers/ScriptProperties/FunctionBinding.tsx +18 -18
- package/src/containers/ScriptProperties/FunctionPublishing.tsx +22 -22
- package/src/containers/ScriptProperties/ScriptProperties.stories.tsx +3 -3
- package/src/containers/ScriptProperties/ScriptProperties.tsx +10 -10
- package/src/containers/ScriptProperties/SkillEditor.tsx +16 -14
- package/src/containers/ScriptProperties/index.ts +1 -1
- package/src/containers/ScriptSettings/ScriptSettings.stories.tsx +1 -1
- package/src/containers/ScriptSettings/ScriptSettings.tsx +16 -11
- package/src/containers/ScriptSettings/index.ts +1 -1
- package/src/containers/TestContainer/TestContainer.tsx +4 -4
- package/src/containers/TestContainer/index.ts +1 -1
- package/src/containers/index.ts +6 -6
- package/src/e2e/ai.test.ts +1 -1
- package/src/hooks/deploy.ts +12 -5
- package/src/hooks/index.ts +6 -6
- package/src/hooks/template.ts +1 -1
- package/src/hooks/useCompiler.ts +8 -7
- package/src/hooks/useCreateAndDeployScriptTemplates.ts +10 -5
- package/src/hooks/useToolbarState.ts +4 -4
- package/src/index.ts +5 -3
- package/src/meta.ts +1 -1
- package/src/notebook/compute-graph.test.ts +2 -2
- package/src/notebook/compute-graph.ts +4 -4
- package/src/notebook/index.ts +1 -1
- package/src/notebook/vfs-parser.test.ts +1 -1
- package/src/notebook/vfs-parser.ts +1 -1
- package/src/operations/ScriptOperationHandlerSet.ts +3 -1
- package/src/operations/create-script.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/plugin.test.ts +2 -2
- package/src/skills/ScriptSkill.ts +3 -1
- package/src/skills/functions/create.ts +4 -4
- package/src/skills/functions/definitions.ts +8 -6
- package/src/skills/functions/delete.ts +1 -1
- package/src/skills/functions/deploy.ts +13 -9
- package/src/skills/functions/errors.ts +8 -0
- package/src/skills/functions/index.ts +11 -11
- package/src/skills/functions/inspect-invocations.ts +1 -1
- package/src/skills/functions/install-function.ts +11 -14
- package/src/skills/functions/invoke.ts +5 -5
- package/src/skills/functions/query-deployed-functions.ts +3 -4
- package/src/skills/functions/read.ts +3 -2
- package/src/skills/functions/update.ts +3 -2
- package/src/skills/index.ts +1 -1
- package/src/templates/anthropic.ts +2 -2
- package/src/templates/commentary.ts +1 -1
- package/src/templates/forex-effect.ts +7 -4
- package/src/testing/index.ts +2 -2
- package/src/translations.ts +4 -2
- package/src/types/Notebook.ts +6 -4
- package/src/types/ScriptCapabilities.ts +3 -3
- package/src/types/ScriptOperation.ts +1 -1
- package/src/types/index.ts +5 -5
- package/src/util/deploy.ts +10 -7
- package/src/util/functions.ts +24 -15
- package/src/util/index.ts +2 -2
- package/dist/lib/chunk-compiler2.mjs +0 -76
- package/dist/lib/chunk-compiler2.mjs.map +0 -1
- package/dist/lib/chunk-util.mjs +0 -146
- package/dist/lib/chunk-util.mjs.map +0 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +0 -5
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +0 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +0 -14
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/QueryEditor/index.d.ts +0 -2
- package/dist/types/src/components/QueryEditor/index.d.ts.map +0 -1
- package/src/components/QueryEditor/QueryEditor.stories.tsx +0 -91
- package/src/components/QueryEditor/QueryEditor.tsx +0 -50
- package/src/components/QueryEditor/index.ts +0 -5
|
@@ -11,7 +11,7 @@ import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
|
11
11
|
import { translations } from '#translations';
|
|
12
12
|
import { ScriptCapabilities, ScriptEvents } from '#types';
|
|
13
13
|
|
|
14
|
-
export const Schema = AppCapability.schema(() => import('../schema'));
|
|
14
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
15
15
|
|
|
16
16
|
export const Compiler = Capability.lazyModule(
|
|
17
17
|
'Compiler',
|
|
@@ -20,14 +20,14 @@ export const Compiler = Capability.lazyModule(
|
|
|
20
20
|
// Genuine runtime event: the compiler is only loaded on demand (`hooks/useCompiler.ts`), not at startup.
|
|
21
21
|
activatesOn: ScriptEvents.SetupCompiler,
|
|
22
22
|
},
|
|
23
|
-
() => import('../compiler'),
|
|
23
|
+
() => import('../compiler.ts'),
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
-
export const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler'), {
|
|
26
|
+
export const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {
|
|
27
27
|
activatesOn: ActivationEvents.Idle,
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
export const ScriptSettings = AppCapability.settings(() => import('../settings'), {
|
|
30
|
+
export const ScriptSettings = AppCapability.settings(() => import('../settings.ts'), {
|
|
31
31
|
activatesOn: ActivationEvents.Idle,
|
|
32
32
|
provides: [ScriptCapabilities.Settings],
|
|
33
33
|
});
|
|
@@ -14,15 +14,15 @@ import { ScriptCapabilities, ScriptEvents } from '#types';
|
|
|
14
14
|
// eslint-disable-next-line import/no-relative-packages
|
|
15
15
|
import pluginSpec from '../../PLUGIN.mdl?raw';
|
|
16
16
|
|
|
17
|
-
export const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'), {
|
|
18
|
-
environments: ['node'],
|
|
17
|
+
export const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder.ts'), {
|
|
18
|
+
environments: ['browser', 'node', 'tauri'],
|
|
19
19
|
});
|
|
20
|
-
export const Schema = AppCapability.schema(() => import('./schema'));
|
|
21
|
-
export const SkillDefinition = AppCapability.skillDefinition(() => import('./skill-definition'), {
|
|
22
|
-
environments: ['node'],
|
|
20
|
+
export const Schema = AppCapability.schema(() => import('./schema.ts'));
|
|
21
|
+
export const SkillDefinition = AppCapability.skillDefinition(() => import('./skill-definition.ts'), {
|
|
22
|
+
environments: ['browser', 'node', 'tauri'],
|
|
23
23
|
});
|
|
24
|
-
export const CreateObject = SpaceCapability.createObject(() => import('./create-object'), {
|
|
25
|
-
environments: ['node'],
|
|
24
|
+
export const CreateObject = SpaceCapability.createObject(() => import('./create-object.ts'), {
|
|
25
|
+
environments: ['browser', 'node', 'tauri'],
|
|
26
26
|
});
|
|
27
27
|
export const Compiler = Capability.lazyModule(
|
|
28
28
|
'Compiler',
|
|
@@ -31,15 +31,15 @@ export const Compiler = Capability.lazyModule(
|
|
|
31
31
|
// Genuine runtime event: the compiler is only loaded on demand (`hooks/useCompiler.ts`), not at startup.
|
|
32
32
|
activatesOn: ScriptEvents.SetupCompiler,
|
|
33
33
|
},
|
|
34
|
-
() => import('./compiler'),
|
|
34
|
+
() => import('./compiler.ts'),
|
|
35
35
|
);
|
|
36
|
-
export const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'), {
|
|
36
|
+
export const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler.ts'), {
|
|
37
37
|
activatesOn: ActivationEvents.Idle,
|
|
38
38
|
});
|
|
39
|
-
export const ReactSurface = AppCapability.surface(() => import('./react-surface'), {
|
|
39
|
+
export const ReactSurface = AppCapability.surface(() => import('./react-surface.ts'), {
|
|
40
40
|
roles: ['org.dxos.role.article', 'org.dxos.role.dialog', 'org.dxos.role.objectProperties', 'org.dxos.role.section'],
|
|
41
41
|
});
|
|
42
|
-
export const ScriptSettings = AppCapability.settings(() => import('./settings'), {
|
|
42
|
+
export const ScriptSettings = AppCapability.settings(() => import('./settings.ts'), {
|
|
43
43
|
activatesOn: ActivationEvents.Idle,
|
|
44
44
|
provides: [ScriptCapabilities.Settings],
|
|
45
45
|
});
|
|
@@ -10,7 +10,7 @@ import * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';
|
|
|
10
10
|
|
|
11
11
|
import { ScriptOperationHandlerSet } from '#operations';
|
|
12
12
|
|
|
13
|
-
import { ScriptHandlers } from '../skills/functions';
|
|
13
|
+
import { ScriptHandlers } from '../skills/functions/index.ts';
|
|
14
14
|
|
|
15
15
|
export default Capability.makeModule(
|
|
16
16
|
Effect.fnUntraced(function* () {
|
|
@@ -7,21 +7,21 @@ import { type ComponentProps } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
9
9
|
import * as Capability from '@dxos/app-framework/Capability';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import * as Surface from '@dxos/app-framework/Surface';
|
|
11
|
+
import * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
12
12
|
import * as Script from '@dxos/compute/Script';
|
|
13
13
|
|
|
14
14
|
import { DeploymentDialog, ScriptProperties, TestContainer } from '#containers';
|
|
15
15
|
import { meta } from '#meta';
|
|
16
16
|
import { Notebook } from '#types';
|
|
17
17
|
|
|
18
|
-
import { DEPLOYMENT_DIALOG } from '../constants';
|
|
18
|
+
import { DEPLOYMENT_DIALOG } from '../constants.ts';
|
|
19
19
|
import {
|
|
20
20
|
NotebookArticleSurface,
|
|
21
21
|
ScriptArticleSurface,
|
|
22
22
|
ScriptLogsSurface,
|
|
23
23
|
ScriptSettingsSurface,
|
|
24
|
-
} from './ScriptSurfaces';
|
|
24
|
+
} from './ScriptSurfaces.tsx';
|
|
25
25
|
|
|
26
26
|
export default Capability.makeModule(() =>
|
|
27
27
|
Effect.succeed(
|
|
@@ -6,14 +6,14 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import * as Capability from '@dxos/app-framework/Capability';
|
|
8
8
|
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
9
|
-
import
|
|
9
|
+
import * as KvsStore from '@dxos/effect/KvsStore';
|
|
10
10
|
|
|
11
11
|
import { meta } from '#meta';
|
|
12
12
|
import { ScriptCapabilities, Settings } from '#types';
|
|
13
13
|
|
|
14
14
|
export default Capability.makeModule(() =>
|
|
15
15
|
Effect.sync(() => {
|
|
16
|
-
const settingsAtom =
|
|
16
|
+
const settingsAtom = KvsStore.make({
|
|
17
17
|
key: meta.profile.key,
|
|
18
18
|
schema: Settings.Settings,
|
|
19
19
|
defaultValue: () => ({
|
package/src/compiler/index.ts
CHANGED
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import * as Surface from '@dxos/app-framework/Surface';
|
|
8
|
+
import * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
9
9
|
import { type Database, Obj } from '@dxos/echo';
|
|
10
10
|
import { Doc } from '@dxos/echo-doc';
|
|
11
|
+
import { useResolveRef } from '@dxos/echo-react';
|
|
11
12
|
import { invariant } from '@dxos/invariant';
|
|
12
|
-
import
|
|
13
|
-
import { useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
14
|
-
import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';
|
|
13
|
+
import * as TemplateEditor from '@dxos/plugin-routine/TemplateEditor';
|
|
15
14
|
import { Editor, type EditorViewProps } from '@dxos/react-ui-editor';
|
|
15
|
+
import { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-query';
|
|
16
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
16
17
|
import {
|
|
17
18
|
type BasicExtensionsOptions,
|
|
18
19
|
createBasicExtensions,
|
|
@@ -27,9 +28,9 @@ import { isNonNullable } from '@dxos/util';
|
|
|
27
28
|
import { meta } from '#meta';
|
|
28
29
|
import { Notebook } from '#types';
|
|
29
30
|
|
|
30
|
-
import { type ComputeGraph } from '../../notebook';
|
|
31
|
-
import { TypescriptEditor, type TypescriptEditorProps } from '../TypescriptEditor';
|
|
32
|
-
import { type NotebookMenuProps } from './NotebookMenu';
|
|
31
|
+
import { type ComputeGraph } from '../../notebook/index.ts';
|
|
32
|
+
import { TypescriptEditor, type TypescriptEditorProps } from '../TypescriptEditor/index.ts';
|
|
33
|
+
import { type NotebookMenuProps } from './NotebookMenu.tsx';
|
|
33
34
|
|
|
34
35
|
const editorStyles = 'p-2 ps-3';
|
|
35
36
|
const valueStyles = 'p-1 ps-3';
|
|
@@ -44,15 +45,15 @@ export type NotebookCellProps = {
|
|
|
44
45
|
|
|
45
46
|
// TODO(burdon): Show evaluation errors.
|
|
46
47
|
export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }: NotebookCellProps) => {
|
|
47
|
-
const { t } = useTranslation(meta.profile.key);
|
|
48
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
48
49
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
: [];
|
|
53
|
-
}, [cell.source?.target]);
|
|
50
|
+
const source = useResolveRef(cell.source);
|
|
51
|
+
const prompt = useResolveRef(cell.prompt);
|
|
52
|
+
const explorerGraph = useResolveRef(cell.graph);
|
|
54
53
|
|
|
55
|
-
const
|
|
54
|
+
const extensions = useMemo(() => {
|
|
55
|
+
return source ? [createDataExtensions({ id: cell.id, text: Doc.createAccessor(source, ['content']) })] : [];
|
|
56
|
+
}, [source]);
|
|
56
57
|
|
|
57
58
|
const handleQueryChange = useCallback<NonNullable<QueryEditorProps['onChange']>>(
|
|
58
59
|
(value: string) => {
|
|
@@ -66,7 +67,7 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
66
67
|
|
|
67
68
|
switch (cell.type) {
|
|
68
69
|
case 'markdown':
|
|
69
|
-
if (!
|
|
70
|
+
if (!source) {
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
72
73
|
|
|
@@ -74,23 +75,23 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
74
75
|
<NotebookTextEditor
|
|
75
76
|
id={cell.id}
|
|
76
77
|
classNames={editorStyles}
|
|
77
|
-
initialValue={
|
|
78
|
+
initialValue={source.content}
|
|
78
79
|
extensions={extensions}
|
|
79
80
|
/>
|
|
80
81
|
);
|
|
81
82
|
|
|
82
83
|
case 'script':
|
|
83
|
-
if (!
|
|
84
|
+
if (!source) {
|
|
84
85
|
return null;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
return (
|
|
88
|
-
<div className='flex flex-col divide-y divide-
|
|
89
|
+
<div className='flex flex-col divide-y divide-separator-subtle'>
|
|
89
90
|
<TypescriptEditor
|
|
90
91
|
id={cell.id}
|
|
91
92
|
role='section'
|
|
92
93
|
classNames={editorStyles}
|
|
93
|
-
initialValue={
|
|
94
|
+
initialValue={source.content}
|
|
94
95
|
extensions={extensions}
|
|
95
96
|
env={env}
|
|
96
97
|
options={{
|
|
@@ -104,7 +105,7 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
104
105
|
);
|
|
105
106
|
|
|
106
107
|
case 'query':
|
|
107
|
-
if (!
|
|
108
|
+
if (!source) {
|
|
108
109
|
return null;
|
|
109
110
|
}
|
|
110
111
|
|
|
@@ -115,7 +116,7 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
115
116
|
id={cell.id}
|
|
116
117
|
classNames={editorStyles}
|
|
117
118
|
db={db}
|
|
118
|
-
value={
|
|
119
|
+
value={source.content}
|
|
119
120
|
onChange={handleQueryChange}
|
|
120
121
|
/>
|
|
121
122
|
{explorerGraph && !dragging && (
|
|
@@ -130,13 +131,18 @@ export const NotebookCell = ({ db, graph, dragging, cell, promptResults, env }:
|
|
|
130
131
|
|
|
131
132
|
// TODO(burdon): Use streaming response from Chat.
|
|
132
133
|
case 'prompt':
|
|
133
|
-
if (!
|
|
134
|
+
if (!prompt) {
|
|
134
135
|
return null;
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
return (
|
|
138
139
|
<>
|
|
139
|
-
<TemplateEditor
|
|
140
|
+
<TemplateEditor.TemplateEditor
|
|
141
|
+
id={cell.id}
|
|
142
|
+
source={prompt.text}
|
|
143
|
+
lineNumbers={false}
|
|
144
|
+
classNames={editorStyles}
|
|
145
|
+
/>
|
|
140
146
|
<NotebookPromptResult cell={cell} promptResults={promptResults} />
|
|
141
147
|
</>
|
|
142
148
|
);
|
|
@@ -154,11 +160,11 @@ const NotebookCellValue = ({ cell, graph }: NotebookCellProps) => {
|
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
return (
|
|
157
|
-
<div className={mx('flex w-full bg-group-surface text-
|
|
163
|
+
<div className={mx('flex w-full bg-group-surface text-fg-muted font-mono', valueStyles)}>
|
|
158
164
|
{name && (
|
|
159
165
|
<>
|
|
160
166
|
<span className='text-success-text'>{name}</span>
|
|
161
|
-
<span className='text-
|
|
167
|
+
<span className='text-fg-muted'> = </span>
|
|
162
168
|
</>
|
|
163
169
|
)}
|
|
164
170
|
<span>{value}</span>
|
|
@@ -177,7 +183,7 @@ const NotebookPromptResult = ({ cell, promptResults }: NotebookCellProps) => {
|
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
return (
|
|
180
|
-
<div className={mx('flex w-full dx-group-surface text-
|
|
186
|
+
<div className={mx('flex w-full dx-group-surface text-fg-muted border-y border-separator-subtle', valueStyles)}>
|
|
181
187
|
<NotebookTextEditor readOnly value={value} />
|
|
182
188
|
</div>
|
|
183
189
|
);
|
|
@@ -189,8 +195,8 @@ const NotebookTextEditor = ({
|
|
|
189
195
|
readOnly,
|
|
190
196
|
...props
|
|
191
197
|
}: EditorViewProps & Pick<BasicExtensionsOptions, 'readOnly'>) => {
|
|
192
|
-
const { t } = useTranslation(meta.profile.key);
|
|
193
|
-
const
|
|
198
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
199
|
+
const themeMode = Hooks.useThemeMode();
|
|
194
200
|
const extensions = useMemo(() => {
|
|
195
201
|
return [
|
|
196
202
|
createThemeExtensions({ themeMode, syntaxHighlighting: true }),
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
8
|
+
import * as Menu from '@dxos/react-ui/Menu';
|
|
8
9
|
|
|
9
10
|
import { meta } from '#meta';
|
|
10
11
|
import { Notebook } from '#types';
|
|
@@ -17,31 +18,31 @@ export type NotebookMenuProps = {
|
|
|
17
18
|
|
|
18
19
|
// TODO(burdon): Better way to organize menu?
|
|
19
20
|
export const NotebookMenu = ({ cell, onCellInsert, onCellDelete }: NotebookMenuProps) => {
|
|
20
|
-
const { t } = useTranslation(meta.profile.key);
|
|
21
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
21
22
|
return (
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</
|
|
23
|
+
<Menu.Content>
|
|
24
|
+
<Menu.Item
|
|
25
|
+
onClick={() => onCellInsert?.('script', cell?.id)}
|
|
26
|
+
item={{ value: t('notebook-cell-insert-script.label'), label: t('notebook-cell-insert-script.label') }}
|
|
27
|
+
/>
|
|
28
|
+
<Menu.Item
|
|
29
|
+
onClick={() => onCellInsert?.('prompt', cell?.id)}
|
|
30
|
+
item={{ value: t('notebook-cell-insert-prompt.label'), label: t('notebook-cell-insert-prompt.label') }}
|
|
31
|
+
/>
|
|
32
|
+
<Menu.Item
|
|
33
|
+
onClick={() => onCellInsert?.('query', cell?.id)}
|
|
34
|
+
item={{ value: t('notebook-cell-insert-query.label'), label: t('notebook-cell-insert-query.label') }}
|
|
35
|
+
/>
|
|
36
|
+
<Menu.Item
|
|
37
|
+
onClick={() => onCellInsert?.('markdown', cell?.id)}
|
|
38
|
+
item={{ value: t('notebook-cell-insert-markdown.label'), label: t('notebook-cell-insert-markdown.label') }}
|
|
39
|
+
/>
|
|
40
|
+
{cell && onCellDelete && (
|
|
41
|
+
<Menu.Item
|
|
42
|
+
onClick={() => onCellDelete?.(cell.id)}
|
|
43
|
+
item={{ value: t('notebook-cell-delete.label'), label: t('notebook-cell-delete.label') }}
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
46
|
+
</Menu.Content>
|
|
46
47
|
);
|
|
47
48
|
};
|
|
@@ -10,14 +10,14 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
10
10
|
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
11
11
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
12
12
|
import { RoutinePlugin } from '@dxos/plugin-routine/testing';
|
|
13
|
-
import
|
|
13
|
+
import * as CorePlugins from '@dxos/plugin-testing/CorePlugins';
|
|
14
14
|
import { withMosaic } from '@dxos/react-ui-mosaic/testing';
|
|
15
15
|
import { withLayout } from '@dxos/react-ui/testing';
|
|
16
16
|
|
|
17
17
|
import { createNotebook } from '#testing';
|
|
18
18
|
import { translations } from '#translations';
|
|
19
19
|
|
|
20
|
-
import { NotebookStack } from './NotebookStack';
|
|
20
|
+
import { NotebookStack } from './NotebookStack.tsx';
|
|
21
21
|
|
|
22
22
|
const NotebookStackStory = () => {
|
|
23
23
|
const notebook = useMemo(() => createNotebook(), []);
|
|
@@ -32,7 +32,7 @@ const meta = {
|
|
|
32
32
|
withLayout({ layout: 'column', classNames: 'dx-document' }),
|
|
33
33
|
withPluginManager({
|
|
34
34
|
plugins: [
|
|
35
|
-
...
|
|
35
|
+
...CorePlugins.make(),
|
|
36
36
|
ClientPlugin.make({
|
|
37
37
|
onClientInitialized: ({ client }) =>
|
|
38
38
|
Effect.gen(function* () {
|
|
@@ -5,32 +5,35 @@
|
|
|
5
5
|
import React, { useCallback, useId, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Obj } from '@dxos/echo';
|
|
8
|
-
import { DropdownMenu, IconButton, ScrollArea, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { composable, composableProps } from '@dxos/react-ui';
|
|
10
8
|
import { type DndContainerHandler } from '@dxos/react-ui-dnd';
|
|
11
9
|
import { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
|
|
10
|
+
import * as Button from '@dxos/react-ui/Button';
|
|
11
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
12
|
+
import * as Menu from '@dxos/react-ui/Menu';
|
|
13
|
+
import * as ScrollArea from '@dxos/react-ui/ScrollArea';
|
|
14
|
+
import * as Util from '@dxos/react-ui/Util';
|
|
12
15
|
import { mx } from '@dxos/ui-theme';
|
|
13
16
|
import { arrayMove } from '@dxos/util';
|
|
14
17
|
|
|
15
18
|
import { meta } from '#meta';
|
|
16
19
|
import { Notebook } from '#types';
|
|
17
20
|
|
|
18
|
-
import { type TypescriptEditorProps } from '../TypescriptEditor';
|
|
19
|
-
import { NotebookCell, type NotebookCellProps } from './NotebookCell';
|
|
20
|
-
import { NotebookMenu } from './NotebookMenu';
|
|
21
|
+
import { type TypescriptEditorProps } from '../TypescriptEditor/index.ts';
|
|
22
|
+
import { NotebookCell, type NotebookCellProps } from './NotebookCell.tsx';
|
|
23
|
+
import { NotebookMenu } from './NotebookMenu.tsx';
|
|
21
24
|
|
|
22
25
|
const minSectionHeight = 'min-h-[16rem]';
|
|
23
26
|
|
|
24
27
|
const getCellId = (cell: Notebook.Cell) => cell.id;
|
|
25
28
|
|
|
26
|
-
export type NotebookStackProps = ThemedClassName<
|
|
29
|
+
export type NotebookStackProps = Util.ThemedClassName<
|
|
27
30
|
{
|
|
28
31
|
notebook?: Notebook.Notebook;
|
|
29
32
|
} & (Pick<NotebookSectionProps, 'db' | 'graph' | 'promptResults' | 'onCellInsert' | 'onCellDelete'> &
|
|
30
33
|
Pick<TypescriptEditorProps, 'env'>)
|
|
31
34
|
>;
|
|
32
35
|
|
|
33
|
-
export const NotebookStack = composable<HTMLDivElement, NotebookStackProps>(
|
|
36
|
+
export const NotebookStack = Util.composable<HTMLDivElement, NotebookStackProps>(
|
|
34
37
|
({ notebook, db, graph, promptResults, onCellInsert, onCellDelete, env, ...props }, forwardedRef) => {
|
|
35
38
|
const [viewport, setViewport] = useState<HTMLElement | null>(null);
|
|
36
39
|
|
|
@@ -96,7 +99,7 @@ export const NotebookStack = composable<HTMLDivElement, NotebookStackProps>(
|
|
|
96
99
|
eventHandler={eventHandler}
|
|
97
100
|
ref={forwardedRef}
|
|
98
101
|
>
|
|
99
|
-
<ScrollArea.Root orientation='vertical'
|
|
102
|
+
<ScrollArea.Root orientation='vertical' {...Util.composableProps(props)}>
|
|
100
103
|
<ScrollArea.Viewport ref={setViewport}>
|
|
101
104
|
<Mosaic.Stack orientation='vertical' items={notebook?.cells ?? []} getId={getCellId} Tile={Tile} />
|
|
102
105
|
</ScrollArea.Viewport>
|
|
@@ -121,7 +124,7 @@ const NotebookSection = ({
|
|
|
121
124
|
onCellDelete,
|
|
122
125
|
...tileProps
|
|
123
126
|
}: NotebookSectionProps) => {
|
|
124
|
-
const { t } = useTranslation(meta.profile.key);
|
|
127
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
125
128
|
const resizable = cell.type === 'query';
|
|
126
129
|
const [dragHandle, setDragHandle] = useState<HTMLButtonElement | null>(null);
|
|
127
130
|
|
|
@@ -131,30 +134,30 @@ const NotebookSection = ({
|
|
|
131
134
|
data={cell}
|
|
132
135
|
dragHandle={dragHandle}
|
|
133
136
|
classNames={mx(
|
|
134
|
-
'grid grid-cols-[min-content_1fr] overflow-visible border border-
|
|
137
|
+
'grid grid-cols-[min-content_1fr] overflow-visible border border-separator-subtle',
|
|
135
138
|
resizable && minSectionHeight,
|
|
136
139
|
)}
|
|
137
140
|
>
|
|
138
141
|
{/* Side rail */}
|
|
139
|
-
<div className='flex flex-col p-1 border-e border-
|
|
140
|
-
<
|
|
142
|
+
<div className='flex flex-col p-1 border-e border-separator-subtle dx-attention-surface'>
|
|
143
|
+
<Button.Root
|
|
141
144
|
ref={setDragHandle}
|
|
142
145
|
variant='ghost'
|
|
143
146
|
icon='ph--dots-six-vertical--regular'
|
|
144
147
|
iconOnly
|
|
145
148
|
label='Drag handle'
|
|
146
149
|
/>
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
+
<Menu.Root>
|
|
151
|
+
<Menu.Trigger asChild>
|
|
152
|
+
<Button.Root
|
|
150
153
|
variant='ghost'
|
|
151
154
|
icon='ph--dots-three--regular'
|
|
152
155
|
iconOnly
|
|
153
156
|
label={t('notebook-cell-insert.label')}
|
|
154
157
|
/>
|
|
155
|
-
</
|
|
158
|
+
</Menu.Trigger>
|
|
156
159
|
<NotebookMenu cell={cell} onCellInsert={onCellInsert} onCellDelete={onCellDelete} />
|
|
157
|
-
</
|
|
160
|
+
</Menu.Root>
|
|
158
161
|
</div>
|
|
159
162
|
|
|
160
163
|
<NotebookCell db={db} cell={cell} env={env} graph={graph} promptResults={promptResults} />
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import * as Atom from 'effect/
|
|
7
|
-
import * as Registry from 'effect/
|
|
6
|
+
import * as Atom from 'effect/reactivity/Atom';
|
|
7
|
+
import * as Registry from 'effect/reactivity/AtomRegistry';
|
|
8
8
|
import React, { useMemo } from 'react';
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import * as ProcessManagerPlugin from '@dxos/app-framework/ProcessManagerPlugin';
|
|
11
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
12
|
import * as Script from '@dxos/compute/Script';
|
|
13
13
|
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
@@ -16,7 +16,7 @@ import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
|
16
16
|
import { type ScriptToolbarState, type ScriptToolbarStateStore } from '#hooks';
|
|
17
17
|
import { translations } from '#translations';
|
|
18
18
|
|
|
19
|
-
import { ScriptToolbar } from './ScriptToolbar';
|
|
19
|
+
import { ScriptToolbar } from './ScriptToolbar.tsx';
|
|
20
20
|
|
|
21
21
|
// Create a mock store for stories.
|
|
22
22
|
const createMockStore = (initialState: ScriptToolbarState = {}): ScriptToolbarStateStore => {
|
|
@@ -54,7 +54,7 @@ const meta = {
|
|
|
54
54
|
withTheme(),
|
|
55
55
|
withLayout({ classNames: 'w-document-max-width' }),
|
|
56
56
|
withPluginManager({
|
|
57
|
-
plugins: [ProcessManagerPlugin(), ClientPlugin.make({})],
|
|
57
|
+
plugins: [ProcessManagerPlugin.make(), ClientPlugin.make({})],
|
|
58
58
|
}),
|
|
59
59
|
],
|
|
60
60
|
parameters: {
|
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Atom from 'effect/
|
|
5
|
+
import * as Atom from 'effect/reactivity/Atom';
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
8
|
import type * as Script from '@dxos/compute/Script';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import {
|
|
10
|
+
type ActionGraphProps,
|
|
11
|
+
ActionToolbar,
|
|
12
|
+
type ActionToolbarProps,
|
|
13
|
+
createGapSeparator,
|
|
14
|
+
useMenuActions,
|
|
15
|
+
} from '@dxos/react-ui-menu';
|
|
16
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
17
|
+
import * as Util from '@dxos/react-ui/Util';
|
|
13
18
|
|
|
14
19
|
import {
|
|
15
20
|
type CreateDeployOptions,
|
|
@@ -21,14 +26,14 @@ import {
|
|
|
21
26
|
} from '#hooks';
|
|
22
27
|
import { meta } from '#meta';
|
|
23
28
|
|
|
24
|
-
export type ScriptToolbarProps = Pick<
|
|
29
|
+
export type ScriptToolbarProps = Pick<ActionToolbarProps, 'attendableId'> & {
|
|
25
30
|
script: Script.Script;
|
|
26
31
|
state: ScriptToolbarStateStore;
|
|
27
32
|
};
|
|
28
33
|
|
|
29
|
-
export const ScriptToolbar = composable<HTMLDivElement, ScriptToolbarProps>(
|
|
34
|
+
export const ScriptToolbar = Util.composable<HTMLDivElement, ScriptToolbarProps>(
|
|
30
35
|
({ script, attendableId, role, state, ...props }, forwardedRef) => {
|
|
31
|
-
const { t } = useTranslation(meta.profile.key);
|
|
36
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
32
37
|
const options = useDeployDeps({ script });
|
|
33
38
|
const menuCreator = useMemo(
|
|
34
39
|
() => createToolbarActions({ state, script, t, ...options }),
|
|
@@ -37,13 +42,7 @@ export const ScriptToolbar = composable<HTMLDivElement, ScriptToolbarProps>(
|
|
|
37
42
|
const menuActions = useMenuActions(menuCreator);
|
|
38
43
|
|
|
39
44
|
return (
|
|
40
|
-
<
|
|
41
|
-
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
42
|
-
<Menu.Toolbar {...composableProps(props)} ref={forwardedRef}>
|
|
43
|
-
<Menu.Items />
|
|
44
|
-
</Menu.Toolbar>
|
|
45
|
-
</Menu.Root>
|
|
46
|
-
</ElevationProvider>
|
|
45
|
+
<ActionToolbar {...menuActions} attendableId={attendableId} {...Util.composableProps(props)} ref={forwardedRef} />
|
|
47
46
|
);
|
|
48
47
|
},
|
|
49
48
|
);
|