@1agh/maude 2.0.8 → 2.1.1
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 +2 -1
- package/apps/hub/src/project-transactions/kernel.mjs +13 -7
- package/apps/studio/access/closure.ts +86 -10
- package/apps/studio/access/filters.ts +18 -1
- package/apps/studio/access/request.ts +8 -0
- package/apps/studio/acp/design-write-verb.ts +12 -2
- package/apps/studio/acp/env.ts +7 -2
- package/apps/studio/acp/index.ts +15 -4
- package/apps/studio/acp/login-state.ts +22 -5
- package/apps/studio/acp/may-scope.ts +38 -1
- package/apps/studio/acp/plugin-bootstrap.ts +13 -1
- package/apps/studio/acp/probe.ts +11 -4
- package/apps/studio/actions/agents.ts +110 -28
- package/apps/studio/actions/canvas-keys.ts +4 -2
- package/apps/studio/actions/ctx.ts +3 -0
- package/apps/studio/actions/defs/annotation.ts +84 -2
- package/apps/studio/actions/defs/app.ts +28 -1
- package/apps/studio/actions/defs/edit.ts +13 -0
- package/apps/studio/actions/defs/export.ts +12 -0
- package/apps/studio/actions/defs/sync.ts +18 -0
- package/apps/studio/actions/defs/video.ts +9 -0
- package/apps/studio/actions/documents.ts +6 -1
- package/apps/studio/actions/keymap.gen.ts +147 -9
- package/apps/studio/actions/menu.ts +5 -1
- package/apps/studio/actions/types.ts +4 -2
- package/apps/studio/actions/verbs.ts +9 -0
- package/apps/studio/actions.manifest.json +300 -45
- package/apps/studio/actions.parity.json +19 -1
- package/apps/studio/ai/save-hold.ts +2 -1
- package/apps/studio/ai/write-claim-scope.ts +7 -1
- package/apps/studio/ai/write-claim.ts +154 -3
- package/apps/studio/annotations/ai-read.ts +42 -6
- package/apps/studio/annotations/ai-write.ts +145 -2
- package/apps/studio/annotations/board-ops.ts +34 -3
- package/apps/studio/annotations/checklist-ops.ts +374 -0
- package/apps/studio/annotations/elements/checkitem.model.ts +129 -0
- package/apps/studio/annotations/elements/sticky.model.ts +54 -2
- package/apps/studio/annotations/ops.ts +30 -0
- package/apps/studio/annotations/registry.ts +9 -1
- package/apps/studio/annotations/templates.ts +4 -2
- package/apps/studio/annotations/text-steps.ts +114 -10
- package/apps/studio/annotations/ui/checklist-wire.ts +129 -0
- package/apps/studio/annotations/ui/checklist.tsx +429 -0
- package/apps/studio/annotations/ui/element-node.tsx +48 -2
- package/apps/studio/annotations/ui/template-place.ts +11 -1
- package/apps/studio/annotations/v1-adapter.ts +22 -3
- package/apps/studio/annotations-context-toolbar.tsx +12 -0
- package/apps/studio/annotations-layer.tsx +442 -49
- package/apps/studio/annotations-model.ts +4 -2
- package/apps/studio/api.ts +148 -21
- package/apps/studio/artboard-live-gate.tsx +54 -17
- package/apps/studio/artboard-still-persist.ts +166 -0
- package/apps/studio/artboard-still-raster.ts +6 -2
- package/apps/studio/artboard-still.ts +390 -20
- package/apps/studio/asset-added.ts +154 -0
- package/apps/studio/asset-details.ts +46 -3
- package/apps/studio/asset-origins.ts +5 -3
- package/apps/studio/asset-trash.ts +6 -1
- package/apps/studio/bin/_agent-browser-safe.mjs +3 -4
- package/apps/studio/bin/_annotate-post.mjs +14 -5
- package/apps/studio/bin/_audio-search.mjs +8 -2
- package/apps/studio/bin/_curl-local.mjs +7 -4
- package/apps/studio/bin/_desktop-locate.sh +145 -0
- package/apps/studio/bin/_ds-check-live.mjs +2 -1
- package/apps/studio/bin/_exports.mjs +38 -2
- package/apps/studio/bin/_history.mjs +79 -8
- package/apps/studio/bin/_import-asset.mjs +14 -9
- package/apps/studio/bin/_import-figma.mjs +510 -98
- package/apps/studio/bin/_index-cli.mjs +10 -21
- package/apps/studio/bin/_ingest-footage.mjs +24 -6
- package/apps/studio/bin/_media-probe.mjs +232 -0
- package/apps/studio/bin/_perf-probe-open.mjs +6 -0
- package/apps/studio/bin/_perf-probe-safari.mjs +6 -0
- package/apps/studio/bin/_perf-probe-studio.mjs +6 -1
- package/apps/studio/bin/_perf-probe.mjs +8 -3
- package/apps/studio/bin/_perf-sweep-shared.mjs +789 -0
- package/apps/studio/bin/_perf-sweep.mjs +240 -0
- package/apps/studio/bin/_record-shot.sh +33 -8
- package/apps/studio/bin/_screenshot-playwright.mjs +45 -2
- package/apps/studio/bin/_studio-verb.mjs +8 -3
- package/apps/studio/bin/_thumb-route.mjs +21 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +83 -1
- package/apps/studio/bin/_transcribe.mjs +22 -6
- package/apps/studio/bin/_unsynced-refs.mjs +22 -0
- package/apps/studio/bin/_url-guard.mjs +120 -5
- package/apps/studio/bin/_url-guard.sh +29 -7
- package/apps/studio/bin/_video-limits.mjs +104 -0
- package/apps/studio/bin/_video-playwright.mjs +119 -19
- package/apps/studio/bin/_video-proxy.mjs +130 -0
- package/apps/studio/bin/_write-claim.mjs +38 -16
- package/apps/studio/bin/annotate.mjs +12 -2
- package/apps/studio/bin/canvas-rects.sh +19 -4
- package/apps/studio/bin/chat-open.sh +7 -1
- package/apps/studio/bin/draw-proof.sh +6 -2
- package/apps/studio/bin/generate.sh +32 -10
- package/apps/studio/bin/handoff.sh +2 -2
- package/apps/studio/bin/perf.sh +96 -15
- package/apps/studio/bin/photo-adjust.sh +6 -3
- package/apps/studio/bin/photo-bg-remove.sh +2 -2
- package/apps/studio/bin/prep.sh +21 -4
- package/apps/studio/bin/read-annotations.mjs +3 -0
- package/apps/studio/bin/runtime-health.sh +27 -1
- package/apps/studio/bin/screenshot.sh +152 -12
- package/apps/studio/bin/server-up.sh +64 -6
- package/apps/studio/bin/smoke.sh +43 -8
- package/apps/studio/bin/to-lottie.sh +3 -2
- package/apps/studio/bin/video-proxy.sh +27 -0
- package/apps/studio/bin/visual-sanity.sh +3 -1
- package/apps/studio/bridge/dgn-protocol.ts +157 -1
- package/apps/studio/bridge/mode-shows.ts +8 -6
- package/apps/studio/bridge/still-webp.ts +233 -0
- package/apps/studio/build.ts +18 -0
- package/apps/studio/canvas-build.ts +93 -11
- package/apps/studio/canvas-comment-mount.tsx +53 -8
- package/apps/studio/canvas-edit.ts +34 -1
- package/apps/studio/canvas-lib-module.ts +210 -0
- package/apps/studio/canvas-lib.tsx +3 -12
- package/apps/studio/canvas-pipeline.ts +111 -5
- package/apps/studio/canvas-shell.tsx +8 -11
- package/apps/studio/canvas-theme-pill.tsx +5 -3
- package/apps/studio/check/index.ts +12 -5
- package/apps/studio/check/video.ts +18 -2
- package/apps/studio/client/app.jsx +65 -7
- package/apps/studio/client/clipboard-relay.ts +193 -16
- package/apps/studio/client/comments-overlay.css +18 -0
- package/apps/studio/client/export-center.jsx +30 -0
- package/apps/studio/client/generate-dialog.jsx +49 -4
- package/apps/studio/client/github.js +7 -0
- package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
- package/apps/studio/client/home/HomeConnection.jsx +111 -0
- package/apps/studio/client/home/home-accounts-model.js +110 -1
- package/apps/studio/client/home/home-api.js +9 -2
- package/apps/studio/client/home/home-app.jsx +126 -13
- package/apps/studio/client/home/home-model.js +69 -1
- package/apps/studio/client/home/home-where-model.js +105 -0
- package/apps/studio/client/home/home.css +239 -1
- package/apps/studio/client/hooks/use-canvas-bridge.jsx +173 -98
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +5 -1
- package/apps/studio/client/hooks/use-tabs.jsx +11 -4
- package/apps/studio/client/panels/DiffView.jsx +7 -1
- package/apps/studio/client/panels/TeamProjects.jsx +137 -134
- package/apps/studio/client/panels/chat-context.js +2 -0
- package/apps/studio/client/panels/slash-commands.gen.js +13 -13
- package/apps/studio/client/selection-scope.js +16 -9
- package/apps/studio/client/share-link.js +12 -0
- package/apps/studio/client/shell/viewport.jsx +11 -1
- package/apps/studio/client/shell-events.js +8 -0
- package/apps/studio/client/styles/3-kit-maude-v2.css +16 -0
- package/apps/studio/client/styles/_index.css +4 -0
- package/apps/studio/client/v2/ai/Feed.jsx +1 -1
- package/apps/studio/client/v2/ai/OfferCard.jsx +34 -0
- package/apps/studio/client/v2/ai/activity-line.js +54 -1
- package/apps/studio/client/v2/ai/ai-offer.js +21 -1
- package/apps/studio/client/v2/ai/run-model.js +3 -1
- package/apps/studio/client/v2/annotations/vote-store.js +28 -4
- package/apps/studio/client/v2/assets/asset-drop-session.js +37 -2
- package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +7 -5
- package/apps/studio/client/v2/assets/details-model.js +1 -1
- package/apps/studio/client/v2/assets/details.jsx +5 -0
- package/apps/studio/client/v2/assets/tile-drag.js +11 -7
- package/apps/studio/client/v2/comments/comments-panel.jsx +22 -3
- package/apps/studio/client/v2/create/duplicate-done.js +6 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
- package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +113 -3
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +343 -6
- package/apps/studio/client/v2/diagnostics/sync-details/unsynced-refs.js +55 -0
- package/apps/studio/client/v2/ds/review.css +1 -1
- package/apps/studio/client/v2/export/exports-model.js +7 -0
- package/apps/studio/client/v2/export/exports-panel.jsx +1 -0
- package/apps/studio/client/v2/export/job-row.jsx +32 -2
- package/apps/studio/client/v2/handoff/ready-card.jsx +1 -1
- package/apps/studio/client/v2/history/compare-view.jsx +1 -0
- package/apps/studio/client/v2/inspector/css-write.js +6 -1
- package/apps/studio/client/v2/inspector/frame.jsx +28 -4
- package/apps/studio/client/v2/inspector/kinds/clip-model.js +51 -0
- package/apps/studio/client/v2/inspector/kinds/clip.jsx +75 -2
- package/apps/studio/client/v2/inspector/model.js +21 -0
- package/apps/studio/client/v2/inspector/sections/fill.jsx +12 -3
- package/apps/studio/client/v2/inspector/sections/recent-colours.js +8 -5
- package/apps/studio/client/v2/inspector/view-mode.jsx +11 -1
- package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
- package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
- package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
- package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
- package/apps/studio/client/v2/link-server/link-server.css +109 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
- package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
- package/apps/studio/client/v2/preview/link-follow.js +4 -2
- package/apps/studio/client/v2/preview/preview-chrome-host.jsx +16 -6
- package/apps/studio/client/v2/search/help-model.js +2 -0
- package/apps/studio/client/v2/search/search-keywords.js +3 -2
- package/apps/studio/client/v2/settings/account.jsx +4 -2
- package/apps/studio/client/v2/settings/advanced-section.jsx +344 -137
- package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
- package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
- package/apps/studio/client/v2/settings/general-section.jsx +155 -24
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
- package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
- package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
- package/apps/studio/client/v2/settings/settings-cards.js +220 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
- package/apps/studio/client/v2/settings/settings-model.js +100 -31
- package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
- package/apps/studio/client/v2/settings/settings.css +374 -64
- package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
- package/apps/studio/client/v2/settings/this-project-model.js +172 -0
- package/apps/studio/client/v2/settings/use-connections.js +3 -2
- package/apps/studio/client/v2/settings/use-open-card.js +37 -0
- package/apps/studio/client/v2/share/share-sheet.jsx +28 -11
- package/apps/studio/client/v2/shell/api-session-boot.js +6 -0
- package/apps/studio/client/v2/shell/api-session.js +126 -0
- package/apps/studio/client/v2/shell/connection-state.js +197 -0
- package/apps/studio/client/v2/shell/floating-panels.css +31 -1
- package/apps/studio/client/v2/shell/image-pick.js +61 -8
- package/apps/studio/client/v2/shell/menu-aim.js +43 -0
- package/apps/studio/client/v2/shell/menu-runner.js +25 -7
- package/apps/studio/client/v2/shell/occlusion-insets.js +18 -1
- package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
- package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
- package/apps/studio/client/v2/shell/project-account-model.js +272 -149
- package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
- package/apps/studio/client/v2/shell/project-account.css +237 -0
- package/apps/studio/client/v2/shell/project-pill.jsx +52 -6
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
- package/apps/studio/client/v2/shell/shell-parity.js +3 -2
- package/apps/studio/client/v2/shell/shell-parity.json +71 -36
- package/apps/studio/client/v2/shell/still-bridge.js +194 -0
- package/apps/studio/client/v2/shell/still-store.js +319 -0
- package/apps/studio/client/v2/shell/use-account.js +2 -0
- package/apps/studio/client/v2/shell/use-tool-panels.js +2 -1
- package/apps/studio/client/v2/signin/use-signin.js +1 -1
- package/apps/studio/client/v2/timeline/Timeline.jsx +15 -0
- package/apps/studio/client/v2/timeline/frame-handle-model.js +142 -0
- package/apps/studio/client/v2/timeline/frame-handle.jsx +151 -0
- package/apps/studio/clip-ops.ts +126 -8
- package/apps/studio/cloud/endpoints.ts +29 -4
- package/apps/studio/collab/ai-activity.ts +10 -8
- package/apps/studio/collab/awareness-bridge.ts +34 -9
- package/apps/studio/collab/index.ts +3 -0
- package/apps/studio/collab/registry.ts +41 -10
- package/apps/studio/comment-reattach.ts +149 -0
- package/apps/studio/comments/mine-stamp.ts +15 -7
- package/apps/studio/comments/ops.ts +52 -8
- package/apps/studio/comments-overlay.tsx +146 -9
- package/apps/studio/dist/client.bundle.js +892 -885
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/dom-selection.ts +87 -18
- package/apps/studio/ds/board/directions.css +8 -0
- package/apps/studio/ds/board/outline.tsx +16 -0
- package/apps/studio/ds/canvas-check.ts +6 -0
- package/apps/studio/edit-ops/clip/reframe.ts +19 -3
- package/apps/studio/edit-ops/clip-carry.ts +602 -0
- package/apps/studio/edit-ops/clipboard.ts +318 -23
- package/apps/studio/edit-ops/dispatch.ts +20 -2
- package/apps/studio/edit-ops/scope-names.ts +249 -40
- package/apps/studio/edit-ops/slot-defaults.ts +3 -0
- package/apps/studio/edit-ops/types.ts +6 -0
- package/apps/studio/editing/align-bar.tsx +33 -9
- package/apps/studio/editing/artboard-actions.ts +5 -0
- package/apps/studio/editing/artboard-menu.tsx +6 -2
- package/apps/studio/editing/click-to-type.ts +1 -1
- package/apps/studio/editing/clip-words.ts +48 -0
- package/apps/studio/editing/clipboard.ts +21 -6
- package/apps/studio/editing/declared-background.ts +25 -0
- package/apps/studio/editing/index.tsx +3 -0
- package/apps/studio/editing/object-keys.ts +4 -4
- package/apps/studio/editing/object-menu.tsx +13 -3
- package/apps/studio/editing/pen/points.tsx +61 -0
- package/apps/studio/editing/text-in-place.tsx +11 -0
- package/apps/studio/editing/video-frame-handle.tsx +425 -0
- package/apps/studio/exporters/capture-prepass.ts +374 -0
- package/apps/studio/exporters/degraded.ts +148 -0
- package/apps/studio/exporters/hub-render-door.ts +28 -2
- package/apps/studio/exporters/index.ts +3 -1
- package/apps/studio/exporters/job-budget.ts +93 -0
- package/apps/studio/exporters/jobs.ts +215 -28
- package/apps/studio/exporters/parity-check.ts +254 -0
- package/apps/studio/exporters/remote.ts +209 -15
- package/apps/studio/exporters/svg-inline.ts +87 -0
- package/apps/studio/exporters/video-render-lib.ts +88 -26
- package/apps/studio/exporters/video.ts +29 -6
- package/apps/studio/figma/assets.ts +58 -43
- package/apps/studio/figma/codegen-fonts.ts +100 -0
- package/apps/studio/figma/fig-decode.ts +390 -25
- package/apps/studio/figma/fig-kiwi.ts +18 -4
- package/apps/studio/figma/fig-vector.ts +59 -3
- package/apps/studio/figma/sanitize.ts +2 -0
- package/apps/studio/figma/style-map.ts +293 -48
- package/apps/studio/figma/to-artboard.ts +455 -69
- package/apps/studio/figma/to-strokes.ts +44 -11
- package/apps/studio/figma/types.ts +13 -0
- package/apps/studio/footage/schema.ts +3 -3
- package/apps/studio/generation/adapters/elevenlabs.ts +7 -1
- package/apps/studio/generation/adapters/groq.ts +8 -1
- package/apps/studio/generation/spend.ts +312 -0
- package/apps/studio/generation/types.ts +12 -0
- package/apps/studio/handoff/run.ts +1 -1
- package/apps/studio/handoff/targets.ts +2 -2
- package/apps/studio/handoff/write-scopes.ts +1 -1
- package/apps/studio/history/describe-annotations.ts +4 -0
- package/apps/studio/home/accounts.ts +30 -11
- package/apps/studio/home/cloud.ts +6 -1
- package/apps/studio/home/create-local.ts +32 -3
- package/apps/studio/home/hub-health.ts +76 -0
- package/apps/studio/home/routes.ts +15 -4
- package/apps/studio/http.ts +438 -86
- package/apps/studio/imported-module-ids.ts +91 -0
- package/apps/studio/inspect.ts +2 -0
- package/apps/studio/migrate/hub.ts +8 -1
- package/apps/studio/notifications.tsx +47 -5
- package/apps/studio/paths.ts +10 -1
- package/apps/studio/port.ts +3 -2
- package/apps/studio/preview/preview-camera.tsx +15 -382
- package/apps/studio/readiness.ts +10 -1
- package/apps/studio/release-build.ts +51 -0
- package/apps/studio/routes/agent.ts +188 -9
- package/apps/studio/routes/ai.ts +43 -11
- package/apps/studio/routes/annotations.ts +27 -1
- package/apps/studio/routes/assets.ts +18 -1
- package/apps/studio/routes/canvas-origin.ts +12 -9
- package/apps/studio/routes/cloud-move.ts +15 -0
- package/apps/studio/routes/edit.ts +3 -0
- package/apps/studio/routes/export.ts +51 -0
- package/apps/studio/routes/generate.ts +42 -12
- package/apps/studio/routes/hub-link-folder.ts +334 -0
- package/apps/studio/routes/hub-signin.ts +78 -1
- package/apps/studio/routes/index.ts +9 -1
- package/apps/studio/routes/shell.ts +217 -5
- package/apps/studio/routes/sync.ts +136 -8
- package/apps/studio/routes/votes.ts +2 -1
- package/apps/studio/schema/annotations.v2.schema.json +143 -1
- package/apps/studio/schema/beats.v1.schema.json +1 -1
- package/apps/studio/schema/edl.v1.schema.json +1 -1
- package/apps/studio/schema/formats.ts +3 -3
- package/apps/studio/schema/transcript.v1.schema.json +1 -1
- package/apps/studio/server.ts +142 -43
- package/apps/studio/shell/api-key.ts +503 -0
- package/apps/studio/shell/attest.ts +59 -0
- package/apps/studio/shell/capture-url.ts +20 -0
- package/apps/studio/shell/cli-yield.ts +276 -0
- package/apps/studio/shell/clip-transfer.ts +302 -0
- package/apps/studio/shell/key-file.ts +108 -0
- package/apps/studio/shell/server-json.ts +75 -0
- package/apps/studio/shell/worktree.ts +19 -0
- package/apps/studio/spoof-chars.ts +9 -0
- package/apps/studio/studio-page-host.ts +1 -1
- package/apps/studio/sync/accepted-cold-start.ts +144 -8
- package/apps/studio/sync/accepted-link.ts +76 -29
- package/apps/studio/sync/action-stage.ts +575 -44
- package/apps/studio/sync/adopt-held.ts +85 -0
- package/apps/studio/sync/ctl-heal.ts +58 -0
- package/apps/studio/sync/file-ledger.ts +38 -4
- package/apps/studio/sync/file-membership.ts +16 -1
- package/apps/studio/sync/file-plane.ts +289 -22
- package/apps/studio/sync/held-deletes.ts +86 -5
- package/apps/studio/sync/hub-link.ts +8 -0
- package/apps/studio/sync/index.ts +196 -12
- package/apps/studio/sync/journal-client.ts +50 -4
- package/apps/studio/sync/link-consent.ts +22 -75
- package/apps/studio/sync/link-survey.ts +252 -0
- package/apps/studio/sync/local-kernel.ts +296 -8
- package/apps/studio/sync/projection.ts +22 -3
- package/apps/studio/sync/seed-progress.ts +12 -0
- package/apps/studio/sync/source-recovery.ts +59 -3
- package/apps/studio/sync/status.ts +19 -2
- package/apps/studio/sync/unsynced-refs.ts +397 -0
- package/apps/studio/sync/writer-registry.ts +20 -0
- package/apps/studio/thumbs/service.ts +4 -1
- package/apps/studio/tool-palette.tsx +23 -0
- package/apps/studio/ui-prefs.ts +40 -0
- package/apps/studio/use-agent-presence.tsx +2 -2
- package/apps/studio/use-canvas-keys.ts +6 -1
- package/apps/studio/video/format-ids.ts +2 -2
- package/apps/studio/video/inject.ts +31 -0
- package/apps/studio/video/media-risk.ts +58 -0
- package/apps/studio/video/object-fit.ts +137 -0
- package/apps/studio/video/provider-transcript.ts +141 -0
- package/apps/studio/whats-new.json +137 -0
- package/apps/studio/workspace-mode.ts +1 -0
- package/apps/studio/ws.ts +5 -0
- package/cli/commands/design.mjs +119 -8
- package/cli/lib/bash-guard.mjs +366 -6
- package/cli/lib/confine-read.mjs +1 -0
- package/cli/lib/design-help.gen.mjs +3 -2
- package/cli/lib/design-hook.mjs +387 -81
- package/cli/lib/design-link.mjs +16 -1
- package/cli/lib/design-open.mjs +49 -3
- package/cli/lib/desktop-locate.mjs +770 -0
- package/cli/lib/handoff.mjs +1 -1
- package/cli/lib/hook-state.mjs +291 -0
- package/cli/lib/pkg-root.mjs +65 -13
- package/cli/lib/studio-locate.mjs +59 -16
- package/package.json +15 -8
- package/plugins/design/templates/_shell.html +13 -0
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
- package/apps/studio/client/v2/shell/account-card-model.js +0 -114
- package/apps/studio/client/v2/shell/account-card.jsx +0 -189
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
// client/v2/settings/this-project-card.jsx — 2.1.1 T6: Settings › General › This project (canvas 17 · 08 · 09).
|
|
2
|
+
//
|
|
3
|
+
// General's first card, open by default: where this project lives, which account it uses, whether it
|
|
4
|
+
// connects — with Change… and Switch… beside them — and, when a sign-in broke, the one fix in its header
|
|
5
|
+
// (visible while the card is closed). A project only on this Mac offers its two ways out: Put on Maude
|
|
6
|
+
// Cloud… and Link your server…. The model is this-project-model.js.
|
|
7
|
+
//
|
|
8
|
+
// Sync details (the card's own fold, remembered per Mac) holds what used to be Advanced › This project
|
|
9
|
+
// (the sync switches and who keeps .design/, project-sync-settings.jsx) and what used to be Connections ›
|
|
10
|
+
// Maude Cloud and › Your team's own server: the account, the cloud projects on this Mac (Connect /
|
|
11
|
+
// Disconnect, D11), the server's address and masked token with Replace…, its Sign out. Same hooks, same
|
|
12
|
+
// routes (use-connections.js) — only the home moved: Connections is about the person, this card is
|
|
13
|
+
// about this project.
|
|
14
|
+
//
|
|
15
|
+
// Switch… runs `account.switch` (the avatar's account list, T4); Link your server… sends
|
|
16
|
+
// `account.link-server`'s event (T5's one dialog takes it; nothing taking it opens today's team-server
|
|
17
|
+
// form here); Sign in again for a server opens that form on the server's address, for Maude Cloud the
|
|
18
|
+
// device sign-in. Moving a project between your folder and a copy Maude keeps has no backend yet —
|
|
19
|
+
// Change… draws only what works (Show in Finder).
|
|
20
|
+
|
|
21
|
+
import { useEffect, useRef, useState } from 'react';
|
|
22
|
+
|
|
23
|
+
import { isNativeApp } from '../../github.js';
|
|
24
|
+
import {
|
|
25
|
+
CloudDeviceDialog,
|
|
26
|
+
isLinkedProjectRow,
|
|
27
|
+
openExternal,
|
|
28
|
+
shareViewUrl,
|
|
29
|
+
} from '../../panels/CloudBar.jsx';
|
|
30
|
+
import { TeamProjectsDialog } from '../../panels/TeamProjects.jsx';
|
|
31
|
+
import { StIcon } from '../../shell/icons.jsx';
|
|
32
|
+
import { getPaletteEnv } from '../search/search-env.js';
|
|
33
|
+
import { useFold } from '../fold/use-fold.js';
|
|
34
|
+
import { requestShareFocus } from '../share/share-model.js';
|
|
35
|
+
import { menuRunner } from '../shell/menu-runner.js';
|
|
36
|
+
import { nativeDoors } from '../shell/native-doors.js';
|
|
37
|
+
import { LINK_SERVER_EVENT } from '../shell/project-account-bus.js';
|
|
38
|
+
import { AccountBlock } from './account.jsx';
|
|
39
|
+
import { ConnField } from './connection-row.jsx';
|
|
40
|
+
import { cloudRow, maskedToken } from './connections-model.js';
|
|
41
|
+
import ProjectSyncSettings from './project-sync-settings.jsx';
|
|
42
|
+
import { CardRow, SettingsCard, StatusLine } from './settings-card.jsx';
|
|
43
|
+
import { PROJECT_FOLD } from './settings-model.js';
|
|
44
|
+
import { thisProjectModel } from './this-project-model.js';
|
|
45
|
+
import { useCloudConnection, useHubDetails } from './use-connections.js';
|
|
46
|
+
|
|
47
|
+
const btn = 'btn btn--sm';
|
|
48
|
+
|
|
49
|
+
function useOnline() {
|
|
50
|
+
const [on, setOn] = useState(() =>
|
|
51
|
+
typeof navigator === 'undefined' ? true : navigator.onLine !== false
|
|
52
|
+
);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const up = () => setOn(true);
|
|
55
|
+
const down = () => setOn(false);
|
|
56
|
+
window.addEventListener('online', up);
|
|
57
|
+
window.addEventListener('offline', down);
|
|
58
|
+
return () => {
|
|
59
|
+
window.removeEventListener('online', up);
|
|
60
|
+
window.removeEventListener('offline', down);
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
return on;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The project's square: its first letter (canvas 17 `Sq`). */
|
|
67
|
+
function ProjectSquare({ name }) {
|
|
68
|
+
const ch =
|
|
69
|
+
String(name || '?')
|
|
70
|
+
.trim()
|
|
71
|
+
.charAt(0)
|
|
72
|
+
.toUpperCase() || '?';
|
|
73
|
+
return <span className="v2s-sq">{ch}</span>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The account's face: an initial, or a laptop for no account (canvas 17 `Face`). */
|
|
77
|
+
function Face({ account }) {
|
|
78
|
+
if (account.kind === 'local')
|
|
79
|
+
return (
|
|
80
|
+
<span className="v2s-face v2s-face--mac" aria-hidden="true">
|
|
81
|
+
<StIcon name="laptop" size={12} />
|
|
82
|
+
</span>
|
|
83
|
+
);
|
|
84
|
+
const ch = String(account.label || '?')
|
|
85
|
+
.charAt(0)
|
|
86
|
+
.toUpperCase();
|
|
87
|
+
return (
|
|
88
|
+
<span className="v2s-face" aria-hidden="true">
|
|
89
|
+
{ch}
|
|
90
|
+
</span>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Lives in: the place chip (canvas 17 `PlaceChip`). */
|
|
95
|
+
function PlaceChip({ place }) {
|
|
96
|
+
const icon = place.kind === 'folder' ? 'folder' : place.kind === 'server' ? 'box' : 'cloud';
|
|
97
|
+
return (
|
|
98
|
+
<span className="v2s-place" data-testid="settings-project-place" data-place={place.kind}>
|
|
99
|
+
<StIcon name={icon} size={12} />
|
|
100
|
+
<span>{place.label}</span>
|
|
101
|
+
{place.path ? <span className="v2s-place-path">{place.path}</span> : null}
|
|
102
|
+
</span>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Change… — where the project lives, and what this Mac can do about it today. */
|
|
107
|
+
function ChangeMenu({ m, onShowInFinder }) {
|
|
108
|
+
const [open, setOpen] = useState(false);
|
|
109
|
+
const btnRef = useRef(null);
|
|
110
|
+
const menuRef = useRef(null);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (!open) return undefined;
|
|
113
|
+
menuRef.current?.querySelector('[role^="menuitem"]:not([aria-disabled="true"])')?.focus();
|
|
114
|
+
const away = (e) => {
|
|
115
|
+
if (!menuRef.current?.contains(e.target) && !btnRef.current?.contains(e.target))
|
|
116
|
+
setOpen(false);
|
|
117
|
+
};
|
|
118
|
+
document.addEventListener('mousedown', away);
|
|
119
|
+
return () => document.removeEventListener('mousedown', away);
|
|
120
|
+
}, [open]);
|
|
121
|
+
const close = () => {
|
|
122
|
+
setOpen(false);
|
|
123
|
+
btnRef.current?.focus();
|
|
124
|
+
};
|
|
125
|
+
const shown = m.changeOptions.filter((o) => o.available);
|
|
126
|
+
const places = shown.filter((o) => o.id !== 'finder');
|
|
127
|
+
const finder = shown.find((o) => o.id === 'finder');
|
|
128
|
+
return (
|
|
129
|
+
<span className="v2s-menu-host">
|
|
130
|
+
<button
|
|
131
|
+
ref={btnRef}
|
|
132
|
+
type="button"
|
|
133
|
+
className={btn}
|
|
134
|
+
aria-haspopup="menu"
|
|
135
|
+
aria-expanded={open}
|
|
136
|
+
onClick={() => setOpen((v) => !v)}
|
|
137
|
+
data-testid="settings-project-change"
|
|
138
|
+
>
|
|
139
|
+
Change…
|
|
140
|
+
</button>
|
|
141
|
+
{open ? (
|
|
142
|
+
<div
|
|
143
|
+
ref={menuRef}
|
|
144
|
+
className="v2s-menu"
|
|
145
|
+
role="menu"
|
|
146
|
+
aria-label={`Where ${m.name} lives`}
|
|
147
|
+
data-testid="settings-project-change-menu"
|
|
148
|
+
onKeyDown={(e) => {
|
|
149
|
+
if (e.key === 'Escape') {
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
e.stopPropagation();
|
|
152
|
+
close();
|
|
153
|
+
}
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
<p className="v2s-menu-h">Where {m.name} lives</p>
|
|
157
|
+
{places.map((o) => (
|
|
158
|
+
<div
|
|
159
|
+
key={o.id}
|
|
160
|
+
// the place it lives now — information, not a choice (moving between places has no
|
|
161
|
+
// backend yet), so it is not a menu item a person could try to pick
|
|
162
|
+
role="presentation"
|
|
163
|
+
aria-current={o.current ? 'true' : undefined}
|
|
164
|
+
className="v2s-menu-i"
|
|
165
|
+
data-testid={`settings-project-place-${o.id}`}
|
|
166
|
+
>
|
|
167
|
+
<span className="v2s-menu-ck">
|
|
168
|
+
{o.current ? <StIcon name="check" size={12} /> : null}
|
|
169
|
+
</span>
|
|
170
|
+
<span>{o.label}</span>
|
|
171
|
+
{o.detail ? <span className="v2s-menu-d">{o.detail}</span> : null}
|
|
172
|
+
</div>
|
|
173
|
+
))}
|
|
174
|
+
{finder ? (
|
|
175
|
+
<>
|
|
176
|
+
<span className="v2s-menu-sep" />
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
role="menuitem"
|
|
180
|
+
className="v2s-menu-i"
|
|
181
|
+
onClick={() => {
|
|
182
|
+
close();
|
|
183
|
+
onShowInFinder();
|
|
184
|
+
}}
|
|
185
|
+
data-testid="settings-project-finder"
|
|
186
|
+
>
|
|
187
|
+
<span className="v2s-menu-ck">
|
|
188
|
+
<StIcon name="folder" size={12} />
|
|
189
|
+
</span>
|
|
190
|
+
<span>Show in Finder</span>
|
|
191
|
+
</button>
|
|
192
|
+
</>
|
|
193
|
+
) : null}
|
|
194
|
+
</div>
|
|
195
|
+
) : null}
|
|
196
|
+
</span>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function CloudProjects({ c }) {
|
|
201
|
+
const { projects, local, cloudUrl, busy } = c;
|
|
202
|
+
if (projects === null)
|
|
203
|
+
return (
|
|
204
|
+
<div className="v2s-conn-li" aria-disabled="true">
|
|
205
|
+
Loading projects…
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
if (projects.length === 0)
|
|
209
|
+
return (
|
|
210
|
+
<div className="v2s-conn-li" aria-disabled="true">
|
|
211
|
+
No projects yet — start one on the dashboard.
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
return projects.map((p) => {
|
|
215
|
+
const name = p.name || p.id;
|
|
216
|
+
// Viewer dignity (Phase 17 T4): no dead Connect that would 403 at the workspace — viewing has a
|
|
217
|
+
// first-class home in the browser, and the label says why.
|
|
218
|
+
if (p.role === 'viewer')
|
|
219
|
+
return (
|
|
220
|
+
<div className="v2s-conn-li" key={p.id}>
|
|
221
|
+
<button
|
|
222
|
+
type="button"
|
|
223
|
+
className="btn btn--ghost btn--sm"
|
|
224
|
+
onClick={() => openExternal(shareViewUrl(p.url, p.id))}
|
|
225
|
+
title="Viewing works in the browser. Editing in the app needs the member role — ask whoever runs the project."
|
|
226
|
+
data-testid={`cloud-project-${p.id}`}
|
|
227
|
+
>
|
|
228
|
+
{`View ${name} in the browser`}
|
|
229
|
+
</button>
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
const linked = isLinkedProjectRow({
|
|
233
|
+
projectUrl: p.url,
|
|
234
|
+
linkedHubUrl: local.linkedHub?.url,
|
|
235
|
+
linkedHubCredentialed: local.linkedHub?.credentialed,
|
|
236
|
+
cloudUrl,
|
|
237
|
+
});
|
|
238
|
+
return linked ? (
|
|
239
|
+
<div className="v2s-conn-li is-connected" key={p.id} data-testid={`cloud-project-${p.id}`}>
|
|
240
|
+
<span>{name}</span>
|
|
241
|
+
<span className="v2s-conn-s v2s-conn-s--ok">Connected</span>
|
|
242
|
+
<button
|
|
243
|
+
type="button"
|
|
244
|
+
className="btn btn--ghost btn--sm"
|
|
245
|
+
disabled={busy === 'disconnect'}
|
|
246
|
+
onClick={c.disconnect}
|
|
247
|
+
aria-label={`Disconnect this folder from ${name}`}
|
|
248
|
+
data-testid={`cloud-disconnect-${p.id}`}
|
|
249
|
+
>
|
|
250
|
+
{busy === 'disconnect' ? 'Disconnecting…' : 'Disconnect'}
|
|
251
|
+
</button>
|
|
252
|
+
</div>
|
|
253
|
+
) : (
|
|
254
|
+
<div className="v2s-conn-li" key={p.id}>
|
|
255
|
+
<span>{name}</span>
|
|
256
|
+
<button
|
|
257
|
+
type="button"
|
|
258
|
+
className="btn btn--ghost btn--sm"
|
|
259
|
+
disabled={busy === p.id}
|
|
260
|
+
onClick={() => c.connect(p.id)}
|
|
261
|
+
title={`Connect this folder to ${name}`}
|
|
262
|
+
data-testid={`cloud-project-${p.id}`}
|
|
263
|
+
>
|
|
264
|
+
{busy === p.id ? 'Connecting…' : `Connect ${name}`}
|
|
265
|
+
</button>
|
|
266
|
+
</div>
|
|
267
|
+
);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Replace… — a password field, sent once through `POST /_api/hub/link`, then cleared. */
|
|
272
|
+
function ReplaceToken({ hub }) {
|
|
273
|
+
const [open, setOpen] = useState(false);
|
|
274
|
+
const [value, setValue] = useState('');
|
|
275
|
+
if (!open)
|
|
276
|
+
return (
|
|
277
|
+
<button
|
|
278
|
+
type="button"
|
|
279
|
+
className="btn btn--ghost btn--sm"
|
|
280
|
+
onClick={() => setOpen(true)}
|
|
281
|
+
data-testid="settings-hub-token-replace"
|
|
282
|
+
>
|
|
283
|
+
Replace…
|
|
284
|
+
</button>
|
|
285
|
+
);
|
|
286
|
+
const done = async () => {
|
|
287
|
+
const ok = await hub.replace(value);
|
|
288
|
+
setValue('');
|
|
289
|
+
if (ok) setOpen(false);
|
|
290
|
+
};
|
|
291
|
+
return (
|
|
292
|
+
<span className="v2s-conn-replace">
|
|
293
|
+
<input
|
|
294
|
+
className="input"
|
|
295
|
+
type="password"
|
|
296
|
+
autoComplete="off"
|
|
297
|
+
spellCheck={false}
|
|
298
|
+
value={value}
|
|
299
|
+
placeholder="Paste the new token"
|
|
300
|
+
aria-label="New access token"
|
|
301
|
+
onChange={(e) => setValue(e.target.value)}
|
|
302
|
+
onKeyDown={(e) => {
|
|
303
|
+
if (e.key === 'Enter') done();
|
|
304
|
+
if (e.key === 'Escape') {
|
|
305
|
+
e.preventDefault();
|
|
306
|
+
setValue('');
|
|
307
|
+
setOpen(false);
|
|
308
|
+
}
|
|
309
|
+
}}
|
|
310
|
+
data-testid="settings-hub-token-input"
|
|
311
|
+
/>
|
|
312
|
+
<button
|
|
313
|
+
type="button"
|
|
314
|
+
className={btn}
|
|
315
|
+
disabled={hub.busy || !value.trim()}
|
|
316
|
+
onClick={done}
|
|
317
|
+
data-testid="settings-hub-token-save"
|
|
318
|
+
>
|
|
319
|
+
{hub.busy ? 'Saving…' : 'Replace'}
|
|
320
|
+
</button>
|
|
321
|
+
<button
|
|
322
|
+
type="button"
|
|
323
|
+
className="btn btn--ghost btn--sm"
|
|
324
|
+
onClick={() => {
|
|
325
|
+
setValue('');
|
|
326
|
+
setOpen(false);
|
|
327
|
+
}}
|
|
328
|
+
>
|
|
329
|
+
Cancel
|
|
330
|
+
</button>
|
|
331
|
+
</span>
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** The linked server's address + masked token — never more than its last four characters. */
|
|
336
|
+
function HubFields({ url, hub, replace, credentialed }) {
|
|
337
|
+
const d = hub.details;
|
|
338
|
+
// Until the details answer, the link's own corroboration says whether a token is stored at all.
|
|
339
|
+
const stored = d ? d.credentialed : !!credentialed;
|
|
340
|
+
return (
|
|
341
|
+
<div data-testid="settings-hub-address">
|
|
342
|
+
<ConnField k="Address" mono copy={url}>
|
|
343
|
+
{url}
|
|
344
|
+
</ConnField>
|
|
345
|
+
<ConnField k="Access token" mono testid="settings-hub-token">
|
|
346
|
+
<span className="v2s-conn-inline">
|
|
347
|
+
{stored ? maskedToken(d?.tokenLast4) : 'None saved for this folder'}
|
|
348
|
+
{replace && stored ? <ReplaceToken hub={hub} /> : null}
|
|
349
|
+
</span>
|
|
350
|
+
</ConnField>
|
|
351
|
+
{typeof d?.account === 'string' && d.account ? (
|
|
352
|
+
<ConnField k="Signed in as" mono testid="settings-hub-account">
|
|
353
|
+
{d.account}
|
|
354
|
+
</ConnField>
|
|
355
|
+
) : null}
|
|
356
|
+
{d?.version ? (
|
|
357
|
+
<ConnField k="Hub version" mono testid="settings-hub-version">
|
|
358
|
+
{d.version}
|
|
359
|
+
</ConnField>
|
|
360
|
+
) : null}
|
|
361
|
+
{hub.error ? (
|
|
362
|
+
<p className="v2s-conn-err" role="alert">
|
|
363
|
+
{hub.error}
|
|
364
|
+
</p>
|
|
365
|
+
) : null}
|
|
366
|
+
</div>
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** Run a registry action through the one runner, when the shell can; false when it cannot. */
|
|
371
|
+
function runAction(id, params) {
|
|
372
|
+
if (!menuRunner.canRun(id)) return false;
|
|
373
|
+
return menuRunner.run(id, params);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export default function ThisProjectCard({
|
|
377
|
+
open,
|
|
378
|
+
onToggle,
|
|
379
|
+
focus,
|
|
380
|
+
syncStatus,
|
|
381
|
+
onLinkedHub,
|
|
382
|
+
onLocalProject,
|
|
383
|
+
onCloseSheet,
|
|
384
|
+
}) {
|
|
385
|
+
const cloud = useCloudConnection({ onLinkedHub, onLocalProject, syncStatus });
|
|
386
|
+
const online = useOnline();
|
|
387
|
+
// 2.1.1 T8 — an address this Mac never confirmed is the repo's text: no details are asked about it
|
|
388
|
+
const linkedUrl =
|
|
389
|
+
cloud.local.linkedHub?.confirmed === false ? null : (cloud.local.linkedHub?.url ?? null);
|
|
390
|
+
const hub = useHubDetails(linkedUrl);
|
|
391
|
+
const [, setFold] = useFold(PROJECT_FOLD);
|
|
392
|
+
const [teamOpen, setTeamOpen] = useState(false);
|
|
393
|
+
const [signInAt, setSignInAt] = useState(null);
|
|
394
|
+
const native = isNativeApp();
|
|
395
|
+
|
|
396
|
+
// ⌘K found a row of this card: nearly all of them sit under Sync details, so the fold opens too (it
|
|
397
|
+
// stays open, like any fold opened by hand).
|
|
398
|
+
const focusN = focus?.n ?? 0;
|
|
399
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: a new ask (`n`) opens it again
|
|
400
|
+
useEffect(() => {
|
|
401
|
+
if (focus?.card === 'this-project') setFold(true);
|
|
402
|
+
}, [focusN]);
|
|
403
|
+
|
|
404
|
+
const m = thisProjectModel({
|
|
405
|
+
status: {
|
|
406
|
+
connected: cloud.state === 'in',
|
|
407
|
+
email: cloud.email,
|
|
408
|
+
url: cloud.cloudUrl,
|
|
409
|
+
project: cloud.local.project,
|
|
410
|
+
linkedHub: cloud.local.linkedHub,
|
|
411
|
+
place: cloud.local.place,
|
|
412
|
+
},
|
|
413
|
+
syncStatus,
|
|
414
|
+
hubAccount: hub.details?.account ?? null,
|
|
415
|
+
online,
|
|
416
|
+
native,
|
|
417
|
+
});
|
|
418
|
+
const cr = cloudRow({ state: cloud.state, email: cloud.email });
|
|
419
|
+
|
|
420
|
+
const signInAgain = () => {
|
|
421
|
+
if (m.linkKind === 'cloud') {
|
|
422
|
+
cloud.startSignIn();
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
// the one Link your server dialog (2.1.1 T5) on the server's address; today's form when nothing takes it
|
|
426
|
+
const ev = new CustomEvent(LINK_SERVER_EVENT, {
|
|
427
|
+
detail: { intent: 'sign-in', url: m.hubUrl ?? '' },
|
|
428
|
+
cancelable: true,
|
|
429
|
+
});
|
|
430
|
+
window.dispatchEvent(ev);
|
|
431
|
+
if (ev.defaultPrevented) onCloseSheet?.();
|
|
432
|
+
else setSignInAt(m.hubUrl ?? '');
|
|
433
|
+
};
|
|
434
|
+
const linkServer = () => {
|
|
435
|
+
// `account.link-server`'s event (shell/project-account-bus.js): 2.1.1 T5's one dialog takes it; when
|
|
436
|
+
// nothing does, today's team-server form opens here, in the sheet
|
|
437
|
+
const ev = new CustomEvent(LINK_SERVER_EVENT, { detail: { intent: 'link' }, cancelable: true });
|
|
438
|
+
window.dispatchEvent(ev);
|
|
439
|
+
if (ev.defaultPrevented) onCloseSheet?.();
|
|
440
|
+
else setTeamOpen(true);
|
|
441
|
+
};
|
|
442
|
+
// 2.1.1 T8 — Review… on an address the repo names opens the Share sheet's Connect row, where the
|
|
443
|
+
// person says whether it is theirs (the one consent step). Nothing is signed in from here.
|
|
444
|
+
const reviewLink = () => {
|
|
445
|
+
onCloseSheet?.();
|
|
446
|
+
requestShareFocus('connect');
|
|
447
|
+
runAction('share.open');
|
|
448
|
+
};
|
|
449
|
+
const canMove = menuRunner.canRun('share.move-to-cloud');
|
|
450
|
+
const canSwitch = menuRunner.canRun('account.switch');
|
|
451
|
+
const showInFinder = () => {
|
|
452
|
+
const rel = getPaletteEnv()?.designRel || '.design';
|
|
453
|
+
nativeDoors()
|
|
454
|
+
.revealPath(rel)
|
|
455
|
+
.catch(() => {});
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
const fix = m.fixLabel ? (
|
|
459
|
+
<button
|
|
460
|
+
type="button"
|
|
461
|
+
className="btn btn--sm btn--primary"
|
|
462
|
+
onClick={signInAgain}
|
|
463
|
+
data-testid="settings-project-sign-in-again"
|
|
464
|
+
>
|
|
465
|
+
{m.fixLabel}
|
|
466
|
+
</button>
|
|
467
|
+
) : null;
|
|
468
|
+
|
|
469
|
+
if (cloud.state === 'loading') return null;
|
|
470
|
+
|
|
471
|
+
return (
|
|
472
|
+
<>
|
|
473
|
+
<SettingsCard
|
|
474
|
+
id="this-project"
|
|
475
|
+
testid="settings-this-project"
|
|
476
|
+
label="This project"
|
|
477
|
+
iconNode={<ProjectSquare name={m.name} />}
|
|
478
|
+
title="This project"
|
|
479
|
+
titleExtra={m.name}
|
|
480
|
+
desc={m.desc}
|
|
481
|
+
summary={m.statusWord}
|
|
482
|
+
sw={m.sw}
|
|
483
|
+
bad={m.bad}
|
|
484
|
+
// the fix never hides inside a closed card (09): open, it is the callout's button instead
|
|
485
|
+
action={m.bad && !open ? fix : undefined}
|
|
486
|
+
open={open}
|
|
487
|
+
onToggle={onToggle}
|
|
488
|
+
reveal={focus?.card === 'this-project'}
|
|
489
|
+
fold={{
|
|
490
|
+
panel: PROJECT_FOLD,
|
|
491
|
+
label: 'Sync details',
|
|
492
|
+
hint: m.local ? 'Maude Cloud · cloud projects' : 'Project files · trash · first link',
|
|
493
|
+
testid: 'settings-sync-details',
|
|
494
|
+
body: (
|
|
495
|
+
<div className="v2s-sync-details">
|
|
496
|
+
<ProjectSyncSettings cloud={null} />
|
|
497
|
+
|
|
498
|
+
<section className="v2s-sub" aria-label="Maude Cloud" data-testid="settings-cloud">
|
|
499
|
+
<h4 className="v2s-sub-t">Maude Cloud</h4>
|
|
500
|
+
<div
|
|
501
|
+
className="v2s-sub-r"
|
|
502
|
+
data-testid={cloud.state === 'in' ? 'cloud-account' : undefined}
|
|
503
|
+
>
|
|
504
|
+
<StatusLine
|
|
505
|
+
sw={cr.tone === 'ok' ? 'ok' : 'off'}
|
|
506
|
+
testid="settings-conn-cloud-status"
|
|
507
|
+
>
|
|
508
|
+
{cr.status}
|
|
509
|
+
</StatusLine>
|
|
510
|
+
{cr.action === 'sign-out' ? (
|
|
511
|
+
<button
|
|
512
|
+
type="button"
|
|
513
|
+
className={btn}
|
|
514
|
+
disabled={cloud.busy === 'signout'}
|
|
515
|
+
onClick={cloud.signOut}
|
|
516
|
+
data-testid="cloud-sign-out"
|
|
517
|
+
>
|
|
518
|
+
Sign out
|
|
519
|
+
</button>
|
|
520
|
+
) : cr.action === 'sign-in' ? (
|
|
521
|
+
<button
|
|
522
|
+
type="button"
|
|
523
|
+
className={btn}
|
|
524
|
+
onClick={cloud.startSignIn}
|
|
525
|
+
data-testid="cloud-signin"
|
|
526
|
+
>
|
|
527
|
+
Sign in
|
|
528
|
+
</button>
|
|
529
|
+
) : null}
|
|
530
|
+
</div>
|
|
531
|
+
{/* `cloud-bar`: the account's own words — the projects, the Connect outcome, an error. */}
|
|
532
|
+
<div className="v2s-conn-body" data-testid="cloud-bar">
|
|
533
|
+
{cloud.state === 'in' ? (
|
|
534
|
+
<div className="v2s-conn-list">
|
|
535
|
+
<p className="v2s-conn-h">Cloud projects on this Mac</p>
|
|
536
|
+
<div data-testid="settings-cloud-projects">
|
|
537
|
+
<CloudProjects c={cloud} />
|
|
538
|
+
</div>
|
|
539
|
+
{cloud.note ? (
|
|
540
|
+
<p
|
|
541
|
+
className="v2s-hint"
|
|
542
|
+
role="status"
|
|
543
|
+
aria-live="polite"
|
|
544
|
+
data-testid="cloud-connect-note"
|
|
545
|
+
>
|
|
546
|
+
{cloud.note.text}
|
|
547
|
+
</p>
|
|
548
|
+
) : null}
|
|
549
|
+
</div>
|
|
550
|
+
) : null}
|
|
551
|
+
{cloud.error ? (
|
|
552
|
+
<p className="v2s-conn-err" role="alert">
|
|
553
|
+
{cloud.error}
|
|
554
|
+
</p>
|
|
555
|
+
) : null}
|
|
556
|
+
</div>
|
|
557
|
+
{cloud.cloudUrl ? (
|
|
558
|
+
<ConnField k="Address" mono copy={cloud.cloudUrl}>
|
|
559
|
+
{cloud.cloudUrl}
|
|
560
|
+
</ConnField>
|
|
561
|
+
) : null}
|
|
562
|
+
{linkedUrl && m.linkKind === 'cloud' ? (
|
|
563
|
+
<HubFields
|
|
564
|
+
url={linkedUrl}
|
|
565
|
+
hub={hub}
|
|
566
|
+
credentialed={cloud.local.linkedHub?.credentialed}
|
|
567
|
+
/>
|
|
568
|
+
) : null}
|
|
569
|
+
<AccountBlock cloud={null} />
|
|
570
|
+
</section>
|
|
571
|
+
|
|
572
|
+
{m.linkKind === 'server' ? (
|
|
573
|
+
<section
|
|
574
|
+
className="v2s-sub"
|
|
575
|
+
aria-label="Your server"
|
|
576
|
+
data-testid="settings-conn-hub"
|
|
577
|
+
>
|
|
578
|
+
<h4 className="v2s-sub-t">Your server · {m.host}</h4>
|
|
579
|
+
<div className="v2s-sub-r">
|
|
580
|
+
<StatusLine sw={m.sw} testid="settings-conn-hub-status">
|
|
581
|
+
{m.statusWord}
|
|
582
|
+
</StatusLine>
|
|
583
|
+
<button
|
|
584
|
+
type="button"
|
|
585
|
+
className={btn}
|
|
586
|
+
disabled={cloud.busy === 'disconnect'}
|
|
587
|
+
onClick={cloud.disconnect}
|
|
588
|
+
data-testid="settings-hub-sign-out"
|
|
589
|
+
>
|
|
590
|
+
Sign out
|
|
591
|
+
</button>
|
|
592
|
+
</div>
|
|
593
|
+
<HubFields
|
|
594
|
+
url={linkedUrl}
|
|
595
|
+
hub={hub}
|
|
596
|
+
replace
|
|
597
|
+
credentialed={cloud.local.linkedHub?.credentialed}
|
|
598
|
+
/>
|
|
599
|
+
</section>
|
|
600
|
+
) : null}
|
|
601
|
+
{!m.local ? (
|
|
602
|
+
<button
|
|
603
|
+
type="button"
|
|
604
|
+
className="btn btn--ghost btn--sm v2s-conn-more"
|
|
605
|
+
onClick={linkServer}
|
|
606
|
+
data-testid="settings-team-server-add"
|
|
607
|
+
>
|
|
608
|
+
Link another server…
|
|
609
|
+
</button>
|
|
610
|
+
) : null}
|
|
611
|
+
</div>
|
|
612
|
+
),
|
|
613
|
+
}}
|
|
614
|
+
>
|
|
615
|
+
<CardRow
|
|
616
|
+
k="Lives in"
|
|
617
|
+
action={m.canChange ? <ChangeMenu m={m} onShowInFinder={showInFinder} /> : null}
|
|
618
|
+
>
|
|
619
|
+
<PlaceChip place={m.place} />
|
|
620
|
+
</CardRow>
|
|
621
|
+
<CardRow
|
|
622
|
+
k="Account"
|
|
623
|
+
testid="settings-project-account"
|
|
624
|
+
action={
|
|
625
|
+
canSwitch ? (
|
|
626
|
+
<button
|
|
627
|
+
type="button"
|
|
628
|
+
className="btn btn--ghost btn--sm"
|
|
629
|
+
onClick={() => {
|
|
630
|
+
onCloseSheet?.();
|
|
631
|
+
runAction('account.switch');
|
|
632
|
+
}}
|
|
633
|
+
data-testid="settings-project-switch"
|
|
634
|
+
>
|
|
635
|
+
Switch…
|
|
636
|
+
</button>
|
|
637
|
+
) : null
|
|
638
|
+
}
|
|
639
|
+
>
|
|
640
|
+
<span className="v2s-inline">
|
|
641
|
+
<Face account={m.account} />
|
|
642
|
+
{m.account.label}
|
|
643
|
+
</span>
|
|
644
|
+
</CardRow>
|
|
645
|
+
<CardRow k="Connection">
|
|
646
|
+
<StatusLine sw={m.sw} testid="settings-project-connection">
|
|
647
|
+
{m.statusWord}
|
|
648
|
+
</StatusLine>
|
|
649
|
+
</CardRow>
|
|
650
|
+
{m.callout ? (
|
|
651
|
+
<div className="v2s-callout" role="alert" data-testid="settings-project-callout">
|
|
652
|
+
<span className="v2s-callout-ic" aria-hidden="true">
|
|
653
|
+
<StIcon name="link" size={14} />
|
|
654
|
+
</span>
|
|
655
|
+
<span className="v2s-callout-t">
|
|
656
|
+
<strong>{m.callout.title}</strong>
|
|
657
|
+
<span>{m.callout.line}</span>
|
|
658
|
+
</span>
|
|
659
|
+
{fix}
|
|
660
|
+
</div>
|
|
661
|
+
) : null}
|
|
662
|
+
{m.unconfirmed ? (
|
|
663
|
+
<div className="v2s-acts" data-testid="settings-project-unconfirmed">
|
|
664
|
+
<span className="v2s-hint">{m.unconfirmed.line}</span>
|
|
665
|
+
<button
|
|
666
|
+
type="button"
|
|
667
|
+
className={btn}
|
|
668
|
+
onClick={reviewLink}
|
|
669
|
+
data-testid="settings-project-review-link"
|
|
670
|
+
>
|
|
671
|
+
{m.unconfirmed.label}
|
|
672
|
+
</button>
|
|
673
|
+
</div>
|
|
674
|
+
) : null}
|
|
675
|
+
{m.local ? (
|
|
676
|
+
<div className="v2s-acts" data-testid="settings-project-local-acts">
|
|
677
|
+
{canMove ? (
|
|
678
|
+
<button
|
|
679
|
+
type="button"
|
|
680
|
+
className={btn}
|
|
681
|
+
onClick={() => {
|
|
682
|
+
onCloseSheet?.();
|
|
683
|
+
runAction('share.move-to-cloud');
|
|
684
|
+
}}
|
|
685
|
+
data-testid="settings-project-put-on-cloud"
|
|
686
|
+
>
|
|
687
|
+
<StIcon name="cloud" size={12} />
|
|
688
|
+
Put on Maude Cloud…
|
|
689
|
+
</button>
|
|
690
|
+
) : null}
|
|
691
|
+
<button
|
|
692
|
+
type="button"
|
|
693
|
+
className={btn}
|
|
694
|
+
onClick={linkServer}
|
|
695
|
+
data-testid="settings-team-server-add"
|
|
696
|
+
>
|
|
697
|
+
<StIcon name="box" size={12} />
|
|
698
|
+
Link your server…
|
|
699
|
+
</button>
|
|
700
|
+
</div>
|
|
701
|
+
) : null}
|
|
702
|
+
</SettingsCard>
|
|
703
|
+
|
|
704
|
+
{teamOpen ? (
|
|
705
|
+
<TeamProjectsDialog
|
|
706
|
+
serverOnly
|
|
707
|
+
title="Link your server"
|
|
708
|
+
onClose={() => setTeamOpen(false)}
|
|
709
|
+
/>
|
|
710
|
+
) : null}
|
|
711
|
+
{signInAt !== null ? (
|
|
712
|
+
<TeamProjectsDialog
|
|
713
|
+
serverOnly
|
|
714
|
+
title="Sign in again"
|
|
715
|
+
initialServer={signInAt}
|
|
716
|
+
onClose={() => setSignInAt(null)}
|
|
717
|
+
/>
|
|
718
|
+
) : null}
|
|
719
|
+
{cloud.device ? (
|
|
720
|
+
<CloudDeviceDialog
|
|
721
|
+
device={cloud.device}
|
|
722
|
+
cloudUrl={cloud.cloudUrl}
|
|
723
|
+
openFailed={cloud.openFailed}
|
|
724
|
+
onOpenResult={(s) => cloud.setOpenFailed(s === 'ok' ? '' : s)}
|
|
725
|
+
onCancel={cloud.cancelSignIn}
|
|
726
|
+
/>
|
|
727
|
+
) : null}
|
|
728
|
+
</>
|
|
729
|
+
);
|
|
730
|
+
}
|