@theoremjs/studio 0.0.0-stage → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +295 -2
- package/agreement.d.ts +14 -0
- package/agreement.js +80 -0
- package/asks.d.ts +47 -0
- package/asks.js +54 -0
- package/browser-connection.d.ts +49 -0
- package/browser-connection.js +215 -0
- package/browser-engine.d.ts +11 -0
- package/browser-engine.js +11 -0
- package/browser-execution.d.ts +6 -0
- package/browser-execution.js +18 -0
- package/browser-live.d.ts +4 -0
- package/browser-live.js +132 -0
- package/browser-transport.d.ts +33 -0
- package/browser-transport.js +229 -0
- package/browser.d.ts +4 -0
- package/browser.js +4 -0
- package/canonical.d.ts +10 -0
- package/canonical.js +25 -0
- package/compile-workspace.d.ts +28 -0
- package/compile-workspace.js +295 -0
- package/compile.d.ts +65 -0
- package/compile.js +1605 -0
- package/concierge-demo.d.ts +17 -0
- package/concierge-demo.js +1230 -0
- package/conversation-key.d.ts +5 -0
- package/conversation-key.js +10 -0
- package/decision-example-images.d.ts +30 -0
- package/decision-example-images.js +30 -0
- package/deno.json +3 -0
- package/draft.d.ts +407 -0
- package/draft.js +505 -0
- package/editors.d.ts +29 -0
- package/editors.js +51 -0
- package/example-embedding-files.d.ts +11 -0
- package/example-embedding-files.js +20 -0
- package/example.d.ts +36 -0
- package/example.js +357 -0
- package/guardrail-probe.d.ts +100 -0
- package/guardrail-probe.js +722 -0
- package/held-credentials.d.ts +28 -0
- package/held-credentials.js +87 -0
- package/installed.mjs +40 -0
- package/lent-keys.d.ts +122 -0
- package/lent-keys.js +47 -0
- package/line-diff.d.ts +15 -0
- package/line-diff.js +41 -0
- package/live-connection.d.ts +22 -0
- package/live-connection.js +27 -0
- package/live-session-bridge.d.ts +15 -0
- package/live-session-bridge.js +202 -0
- package/map-line.d.ts +19 -0
- package/map-line.js +42 -0
- package/map.d.ts +154 -0
- package/map.js +525 -0
- package/media-accept.d.ts +19 -0
- package/media-accept.js +65 -0
- package/mod.d.ts +39 -0
- package/mod.js +33 -0
- package/origins.d.ts +52 -0
- package/origins.js +165 -0
- package/package.json +85 -4
- package/page/assets/Banner-BISz3nXA.js +2 -0
- package/page/assets/BottomSheet-BwfBDtje.js +1 -0
- package/page/assets/Card-Lp-0P5eL.js +1 -0
- package/page/assets/CardWall-CBRLdDZW.js +1 -0
- package/page/assets/Center-nHS1JSux.js +1 -0
- package/page/assets/CheckboxInput-Cj5pk-KI.js +2 -0
- package/page/assets/CodeBlock-C7XJ4ioE.js +51 -0
- package/page/assets/CollapsibleGroup-N7_SOjbm.js +2 -0
- package/page/assets/ContextMenu-CBu9H-9H.js +2 -0
- package/page/assets/DateInput-BGrQ5tPC.js +1 -0
- package/page/assets/Dialog-DELWQo-v.js +1 -0
- package/page/assets/EmptyState-C8W4JKBZ.js +1 -0
- package/page/assets/HoverCard-D1Y1ltWQ.js +1 -0
- package/page/assets/Icon-JrysT8aU.js +3 -0
- package/page/assets/IconAlertTriangle-BqAEqqdU.js +1 -0
- package/page/assets/IconButton-DlOGzJIX.js +1 -0
- package/page/assets/IconEye-BB5aY-wQ.js +1 -0
- package/page/assets/IconFileText-6zOFKKrF.js +1 -0
- package/page/assets/IconSearch-BTx66a40.js +1 -0
- package/page/assets/IconShield-DDOh7Gr5.js +1 -0
- package/page/assets/ItemSwipeLayer-Ckn4X6h9.js +1 -0
- package/page/assets/PaneState-BvA2tLQg.js +1 -0
- package/page/assets/PaneState-eUzUkNE8.css +1 -0
- package/page/assets/ScrollableArea-Ckugdj1N.js +1 -0
- package/page/assets/Section-DJ97F7QE.js +1 -0
- package/page/assets/SegmentedControlItem-h-aaXzyS.js +1 -0
- package/page/assets/SidePanel-BL32abk8.js +1 -0
- package/page/assets/StackItem-CQviqAfM.js +1 -0
- package/page/assets/Text-bum6zWWx.js +2 -0
- package/page/assets/TimestampHoverCard-DQIG0RZF.js +1 -0
- package/page/assets/ToolResultCharts-CgshSv9Q.js +1 -0
- package/page/assets/Tooltip-BH9xiRMl.js +1 -0
- package/page/assets/TraceInspector-_yZiz05W.js +1 -0
- package/page/assets/TraceOverview-BPO-HIYK.js +57 -0
- package/page/assets/VStack-CkVMcNiK.js +1 -0
- package/page/assets/_virtual_studio-type-sources-ByxqQaOG.js +12936 -0
- package/page/assets/arrive-DvbqpeRS.js +1 -0
- package/page/assets/browser-engine-CYq9DQAM.js +9 -0
- package/page/assets/browser-transport-D-2jDYe7.js +47 -0
- package/page/assets/codicon-DF1abBS2.ttf +0 -0
- package/page/assets/compile-egress-BSxOdX4K.js +23 -0
- package/page/assets/container.stylex-BmOi-8DQ.js +1 -0
- package/page/assets/createReactComponent-CZwsv6DD.js +1 -0
- package/page/assets/decision-example-images-CZGr7YIT.js +1 -0
- package/page/assets/devWarning-DxuplmRl.js +1 -0
- package/page/assets/editor-DjpsE8to.css +1 -0
- package/page/assets/editor.api-Cd3ViPQa.js +908 -0
- package/page/assets/editor.worker-6GY8RhDc.js +1 -0
- package/page/assets/editor.worker-BmdWdrHZ.js +33 -0
- package/page/assets/editors-BJX_S59A.js +1 -0
- package/page/assets/egress-automata-B5ZGE1mT.js +1 -0
- package/page/assets/embedding-space-view-CfQBPDxD.js +140 -0
- package/page/assets/encode-files-Bc3HJyAh.js +1 -0
- package/page/assets/export-agent-C3yyzXH8.js +43 -0
- package/page/assets/figtree-latin-400-normal-BD4aNku5.woff +0 -0
- package/page/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
- package/page/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
- package/page/assets/figtree-latin-500-normal-B_yy1phn.woff +0 -0
- package/page/assets/figtree-latin-600-normal-BM_oTo4n.woff +0 -0
- package/page/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
- package/page/assets/figtree-latin-700-normal-BCCt2T1q.woff +0 -0
- package/page/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
- package/page/assets/focusOutline.stylex-BT0kfa4t.js +1 -0
- package/page/assets/focusableSelector-DXZeMU85.js +1 -0
- package/page/assets/groupStyles-C7Ter7zC.js +1 -0
- package/page/assets/guardrail-tester-Gut5xK4a.js +9 -0
- package/page/assets/host-patterns-C9RMP16Q.js +1 -0
- package/page/assets/index-CvvmFKgS.js +105 -0
- package/page/assets/index-DOaHlqBo.css +1 -0
- package/page/assets/isRtlElement-BG33-k_H.js +1 -0
- package/page/assets/labels-provider-4TIWDvsE.js +3 -0
- package/page/assets/lent-keys-C32ems-I.js +1 -0
- package/page/assets/live-ingress-lDUGPwth.js +1 -0
- package/page/assets/live-messages-CnkL4GWi.js +1 -0
- package/page/assets/mergeProps-ptS-gIMz.js +1 -0
- package/page/assets/padding.stylex-B76907Zf.js +1 -0
- package/page/assets/preload-helper-DpV6A1kQ.js +1 -0
- package/page/assets/reader-BOCCYaRp.js +7 -0
- package/page/assets/register-CDgivxvX.js +2 -0
- package/page/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/page/assets/schemas-BQ9Jydzb.js +56 -0
- package/page/assets/shaped-data-BcarWqd5.js +16 -0
- package/page/assets/sharedResizeObserver-4U9Xq5Oq.js +1 -0
- package/page/assets/stub-DhdcU_Ew.js +471 -0
- package/page/assets/studio-code-pane-C_SAbcOa.js +8 -0
- package/page/assets/studio-console-DZwlEsvr.js +3 -0
- package/page/assets/studio-decision-B0FnCAXA.js +1 -0
- package/page/assets/studio-embedding-CmA51HVo.js +2 -0
- package/page/assets/studio-host-console-By7hqu2l.js +2 -0
- package/page/assets/studio-live-BrcVQcyV.js +1 -0
- package/page/assets/studio-map-B_xSia-z.js +1 -0
- package/page/assets/studio-map-Bb06Tw1F.css +1 -0
- package/page/assets/studio-monaco-CbKf90i6.css +1 -0
- package/page/assets/studio-monaco-xfyfezQS.js +34 -0
- package/page/assets/studio-ts.worker-B-EXG4Sv.js +67741 -0
- package/page/assets/studio-ts.worker-BXtW3z-O.js +1 -0
- package/page/assets/studio-type-checker-BOvxudki.js +23 -0
- package/page/assets/themeProps-3IqahpCr.js +1 -0
- package/page/assets/tokens.stylex-DkHf0P9C.js +1 -0
- package/page/assets/tool-schema-idaOe2nI.js +18 -0
- package/page/assets/trace-patterns-DnYJa0nI.js +1 -0
- package/page/assets/trace-record-C3zNksA_.js +1 -0
- package/page/assets/trace-schema-9CdEyG6Q.js +1 -0
- package/page/assets/tree-DqyAMsbI.js +3 -0
- package/page/assets/turn-client-Du3Um3Mg.js +2 -0
- package/page/assets/types-BhfXQCLx.js +1 -0
- package/page/assets/typescript-20GgZ8PJ.js +1 -0
- package/page/assets/use-one-call-Hcs8YBp1.js +1 -0
- package/page/assets/useAdaptivePresentation-BzmPCddb.js +1 -0
- package/page/assets/useClipboard-BgGRxRMJ.js +1 -0
- package/page/assets/useContainerReveal-BFy8N_QU.js +1 -0
- package/page/assets/useDevWarning-Z9SoixOP.js +1 -0
- package/page/assets/useLayerDismissal-B_G7IWpC.js +1 -0
- package/page/assets/useMediaQuery-BCT0NUeZ.js +1 -0
- package/page/assets/useScrollLock-Dyf6PHJt.js +1 -0
- package/page/assets/useScrollableArea-0NzdiBCq.js +1 -0
- package/page/assets/useTooltip-CJM_xhLB.js +1 -0
- package/page/assets/workspace-DZALqEDX.js +1 -0
- package/page/assets/zip-DTcEfps6.js +1 -0
- package/page/index.html +90 -0
- package/page.mjs +49 -0
- package/people.d.ts +87 -0
- package/people.js +110 -0
- package/policy.d.ts +43 -0
- package/policy.js +102 -0
- package/ports.d.mts +32 -0
- package/ports.mjs +85 -0
- package/probe-battery.d.ts +13 -0
- package/probe-battery.js +404 -0
- package/providers.d.ts +149 -0
- package/providers.js +306 -0
- package/read-source.d.ts +48 -0
- package/read-source.js +1301 -0
- package/read-steps.d.ts +23 -0
- package/read-steps.js +2 -0
- package/reader.d.ts +11 -0
- package/reader.js +11 -0
- package/registrations.d.ts +83 -0
- package/registrations.js +1 -0
- package/requirements.d.ts +22 -0
- package/requirements.js +38 -0
- package/run-payload-core.d.ts +28 -0
- package/run-payload-core.js +123 -0
- package/run-payload.d.ts +32 -0
- package/run-payload.js +26 -0
- package/runtime-scope.d.ts +84 -0
- package/runtime-scope.js +308 -0
- package/runtime.d.ts +84 -0
- package/runtime.js +387 -0
- package/section-notes.d.ts +33 -0
- package/section-notes.js +38 -0
- package/serve-page.mjs +96 -0
- package/server/draft-decide.d.ts +72 -0
- package/server/draft-decide.js +111 -0
- package/server/draft-embedding.d.ts +3 -0
- package/server/draft-embedding.js +35 -0
- package/server/draft-handler.d.ts +82 -0
- package/server/draft-handler.js +213 -0
- package/server/draft-probe.d.ts +14 -0
- package/server/draft-probe.js +61 -0
- package/server/draft-replies.d.ts +22 -0
- package/server/draft-replies.js +46 -0
- package/server/edited-session.d.ts +28 -0
- package/server/edited-session.js +83 -0
- package/server/edits.d.ts +38 -0
- package/server/edits.js +195 -0
- package/server/handler.d.ts +133 -0
- package/server/handler.js +598 -0
- package/server/lent-draft.d.ts +19 -0
- package/server/lent-draft.js +23 -0
- package/server/live.d.ts +15 -0
- package/server/live.js +96 -0
- package/server/open-editor.d.ts +63 -0
- package/server/open-editor.js +115 -0
- package/server/origins.d.ts +18 -0
- package/server/origins.js +330 -0
- package/server/project-source.d.ts +208 -0
- package/server/project-source.js +1042 -0
- package/server/project.d.ts +22 -0
- package/server/project.js +56 -0
- package/server/run-traces.d.ts +20 -0
- package/server/run-traces.js +96 -0
- package/server/save-new.d.ts +29 -0
- package/server/save-new.js +514 -0
- package/server/save-plan.d.ts +46 -0
- package/server/save-plan.js +1134 -0
- package/server/save-remove.d.ts +21 -0
- package/server/save-remove.js +528 -0
- package/server/save-session.d.ts +96 -0
- package/server/save-session.js +418 -0
- package/server/save-wire.d.ts +235 -0
- package/server/save-wire.js +8 -0
- package/server/save.d.ts +52 -0
- package/server/save.js +209 -0
- package/server/serve.d.ts +23 -0
- package/server/serve.js +413 -0
- package/server/test-connection.d.ts +17 -0
- package/server/test-connection.js +362 -0
- package/server/test-key.d.ts +2 -0
- package/server/test-key.js +83 -0
- package/server/watch.d.ts +28 -0
- package/server/watch.js +93 -0
- package/server/zod-edit.d.ts +74 -0
- package/server/zod-edit.js +558 -0
- package/server.d.ts +8 -0
- package/server.js +8 -0
- package/setups.mjs +170 -0
- package/shared-carry.d.ts +114 -0
- package/shared-carry.js +523 -0
- package/shared-settings.d.ts +34 -0
- package/shared-settings.js +70 -0
- package/source.d.ts +75 -0
- package/source.js +414 -0
- package/start.mjs +169 -0
- package/stream-lines.d.ts +9 -0
- package/stream-lines.js +27 -0
- package/stub.d.ts +6 -0
- package/stub.js +33 -0
- package/surface.d.ts +53 -0
- package/surface.js +631 -0
- package/system-markup.d.ts +20 -0
- package/system-markup.js +51 -0
- package/tool-schema.d.ts +23 -0
- package/tool-schema.js +69 -0
- package/tools.d.ts +16 -0
- package/tools.js +91 -0
- package/traces.d.ts +24 -0
- package/traces.js +29 -0
- package/transport.d.ts +57 -0
- package/transport.js +187 -0
- package/tree.d.ts +32 -0
- package/tree.js +83 -0
- package/types.d.ts +62 -0
- package/types.js +6 -0
- package/ui/acting-as-button.d.ts +2 -0
- package/ui/acting-as-button.js +16 -0
- package/ui/add-provider.d.ts +13 -0
- package/ui/add-provider.js +20 -0
- package/ui/boot-mark.css +53 -0
- package/ui/boot-mark.d.ts +19 -0
- package/ui/boot-mark.js +128 -0
- package/ui/boot-paint.d.ts +8 -0
- package/ui/boot-paint.js +8 -0
- package/ui/brand-icons.d.ts +57 -0
- package/ui/brand-icons.js +148 -0
- package/ui/built/theme.css +830 -0
- package/ui/built/theme.css.d.ts +9 -0
- package/ui/built/theorem-studio.d.ts +13 -0
- package/ui/built/theorem-studio.js +705 -0
- package/ui/built/theorem-studio.variants.d.ts +28 -0
- package/ui/code/monaco-contributions.d.ts +45 -0
- package/ui/code/studio-code.d.ts +7 -0
- package/ui/code/studio-code.js +253 -0
- package/ui/code/studio-monaco.d.ts +44 -0
- package/ui/code/studio-monaco.js +48 -0
- package/ui/code/studio-ts.worker.d.ts +1 -0
- package/ui/code/studio-ts.worker.js +16 -0
- package/ui/code/studio-type-checker.d.ts +12 -0
- package/ui/code/studio-type-checker.js +308 -0
- package/ui/code/studio-type-sources.d.ts +26 -0
- package/ui/confirm-write.d.ts +12 -0
- package/ui/confirm-write.js +45 -0
- package/ui/diff-block.d.ts +21 -0
- package/ui/diff-block.js +17 -0
- package/ui/figtree.css +59 -0
- package/ui/file-place.d.ts +4 -0
- package/ui/file-place.js +26 -0
- package/ui/guardrail-tester.d.ts +18 -0
- package/ui/guardrail-tester.js +248 -0
- package/ui/inspector-context.d.ts +119 -0
- package/ui/inspector-context.js +84 -0
- package/ui/inspector.d.ts +247 -0
- package/ui/inspector.js +284 -0
- package/ui/lib/acting-as.d.ts +25 -0
- package/ui/lib/acting-as.js +90 -0
- package/ui/lib/boot-sequence.d.ts +32 -0
- package/ui/lib/boot-sequence.js +57 -0
- package/ui/lib/export-agent.d.ts +11 -0
- package/ui/lib/export-agent.js +335 -0
- package/ui/lib/facet-icons.d.ts +20 -0
- package/ui/lib/facet-icons.js +21 -0
- package/ui/lib/panel-motion.d.ts +8 -0
- package/ui/lib/panel-motion.js +74 -0
- package/ui/lib/project-address.d.ts +14 -0
- package/ui/lib/project-address.js +24 -0
- package/ui/lib/project-starting.d.ts +13 -0
- package/ui/lib/project-starting.js +30 -0
- package/ui/lib/project-traces.d.ts +17 -0
- package/ui/lib/project-traces.js +54 -0
- package/ui/lib/read-map.d.ts +30 -0
- package/ui/lib/read-map.js +173 -0
- package/ui/lib/read-progress.d.ts +14 -0
- package/ui/lib/read-progress.js +12 -0
- package/ui/lib/refusal-lines.d.ts +3 -0
- package/ui/lib/refusal-lines.js +8 -0
- package/ui/lib/studio-activity.d.ts +5 -0
- package/ui/lib/studio-activity.js +17 -0
- package/ui/lib/studio-console.d.ts +27 -0
- package/ui/lib/studio-console.js +9 -0
- package/ui/lib/studio-conversation.d.ts +20 -0
- package/ui/lib/studio-conversation.js +130 -0
- package/ui/lib/studio-examples.d.ts +31 -0
- package/ui/lib/studio-examples.js +25 -0
- package/ui/lib/studio-labels.d.ts +6 -0
- package/ui/lib/studio-labels.js +13 -0
- package/ui/lib/studio-map-kept.d.ts +17 -0
- package/ui/lib/studio-map-kept.js +48 -0
- package/ui/lib/studio-open.d.ts +22 -0
- package/ui/lib/studio-open.js +54 -0
- package/ui/lib/studio-page.d.ts +33 -0
- package/ui/lib/studio-page.js +121 -0
- package/ui/lib/studio-prefs.d.ts +26 -0
- package/ui/lib/studio-prefs.js +87 -0
- package/ui/lib/studio-project.d.ts +106 -0
- package/ui/lib/studio-project.js +177 -0
- package/ui/lib/studio-restore.d.ts +49 -0
- package/ui/lib/studio-restore.js +251 -0
- package/ui/lib/studio-run-open.d.ts +15 -0
- package/ui/lib/studio-run-open.js +16 -0
- package/ui/lib/studio-session.d.ts +34 -0
- package/ui/lib/studio-session.js +17 -0
- package/ui/lib/studio-settings.d.ts +15 -0
- package/ui/lib/studio-settings.js +48 -0
- package/ui/lib/studio-store.d.ts +64 -0
- package/ui/lib/studio-store.js +391 -0
- package/ui/lib/studio-watch.d.ts +12 -0
- package/ui/lib/studio-watch.js +27 -0
- package/ui/lib/tab-fills.d.ts +6 -0
- package/ui/lib/tab-fills.js +14 -0
- package/ui/lib/tool-credentials.d.ts +3 -0
- package/ui/lib/tool-credentials.js +23 -0
- package/ui/lib/tool-probe.d.ts +19 -0
- package/ui/lib/tool-probe.js +104 -0
- package/ui/lib/type-icons.d.ts +35 -0
- package/ui/lib/type-icons.js +38 -0
- package/ui/lib/when-idle.d.ts +5 -0
- package/ui/lib/when-idle.js +14 -0
- package/ui/lib/zip.d.ts +5 -0
- package/ui/lib/zip.js +8 -0
- package/ui/map-token.css +11 -0
- package/ui/map-token.d.ts +17 -0
- package/ui/map-token.js +29 -0
- package/ui/mcp-icon.d.ts +6 -0
- package/ui/mcp-icon.js +8 -0
- package/ui/motion.css +113 -0
- package/ui/pan.d.ts +32 -0
- package/ui/pan.js +90 -0
- package/ui/profile-editor.d.ts +33 -0
- package/ui/profile-editor.js +2638 -0
- package/ui/provider-editor.d.ts +15 -0
- package/ui/provider-editor.js +92 -0
- package/ui/read-map.css +48 -0
- package/ui/read-map.d.ts +7 -0
- package/ui/read-map.js +163 -0
- package/ui/refusal-detail.d.ts +4 -0
- package/ui/refusal-detail.js +21 -0
- package/ui/shared-change.d.ts +9 -0
- package/ui/shared-change.js +28 -0
- package/ui/shell-motion.css +121 -0
- package/ui/shell-motion.d.ts +73 -0
- package/ui/shell-motion.js +194 -0
- package/ui/studio-code-pane.d.ts +19 -0
- package/ui/studio-code-pane.js +44 -0
- package/ui/studio-compare.d.ts +80 -0
- package/ui/studio-compare.js +326 -0
- package/ui/studio-conflicts.d.ts +17 -0
- package/ui/studio-conflicts.js +87 -0
- package/ui/studio-connection.d.ts +64 -0
- package/ui/studio-connection.js +286 -0
- package/ui/studio-decision.d.ts +6 -0
- package/ui/studio-decision.js +49 -0
- package/ui/studio-embedding.d.ts +6 -0
- package/ui/studio-embedding.js +30 -0
- package/ui/studio-host-console.d.ts +6 -0
- package/ui/studio-host-console.js +17 -0
- package/ui/studio-host.d.ts +73 -0
- package/ui/studio-host.js +12 -0
- package/ui/studio-live.d.ts +17 -0
- package/ui/studio-live.js +26 -0
- package/ui/studio-map.css +273 -0
- package/ui/studio-map.d.ts +17 -0
- package/ui/studio-map.js +397 -0
- package/ui/studio-nav.d.ts +24 -0
- package/ui/studio-nav.js +17 -0
- package/ui/studio-no-project.d.ts +5 -0
- package/ui/studio-no-project.js +9 -0
- package/ui/studio-run.css +76 -0
- package/ui/studio-run.d.ts +14 -0
- package/ui/studio-run.js +119 -0
- package/ui/studio-runner.d.ts +45 -0
- package/ui/studio-runner.js +187 -0
- package/ui/studio-save.d.ts +49 -0
- package/ui/studio-save.js +307 -0
- package/ui/studio-screen.d.ts +61 -0
- package/ui/studio-screen.js +2078 -0
- package/ui/studio-settings.d.ts +31 -0
- package/ui/studio-settings.js +288 -0
- package/ui/studio-shell.css +27 -0
- package/ui/studio-shell.d.ts +43 -0
- package/ui/studio-shell.js +87 -0
- package/ui/studio-theme.d.ts +7 -0
- package/ui/studio-theme.js +94 -0
- package/ui/studio.css +427 -0
- package/ui/theorem-mark.css +84 -0
- package/ui/theorem-mark.d.ts +22 -0
- package/ui/theorem-mark.js +21 -0
- package/vite.d.mts +30 -0
- package/vite.mjs +277 -0
- package/workspace.d.ts +230 -0
- package/workspace.js +1054 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The icon for each type of agent, of tool, and of decision question, wherever the studio shows
|
|
3
|
+
* one: the editor's Type controls and lists, the tree, the map, and the loader's map of a project
|
|
4
|
+
* being read.
|
|
5
|
+
*/
|
|
6
|
+
import type { IconType } from '@astryxdesign/core/Icon';
|
|
7
|
+
import { IconMcp } from '../mcp-icon.tsx';
|
|
8
|
+
/** Each profile type's icon: the Type control's segments and the tree's Identity row. */
|
|
9
|
+
export declare const PROFILE_TYPE_ICON: {
|
|
10
|
+
text: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
image: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
12
|
+
speech: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
13
|
+
live: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
14
|
+
decision: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
15
|
+
embedding: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
16
|
+
host: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
17
|
+
};
|
|
18
|
+
/** The icon for a profile type, or none when the type is not one of those. */
|
|
19
|
+
export declare function profileTypeIcon(type: string | undefined): IconType | undefined;
|
|
20
|
+
/** Each custom tool type's icon: the Type control's segments and the tree's tool rows. */
|
|
21
|
+
export declare const TOOL_TYPE_ICON: {
|
|
22
|
+
function: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
23
|
+
http: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
24
|
+
mcp: typeof IconMcp;
|
|
25
|
+
agent: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
26
|
+
};
|
|
27
|
+
/** Each decision question type's icon: the Answer control's segments and the question list. */
|
|
28
|
+
export declare const QUESTION_TYPE_ICON: {
|
|
29
|
+
choice: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
30
|
+
score: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
31
|
+
noul: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
32
|
+
box: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
33
|
+
};
|
|
34
|
+
/** The icon for a tool type, or the plain tool icon when the type is not one of those. */
|
|
35
|
+
export declare function toolTypeIcon(type: string): IconType;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IconChartBar, IconChartScatter3d, IconGavel, IconHeadset, IconLetterT, IconListCheck, IconMathFunction, IconMessageForward, IconNumber, IconPhoto, IconServer, IconSquareDashed, IconTool, IconVolume, IconWorld, } from '@tabler/icons-react';
|
|
2
|
+
import { IconMcp } from "../mcp-icon.js";
|
|
3
|
+
/** Each profile type's icon: the Type control's segments and the tree's Identity row. */
|
|
4
|
+
export const PROFILE_TYPE_ICON = {
|
|
5
|
+
text: IconLetterT,
|
|
6
|
+
image: IconPhoto,
|
|
7
|
+
speech: IconVolume,
|
|
8
|
+
live: IconHeadset,
|
|
9
|
+
decision: IconGavel,
|
|
10
|
+
embedding: IconChartScatter3d,
|
|
11
|
+
host: IconServer,
|
|
12
|
+
};
|
|
13
|
+
/** The icon for a profile type, or none when the type is not one of those. */
|
|
14
|
+
export function profileTypeIcon(type) {
|
|
15
|
+
if (type !== undefined && Object.hasOwn(PROFILE_TYPE_ICON, type))
|
|
16
|
+
return PROFILE_TYPE_ICON[type];
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Each custom tool type's icon: the Type control's segments and the tree's tool rows. */
|
|
20
|
+
export const TOOL_TYPE_ICON = {
|
|
21
|
+
function: IconMathFunction,
|
|
22
|
+
http: IconWorld,
|
|
23
|
+
mcp: IconMcp,
|
|
24
|
+
agent: IconMessageForward,
|
|
25
|
+
};
|
|
26
|
+
/** Each decision question type's icon: the Answer control's segments and the question list. */
|
|
27
|
+
export const QUESTION_TYPE_ICON = {
|
|
28
|
+
choice: IconListCheck,
|
|
29
|
+
score: IconChartBar,
|
|
30
|
+
noul: IconNumber,
|
|
31
|
+
box: IconSquareDashed,
|
|
32
|
+
};
|
|
33
|
+
/** The icon for a tool type, or the plain tool icon when the type is not one of those. */
|
|
34
|
+
export function toolTypeIcon(type) {
|
|
35
|
+
if (Object.hasOwn(TOOL_TYPE_ICON, type))
|
|
36
|
+
return TOOL_TYPE_ICON[type];
|
|
37
|
+
return IconTool;
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads `modules` once the page is idle, so a panel or runner the builder opens later does not
|
|
3
|
+
* wait on the network, and nothing the first paint needs waits on them.
|
|
4
|
+
*/
|
|
5
|
+
export function warmWhenIdle(...modules) {
|
|
6
|
+
const warm = () => {
|
|
7
|
+
for (const load of modules)
|
|
8
|
+
load().catch(() => { });
|
|
9
|
+
};
|
|
10
|
+
if (globalThis.requestIdleCallback)
|
|
11
|
+
globalThis.requestIdleCallback(warm);
|
|
12
|
+
else
|
|
13
|
+
globalThis.setTimeout(warm, 1);
|
|
14
|
+
}
|
package/ui/lib/zip.d.ts
ADDED
package/ui/lib/zip.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { strToU8, zipSync } from 'fflate';
|
|
2
|
+
/** 1 January 1980, the earliest date a zip can hold: every export has the same bytes. */
|
|
3
|
+
const ZIP_EPOCH = new Date(1980, 0, 1);
|
|
4
|
+
/** The files as a .zip, each at its path. */
|
|
5
|
+
export function zipFiles(files) {
|
|
6
|
+
const entries = Object.fromEntries(files.map((file) => [file.path, strToU8(file.code)]));
|
|
7
|
+
return new Uint8Array(zipSync(entries, { mtime: ZIP_EPOCH }));
|
|
8
|
+
}
|
package/ui/map-token.css
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type IconType } from '@astryxdesign/core/Icon';
|
|
2
|
+
import { type TokenColor } from '@astryxdesign/core/Token';
|
|
3
|
+
import { type HTMLAttributes, type RefObject } from 'react';
|
|
4
|
+
export interface MapTokenProps extends Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'color'> {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: IconType | undefined;
|
|
8
|
+
/** The left side, and the middle from the top. */
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
color?: TokenColor | undefined;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
onOpen?: (() => void) | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare function MapToken({ id, label, icon, x, y, color, description, onOpen, className, style, ...rest }: MapTokenProps): import("react").JSX.Element;
|
|
16
|
+
/** Each token's width under `root`, by id, measured again whenever `drawn` changes. */
|
|
17
|
+
export declare function useTokenWidths(root: RefObject<HTMLElement | null>, drawn: unknown): Record<string, number>;
|
package/ui/map-token.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '@astryxdesign/core/Icon';
|
|
3
|
+
import { Token } from '@astryxdesign/core/Token';
|
|
4
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
+
import './map-token.css';
|
|
6
|
+
export function MapToken({ id, label, icon, x, y, color, description, onOpen, className, style, ...rest }) {
|
|
7
|
+
return (_jsx("div", { ...rest, className: className ? `map-token ${className}` : 'map-token', "data-map-token": id, style: { ...style, left: x, top: y }, children: _jsx(Token, { size: "sm", label: label, icon: icon && _jsx(Icon, { icon: icon, size: "sm" }), ...(color === undefined ? {} : { color }), ...(description === undefined ? {} : { description }), ...(onOpen === undefined ? {} : { onClick: onOpen }) }) }));
|
|
8
|
+
}
|
|
9
|
+
/** Not yet measured for anything. */
|
|
10
|
+
const UNMEASURED = Symbol('unmeasured');
|
|
11
|
+
/** Each token's width under `root`, by id, measured again whenever `drawn` changes. */
|
|
12
|
+
export function useTokenWidths(root, drawn) {
|
|
13
|
+
const [widths, setWidths] = useState({});
|
|
14
|
+
const measuredFor = useRef(UNMEASURED);
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
if (measuredFor.current === drawn)
|
|
17
|
+
return;
|
|
18
|
+
measuredFor.current = drawn;
|
|
19
|
+
const next = {};
|
|
20
|
+
for (const each of root.current?.querySelectorAll('[data-map-token]') ?? []) {
|
|
21
|
+
next[each.dataset.mapToken ?? ''] = each.offsetWidth;
|
|
22
|
+
}
|
|
23
|
+
setWidths((last) => Object.keys(next).length === Object.keys(last).length &&
|
|
24
|
+
Object.entries(next).every(([id, width]) => last[id] === width)
|
|
25
|
+
? last
|
|
26
|
+
: next);
|
|
27
|
+
});
|
|
28
|
+
return widths;
|
|
29
|
+
}
|
package/ui/mcp-icon.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Model Context Protocol mark (from Simple Icons, CC0), filled in the current colour.
|
|
4
|
+
* Tabler has no MCP icon; this marks MCP tools beside Tabler's glyphs for the other types.
|
|
5
|
+
*/
|
|
6
|
+
export declare function IconMcp(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
|
package/ui/mcp-icon.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Model Context Protocol mark (from Simple Icons, CC0), filled in the current colour.
|
|
4
|
+
* Tabler has no MCP icon; this marks MCP tools beside Tabler's glyphs for the other types.
|
|
5
|
+
*/
|
|
6
|
+
export function IconMcp(props) {
|
|
7
|
+
return (_jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, ...props, children: _jsx("path", { d: "M13.85 0a4.16 4.16 0 0 0-2.95 1.217L1.456 10.66a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l9.442-9.442a2.49 2.49 0 0 1 3.541 0 2.49 2.49 0 0 1 0 3.541L8.59 12.97l-.1.1a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l.1-.098 7.03-7.034a2.49 2.49 0 0 1 3.542 0l.049.05a2.49 2.49 0 0 1 0 3.54l-8.54 8.54a1.96 1.96 0 0 0 0 2.755l1.753 1.753a.835.835 0 0 0 1.18 0 .835.835 0 0 0 0-1.18l-1.753-1.753a.266.266 0 0 1 0-.394l8.54-8.54a4.185 4.185 0 0 0 0-5.9l-.05-.05a4.16 4.16 0 0 0-2.95-1.218c-.2 0-.401.02-.6.048a4.17 4.17 0 0 0-1.17-3.552A4.16 4.16 0 0 0 13.85 0m0 3.333a.84.84 0 0 0-.59.245L6.275 10.56a4.186 4.186 0 0 0 0 5.902 4.186 4.186 0 0 0 5.902 0L19.16 9.48a.835.835 0 0 0 0-1.18.835.835 0 0 0-1.18 0l-6.985 6.984a2.49 2.49 0 0 1-3.54 0 2.49 2.49 0 0 1 0-3.54l6.983-6.985a.835.835 0 0 0 0-1.18.84.84 0 0 0-.59-.245" }) }));
|
|
8
|
+
}
|
package/ui/motion.css
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Every popover layer (tooltips, menus, selects, popovers) fades in and out. Astryx shows and hides
|
|
3
|
+
* them without motion, and its theme API can't declare the entry: fading in from `display: none`
|
|
4
|
+
* needs @starting-style, which only a stylesheet can hold. Leaving, the layer holds its display and
|
|
5
|
+
* top-layer place (allow-discrete) until it has faded.
|
|
6
|
+
*/
|
|
7
|
+
[popover] {
|
|
8
|
+
transition:
|
|
9
|
+
opacity var(--duration-fast) var(--ease-standard),
|
|
10
|
+
display var(--duration-fast) allow-discrete,
|
|
11
|
+
overlay var(--duration-fast) allow-discrete;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[popover]:not(:popover-open) {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@starting-style {
|
|
19
|
+
[popover]:popover-open {
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media (prefers-reduced-motion: reduce) {
|
|
25
|
+
[popover] {
|
|
26
|
+
transition: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* A trace row, a decision's answer, or a piece of a host result eases in as it
|
|
32
|
+
* mounts, each a step after the last, the way a test's rows arrive one by one.
|
|
33
|
+
* The delay is set on the item. Reduced motion shows them at once.
|
|
34
|
+
*/
|
|
35
|
+
.theorem-arrive {
|
|
36
|
+
min-width: 0;
|
|
37
|
+
animation: theorem-arrive var(--duration-medium) var(--ease-standard) both;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@keyframes theorem-arrive {
|
|
41
|
+
from {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
translate: 0 0.5rem;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (prefers-reduced-motion: reduce) {
|
|
48
|
+
.theorem-arrive {
|
|
49
|
+
animation: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* Text with no place to break (a field path in an issue, an address, a key) wraps inside its box
|
|
55
|
+
* rather than spilling over what sits beside it. A status message under a field breaks anywhere,
|
|
56
|
+
* since its box is only as wide as the field.
|
|
57
|
+
*/
|
|
58
|
+
body {
|
|
59
|
+
overflow-wrap: break-word;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.astryx-field-status,
|
|
63
|
+
.astryx-banner {
|
|
64
|
+
min-width: 0;
|
|
65
|
+
overflow-wrap: anywhere;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* The files' side of a comparison closes toward its edge when it is hidden and opens again when
|
|
70
|
+
* it is shown, on the studio's standard motion. It only moves once the builder has asked: the
|
|
71
|
+
* page opens with it in place.
|
|
72
|
+
*/
|
|
73
|
+
.studio-saved-slot,
|
|
74
|
+
.studio-edited-slot {
|
|
75
|
+
flex: 1 1 0;
|
|
76
|
+
min-width: 0;
|
|
77
|
+
height: 100%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.studio-saved-slot {
|
|
81
|
+
display: flex;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.studio-saved-slot-side {
|
|
86
|
+
flex: 1 1 0;
|
|
87
|
+
min-width: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.studio-saved-slot[data-moved] {
|
|
91
|
+
transition:
|
|
92
|
+
flex-grow var(--duration-medium) var(--ease-standard),
|
|
93
|
+
opacity var(--duration-medium) var(--ease-standard);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.studio-saved-slot[data-closed] {
|
|
97
|
+
flex-grow: 0;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@starting-style {
|
|
103
|
+
.studio-saved-slot[data-moved] {
|
|
104
|
+
flex-grow: 0;
|
|
105
|
+
opacity: 0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (prefers-reduced-motion: reduce) {
|
|
110
|
+
.studio-saved-slot[data-moved] {
|
|
111
|
+
transition: none;
|
|
112
|
+
}
|
|
113
|
+
}
|
package/ui/pan.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A field that pans: dragged with a mouse or a pen, scrolled with a finger or a wheel. The map and
|
|
3
|
+
* the site's showcase pan alike.
|
|
4
|
+
*/
|
|
5
|
+
import { type PointerEvent as ReactPointerEvent } from 'react';
|
|
6
|
+
/** The box around `from` that scrolls, if one does. */
|
|
7
|
+
export declare function scrollerOf(from: HTMLElement): HTMLElement | undefined;
|
|
8
|
+
/** Where `field` starts inside `scroller`'s scrolled content. */
|
|
9
|
+
export declare function fieldStart(field: HTMLElement, scroller: HTMLElement): {
|
|
10
|
+
left: number;
|
|
11
|
+
top: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Scroll the box around `field` to `at`, once it can: a field that is still opening has no box that
|
|
15
|
+
* scrolls yet, so it tries again each frame until the scroll lands. Returns what stops the tries.
|
|
16
|
+
*/
|
|
17
|
+
export declare function scrollOnce(field: HTMLElement, at: (scroller: HTMLElement) => {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
}): () => void;
|
|
21
|
+
/** A mouse or a pen drags; a finger scrolls the field as it always does. */
|
|
22
|
+
export declare const drags: (event: ReactPointerEvent) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Follow the pointer that pressed until it lifts, wherever it goes: `onMove` with how far it is
|
|
25
|
+
* from where it pressed, then `onEnd`, with whether it lifted or the press was called off.
|
|
26
|
+
*/
|
|
27
|
+
export declare function follow(press: ReactPointerEvent, onMove: (x: number, y: number) => void, onEnd: (lifted: boolean) => void): void;
|
|
28
|
+
/** A drag that starts on the field, off anything `held` matches, pans it. */
|
|
29
|
+
export declare function usePan(held: string): {
|
|
30
|
+
panning: boolean;
|
|
31
|
+
pan: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
32
|
+
};
|
package/ui/pan.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A field that pans: dragged with a mouse or a pen, scrolled with a finger or a wheel. The map and
|
|
3
|
+
* the site's showcase pan alike.
|
|
4
|
+
*/
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
/** The box around `from` that scrolls, if one does. */
|
|
7
|
+
export function scrollerOf(from) {
|
|
8
|
+
for (let each = from.parentElement; each; each = each.parentElement) {
|
|
9
|
+
const { overflowX, overflowY } = getComputedStyle(each);
|
|
10
|
+
if (/auto|scroll/.test(`${overflowX} ${overflowY}`))
|
|
11
|
+
return each;
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
/** Where `field` starts inside `scroller`'s scrolled content. */
|
|
16
|
+
export function fieldStart(field, scroller) {
|
|
17
|
+
const box = field.getBoundingClientRect();
|
|
18
|
+
const port = scroller.getBoundingClientRect();
|
|
19
|
+
return {
|
|
20
|
+
left: box.left - port.left + scroller.scrollLeft,
|
|
21
|
+
top: box.top - port.top + scroller.scrollTop,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Scroll the box around `field` to `at`, once it can: a field that is still opening has no box that
|
|
26
|
+
* scrolls yet, so it tries again each frame until the scroll lands. Returns what stops the tries.
|
|
27
|
+
*/
|
|
28
|
+
export function scrollOnce(field, at) {
|
|
29
|
+
let frame = 0;
|
|
30
|
+
let tries = 120;
|
|
31
|
+
const go = () => {
|
|
32
|
+
tries -= 1;
|
|
33
|
+
const scroller = scrollerOf(field);
|
|
34
|
+
if (scroller && scroller.scrollWidth > scroller.clientWidth) {
|
|
35
|
+
const { left, top } = at(scroller);
|
|
36
|
+
scroller.scrollTo({ left, top, behavior: 'instant' });
|
|
37
|
+
if (Math.abs(scroller.scrollLeft - left) < 1 && Math.abs(scroller.scrollTop - top) < 1)
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (tries > 0)
|
|
41
|
+
frame = requestAnimationFrame(go);
|
|
42
|
+
};
|
|
43
|
+
go();
|
|
44
|
+
return () => {
|
|
45
|
+
cancelAnimationFrame(frame);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** A mouse or a pen drags; a finger scrolls the field as it always does. */
|
|
49
|
+
export const drags = (event) => event.button === 0 && event.pointerType !== 'touch';
|
|
50
|
+
/**
|
|
51
|
+
* Follow the pointer that pressed until it lifts, wherever it goes: `onMove` with how far it is
|
|
52
|
+
* from where it pressed, then `onEnd`, with whether it lifted or the press was called off.
|
|
53
|
+
*/
|
|
54
|
+
export function follow(press, onMove, onEnd) {
|
|
55
|
+
const { pointerId, clientX, clientY } = press;
|
|
56
|
+
const move = (event) => {
|
|
57
|
+
if (event.pointerId === pointerId)
|
|
58
|
+
onMove(event.clientX - clientX, event.clientY - clientY);
|
|
59
|
+
};
|
|
60
|
+
const end = (event) => {
|
|
61
|
+
if (event.pointerId !== pointerId)
|
|
62
|
+
return;
|
|
63
|
+
globalThis.removeEventListener('pointermove', move);
|
|
64
|
+
globalThis.removeEventListener('pointerup', end);
|
|
65
|
+
globalThis.removeEventListener('pointercancel', end);
|
|
66
|
+
onEnd(event.type === 'pointerup');
|
|
67
|
+
};
|
|
68
|
+
globalThis.addEventListener('pointermove', move);
|
|
69
|
+
globalThis.addEventListener('pointerup', end);
|
|
70
|
+
globalThis.addEventListener('pointercancel', end);
|
|
71
|
+
}
|
|
72
|
+
/** A drag that starts on the field, off anything `held` matches, pans it. */
|
|
73
|
+
export function usePan(held) {
|
|
74
|
+
const [panning, setPanning] = useState(false);
|
|
75
|
+
const pan = (event) => {
|
|
76
|
+
if (!drags(event) || event.target.closest(held))
|
|
77
|
+
return;
|
|
78
|
+
const scroller = scrollerOf(event.currentTarget);
|
|
79
|
+
if (!scroller)
|
|
80
|
+
return;
|
|
81
|
+
const { scrollLeft, scrollTop } = scroller;
|
|
82
|
+
setPanning(true);
|
|
83
|
+
follow(event, (x, y) => {
|
|
84
|
+
scroller.scrollTo({ left: scrollLeft - x, top: scrollTop - y, behavior: 'instant' });
|
|
85
|
+
}, () => {
|
|
86
|
+
setPanning(false);
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
return { panning, pan };
|
|
90
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
+
import { type StudioDraft, type StudioIssue } from '../mod.ts';
|
|
3
|
+
export type SetDraft = Dispatch<SetStateAction<StudioDraft>>;
|
|
4
|
+
/** A key slot, chosen from the slots the keys panel holds; each says which service its key is for. */
|
|
5
|
+
export declare function SlotRow({ label, path, field, value, isRequired, given, onChange, }: {
|
|
6
|
+
label: string;
|
|
7
|
+
path: string;
|
|
8
|
+
field?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
isRequired?: boolean;
|
|
11
|
+
/** The slot the model reads while this is blank: its provider's. */
|
|
12
|
+
given?: string;
|
|
13
|
+
onChange: (slot: string) => void;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** Adds a new tool to the draft and opens it. */
|
|
16
|
+
export declare function addToolSpec(draft: StudioDraft, setDraft: SetDraft, onSelect: (id: string) => void): void;
|
|
17
|
+
/** A node's issues that name no field of it, over its rows. */
|
|
18
|
+
export declare function IssueBanners({ issues }: {
|
|
19
|
+
issues: readonly StudioIssue[];
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* The editor for the tree node `selectedId`. The compile's issues for that node show on the rows
|
|
23
|
+
* of the fields they name; the rest show above it.
|
|
24
|
+
* Edits go straight to the draft; the page compiles it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ProfileEditor({ draft, setDraft, selectedId, onSelect, issues, }: {
|
|
27
|
+
draft: StudioDraft;
|
|
28
|
+
setDraft: SetDraft;
|
|
29
|
+
selectedId: string;
|
|
30
|
+
/** Selects another tree node: a tool, once added or picked from the list, or Tools once removed. */
|
|
31
|
+
onSelect: (id: string) => void;
|
|
32
|
+
issues: readonly StudioIssue[];
|
|
33
|
+
}): import("react").JSX.Element | null;
|