@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
|
@@ -1,182 +1,305 @@
|
|
|
1
|
-
// client/v2/shell/project-account-model.js — 2.
|
|
1
|
+
// client/v2/shell/project-account-model.js — 2.1.1 T2/T4: the account chip and the avatar menu of THIS
|
|
2
|
+
// project (canvas 17 Accounts and Connections · ac-states, ac-menus, ac-menu-broken, ac-switch).
|
|
2
3
|
//
|
|
3
|
-
// PURE: what the
|
|
4
|
-
//
|
|
4
|
+
// PURE: what the chip's face shows and what the menu says, from what the page already holds. The
|
|
5
|
+
// connection state itself is connection-state.js; this module only words it per project.
|
|
5
6
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
// team server W4b: `hub-switch` → `team_sign_in_prepare` (this project moves to a fresh profile
|
|
22
|
-
// of its own when its profile is shared — the shell restarts it, the page reloads,
|
|
23
|
-
// the person signs in there) → `/_api/hub-signin/start` + the server's own page.
|
|
24
|
-
// A browser tab on this Mac has no shell: it says what is known and offers no button. A cloud tab's
|
|
25
|
-
// account is the hub's browser session: `account.switch` ends it (the v1 menubar's Sign out).
|
|
7
|
+
// face the kind is the face — a circle with a letter for a Maude Cloud account, a server tile for
|
|
8
|
+
// your server, a laptop for this Mac only — with at most one badge (broken link · warning ·
|
|
9
|
+
// grey · a turning ring while syncing). A project only on this Mac never has a badge.
|
|
10
|
+
// block the top of the menu: name · where it lives (Your folder / Kept by Maude / On <server>) ·
|
|
11
|
+
// the account · the status with the last sync; red with "Sign in again" + the server
|
|
12
|
+
// address when the sign-in is broken (the address is never typed again).
|
|
13
|
+
// actions what this state needs: a local project gets its two ways out (Put on Maude Cloud, Link
|
|
14
|
+
// your server); a reachable folder Show in Finder; an unreachable server Retry.
|
|
15
|
+
// switch "Switch account": the accounts already on this Mac (`accounts_list`, profiles.rs — the
|
|
16
|
+
// caller's own e-mail only; every other account an alias id, a neutral label such as
|
|
17
|
+
// "Account 2", `signedIn` and the shell's `tone`), "No account — this Mac only" (the
|
|
18
|
+
// `default` profile), then Add a Maude Cloud account / Sign in with custom server.
|
|
19
|
+
// Picking one asks first (`switchSheet`), then `project_use_account`, which for another
|
|
20
|
+
// account asks the person again in a native dialog before it rebinds the project —
|
|
21
|
+
// nothing is moved or uploaded.
|
|
26
22
|
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
23
|
+
import { ACCOUNT_TONES, accountTone } from '../../shell/account-tone.js';
|
|
24
|
+
import { connectionWords, isBrokenSignIn } from './connection-state.js';
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
try {
|
|
33
|
-
return new URL(String(url)).host.toLowerCase();
|
|
34
|
-
} catch {
|
|
35
|
-
return '';
|
|
36
|
-
}
|
|
37
|
-
};
|
|
26
|
+
export const DEFAULT_PROFILE = 'default';
|
|
27
|
+
const TONES = new Set(ACCOUNT_TONES);
|
|
38
28
|
const str = (v) => (typeof v === 'string' && v.trim() ? v.trim() : null);
|
|
39
|
-
const
|
|
29
|
+
const initialOf = (s) => (s ? Array.from(s)[0].toUpperCase() : '·');
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
31
|
+
/** "synced just now" · "synced 4 min ago" · "synced 3 h ago" · "synced yesterday" · "synced 5 days ago" */
|
|
32
|
+
export function syncedAgo(ms, now = Date.now()) {
|
|
33
|
+
if (!Number.isFinite(ms) || ms <= 0) return null;
|
|
34
|
+
const min = Math.floor(Math.max(0, now - ms) / 60_000);
|
|
35
|
+
if (min < 1) return 'synced just now';
|
|
36
|
+
if (min < 60) return `synced ${min} min ago`;
|
|
37
|
+
const h = Math.floor(min / 60);
|
|
38
|
+
if (h < 24) return `synced ${h} h ago`;
|
|
39
|
+
if (h < 48) return 'synced yesterday';
|
|
40
|
+
return `synced ${Math.floor(h / 24)} days ago`;
|
|
41
|
+
}
|
|
47
42
|
|
|
48
|
-
|
|
43
|
+
/** The status word's tone for the menu's dot (StatusWord). */
|
|
44
|
+
const DOT = {
|
|
45
|
+
connected: 'ok',
|
|
46
|
+
syncing: 'busy',
|
|
47
|
+
offline: 'off',
|
|
48
|
+
'signin-missing': 'error',
|
|
49
|
+
'signin-rejected': 'error',
|
|
50
|
+
unreachable: 'warn',
|
|
51
|
+
unconfirmed: 'off',
|
|
52
|
+
local: 'off',
|
|
53
|
+
};
|
|
49
54
|
|
|
50
55
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @param in.
|
|
56
|
+
* The account chip's face.
|
|
57
|
+
* @param in.conn connectionState()
|
|
53
58
|
* @param in.profile `/_config.profile` { id, label? }
|
|
54
|
-
* @param in.
|
|
55
|
-
* @param in.linkedHub { url, credentialed } from `/_api/cloud/status`
|
|
56
|
-
* @param in.hubAccount the hub sign-in's recorded account (`/_api/connections/hub` `account`)
|
|
57
|
-
* @param in.cloudUrl the Maude Cloud address this Mac signs in against
|
|
58
|
-
* @param in.cloudConnected this profile holds a Maude Cloud sign-in
|
|
59
|
+
* @param in.cloudConnected this project's profile holds a Maude Cloud sign-in
|
|
59
60
|
* @param in.cloudEmail its e-mail
|
|
60
|
-
* @param in.github { state: 'loading'|'in'|'out', login }
|
|
61
61
|
*/
|
|
62
|
-
export function
|
|
62
|
+
export function accountFace({ conn, profile = null, cloudConnected = false, cloudEmail = null }) {
|
|
63
|
+
const c = conn ?? { state: 'local', kind: 'local', badge: null };
|
|
64
|
+
const id = str(profile?.id) || DEFAULT_PROFILE;
|
|
65
|
+
const profileLabel = str(profile?.label) || id;
|
|
66
|
+
const kind = c.kind !== 'local' ? c.kind : cloudConnected ? 'cloud' : 'local';
|
|
67
|
+
const label =
|
|
68
|
+
kind === 'server'
|
|
69
|
+
? c.host || 'Your server'
|
|
70
|
+
: kind === 'cloud'
|
|
71
|
+
? str(cloudEmail) || profileLabel
|
|
72
|
+
: 'This Mac';
|
|
73
|
+
const words = connectionWords(c);
|
|
74
|
+
return {
|
|
75
|
+
kind,
|
|
76
|
+
state: c.state,
|
|
77
|
+
badge: c.state === 'local' ? null : (c.badge ?? null),
|
|
78
|
+
label,
|
|
79
|
+
initial: kind === 'cloud' ? initialOf(label) : '',
|
|
80
|
+
tone: kind === 'cloud' ? accountTone(id, profileLabel) : kind === 'server' ? 'green' : 'grey',
|
|
81
|
+
title: `${label} — ${words.word}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Everything the avatar menu says.
|
|
87
|
+
* @param in.native the desktop app
|
|
88
|
+
* @param in.cloudTab a cloud tab (`cfg.cloud`) — its account is the hub's browser session
|
|
89
|
+
* @param in.project this project's name
|
|
90
|
+
* @param in.conn connectionState()
|
|
91
|
+
* @param in.face accountFace()
|
|
92
|
+
* @param in.place `/_api/cloud/status` `place` — `{ kept: true }` | `{ kept: false, folder }`
|
|
93
|
+
* @param in.hubAccount the team server sign-in's recorded account
|
|
94
|
+
* @param in.pending changes going out
|
|
95
|
+
* @param in.lastSyncAt the hub monitor's last real sync (ms), or null
|
|
96
|
+
*/
|
|
97
|
+
export function accountMenu(input = {}) {
|
|
63
98
|
const {
|
|
64
99
|
native = false,
|
|
65
100
|
cloudTab = null,
|
|
66
|
-
profile = null,
|
|
67
101
|
project = null,
|
|
68
|
-
|
|
102
|
+
conn,
|
|
103
|
+
face,
|
|
104
|
+
place = null,
|
|
69
105
|
hubAccount = null,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
github = null,
|
|
106
|
+
pending = 0,
|
|
107
|
+
lastSyncAt = null,
|
|
108
|
+
now = Date.now(),
|
|
74
109
|
} = input;
|
|
75
|
-
const
|
|
110
|
+
const c = conn ?? { state: 'local', kind: 'local' };
|
|
111
|
+
const w = connectionWords(c, { pending });
|
|
112
|
+
const bad = isBrokenSignIn(c);
|
|
113
|
+
const folder = place && place.kept === false ? str(place.folder) : null;
|
|
114
|
+
const kept = place?.kept === true;
|
|
76
115
|
|
|
116
|
+
// where it lives — exactly one of three places
|
|
117
|
+
let where;
|
|
118
|
+
if (c.kind === 'server')
|
|
119
|
+
where = {
|
|
120
|
+
kind: 'server',
|
|
121
|
+
text: `On ${c.host}`,
|
|
122
|
+
extra: kept ? 'copy kept by Maude' : folder ? `copy in ${folder}` : null,
|
|
123
|
+
};
|
|
124
|
+
else if (kept)
|
|
125
|
+
where = {
|
|
126
|
+
kind: 'kept',
|
|
127
|
+
text: 'Kept by Maude',
|
|
128
|
+
extra: c.kind === 'cloud' ? 'also on Maude Cloud' : null,
|
|
129
|
+
};
|
|
130
|
+
else
|
|
131
|
+
where = {
|
|
132
|
+
kind: 'folder',
|
|
133
|
+
text: 'Your folder',
|
|
134
|
+
mono: folder,
|
|
135
|
+
extra: c.kind === 'cloud' ? 'also on Maude Cloud' : null,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// which account
|
|
139
|
+
let account;
|
|
77
140
|
if (cloudTab) {
|
|
78
|
-
// A browser on a cell: a hub with a dashboard is Maude Cloud, one that serves a single project is a
|
|
79
|
-
// team's own server. No Mac, no keychain, no GitHub.
|
|
80
141
|
const email = str(cloudTab.user?.email);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
signOut: null,
|
|
88
|
-
// the registry hides account.switch in a cloud tab without a user (app.jsx); so does the card
|
|
89
|
-
switch: email ? { id: 'account.switch', label: labelOf('account.switch') } : null,
|
|
90
|
-
github: null,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
142
|
+
account = { kind: 'cloud', text: email || 'Maude Cloud', sub: email ? 'Maude Cloud' : null };
|
|
143
|
+
} else if (face?.kind === 'server')
|
|
144
|
+
account = { kind: 'server', text: str(hubAccount) || c.host, sub: 'your server' };
|
|
145
|
+
else if (face?.kind === 'cloud')
|
|
146
|
+
account = { kind: 'cloud', text: face.label, sub: 'Maude Cloud' };
|
|
147
|
+
else account = { kind: 'local', text: 'No account — only on this Mac', sub: null };
|
|
93
148
|
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
149
|
+
// the status, with the last sync where it says something
|
|
150
|
+
const ago = syncedAgo(lastSyncAt, now);
|
|
151
|
+
const statusText =
|
|
152
|
+
c.state === 'local'
|
|
153
|
+
? 'Only on this Mac'
|
|
154
|
+
: c.state === 'signin-rejected'
|
|
155
|
+
? `Sign-in stopped working${ago ? ` · ${ago}` : ''}`
|
|
156
|
+
: c.state === 'connected'
|
|
157
|
+
? `Connected${ago ? ` · ${ago}` : ''}`
|
|
158
|
+
: w.line;
|
|
102
159
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
160
|
+
const fix = bad
|
|
161
|
+
? {
|
|
162
|
+
text: 'Changes wait on this Mac and go out after you sign in.',
|
|
163
|
+
address: c.host,
|
|
164
|
+
url: c.url,
|
|
165
|
+
label: w.fix.label,
|
|
166
|
+
// your server: its own sign-in page with the linked address; Maude Cloud: its sign-in in Settings
|
|
167
|
+
path: c.kind === 'server' ? 'hub-signin' : 'cloud-signin',
|
|
168
|
+
}
|
|
169
|
+
: null;
|
|
112
170
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const host = where || 'this server';
|
|
132
|
-
// 2.0.5 W4b — Switch through `team_sign_in_prepare`: a project on a profile other projects
|
|
133
|
-
// share first moves to its own (the shell restarts it); then the team server's own page.
|
|
134
|
-
sw = {
|
|
135
|
-
path: 'hub-switch',
|
|
136
|
-
url: hubUrl,
|
|
137
|
-
label: linkedHub?.credentialed ? 'Sign in as someone else…' : `Sign in to ${host}…`,
|
|
138
|
-
};
|
|
139
|
-
if (linkedHub?.credentialed)
|
|
140
|
-
signOut = {
|
|
141
|
-
path: 'hub-detach',
|
|
142
|
-
label: `Sign out of ${host}…`,
|
|
143
|
-
confirm: {
|
|
144
|
-
title: `Sign out of ${host}?`,
|
|
145
|
-
body: 'This folder stops syncing with it. Your work stays on this Mac.',
|
|
146
|
-
primary: 'Sign out',
|
|
147
|
-
cancel: 'Cancel',
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
} else if (kind === 'github' && ghLogin) {
|
|
151
|
-
signOut = {
|
|
152
|
-
path: 'github-signout',
|
|
153
|
-
label: `Sign out of @${ghLogin}…`,
|
|
154
|
-
confirm: {
|
|
155
|
-
title: `Sign out of @${ghLogin}?`,
|
|
156
|
-
body: 'Every project on it is signed out of GitHub. Your work stays on this Mac.',
|
|
157
|
-
primary: 'Sign out',
|
|
158
|
-
cancel: 'Cancel',
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
sw = { id: 'account.github-signin', label: 'Sign in as another GitHub account…' };
|
|
171
|
+
const actions = [];
|
|
172
|
+
if (!cloudTab) {
|
|
173
|
+
if (c.state === 'local') {
|
|
174
|
+
if (native)
|
|
175
|
+
actions.push({
|
|
176
|
+
id: 'share.move-to-cloud',
|
|
177
|
+
label: 'Put this project on Maude Cloud…',
|
|
178
|
+
icon: 'cloud',
|
|
179
|
+
});
|
|
180
|
+
actions.push({ id: 'account.link-server', label: 'Link your server…', icon: 'server' });
|
|
181
|
+
} else if (c.state === 'unreachable') {
|
|
182
|
+
actions.push({ id: 'retry', label: w.fix.label, icon: 'reload' });
|
|
183
|
+
} else if (c.state === 'unconfirmed') {
|
|
184
|
+
// an address the repo names: Review… opens the Share sheet's Connect (the person confirms it is
|
|
185
|
+
// theirs) — never a sign-in with that address filled in
|
|
186
|
+
actions.push({ id: 'review-link', label: w.fix.label, icon: 'link' });
|
|
187
|
+
} else if (!bad && native && !kept && folder) {
|
|
188
|
+
actions.push({ id: 'show-in-finder', label: 'Show in Finder', icon: 'folder' });
|
|
162
189
|
}
|
|
163
190
|
}
|
|
164
191
|
|
|
165
192
|
return {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
profileLabel,
|
|
193
|
+
name: str(cloudTab?.projectName) || str(project) || 'This project',
|
|
194
|
+
bad,
|
|
169
195
|
where,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
196
|
+
account,
|
|
197
|
+
status: { tone: DOT[c.state] ?? 'off', text: statusText },
|
|
198
|
+
fix,
|
|
199
|
+
actions,
|
|
200
|
+
// Switch account: the desktop's list; a cloud tab's account.switch ends its browser session
|
|
201
|
+
switch: native && !cloudTab ? 'list' : cloudTab?.user?.email ? 'sign-out' : null,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The Switch account list (canvas 17 · ac-switch).
|
|
207
|
+
* @param accounts `accounts_list` rows `[{ id, label, email, signedIn }]`, or null (an older shell)
|
|
208
|
+
* @param profile this project's `/_config.profile`
|
|
209
|
+
* @param cloudEmail this project's own cloud e-mail (the caller's row carries it too)
|
|
210
|
+
* @returns {{ rows: Array<{ id, kind: 'local'|'cloud', title, sub, initial, tone, current }>, foot }}
|
|
211
|
+
*/
|
|
212
|
+
export function switchList({ accounts = null, profile = null, cloudEmail = null } = {}) {
|
|
213
|
+
const currentId = str(profile?.id) || DEFAULT_PROFILE;
|
|
214
|
+
const list = Array.isArray(accounts)
|
|
215
|
+
? accounts.filter((a) => a && typeof a.id === 'string')
|
|
216
|
+
: [
|
|
217
|
+
{
|
|
218
|
+
id: currentId,
|
|
219
|
+
label: str(profile?.label) || currentId,
|
|
220
|
+
email: cloudEmail,
|
|
221
|
+
signedIn: !!cloudEmail,
|
|
222
|
+
},
|
|
223
|
+
];
|
|
224
|
+
const me = list.find((a) => a.id === currentId) ?? null;
|
|
225
|
+
const signedIn = (a) => a.signedIn === true || !!str(a.email);
|
|
226
|
+
const def = list.find((a) => a.id === DEFAULT_PROFILE) ?? {
|
|
227
|
+
id: DEFAULT_PROFILE,
|
|
228
|
+
signedIn: false,
|
|
229
|
+
};
|
|
230
|
+
const rows = [];
|
|
231
|
+
// "No account" = the `default` profile while it holds no sign-in. Ticked when this project's own
|
|
232
|
+
// account holds none — the way back for a project an earlier switch left on an empty profile.
|
|
233
|
+
if (!signedIn(def))
|
|
234
|
+
rows.push({
|
|
235
|
+
id: DEFAULT_PROFILE,
|
|
236
|
+
kind: 'local',
|
|
237
|
+
title: 'No account — this Mac only',
|
|
238
|
+
sub: 'Nothing leaves this Mac',
|
|
239
|
+
initial: '',
|
|
240
|
+
tone: 'grey',
|
|
241
|
+
current: !me || !signedIn(me),
|
|
242
|
+
});
|
|
243
|
+
for (const a of list) {
|
|
244
|
+
if (!signedIn(a)) continue;
|
|
245
|
+
const title = (a.id === currentId && str(a.email)) || str(a.label) || a.id;
|
|
246
|
+
rows.push({
|
|
247
|
+
id: a.id,
|
|
248
|
+
kind: 'cloud',
|
|
249
|
+
title,
|
|
250
|
+
sub: 'Maude Cloud',
|
|
251
|
+
initial: initialOf(title),
|
|
252
|
+
// The shell's own tone (tabs.rs `account_tone` of the real id): another account's `id` is an
|
|
253
|
+
// alias and its label may be neutral ("Account 2"), so neither can recompute it (2.1.1 L5).
|
|
254
|
+
tone: TONES.has(a.tone) ? a.tone : accountTone(a.id, str(a.label) || a.id),
|
|
255
|
+
current: a.id === currentId,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
rows,
|
|
260
|
+
foot: [
|
|
261
|
+
{ id: 'account.add-cloud', label: 'Add a Maude Cloud account…', icon: 'plus' },
|
|
262
|
+
{
|
|
263
|
+
id: 'account.link-server',
|
|
264
|
+
params: { intent: 'sign-in' },
|
|
265
|
+
label: 'Sign in with custom server…',
|
|
266
|
+
icon: 'server',
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** The confirm sheet before a switch (canvas 17 · ac-switch): what happens, and the way back. */
|
|
273
|
+
export function switchSheet({ row, project, place = null, conn = null }) {
|
|
274
|
+
const name = str(project) || 'This project';
|
|
275
|
+
const folder = place && place.kept === false ? str(place.folder) : null;
|
|
276
|
+
const stays = folder
|
|
277
|
+
? { text: `${name} stays in `, mono: folder, after: '. Nothing is moved or uploaded.' }
|
|
278
|
+
: { text: `${name} stays where it is. Nothing is moved or uploaded.` };
|
|
279
|
+
const linked = conn && conn.kind !== 'local';
|
|
280
|
+
const none = row?.kind === 'local';
|
|
281
|
+
const goes = none
|
|
282
|
+
? { text: 'Nothing leaves this Mac until you put it on Maude Cloud or link your server.' }
|
|
283
|
+
: linked
|
|
175
284
|
? {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
285
|
+
text: `It syncs with ${conn.host} as `,
|
|
286
|
+
strong: row.title,
|
|
287
|
+
after: ' — sign in there if it asks.',
|
|
179
288
|
}
|
|
180
|
-
: {
|
|
289
|
+
: { text: 'When you put it on Maude Cloud, it goes to ', strong: row.title, after: '.' };
|
|
290
|
+
return {
|
|
291
|
+
title: none ? `Use no account for ${name}?` : `Use ${row?.title} for ${name}?`,
|
|
292
|
+
lines: [
|
|
293
|
+
{ icon: 'folder', ...stays },
|
|
294
|
+
{ icon: none ? 'laptop' : 'cloud', ...goes },
|
|
295
|
+
{
|
|
296
|
+
icon: 'undo',
|
|
297
|
+
text: none
|
|
298
|
+
? 'Switch to an account at any time, from the same list.'
|
|
299
|
+
: 'Switch back to No account at any time, from the same list.',
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
primary: 'Use account',
|
|
303
|
+
cancel: 'Cancel',
|
|
181
304
|
};
|
|
182
305
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// client/v2/shell/project-account-toast.js — 2.1.1 T2: told once, then it waits by the face (canvas 17
|
|
2
|
+
// · ac-toast). The first time this session finds THIS project's sign-in missing or stopped working, one
|
|
3
|
+
// toast says so with its one button ("Sign in" / "Sign in again"); after that the broken-link badge and
|
|
4
|
+
// the save word keep saying it and nothing else interrupts.
|
|
5
|
+
//
|
|
6
|
+
// "This session" = this window's session storage (a reload is the same session; a relaunch is a new
|
|
7
|
+
// one), keyed by project, server and state — so a missing sign-in fixed and later rejected is told again.
|
|
8
|
+
|
|
9
|
+
import { useEffect } from 'react';
|
|
10
|
+
import { signInToast } from './connection-state.js';
|
|
11
|
+
|
|
12
|
+
const PREFIX = 'maude.signin-toast:';
|
|
13
|
+
const told = new Set(); // this page, when session storage is unavailable
|
|
14
|
+
|
|
15
|
+
function seen(key) {
|
|
16
|
+
if (told.has(key)) return true;
|
|
17
|
+
try {
|
|
18
|
+
return window.sessionStorage.getItem(PREFIX + key) === '1';
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function mark(key) {
|
|
24
|
+
told.add(key);
|
|
25
|
+
try {
|
|
26
|
+
window.sessionStorage.setItem(PREFIX + key, '1');
|
|
27
|
+
} catch {
|
|
28
|
+
/* private window / blocked storage: this page's memory is enough */
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Tests only. */
|
|
33
|
+
export function resetSignInToasts() {
|
|
34
|
+
told.clear();
|
|
35
|
+
try {
|
|
36
|
+
for (let i = window.sessionStorage.length - 1; i >= 0; i--) {
|
|
37
|
+
const k = window.sessionStorage.key(i);
|
|
38
|
+
if (k?.startsWith(PREFIX)) window.sessionStorage.removeItem(k);
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
/* nothing kept */
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Toast a broken sign-in once per session.
|
|
47
|
+
* @param conn connectionState()
|
|
48
|
+
* @param project this project's name
|
|
49
|
+
* @param onFix () => void — the toast's button (the menu's fix)
|
|
50
|
+
* @param toast the notice primitive (`notify`)
|
|
51
|
+
*/
|
|
52
|
+
export function useSignInToast({ conn, project, onFix, toast, enabled = true }) {
|
|
53
|
+
const t = enabled ? signInToast(conn, { project }) : null;
|
|
54
|
+
const key = t?.key ?? '';
|
|
55
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: `key` is the identity of the toast
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!t || seen(t.key)) return;
|
|
58
|
+
mark(t.key);
|
|
59
|
+
toast?.({
|
|
60
|
+
id: t.id,
|
|
61
|
+
title: t.title,
|
|
62
|
+
kind: t.kind,
|
|
63
|
+
action: { label: t.actionLabel, onClick: () => onFix?.() },
|
|
64
|
+
});
|
|
65
|
+
}, [key]);
|
|
66
|
+
}
|