@1agh/maude 1.10.0 → 2.0.0-rc.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/apps/hub/src/project-transactions/baseline.mjs +276 -0
- package/apps/hub/src/project-transactions/kernel.mjs +1756 -0
- package/apps/hub/src/project-transactions/lanes.mjs +287 -0
- package/apps/hub/src/project-transactions/runs-core.mjs +639 -0
- package/apps/hub/src/project-transactions/store-core.mjs +831 -0
- package/apps/studio/access/closure.ts +1075 -0
- package/apps/studio/access/filters.ts +1193 -0
- package/apps/studio/access/frame.ts +365 -0
- package/apps/studio/access/known-canvases.ts +82 -0
- package/apps/studio/access/request.ts +637 -0
- package/apps/studio/access/roles.ts +187 -0
- package/apps/studio/access/scope.ts +407 -0
- package/apps/studio/access/share-map.ts +434 -0
- package/apps/studio/acp/adapter-stderr.ts +22 -0
- package/apps/studio/acp/agent-path.ts +39 -0
- package/apps/studio/acp/ask-queue.ts +238 -0
- package/apps/studio/acp/audience.ts +615 -0
- package/apps/studio/acp/bootstrap-brief.ts +32 -15
- package/apps/studio/acp/bridge.ts +890 -114
- package/apps/studio/acp/chat-search.ts +195 -0
- package/apps/studio/acp/connected-fact.ts +83 -0
- package/apps/studio/acp/design-write-verb.ts +71 -0
- package/apps/studio/acp/env.ts +86 -0
- package/apps/studio/acp/index.ts +775 -58
- package/apps/studio/acp/login-state.ts +15 -1
- package/apps/studio/acp/may-scope.ts +771 -0
- package/apps/studio/acp/plugin-bootstrap.ts +90 -5
- package/apps/studio/acp/probe.ts +18 -4
- package/apps/studio/acp/repo-private.ts +73 -0
- package/apps/studio/acp/running.ts +50 -5
- package/apps/studio/acp/transcript.ts +356 -21
- package/apps/studio/acp/write-scope.ts +141 -11
- package/apps/studio/actions/agents.ts +2068 -0
- package/apps/studio/actions/canvas-keys.ts +41 -0
- package/apps/studio/actions/ctx.ts +118 -0
- package/apps/studio/actions/defs/_v1.ts +55 -0
- package/apps/studio/actions/defs/ai-runs.ts +56 -0
- package/apps/studio/actions/defs/annotation.ts +164 -0
- package/apps/studio/actions/defs/app.ts +269 -0
- package/apps/studio/actions/defs/canvas.ts +281 -0
- package/apps/studio/actions/defs/chat.ts +158 -0
- package/apps/studio/actions/defs/diagnostics.ts +52 -0
- package/apps/studio/actions/defs/ds.ts +139 -0
- package/apps/studio/actions/defs/edit.ts +986 -0
- package/apps/studio/actions/defs/export.ts +221 -0
- package/apps/studio/actions/defs/history.ts +175 -0
- package/apps/studio/actions/defs/native.ts +264 -0
- package/apps/studio/actions/defs/presence.ts +53 -0
- package/apps/studio/actions/defs/search.ts +90 -0
- package/apps/studio/actions/defs/sync.ts +47 -0
- package/apps/studio/actions/defs/timeline.ts +254 -0
- package/apps/studio/actions/defs/tool.ts +152 -0
- package/apps/studio/actions/defs/ui.ts +38 -0
- package/apps/studio/actions/defs/video.ts +115 -0
- package/apps/studio/actions/defs/view.ts +556 -0
- package/apps/studio/actions/documents.ts +32 -0
- package/apps/studio/actions/forward.ts +48 -0
- package/apps/studio/actions/help.ts +115 -0
- package/apps/studio/actions/index.ts +51 -0
- package/apps/studio/actions/keymap.gen.ts +1170 -0
- package/apps/studio/actions/keys.ts +271 -0
- package/apps/studio/actions/legacy.ts +250 -0
- package/apps/studio/actions/manifest-version.ts +18 -0
- package/apps/studio/actions/menu.ts +203 -0
- package/apps/studio/actions/native-menu.ts +132 -0
- package/apps/studio/actions/resolve.ts +118 -0
- package/apps/studio/actions/types.ts +266 -0
- package/apps/studio/actions/uniqueness.ts +119 -0
- package/apps/studio/actions/verbs.ts +306 -0
- package/apps/studio/actions.manifest.json +7826 -0
- package/apps/studio/actions.parity.json +268 -0
- package/apps/studio/activity.ts +4 -31
- package/apps/studio/agent-runs.ts +676 -0
- package/apps/studio/ai/attach-grants.ts +497 -0
- package/apps/studio/ai/copy-meta.ts +204 -0
- package/apps/studio/ai/create-claim.ts +88 -0
- package/apps/studio/ai/lease-home.ts +202 -0
- package/apps/studio/ai/run-doing.ts +106 -0
- package/apps/studio/ai/run-lifecycle.ts +320 -0
- package/apps/studio/ai/run-progress.ts +154 -0
- package/apps/studio/ai/runs.ts +1180 -0
- package/apps/studio/ai/save-hold.ts +565 -0
- package/apps/studio/ai/watch-progress.ts +182 -0
- package/apps/studio/ai/write-claim-scope.ts +39 -0
- package/apps/studio/ai/write-claim.ts +193 -0
- package/apps/studio/ai-banner.tsx +8 -14
- package/apps/studio/annotations/ai-read.ts +289 -1
- package/apps/studio/annotations/ai-write.ts +281 -23
- package/apps/studio/annotations/artboard-members.ts +86 -0
- package/apps/studio/annotations/board-ops.ts +358 -0
- package/apps/studio/annotations/board-schema.ts +81 -0
- package/apps/studio/annotations/constants.ts +2 -0
- package/apps/studio/annotations/elements/_shared.ts +290 -1
- package/apps/studio/annotations/elements/arrow.model.ts +29 -2
- package/apps/studio/annotations/elements/ballot.model.ts +110 -0
- package/apps/studio/annotations/elements/media.model.ts +11 -1
- package/apps/studio/annotations/elements/section.model.ts +3 -1
- package/apps/studio/annotations/elements/stamp.model.ts +83 -0
- package/apps/studio/annotations/elements/sticky.model.ts +235 -0
- package/apps/studio/annotations/elements/vote.model.ts +71 -0
- package/apps/studio/annotations/fields.ts +51 -0
- package/apps/studio/annotations/figjam-into.ts +119 -0
- package/apps/studio/annotations/hosts.ts +231 -0
- package/apps/studio/annotations/migrate-v1.ts +21 -2
- package/apps/studio/annotations/ops.ts +23 -0
- package/apps/studio/annotations/registry.ts +154 -16
- package/apps/studio/annotations/route.ts +268 -0
- package/apps/studio/annotations/run-tag.ts +150 -0
- package/apps/studio/annotations/stamp-kinds.ts +66 -0
- package/apps/studio/annotations/templates.ts +154 -0
- package/apps/studio/annotations/text-steps.ts +253 -0
- package/apps/studio/annotations/time-marks.ts +140 -0
- package/apps/studio/annotations/types.ts +22 -0
- package/apps/studio/annotations/ui/ai-marks.tsx +64 -0
- package/apps/studio/annotations/ui/ai-seen.tsx +117 -0
- package/apps/studio/annotations/ui/arrow-bind.ts +347 -0
- package/apps/studio/annotations/ui/arrow-cards.tsx +396 -0
- package/apps/studio/annotations/ui/arrow-kinds.ts +90 -0
- package/apps/studio/annotations/ui/bar-place.ts +18 -0
- package/apps/studio/annotations/ui/element-node.tsx +300 -52
- package/apps/studio/annotations/ui/host-view.ts +99 -0
- package/apps/studio/annotations/ui/locked.tsx +83 -0
- package/apps/studio/annotations/ui/lod.tsx +246 -0
- package/apps/studio/annotations/ui/placement.tsx +270 -0
- package/apps/studio/annotations/ui/pointer-pipeline.ts +10 -0
- package/apps/studio/annotations/ui/posture.ts +124 -0
- package/apps/studio/annotations/ui/quiet-tip.ts +28 -0
- package/apps/studio/annotations/ui/render-model.ts +27 -2
- package/apps/studio/annotations/ui/rest-route.ts +152 -0
- package/apps/studio/annotations/ui/ride.ts +957 -0
- package/apps/studio/annotations/ui/scene.tsx +59 -11
- package/apps/studio/annotations/ui/section-fold.ts +95 -0
- package/apps/studio/annotations/ui/shell-asks.ts +62 -0
- package/apps/studio/annotations/ui/stamps.ts +221 -0
- package/apps/studio/annotations/ui/stamps.tsx +272 -0
- package/apps/studio/annotations/ui/sticker-drop.ts +147 -0
- package/apps/studio/annotations/ui/sticker-preview.ts +41 -0
- package/apps/studio/annotations/ui/sticky-resolve.ts +106 -0
- package/apps/studio/annotations/ui/template-place.ts +108 -0
- package/apps/studio/annotations/ui/text-editor.tsx +6 -4
- package/apps/studio/annotations/ui/text-session.ts +63 -1
- package/apps/studio/annotations/ui/text-style.ts +11 -3
- package/apps/studio/annotations/ui/time-pins.tsx +134 -0
- package/apps/studio/annotations/ui/tool-prefs.ts +242 -0
- package/apps/studio/annotations/ui/tool-state.ts +211 -0
- package/apps/studio/annotations/ui/visibility.ts +76 -0
- package/apps/studio/annotations/ui/vote-dots.tsx +283 -0
- package/apps/studio/annotations/v1-adapter.ts +88 -5
- package/apps/studio/annotations/validate-board.ts +257 -0
- package/apps/studio/annotations/vote-guard.ts +48 -0
- package/apps/studio/annotations/votes-local.ts +481 -0
- package/apps/studio/annotations-bindings.ts +54 -8
- package/apps/studio/annotations-context-toolbar.tsx +612 -150
- package/apps/studio/annotations-layer.tsx +1768 -674
- package/apps/studio/annotations-model.ts +80 -5
- package/apps/studio/api.ts +1522 -454
- package/apps/studio/artboard-activity-overlay.tsx +530 -3
- package/apps/studio/artboard-ai-copies.tsx +187 -0
- package/apps/studio/artboard-convert-marks.tsx +142 -0
- package/apps/studio/artboard-gap-mark.tsx +177 -0
- package/apps/studio/artboard-ghosts-overlay.tsx +106 -0
- package/apps/studio/artboard-growth-memory.ts +56 -0
- package/apps/studio/artboard-growth-tag.tsx +115 -0
- package/apps/studio/artboard-guides-overlay.tsx +86 -26
- package/apps/studio/artboard-marquee.tsx +21 -6
- package/apps/studio/artboard-new-section.tsx +188 -0
- package/apps/studio/artboard-warn-mark.tsx +330 -0
- package/apps/studio/asset-details.ts +339 -0
- package/apps/studio/asset-generated.ts +99 -0
- package/apps/studio/asset-origins.ts +147 -0
- package/apps/studio/asset-placeholder.tsx +481 -0
- package/apps/studio/asset-rename.ts +171 -0
- package/apps/studio/asset-trash.ts +176 -0
- package/apps/studio/asset-upload-bars.tsx +167 -0
- package/apps/studio/asset-upload.ts +145 -1
- package/apps/studio/attribute-artboards.ts +327 -0
- package/apps/studio/bin/_ab-headless.sh +35 -0
- package/apps/studio/bin/_ab-park.sh +83 -0
- package/apps/studio/bin/_agent-browser-safe.mjs +36 -3
- package/apps/studio/bin/_annotate-post.mjs +137 -0
- package/apps/studio/bin/_assets.mjs +213 -0
- package/apps/studio/bin/_brand-colours.mjs +189 -0
- package/apps/studio/bin/_brand-fonts.mjs +158 -0
- package/apps/studio/bin/_brand-site.mjs +309 -0
- package/apps/studio/bin/_canvas-errors.mjs +143 -0
- package/apps/studio/bin/_canvas-rects-playwright.mjs +6 -3
- package/apps/studio/bin/_canvas-rects-static.mjs +1 -1
- package/apps/studio/bin/_check.mjs +122 -0
- package/apps/studio/bin/_comments.mjs +274 -0
- package/apps/studio/bin/_curl-local.mjs +122 -3
- package/apps/studio/bin/_decode-webaudio.mjs +120 -0
- package/apps/studio/bin/_describe.mjs +220 -0
- package/apps/studio/bin/_ds-check.mjs +26 -0
- package/apps/studio/bin/_ds-prove-playwright.mjs +327 -0
- package/apps/studio/bin/_ds-upgrade.mjs +14 -0
- package/apps/studio/bin/_ds.mjs +82 -0
- package/apps/studio/bin/_enumerate-artboards-playwright.mjs +6 -3
- package/apps/studio/bin/_exports.mjs +244 -0
- package/apps/studio/bin/_fetch-asset.mjs +209 -15
- package/apps/studio/bin/_history.mjs +509 -0
- package/apps/studio/bin/_html-playwright.mjs +10 -3
- package/apps/studio/bin/_import-asset.mjs +446 -15
- package/apps/studio/bin/_import-brand.mjs +40 -156
- package/apps/studio/bin/_import-figma.mjs +878 -20
- package/apps/studio/bin/_import-tokens.mjs +8 -118
- package/apps/studio/bin/_index-cli.mjs +126 -0
- package/apps/studio/bin/_layout-check.mjs +35 -0
- package/apps/studio/bin/_logs.mjs +130 -0
- package/apps/studio/bin/_motion-sample-playwright.mjs +6 -3
- package/apps/studio/bin/_no-egress.sh +36 -0
- package/apps/studio/bin/_pdf-playwright.mjs +9 -3
- package/apps/studio/bin/_perf-probe-safari.mjs +327 -37
- package/apps/studio/bin/_perf-probe-studio.mjs +259 -0
- package/apps/studio/bin/_perf-probe.mjs +35 -1
- package/apps/studio/bin/_perf-shared.mjs +377 -12
- package/apps/studio/bin/_place.mjs +35 -0
- package/apps/studio/bin/_png-playwright.mjs +27 -7
- package/apps/studio/bin/_pptx-playwright.mjs +4 -3
- package/apps/studio/bin/_pw-launch.mjs +124 -2
- package/apps/studio/bin/_record-shot.sh +65 -0
- package/apps/studio/bin/_rects-input.mjs +69 -0
- package/apps/studio/bin/_reel-place.mjs +160 -0
- package/apps/studio/bin/_region.mjs +37 -1
- package/apps/studio/bin/_runs.mjs +178 -0
- package/apps/studio/bin/_screenshot-playwright.mjs +6 -3
- package/apps/studio/bin/_studio-verb.mjs +220 -0
- package/apps/studio/bin/_svg-playwright.mjs +4 -3
- package/apps/studio/bin/_sync.mjs +179 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +704 -0
- package/apps/studio/bin/_tile-draw.mjs +74 -0
- package/apps/studio/bin/_transcribe-local.mjs +243 -0
- package/apps/studio/bin/_transcribe.mjs +48 -56
- package/apps/studio/bin/_trash.mjs +287 -0
- package/apps/studio/bin/_url-guard.mjs +88 -0
- package/apps/studio/bin/_url-guard.sh +16 -0
- package/apps/studio/bin/_video-playwright.mjs +9 -3
- package/apps/studio/bin/_video-verbs.mjs +403 -0
- package/apps/studio/bin/_write-claim.mjs +124 -0
- package/apps/studio/bin/annotate.mjs +348 -330
- package/apps/studio/bin/assets.sh +28 -0
- package/apps/studio/bin/beats.mjs +237 -0
- package/apps/studio/bin/beats.sh +24 -0
- package/apps/studio/bin/bootstrap-check.sh +2 -1
- package/apps/studio/bin/canvas-edit.sh +17 -9
- package/apps/studio/bin/canvas-errors.sh +18 -0
- package/apps/studio/bin/canvas-rects.sh +14 -0
- package/apps/studio/bin/canvas-source.sh +18 -0
- package/apps/studio/bin/captions.sh +13 -0
- package/apps/studio/bin/chat-open.sh +2 -2
- package/apps/studio/bin/check.sh +27 -0
- package/apps/studio/bin/comments.sh +20 -0
- package/apps/studio/bin/cut-to-beat.sh +13 -0
- package/apps/studio/bin/cut-words.sh +13 -0
- package/apps/studio/bin/describe.sh +28 -0
- package/apps/studio/bin/draw-proof.sh +41 -8
- package/apps/studio/bin/ds-check.sh +30 -0
- package/apps/studio/bin/ds-upgrade.sh +30 -0
- package/apps/studio/bin/ds.sh +29 -0
- package/apps/studio/bin/exports.sh +19 -0
- package/apps/studio/bin/generate.sh +45 -3
- package/apps/studio/bin/handoff.sh +60 -1
- package/apps/studio/bin/history.sh +24 -0
- package/apps/studio/bin/import-brand.sh +5 -3
- package/apps/studio/bin/index.sh +26 -0
- package/apps/studio/bin/layout-check.sh +20 -0
- package/apps/studio/bin/logs.sh +17 -0
- package/apps/studio/bin/perf.sh +93 -3
- package/apps/studio/bin/photo-bg-remove.sh +49 -7
- package/apps/studio/bin/place.sh +20 -0
- package/apps/studio/bin/read-annotations.mjs +52 -1
- package/apps/studio/bin/reel-place.sh +15 -0
- package/apps/studio/bin/runs.sh +19 -0
- package/apps/studio/bin/screenshot.sh +37 -21
- package/apps/studio/bin/server-up.sh +50 -13
- package/apps/studio/bin/smoke.sh +10 -0
- package/apps/studio/bin/sync.sh +18 -0
- package/apps/studio/bin/to-lottie.sh +1 -1
- package/apps/studio/bin/transcribe-local.sh +27 -0
- package/apps/studio/bin/trash.sh +23 -0
- package/apps/studio/bin/visual-sanity.sh +1 -0
- package/apps/studio/bridge/canvas-mode-store.ts +301 -0
- package/apps/studio/bridge/canvas-modes.ts +548 -0
- package/apps/studio/bridge/dgn-protocol.ts +2671 -0
- package/apps/studio/bridge/esc-ladder.ts +98 -0
- package/apps/studio/bridge/link-target.ts +157 -0
- package/apps/studio/bridge/mode-shows.ts +167 -0
- package/apps/studio/bridge/occlusion.ts +108 -0
- package/apps/studio/bridge/paste-data.ts +101 -0
- package/apps/studio/build.ts +12 -1
- package/apps/studio/bunfig.toml +4 -0
- package/apps/studio/canvas-build-sandbox.ts +34 -5
- package/apps/studio/canvas-build-worker.ts +23 -1
- package/apps/studio/canvas-build.ts +419 -15
- package/apps/studio/canvas-comment-mount.tsx +113 -25
- package/apps/studio/canvas-create.ts +285 -49
- package/apps/studio/canvas-cursors.ts +12 -0
- package/apps/studio/canvas-ds-icons.tsx +241 -0
- package/apps/studio/canvas-edit.ts +1188 -172
- package/apps/studio/canvas-hud-tokens.gen.ts +120 -0
- package/apps/studio/canvas-icons.tsx +47 -0
- package/apps/studio/canvas-lib-inline.ts +57 -3
- package/apps/studio/canvas-lib.tsx +1033 -263
- package/apps/studio/canvas-list-watch.ts +73 -2
- package/apps/studio/canvas-meta.schema.json +11 -0
- package/apps/studio/canvas-notifications.tsx +28 -3
- package/apps/studio/canvas-pipeline.ts +43 -8
- package/apps/studio/canvas-replay-keys.ts +65 -0
- package/apps/studio/canvas-rows.ts +116 -0
- package/apps/studio/canvas-shell.tsx +784 -698
- package/apps/studio/canvas-source/errors.ts +315 -0
- package/apps/studio/canvas-source/source-map.ts +69 -0
- package/apps/studio/canvas-theme-pill.tsx +164 -0
- package/apps/studio/canvas-theme.ts +133 -0
- package/apps/studio/canvas-top-level.ts +69 -0
- package/apps/studio/check/ids.ts +28 -0
- package/apps/studio/check/index.ts +586 -0
- package/apps/studio/check/link-resolver.ts +75 -0
- package/apps/studio/check/meta.ts +79 -0
- package/apps/studio/check/video.ts +352 -0
- package/apps/studio/client/actions/shell-key-handlers.js +450 -0
- package/apps/studio/client/app.jsx +2914 -1203
- package/apps/studio/client/canvas-url.js +241 -5
- package/apps/studio/client/clipboard-relay.ts +144 -0
- package/apps/studio/client/command-palette-match.js +4 -2
- package/apps/studio/client/comments-overlay.css +529 -144
- package/apps/studio/client/dialogs/asset-picker.jsx +77 -32
- package/apps/studio/client/dialogs/command-palette.jsx +453 -67
- package/apps/studio/client/dialogs/export-dialog.jsx +6 -781
- package/apps/studio/client/dialogs/help-modal.jsx +31 -2
- package/apps/studio/client/dialogs/shortcuts-overlay.jsx +201 -106
- package/apps/studio/client/edit-op-relay.ts +77 -0
- package/apps/studio/client/embed-view.jsx +25 -5
- package/apps/studio/client/export-bridge-scope.js +72 -0
- package/apps/studio/client/export-center.jsx +179 -369
- package/apps/studio/client/export-lane.js +117 -0
- package/apps/studio/client/export-region.ts +25 -0
- package/apps/studio/client/file-tree.jsx +4 -4
- package/apps/studio/client/frame-cap.js +132 -0
- package/apps/studio/client/generate-dialog.jsx +38 -36
- package/apps/studio/client/github.js +85 -26
- package/apps/studio/client/home/HomeAsk.jsx +220 -0
- package/apps/studio/client/home/InviteSheet.jsx +150 -0
- package/apps/studio/client/home/Shelves.jsx +216 -0
- package/apps/studio/client/home/Starters.jsx +42 -0
- package/apps/studio/client/home/TargetChip.jsx +152 -0
- package/apps/studio/client/home/home-api.js +275 -0
- package/apps/studio/client/home/home-app.jsx +1884 -0
- package/apps/studio/client/home/home-icons.jsx +143 -0
- package/apps/studio/client/home/home-menu.js +43 -0
- package/apps/studio/client/home/home-model.js +514 -0
- package/apps/studio/client/home/home-starters.js +136 -0
- package/apps/studio/client/home/home.css +1681 -0
- package/apps/studio/client/home/invite-flow.js +422 -0
- package/apps/studio/client/home/shell-mode.js +49 -0
- package/apps/studio/client/hooks/annotations-hidden-toast.js +21 -0
- package/apps/studio/client/hooks/canvas-origin-probe.js +26 -0
- package/apps/studio/client/hooks/edit-scope-query.js +16 -0
- package/apps/studio/client/hooks/use-action-keys.jsx +121 -0
- package/apps/studio/client/hooks/use-canvas-bridge.jsx +881 -247
- package/apps/studio/client/hooks/use-git-actions.jsx +33 -12
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +722 -287
- package/apps/studio/client/hooks/use-photo-and-timeline.jsx +268 -307
- package/apps/studio/client/hooks/use-project-data.jsx +23 -2
- package/apps/studio/client/hooks/use-shell-core.jsx +582 -126
- package/apps/studio/client/hooks/use-tabs.jsx +268 -126
- package/apps/studio/client/index-loader.ts +3 -1
- package/apps/studio/client/inspector/color-picker.jsx +29 -18
- package/apps/studio/client/inspector/css-knobs.jsx +765 -436
- package/apps/studio/client/inspector/css-vocab.jsx +37 -4
- package/apps/studio/client/inspector/ds-tokens.js +127 -15
- package/apps/studio/client/inspector/grid-tracks-editor.jsx +21 -15
- package/apps/studio/client/inspector/inspect-computed.jsx +17 -15
- package/apps/studio/client/inspector/inspector-panel.jsx +314 -207
- package/apps/studio/client/inspector/layers.jsx +90 -65
- package/apps/studio/client/inspector/selection.js +20 -0
- package/apps/studio/client/inspector/token-popover.jsx +42 -28
- package/apps/studio/client/inspector-controls.jsx +453 -106
- package/apps/studio/client/panels/BrandUploadPanel.jsx +8 -229
- package/apps/studio/client/panels/ChatPanel.jsx +391 -1674
- package/apps/studio/client/panels/CloudBar.jsx +548 -252
- package/apps/studio/client/panels/CollabModelInfographic.jsx +77 -20
- package/apps/studio/client/panels/CreateProject.jsx +224 -40
- package/apps/studio/client/panels/DiffView.jsx +27 -10
- package/apps/studio/client/panels/ElicitationPrompt.jsx +4 -3
- package/apps/studio/client/panels/FigmaImportPanel.jsx +12 -263
- package/apps/studio/client/panels/IdentityBar.jsx +262 -74
- package/apps/studio/client/panels/IntroVideoDialog.jsx +6 -1
- package/apps/studio/client/panels/PermissionPrompt.jsx +85 -9
- package/apps/studio/client/panels/ReadinessList.jsx +71 -46
- package/apps/studio/client/panels/RepoBranchSwitcher.jsx +124 -745
- package/apps/studio/client/panels/SettingsPanel.jsx +492 -608
- package/apps/studio/client/panels/SetupChecklist.jsx +10 -3
- package/apps/studio/client/panels/SourceConflictPanel.jsx +96 -20
- package/apps/studio/client/panels/SyncConsentDialog.jsx +14 -13
- package/apps/studio/client/panels/TeamProjects.jsx +365 -119
- package/apps/studio/client/panels/ToolGroup.jsx +6 -2
- package/apps/studio/client/panels/acp-runtime.js +127 -22
- package/apps/studio/client/panels/acp-usage.js +4 -1
- package/apps/studio/client/panels/chat-context.js +74 -5
- package/apps/studio/client/panels/chat-header.jsx +67 -0
- package/apps/studio/client/panels/chat-markdown.jsx +6 -2
- package/apps/studio/client/panels/file-deep-link-dialog.jsx +88 -17
- package/apps/studio/client/panels/file-preview.jsx +50 -24
- package/apps/studio/client/panels/git-grouping.js +9 -2
- package/apps/studio/client/panels/slash-commands.gen.js +171 -0
- package/apps/studio/client/panels/slash-commands.js +65 -25
- package/apps/studio/client/panels/timeline-media-cache.js +68 -2
- package/apps/studio/client/panels/timeline-parse.js +62 -22
- package/apps/studio/client/panels/timeline-snap.js +4 -1
- package/apps/studio/client/panels/transcript-view.js +9 -0
- package/apps/studio/client/photo-knobs.jsx +225 -46
- package/apps/studio/client/prefs-migrate.js +79 -0
- package/apps/studio/client/report-bug.jsx +59 -26
- package/apps/studio/client/selection-scope.js +215 -0
- package/apps/studio/client/share-link.js +104 -8
- package/apps/studio/client/shell/account-tone.js +28 -0
- package/apps/studio/client/shell/banners.jsx +21 -188
- package/apps/studio/client/shell/comments-panel.jsx +5 -176
- package/apps/studio/client/shell/constants.js +1 -0
- package/apps/studio/client/shell/dock.jsx +217 -31
- package/apps/studio/client/shell/drop-guard.js +52 -0
- package/apps/studio/client/shell/icons.jsx +165 -23
- package/apps/studio/client/shell/util.js +20 -33
- package/apps/studio/client/shell/viewport.jsx +249 -95
- package/apps/studio/client/shell-bus.js +82 -0
- package/apps/studio/client/shell-events.js +251 -0
- package/apps/studio/client/stamp-follow.js +62 -0
- package/apps/studio/client/stores/shell-store.jsx +15 -0
- package/apps/studio/client/styles/0-reset.css +79 -16
- package/apps/studio/client/styles/1-tokens-maude-v2.css +367 -0
- package/apps/studio/client/styles/1-tokens-shell.css +374 -0
- package/apps/studio/client/styles/2-layout.css +404 -24
- package/apps/studio/client/styles/3-kit-maude-v2.css +683 -0
- package/apps/studio/client/styles/_index.css +183 -18
- package/apps/studio/client/system/system-view.jsx +52 -6
- package/apps/studio/client/tour/collab-tour.js +43 -38
- package/apps/studio/client/tour/overlay.jsx +61 -19
- package/apps/studio/client/tour/quick-setup-tour.js +27 -20
- package/apps/studio/client/tour/tour-model.js +36 -0
- package/apps/studio/client/tour/usage-tour.js +43 -24
- package/apps/studio/client/tree/tree.jsx +661 -409
- package/apps/studio/client/tree-expansion.js +5 -2
- package/apps/studio/client/tree-row-menu.jsx +43 -29
- package/apps/studio/client/ui-open.js +104 -0
- package/apps/studio/client/use-tree-drag.js +2 -0
- package/apps/studio/client/v2/access/access-card.jsx +54 -0
- package/apps/studio/client/v2/access/access-client.js +525 -0
- package/apps/studio/client/v2/access/access-host.jsx +328 -0
- package/apps/studio/client/v2/access/access.css +163 -0
- package/apps/studio/client/v2/access/ask-to-edit.jsx +97 -0
- package/apps/studio/client/v2/access/disabled-reason.js +50 -0
- package/apps/studio/client/v2/access/link-off-card.jsx +37 -0
- package/apps/studio/client/v2/access/trashed-banner.jsx +123 -0
- package/apps/studio/client/v2/advanced/where-matrix.js +231 -0
- package/apps/studio/client/v2/ai/AChip.jsx +158 -0
- package/apps/studio/client/v2/ai/Advanced.jsx +640 -0
- package/apps/studio/client/v2/ai/AiChatIsland.jsx +108 -0
- package/apps/studio/client/v2/ai/AskSelectionHost.jsx +173 -0
- package/apps/studio/client/v2/ai/AttachMenu.jsx +190 -0
- package/apps/studio/client/v2/ai/BigChat.jsx +195 -0
- package/apps/studio/client/v2/ai/ChatList.jsx +614 -0
- package/apps/studio/client/v2/ai/ChatUndo.jsx +164 -0
- package/apps/studio/client/v2/ai/ChoiceCard.jsx +178 -0
- package/apps/studio/client/v2/ai/Composer.jsx +655 -0
- package/apps/studio/client/v2/ai/ConnectSheet.jsx +118 -0
- package/apps/studio/client/v2/ai/Consent.jsx +66 -0
- package/apps/studio/client/v2/ai/DropOverlay.jsx +113 -0
- package/apps/studio/client/v2/ai/Feed.jsx +589 -0
- package/apps/studio/client/v2/ai/FoldNeeds.jsx +23 -0
- package/apps/studio/client/v2/ai/NeedsYouSlot.jsx +250 -0
- package/apps/studio/client/v2/ai/NotReady.jsx +110 -0
- package/apps/studio/client/v2/ai/OfferCard.jsx +165 -0
- package/apps/studio/client/v2/ai/PermissionCard.jsx +168 -0
- package/apps/studio/client/v2/ai/PickedShots.jsx +33 -0
- package/apps/studio/client/v2/ai/ProblemCard.jsx +41 -0
- package/apps/studio/client/v2/ai/QuitDialog.jsx +127 -0
- package/apps/studio/client/v2/ai/RawLog.jsx +68 -0
- package/apps/studio/client/v2/ai/Result.jsx +144 -0
- package/apps/studio/client/v2/ai/RunList.jsx +352 -0
- package/apps/studio/client/v2/ai/RunSurface.jsx +248 -0
- package/apps/studio/client/v2/ai/ScopeChip.jsx +239 -0
- package/apps/studio/client/v2/ai/SentStrip.jsx +70 -0
- package/apps/studio/client/v2/ai/StoppedDivider.jsx +84 -0
- package/apps/studio/client/v2/ai/Suggest.jsx +153 -0
- package/apps/studio/client/v2/ai/TurnResult.jsx +95 -0
- package/apps/studio/client/v2/ai/WaitingCard.jsx +133 -0
- package/apps/studio/client/v2/ai/WillChange.jsx +40 -0
- package/apps/studio/client/v2/ai/Working.jsx +74 -0
- package/apps/studio/client/v2/ai/advanced-handlers.js +56 -0
- package/apps/studio/client/v2/ai/advanced-model.js +214 -0
- package/apps/studio/client/v2/ai/ai-list-advanced.css +625 -0
- package/apps/studio/client/v2/ai/ai-may.js +75 -0
- package/apps/studio/client/v2/ai/ai-offer.js +178 -0
- package/apps/studio/client/v2/ai/ai-run.css +281 -0
- package/apps/studio/client/v2/ai/ai-send.js +164 -0
- package/apps/studio/client/v2/ai/ai.css +261 -0
- package/apps/studio/client/v2/ai/answer-note.js +44 -0
- package/apps/studio/client/v2/ai/ask-frame.js +131 -0
- package/apps/studio/client/v2/ai/ask-selection-lane.js +100 -0
- package/apps/studio/client/v2/ai/ask-selection.css +142 -0
- package/apps/studio/client/v2/ai/ask-selection.js +84 -0
- package/apps/studio/client/v2/ai/attach.css +366 -0
- package/apps/studio/client/v2/ai/attach.js +186 -0
- package/apps/studio/client/v2/ai/chat-list-model.js +333 -0
- package/apps/studio/client/v2/ai/chat-store-api.js +93 -0
- package/apps/studio/client/{styles/6-acp-chat.css → v2/ai/chat.css} +1152 -797
- package/apps/studio/client/v2/ai/connect-flow.js +75 -0
- package/apps/studio/client/v2/ai/gate-lines.js +121 -0
- package/apps/studio/client/v2/ai/icons.jsx +66 -0
- package/apps/studio/client/v2/ai/jump-model.js +61 -0
- package/apps/studio/client/v2/ai/made-by-ai.js +179 -0
- package/apps/studio/client/v2/ai/needs-you-store.js +112 -0
- package/apps/studio/client/v2/ai/needs-you-toast.js +104 -0
- package/apps/studio/client/v2/ai/needs-you.css +554 -0
- package/apps/studio/client/v2/ai/needs-you.js +391 -0
- package/apps/studio/client/v2/ai/panel-focus.js +71 -0
- package/apps/studio/client/v2/ai/panel.css +88 -0
- package/apps/studio/client/v2/ai/paste-chips.jsx +108 -0
- package/apps/studio/client/v2/ai/picked-shots.js +48 -0
- package/apps/studio/client/v2/ai/quit.css +64 -0
- package/apps/studio/client/v2/ai/result-shown.js +50 -0
- package/apps/studio/client/v2/ai/ring-relay.js +143 -0
- package/apps/studio/client/v2/ai/row-slots-lane.js +67 -0
- package/apps/studio/client/v2/ai/run-api.js +137 -0
- package/apps/studio/client/v2/ai/run-cards.js +31 -0
- package/apps/studio/client/v2/ai/run-compare.js +60 -0
- package/apps/studio/client/v2/ai/run-icons.jsx +53 -0
- package/apps/studio/client/v2/ai/run-model.js +348 -0
- package/apps/studio/client/v2/ai/runs-model.js +568 -0
- package/apps/studio/client/v2/ai/runs-store.js +161 -0
- package/apps/studio/client/v2/ai/runs.css +226 -0
- package/apps/studio/client/v2/ai/scope.js +298 -0
- package/apps/studio/client/v2/ai/seen-relay.js +95 -0
- package/apps/studio/client/v2/ai/sent-attachments.js +77 -0
- package/apps/studio/client/v2/ai/stopped.js +69 -0
- package/apps/studio/client/v2/ai/suggest-why.js +200 -0
- package/apps/studio/client/v2/ai/use-ai-scope.js +198 -0
- package/apps/studio/client/v2/ai/use-ask-ai.js +63 -0
- package/apps/studio/client/v2/ai/use-ask-selection.js +41 -0
- package/apps/studio/client/v2/ai/use-attachments.js +239 -0
- package/apps/studio/client/v2/ai/use-chat-runs.js +32 -0
- package/apps/studio/client/v2/ai/use-run-versions.js +39 -0
- package/apps/studio/client/v2/ai/video/ClipsAttached.jsx +23 -0
- package/apps/studio/client/v2/ai/video/LeftOut.jsx +29 -0
- package/apps/studio/client/v2/ai/video/WatchProgress.jsx +65 -0
- package/apps/studio/client/v2/ai/video/card-model.js +107 -0
- package/apps/studio/client/v2/ai/video/cards.jsx +51 -0
- package/apps/studio/client/v2/ai/video/clip-pic.js +12 -0
- package/apps/studio/client/v2/ai/video/video-cards.css +168 -0
- package/apps/studio/client/v2/annotations/annotation-asks.js +171 -0
- package/apps/studio/client/v2/annotations/annotation-list-model.js +238 -0
- package/apps/studio/client/v2/annotations/annotation-list.css +277 -0
- package/apps/studio/client/v2/annotations/annotation-list.jsx +433 -0
- package/apps/studio/client/v2/annotations/recent-stickers.js +64 -0
- package/apps/studio/client/v2/annotations/stamp-row.jsx +66 -0
- package/apps/studio/client/v2/annotations/stamps-glyphs.jsx +35 -0
- package/apps/studio/client/v2/annotations/sticker-preload.js +44 -0
- package/apps/studio/client/v2/annotations/sticker-search.js +155 -0
- package/apps/studio/client/v2/annotations/stickers-gallery.css +295 -0
- package/apps/studio/client/v2/annotations/stickers-gallery.jsx +454 -0
- package/apps/studio/client/v2/annotations/templates-panel.css +344 -0
- package/apps/studio/client/v2/annotations/templates-panel.jsx +240 -0
- package/apps/studio/client/v2/annotations/v2-scope.js +20 -0
- package/apps/studio/client/v2/annotations/vote-bar.jsx +212 -0
- package/apps/studio/client/v2/annotations/vote-sheet.jsx +200 -0
- package/apps/studio/client/v2/annotations/vote-store.js +392 -0
- package/apps/studio/client/v2/annotations/vote.css +153 -0
- package/apps/studio/client/v2/assets/ask-once.js +65 -0
- package/apps/studio/client/v2/assets/asset-drop-session.js +238 -0
- package/apps/studio/client/v2/assets/asset-state-lane.js +267 -0
- package/apps/studio/client/v2/assets/assets-bus.js +109 -0
- package/apps/studio/client/v2/assets/browse-model.js +90 -0
- package/apps/studio/client/v2/assets/browse-view.jsx +202 -0
- package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +114 -0
- package/apps/studio/client/v2/assets/connect-key-sheet.jsx +69 -0
- package/apps/studio/client/v2/assets/copy-asset.js +37 -0
- package/apps/studio/client/v2/assets/describe-client.js +156 -0
- package/apps/studio/client/v2/assets/describe-consent.jsx +184 -0
- package/apps/studio/client/v2/assets/describe.css +72 -0
- package/apps/studio/client/v2/assets/details-advanced.jsx +76 -0
- package/apps/studio/client/v2/assets/details-model.js +233 -0
- package/apps/studio/client/v2/assets/details.jsx +292 -0
- package/apps/studio/client/v2/assets/generate-ask.jsx +506 -0
- package/apps/studio/client/v2/assets/generated.js +83 -0
- package/apps/studio/client/v2/assets/import-lines.js +228 -0
- package/apps/studio/client/v2/assets/import-offline.js +32 -0
- package/apps/studio/client/v2/assets/import-toast.js +56 -0
- package/apps/studio/client/v2/assets/just-added.js +32 -0
- package/apps/studio/client/v2/assets/kinds-chip.jsx +77 -0
- package/apps/studio/client/v2/assets/library-foot.js +42 -0
- package/apps/studio/client/v2/assets/missing-frame.css +60 -0
- package/apps/studio/client/v2/assets/missing-frame.jsx +218 -0
- package/apps/studio/client/v2/assets/multi-select.js +58 -0
- package/apps/studio/client/v2/assets/place-asset.js +128 -0
- package/apps/studio/client/v2/assets/relink.js +96 -0
- package/apps/studio/client/v2/assets/rename-asset.js +83 -0
- package/apps/studio/client/v2/assets/search-marks.jsx +75 -0
- package/apps/studio/client/v2/assets/takes-overlay.jsx +86 -0
- package/apps/studio/client/v2/assets/takes.css +177 -0
- package/apps/studio/client/v2/assets/takes.js +224 -0
- package/apps/studio/client/v2/assets/tidy.jsx +144 -0
- package/apps/studio/client/v2/assets/tile-drag.js +53 -0
- package/apps/studio/client/v2/assets/tile-menu.jsx +119 -0
- package/apps/studio/client/v2/assets/tile.jsx +131 -0
- package/apps/studio/client/v2/assets/trash-assets.js +98 -0
- package/apps/studio/client/v2/assets/use-asset-details.js +58 -0
- package/apps/studio/client/v2/assets/use-assets.js +121 -0
- package/apps/studio/client/v2/assets/use-takes-lane.js +150 -0
- package/apps/studio/client/v2/canvases/canvas-icons.jsx +107 -0
- package/apps/studio/client/v2/canvases/canvases-panel.jsx +1466 -0
- package/apps/studio/client/v2/canvases/canvases.css +699 -0
- package/apps/studio/client/v2/canvases/covers.js +32 -0
- package/apps/studio/client/v2/canvases/inline-rename.jsx +122 -0
- package/apps/studio/client/v2/canvases/jump-list.jsx +100 -0
- package/apps/studio/client/v2/canvases/jump-model.js +102 -0
- package/apps/studio/client/v2/canvases/kept-on-this-mac.jsx +192 -0
- package/apps/studio/client/v2/canvases/last-canvas.js +36 -0
- package/apps/studio/client/v2/canvases/move-model.js +45 -0
- package/apps/studio/client/v2/canvases/move-sheet.jsx +91 -0
- package/apps/studio/client/v2/canvases/open-link.js +154 -0
- package/apps/studio/client/v2/canvases/panel-search.js +156 -0
- package/apps/studio/client/v2/canvases/rename-model.js +134 -0
- package/apps/studio/client/v2/canvases/row-menu.jsx +145 -0
- package/apps/studio/client/v2/canvases/row-slots.js +224 -0
- package/apps/studio/client/v2/canvases/sort.js +132 -0
- package/apps/studio/client/v2/canvases/support-model.js +68 -0
- package/apps/studio/client/v2/canvases/trash-canvas.js +120 -0
- package/apps/studio/client/v2/canvases/tree-model.js +760 -0
- package/apps/studio/client/v2/canvases/use-canvas-index.js +50 -0
- package/apps/studio/client/v2/canvases/use-canvases-sort.js +59 -0
- package/apps/studio/client/v2/canvases/use-move.js +61 -0
- package/apps/studio/client/v2/canvases/use-pins.js +80 -0
- package/apps/studio/client/v2/cloud/browser-door.js +152 -0
- package/apps/studio/client/v2/cloud/cloud-name.js +38 -0
- package/apps/studio/client/v2/code/canvas-error-card.jsx +407 -0
- package/apps/studio/client/v2/code/canvas-imports-card.jsx +31 -0
- package/apps/studio/client/v2/code/code-bus.js +63 -0
- package/apps/studio/client/v2/code/code-view.jsx +277 -0
- package/apps/studio/client/v2/code/code.css +373 -0
- package/apps/studio/client/v2/code/highlight.js +163 -0
- package/apps/studio/client/v2/code/use-canvas-source.js +338 -0
- package/apps/studio/client/v2/comments/comment-bridge.js +154 -0
- package/apps/studio/client/v2/comments/comment-client.js +84 -0
- package/apps/studio/client/v2/comments/comment-tool.js +18 -0
- package/apps/studio/client/v2/comments/comments-model.js +213 -0
- package/apps/studio/client/v2/comments/comments-panel.jsx +400 -0
- package/apps/studio/client/v2/comments/comments.css +305 -0
- package/apps/studio/client/v2/comments/mention-callouts.jsx +90 -0
- package/apps/studio/client/v2/comments/mention-model.js +118 -0
- package/apps/studio/client/v2/comments/native-mention-notice.js +73 -0
- package/apps/studio/client/v2/comments/reply-focus.js +30 -0
- package/apps/studio/client/v2/comments/use-comments-shell.jsx +176 -0
- package/apps/studio/client/v2/create/NameDialog.jsx +95 -0
- package/apps/studio/client/v2/create/NameDialogHost.jsx +141 -0
- package/apps/studio/client/v2/create/create-project.css +260 -0
- package/apps/studio/client/v2/create/duplicate-done.js +45 -0
- package/apps/studio/client/v2/create/empty-project.css +113 -0
- package/apps/studio/client/v2/create/empty-project.jsx +162 -0
- package/apps/studio/client/v2/create/first-draft.js +30 -0
- package/apps/studio/client/v2/create/intent-host.jsx +40 -0
- package/apps/studio/client/v2/create/name-dialog-bus.js +41 -0
- package/apps/studio/client/v2/create/name-dialog.css +36 -0
- package/apps/studio/client/v2/create/new-canvas.js +64 -0
- package/apps/studio/client/v2/create/open-sizes.js +41 -0
- package/apps/studio/client/v2/create/render-error.css +29 -0
- package/apps/studio/client/v2/create/render-error.jsx +107 -0
- package/apps/studio/client/v2/create/repair-offer.js +36 -0
- package/apps/studio/client/v2/create/take-intent.js +154 -0
- package/apps/studio/client/v2/create/use-project-empty.js +85 -0
- package/apps/studio/client/v2/create/use-render-error.js +116 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-bus.js +47 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-handlers.js +108 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +196 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +253 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +557 -0
- package/apps/studio/client/v2/diagnostics/diagnostics.css +612 -0
- package/apps/studio/client/v2/diagnostics/resync-model.js +51 -0
- package/apps/studio/client/v2/diagnostics/resync-run.js +79 -0
- package/apps/studio/client/v2/diagnostics/sync-actions.js +38 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +241 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +392 -0
- package/apps/studio/client/v2/diagnostics/use-diagnostics-menu.js +58 -0
- package/apps/studio/client/v2/ds/advanced-bus.js +40 -0
- package/apps/studio/client/v2/ds/advanced-host.jsx +228 -0
- package/apps/studio/client/v2/ds/advanced-model.js +110 -0
- package/apps/studio/client/v2/ds/advanced-store.js +47 -0
- package/apps/studio/client/v2/ds/advanced.css +277 -0
- package/apps/studio/client/v2/ds/advanced.jsx +203 -0
- package/apps/studio/client/v2/ds/check-card.jsx +80 -0
- package/apps/studio/client/v2/ds/colour-picker.jsx +121 -0
- package/apps/studio/client/v2/ds/colour-words.js +48 -0
- package/apps/studio/client/v2/ds/conflict-pick.jsx +151 -0
- package/apps/studio/client/v2/ds/contrast-warning.jsx +80 -0
- package/apps/studio/client/v2/ds/contrast.js +137 -0
- package/apps/studio/client/v2/ds/convert-dialog.jsx +133 -0
- package/apps/studio/client/v2/ds/convert-host.jsx +143 -0
- package/apps/studio/client/v2/ds/convert-model.js +221 -0
- package/apps/studio/client/v2/ds/default-write.js +69 -0
- package/apps/studio/client/v2/ds/direction-bar.jsx +287 -0
- package/apps/studio/client/v2/ds/door-write.js +163 -0
- package/apps/studio/client/v2/ds/edge-model.js +151 -0
- package/apps/studio/client/v2/ds/edge-write.js +91 -0
- package/apps/studio/client/v2/ds/edges.css +152 -0
- package/apps/studio/client/v2/ds/follower-swap.js +88 -0
- package/apps/studio/client/v2/ds/go-to.js +71 -0
- package/apps/studio/client/v2/ds/kinds/master.jsx +214 -0
- package/apps/studio/client/v2/ds/kinds/token.jsx +546 -0
- package/apps/studio/client/v2/ds/library-bus.js +43 -0
- package/apps/studio/client/v2/ds/library-card.jsx +379 -0
- package/apps/studio/client/v2/ds/library-host.jsx +436 -0
- package/apps/studio/client/v2/ds/library-model.js +305 -0
- package/apps/studio/client/v2/ds/library-store.js +45 -0
- package/apps/studio/client/v2/ds/library.css +148 -0
- package/apps/studio/client/v2/ds/make-host.jsx +244 -0
- package/apps/studio/client/v2/ds/make-model.js +208 -0
- package/apps/studio/client/v2/ds/make-sheet.jsx +264 -0
- package/apps/studio/client/v2/ds/make-write.js +90 -0
- package/apps/studio/client/v2/ds/make.css +242 -0
- package/apps/studio/client/v2/ds/master-write.js +145 -0
- package/apps/studio/client/v2/ds/new-canvas-default.js +89 -0
- package/apps/studio/client/v2/ds/off-system-host.jsx +107 -0
- package/apps/studio/client/v2/ds/off-system.jsx +101 -0
- package/apps/studio/client/v2/ds/outside-banner.jsx +153 -0
- package/apps/studio/client/v2/ds/pinned-rows.js +138 -0
- package/apps/studio/client/v2/ds/pins.js +102 -0
- package/apps/studio/client/v2/ds/preview-bar.jsx +220 -0
- package/apps/studio/client/v2/ds/preview-doors.js +47 -0
- package/apps/studio/client/v2/ds/preview-mode.js +163 -0
- package/apps/studio/client/v2/ds/reach-data.js +68 -0
- package/apps/studio/client/v2/ds/reach-model.js +184 -0
- package/apps/studio/client/v2/ds/reach-view.jsx +577 -0
- package/apps/studio/client/v2/ds/reach.css +298 -0
- package/apps/studio/client/v2/ds/rename-write.js +88 -0
- package/apps/studio/client/v2/ds/review-bus.js +41 -0
- package/apps/studio/client/v2/ds/review-host.jsx +438 -0
- package/apps/studio/client/v2/ds/review-model.js +307 -0
- package/apps/studio/client/v2/ds/review-sheet.jsx +390 -0
- package/apps/studio/client/v2/ds/review.css +894 -0
- package/apps/studio/client/v2/ds/row-dots.js +41 -0
- package/apps/studio/client/v2/ds/switch-bus.js +56 -0
- package/apps/studio/client/v2/ds/switch-host.jsx +241 -0
- package/apps/studio/client/v2/ds/switch-model.js +254 -0
- package/apps/studio/client/v2/ds/switch-sheet.jsx +364 -0
- package/apps/studio/client/v2/ds/switch.css +263 -0
- package/apps/studio/client/v2/ds/system-menu.jsx +81 -0
- package/apps/studio/client/v2/ds/system-rename.jsx +102 -0
- package/apps/studio/client/v2/ds/token-write.js +241 -0
- package/apps/studio/client/v2/ds/token.css +185 -0
- package/apps/studio/client/v2/ds/trash-token-sheet.jsx +112 -0
- package/apps/studio/client/v2/ds/truth-card.jsx +85 -0
- package/apps/studio/client/v2/ds/truth-host.jsx +239 -0
- package/apps/studio/client/v2/ds/truth-model.js +315 -0
- package/apps/studio/client/v2/ds/truth-store.js +45 -0
- package/apps/studio/client/v2/ds/truth.css +143 -0
- package/apps/studio/client/v2/ds/update-available.jsx +261 -0
- package/apps/studio/client/v2/ds/update-dots.js +103 -0
- package/apps/studio/client/v2/ds/update-model.js +295 -0
- package/apps/studio/client/v2/ds/upgrade-bus.js +40 -0
- package/apps/studio/client/v2/ds/upgrade-host.jsx +185 -0
- package/apps/studio/client/v2/ds/upgrade-model.js +266 -0
- package/apps/studio/client/v2/ds/upgrade-offers.js +34 -0
- package/apps/studio/client/v2/ds/upgrade-sheet.jsx +277 -0
- package/apps/studio/client/v2/ds/upgrade.css +166 -0
- package/apps/studio/client/v2/ds/use-covers.js +27 -0
- package/apps/studio/client/v2/ds/use-ds-frames.js +165 -0
- package/apps/studio/client/v2/ds/use-ds-model.js +61 -0
- package/apps/studio/client/v2/ds/use-ds-search.js +61 -0
- package/apps/studio/client/v2/ds/use-ds-state.js +65 -0
- package/apps/studio/client/v2/ds/uses-link.jsx +58 -0
- package/apps/studio/client/v2/empty/all-trashed-model.js +321 -0
- package/apps/studio/client/v2/empty/all-trashed-relay.js +65 -0
- package/apps/studio/client/v2/empty/all-trashed.jsx +229 -0
- package/apps/studio/client/v2/empty/arriving.jsx +180 -0
- package/apps/studio/client/v2/empty/artboard-hint.jsx +47 -0
- package/apps/studio/client/v2/empty/ask-button.jsx +35 -0
- package/apps/studio/client/v2/empty/confetti.jsx +46 -0
- package/apps/studio/client/v2/empty/empty-canvas.jsx +96 -0
- package/apps/studio/client/v2/empty/empty-copy.js +265 -0
- package/apps/studio/client/v2/empty/empty-hint-store.js +31 -0
- package/apps/studio/client/v2/empty/empty-host.jsx +168 -0
- package/apps/studio/client/v2/empty/empty.css +440 -0
- package/apps/studio/client/v2/empty/empty.jsx +162 -0
- package/apps/studio/client/v2/empty/fill-ask.js +22 -0
- package/apps/studio/client/v2/empty/free-centre.js +11 -0
- package/apps/studio/client/v2/empty/index.js +40 -0
- package/apps/studio/client/v2/empty/layers-empty.jsx +22 -0
- package/apps/studio/client/v2/empty/not-local.jsx +111 -0
- package/apps/studio/client/v2/empty/select-new-artboard.js +32 -0
- package/apps/studio/client/v2/empty/skeleton.jsx +51 -0
- package/apps/studio/client/v2/empty/spot-art.jsx +923 -0
- package/apps/studio/client/v2/empty/spot.jsx +96 -0
- package/apps/studio/client/v2/empty/suggestions.jsx +18 -0
- package/apps/studio/client/v2/empty/use-empty-canvas.js +251 -0
- package/apps/studio/client/v2/export/access-line.jsx +48 -0
- package/apps/studio/client/v2/export/advanced/advanced-copy.js +77 -0
- package/apps/studio/client/v2/export/advanced/advanced.css +252 -0
- package/apps/studio/client/v2/export/advanced/advanced.jsx +148 -0
- package/apps/studio/client/v2/export/advanced/command.js +128 -0
- package/apps/studio/client/v2/export/advanced/command.jsx +50 -0
- package/apps/studio/client/v2/export/advanced/fields.jsx +132 -0
- package/apps/studio/client/v2/export/advanced/image.jsx +124 -0
- package/apps/studio/client/v2/export/advanced/model.js +199 -0
- package/apps/studio/client/v2/export/advanced/names.jsx +65 -0
- package/apps/studio/client/v2/export/advanced/print.jsx +99 -0
- package/apps/studio/client/v2/export/advanced/render.jsx +63 -0
- package/apps/studio/client/v2/export/advanced/video.jsx +76 -0
- package/apps/studio/client/v2/export/annotations-policy.js +28 -0
- package/apps/studio/client/v2/export/cloud-queue.js +69 -0
- package/apps/studio/client/v2/export/copy-command.js +72 -0
- package/apps/studio/client/v2/export/copy-png.js +144 -0
- package/apps/studio/client/v2/export/done-toast.jsx +89 -0
- package/apps/studio/client/v2/export/edges.css +74 -0
- package/apps/studio/client/v2/export/export-copy.js +352 -0
- package/apps/studio/client/v2/export/export-sheet.jsx +804 -0
- package/apps/studio/client/v2/export/export-sizes.js +217 -0
- package/apps/studio/client/v2/export/export.css +832 -0
- package/apps/studio/client/v2/export/exports-model.js +383 -0
- package/apps/studio/client/v2/export/exports-panel.css +192 -0
- package/apps/studio/client/v2/export/exports-panel.jsx +164 -0
- package/apps/studio/client/v2/export/file-rows.jsx +84 -0
- package/apps/studio/client/v2/export/inspector-export.jsx +335 -0
- package/apps/studio/client/v2/export/job-row.jsx +358 -0
- package/apps/studio/client/v2/export/last-finished.js +34 -0
- package/apps/studio/client/v2/export/native-save.js +160 -0
- package/apps/studio/client/v2/export/other-formats.jsx +199 -0
- package/apps/studio/client/v2/export/parts.jsx +117 -0
- package/apps/studio/client/v2/export/preflight/fonts.js +27 -0
- package/apps/studio/client/v2/export/preflight/paper.jsx +177 -0
- package/apps/studio/client/v2/export/preflight/safe-margin.js +24 -0
- package/apps/studio/client/v2/export/preflight/use-preflight.js +74 -0
- package/apps/studio/client/v2/export/preview.jsx +79 -0
- package/apps/studio/client/v2/export/print.css +219 -0
- package/apps/studio/client/v2/export/run-export.js +177 -0
- package/apps/studio/client/v2/export/scope-bar.jsx +70 -0
- package/apps/studio/client/v2/export/sections/batch-model.js +224 -0
- package/apps/studio/client/v2/export/sections/batch.jsx +235 -0
- package/apps/studio/client/v2/export/sections/image.jsx +93 -0
- package/apps/studio/client/v2/export/sections/print-copy.js +41 -0
- package/apps/studio/client/v2/export/sections/print.jsx +285 -0
- package/apps/studio/client/v2/export/sections/render-row.jsx +81 -0
- package/apps/studio/client/v2/export/sections/version.jsx +176 -0
- package/apps/studio/client/v2/export/sections/video-copy.js +92 -0
- package/apps/studio/client/v2/export/sections/video-model.js +127 -0
- package/apps/studio/client/v2/export/sections/video.jsx +397 -0
- package/apps/studio/client/v2/export/sections/web.jsx +151 -0
- package/apps/studio/client/v2/export/share-hint.jsx +51 -0
- package/apps/studio/client/v2/export/use-export-spec.js +546 -0
- package/apps/studio/client/v2/export/video-content.js +75 -0
- package/apps/studio/client/v2/export/video.css +221 -0
- package/apps/studio/client/v2/fold/advanced-fold.jsx +96 -0
- package/apps/studio/client/v2/fold/fold-store.js +151 -0
- package/apps/studio/client/v2/fold/fold.css +59 -0
- package/apps/studio/client/v2/fold/use-fold.js +36 -0
- package/apps/studio/client/v2/handoff/edges.jsx +74 -0
- package/apps/studio/client/v2/handoff/handoff-sheet.jsx +469 -0
- package/apps/studio/client/v2/handoff/handoff.css +181 -0
- package/apps/studio/client/v2/handoff/ready-card.jsx +84 -0
- package/apps/studio/client/v2/handoff/targets.js +111 -0
- package/apps/studio/client/v2/help/add-guides.js +43 -0
- package/apps/studio/client/v2/help/help.css +995 -0
- package/apps/studio/client/v2/history/blame.js +161 -0
- package/apps/studio/client/v2/history/branch-actions.js +214 -0
- package/apps/studio/client/v2/history/change-list.jsx +102 -0
- package/apps/studio/client/v2/history/clear-band.js +144 -0
- package/apps/studio/client/v2/history/compare-store.js +80 -0
- package/apps/studio/client/v2/history/compare-view.jsx +318 -0
- package/apps/studio/client/v2/history/compare-words.js +8 -0
- package/apps/studio/client/v2/history/git-advanced.jsx +580 -0
- package/apps/studio/client/v2/history/git-io.js +58 -0
- package/apps/studio/client/v2/history/git-model.js +526 -0
- package/apps/studio/client/v2/history/git-parts.jsx +662 -0
- package/apps/studio/client/v2/history/history-host.jsx +78 -0
- package/apps/studio/client/v2/history/history-panel.jsx +599 -0
- package/apps/studio/client/v2/history/history.css +1477 -0
- package/apps/studio/client/v2/history/name-dialog.jsx +109 -0
- package/apps/studio/client/v2/history/object-filter.js +143 -0
- package/apps/studio/client/v2/history/object-history-ask.js +62 -0
- package/apps/studio/client/v2/history/object-view.jsx +236 -0
- package/apps/studio/client/v2/history/rows.ts +445 -0
- package/apps/studio/client/v2/history/use-versions.js +391 -0
- package/apps/studio/client/v2/history/view-bar.jsx +80 -0
- package/apps/studio/client/v2/import/brand-model.js +145 -0
- package/apps/studio/client/v2/import/brand-result.jsx +197 -0
- package/apps/studio/client/v2/import/brand-sheet.jsx +434 -0
- package/apps/studio/client/v2/import/brand.css +378 -0
- package/apps/studio/client/v2/import/figma-artboard.jsx +121 -0
- package/apps/studio/client/v2/import/figma-model.js +237 -0
- package/apps/studio/client/v2/import/figma-prefill.js +23 -0
- package/apps/studio/client/v2/import/figma-sheet.jsx +525 -0
- package/apps/studio/client/v2/import/figma-summary.jsx +62 -0
- package/apps/studio/client/v2/import/figma.css +179 -0
- package/apps/studio/client/v2/import/frame-picker.jsx +57 -0
- package/apps/studio/client/v2/inspect/inspect-host.jsx +53 -0
- package/apps/studio/client/v2/inspect/inspect-model.js +132 -0
- package/apps/studio/client/v2/inspect/inspect-panel.jsx +214 -0
- package/apps/studio/client/v2/inspect/inspect.css +87 -0
- package/apps/studio/client/v2/inspector/advanced-rows-default.jsx +773 -0
- package/apps/studio/client/v2/inspector/advanced-rows.js +106 -0
- package/apps/studio/client/v2/inspector/advanced.jsx +286 -0
- package/apps/studio/client/v2/inspector/blocks.js +57 -0
- package/apps/studio/client/v2/inspector/colour-groups.js +129 -0
- package/apps/studio/client/v2/inspector/component-picker.css +133 -0
- package/apps/studio/client/v2/inspector/component-picker.jsx +367 -0
- package/apps/studio/client/v2/inspector/crumbs.jsx +89 -0
- package/apps/studio/client/v2/inspector/css-text.js +179 -0
- package/apps/studio/client/v2/inspector/css-write.js +204 -0
- package/apps/studio/client/v2/inspector/element-code.js +39 -0
- package/apps/studio/client/v2/inspector/element-id.js +70 -0
- package/apps/studio/client/v2/inspector/formats-ui.js +101 -0
- package/apps/studio/client/v2/inspector/formats-write.js +60 -0
- package/apps/studio/client/v2/inspector/frame.jsx +336 -0
- package/apps/studio/client/v2/inspector/inspector-actions.js +60 -0
- package/apps/studio/client/v2/inspector/inspector.css +2872 -0
- package/apps/studio/client/v2/inspector/jsx-slice.js +219 -0
- package/apps/studio/client/v2/inspector/kinds/add-width.js +55 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-advanced-rows.jsx +89 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-advanced.jsx +62 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-fixed.jsx +111 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-kinds-model.js +171 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-model.js +155 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-multi.jsx +142 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-print-advanced.jsx +210 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-print-model.js +112 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-print.jsx +268 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-rows.jsx +124 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-video.jsx +144 -0
- package/apps/studio/client/v2/inspector/kinds/artboard-web.jsx +170 -0
- package/apps/studio/client/v2/inspector/kinds/artboard.jsx +168 -0
- package/apps/studio/client/v2/inspector/kinds/caption.jsx +203 -0
- package/apps/studio/client/v2/inspector/kinds/clip-model.js +190 -0
- package/apps/studio/client/v2/inspector/kinds/clip.css +157 -0
- package/apps/studio/client/v2/inspector/kinds/clip.jsx +447 -0
- package/apps/studio/client/v2/inspector/kinds/frame.jsx +118 -0
- package/apps/studio/client/v2/inspector/kinds/image.jsx +267 -0
- package/apps/studio/client/v2/inspector/kinds/index.js +180 -0
- package/apps/studio/client/v2/inspector/kinds/instance.jsx +377 -0
- package/apps/studio/client/v2/inspector/kinds/multi-artboard.jsx +129 -0
- package/apps/studio/client/v2/inspector/kinds/multi.jsx +220 -0
- package/apps/studio/client/v2/inspector/kinds/music.jsx +294 -0
- package/apps/studio/client/v2/inspector/kinds/path.jsx +174 -0
- package/apps/studio/client/v2/inspector/kinds/shape.jsx +59 -0
- package/apps/studio/client/v2/inspector/kinds/text.jsx +518 -0
- package/apps/studio/client/v2/inspector/kinds/title-rows.jsx +135 -0
- package/apps/studio/client/v2/inspector/kinds/video-facts.js +142 -0
- package/apps/studio/client/v2/inspector/layers-row-tools.jsx +93 -0
- package/apps/studio/client/v2/inspector/layers-slot.jsx +93 -0
- package/apps/studio/client/v2/inspector/link-write.js +52 -0
- package/apps/studio/client/v2/inspector/live-size.js +96 -0
- package/apps/studio/client/v2/inspector/model.js +228 -0
- package/apps/studio/client/v2/inspector/path-point.js +104 -0
- package/apps/studio/client/v2/inspector/print-write.js +85 -0
- package/apps/studio/client/v2/inspector/safe-zones-write.js +88 -0
- package/apps/studio/client/v2/inspector/sections/add-requests.js +35 -0
- package/apps/studio/client/v2/inspector/sections/border.jsx +141 -0
- package/apps/studio/client/v2/inspector/sections/color-control.jsx +246 -0
- package/apps/studio/client/v2/inspector/sections/colour-custom.jsx +826 -0
- package/apps/studio/client/v2/inspector/sections/colour-model.js +404 -0
- package/apps/studio/client/v2/inspector/sections/colour-popover.jsx +631 -0
- package/apps/studio/client/v2/inspector/sections/colour-words.js +131 -0
- package/apps/studio/client/v2/inspector/sections/corners.jsx +177 -0
- package/apps/studio/client/v2/inspector/sections/effects.jsx +67 -0
- package/apps/studio/client/v2/inspector/sections/export-slot.jsx +60 -0
- package/apps/studio/client/v2/inspector/sections/fill.jsx +187 -0
- package/apps/studio/client/v2/inspector/sections/formats.jsx +209 -0
- package/apps/studio/client/v2/inspector/sections/index.js +74 -0
- package/apps/studio/client/v2/inspector/sections/interaction.jsx +204 -0
- package/apps/studio/client/v2/inspector/sections/layout.jsx +314 -0
- package/apps/studio/client/v2/inspector/sections/opacity-row.jsx +37 -0
- package/apps/studio/client/v2/inspector/sections/point.jsx +102 -0
- package/apps/studio/client/v2/inspector/sections/position.jsx +259 -0
- package/apps/studio/client/v2/inspector/sections/recent-colours.js +106 -0
- package/apps/studio/client/v2/inspector/sections/row.jsx +91 -0
- package/apps/studio/client/v2/inspector/sections/safe-zones.jsx +174 -0
- package/apps/studio/client/v2/inspector/sections/sections.css +1474 -0
- package/apps/studio/client/v2/inspector/sections/size.jsx +104 -0
- package/apps/studio/client/v2/inspector/sections/type.jsx +168 -0
- package/apps/studio/client/v2/inspector/sections/warnings.css +44 -0
- package/apps/studio/client/v2/inspector/sections/warnings.jsx +137 -0
- package/apps/studio/client/v2/inspector/sections.js +226 -0
- package/apps/studio/client/v2/inspector/slots.js +110 -0
- package/apps/studio/client/v2/inspector/token-chip.jsx +315 -0
- package/apps/studio/client/v2/inspector/view-mode.jsx +193 -0
- package/apps/studio/client/v2/inspector/warning-fix.js +111 -0
- package/apps/studio/client/v2/kinds/ConvertDialog.jsx +183 -0
- package/apps/studio/client/v2/kinds/KindChips.jsx +60 -0
- package/apps/studio/client/v2/kinds/KindDimHost.jsx +35 -0
- package/apps/studio/client/v2/kinds/LayersKindFilter.jsx +108 -0
- package/apps/studio/client/v2/kinds/SizePicker.jsx +566 -0
- package/apps/studio/client/v2/kinds/SizePickerHost.jsx +104 -0
- package/apps/studio/client/v2/kinds/advanced-rows.js +40 -0
- package/apps/studio/client/v2/kinds/convert-api.js +116 -0
- package/apps/studio/client/v2/kinds/convert.css +87 -0
- package/apps/studio/client/v2/kinds/kind-dim-relay.js +93 -0
- package/apps/studio/client/v2/kinds/kind-filter-model.js +106 -0
- package/apps/studio/client/v2/kinds/kind-filter-store.js +71 -0
- package/apps/studio/client/v2/kinds/kind-filter.css +105 -0
- package/apps/studio/client/v2/kinds/layers-kind-model.js +99 -0
- package/apps/studio/client/v2/kinds/size-picker-model.js +189 -0
- package/apps/studio/client/v2/kinds/size-picker.css +393 -0
- package/apps/studio/client/v2/layers/artboard-layers.jsx +105 -0
- package/apps/studio/client/v2/layers/layers.css +94 -0
- package/apps/studio/client/v2/left-panel/advanced-model.js +98 -0
- package/apps/studio/client/v2/left-panel/assets-panel.jsx +1203 -0
- package/apps/studio/client/v2/left-panel/canvas-file-menu.js +115 -0
- package/apps/studio/client/v2/left-panel/canvases-advanced.jsx +270 -0
- package/apps/studio/client/v2/left-panel/canvases-pinned.jsx +274 -0
- package/apps/studio/client/v2/left-panel/layers-advanced.jsx +179 -0
- package/apps/studio/client/v2/left-panel/left-panel-bus.js +83 -0
- package/apps/studio/client/v2/left-panel/left-panel-model.js +184 -0
- package/apps/studio/client/v2/left-panel/left-panel.css +1846 -0
- package/apps/studio/client/v2/left-panel/selector-scope.js +42 -0
- package/apps/studio/client/v2/left-panel/trash-model.js +282 -0
- package/apps/studio/client/v2/left-panel/trash-view.jsx +257 -0
- package/apps/studio/client/v2/left-panel/use-trash.js +172 -0
- package/apps/studio/client/v2/left-panel/view-prefs.js +84 -0
- package/apps/studio/client/v2/onboarding/AdvSheet.jsx +114 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +239 -0
- package/apps/studio/client/v2/onboarding/CliSheet.jsx +101 -0
- package/apps/studio/client/v2/onboarding/ConnectAiSheet.jsx +60 -0
- package/apps/studio/client/v2/onboarding/FigmaSheet.jsx +96 -0
- package/apps/studio/client/v2/onboarding/FolderGithubSheet.jsx +77 -0
- package/apps/studio/client/v2/onboarding/GithubSegment.jsx +241 -0
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +244 -0
- package/apps/studio/client/v2/onboarding/connect-ai-home.js +94 -0
- package/apps/studio/client/v2/onboarding/github-home.js +84 -0
- package/apps/studio/client/v2/onboarding/onboarding-model.js +106 -0
- package/apps/studio/client/v2/onboarding/onboarding.css +546 -0
- package/apps/studio/client/v2/photo/apply-every-use-sheet.jsx +196 -0
- package/apps/studio/client/v2/photo/canvas-rel.js +20 -0
- package/apps/studio/client/v2/photo/looks.js +129 -0
- package/apps/studio/client/v2/photo/photo-section.jsx +625 -0
- package/apps/studio/client/v2/photo/photo.css +218 -0
- package/apps/studio/client/v2/portal-scope.jsx +14 -0
- package/apps/studio/client/v2/presence/faces.jsx +356 -0
- package/apps/studio/client/v2/presence/presence.css +187 -0
- package/apps/studio/client/v2/presence/use-presence-host.js +83 -0
- package/apps/studio/client/v2/present/audience-window.js +63 -0
- package/apps/studio/client/v2/present/canvas-pill.jsx +55 -0
- package/apps/studio/client/v2/present/copy-link.js +82 -0
- package/apps/studio/client/v2/present/follow-location.js +82 -0
- package/apps/studio/client/v2/present/follow-model.js +68 -0
- package/apps/studio/client/v2/present/follow-view.jsx +354 -0
- package/apps/studio/client/v2/present/follow.css +91 -0
- package/apps/studio/client/v2/present/order-map.jsx +64 -0
- package/apps/studio/client/v2/present/order-notes-artboards.js +88 -0
- package/apps/studio/client/v2/present/order-notes-model.js +141 -0
- package/apps/studio/client/v2/present/order-notes-mount.jsx +26 -0
- package/apps/studio/client/v2/present/order-notes-sheet.jsx +293 -0
- package/apps/studio/client/v2/present/order-notes.css +150 -0
- package/apps/studio/client/v2/present/present-chrome-host.jsx +95 -0
- package/apps/studio/client/v2/present/present-controls-model.js +114 -0
- package/apps/studio/client/v2/present/present-controls.jsx +263 -0
- package/apps/studio/client/v2/present/present-zoom-store.js +33 -0
- package/apps/studio/client/v2/present/present.css +258 -0
- package/apps/studio/client/v2/present/presenter-button.jsx +25 -0
- package/apps/studio/client/v2/present/presenter-host.jsx +246 -0
- package/apps/studio/client/v2/present/presenter-model.js +167 -0
- package/apps/studio/client/v2/present/presenter-store.js +140 -0
- package/apps/studio/client/v2/present/presenter-view.css +298 -0
- package/apps/studio/client/v2/present/presenter-view.jsx +241 -0
- package/apps/studio/client/v2/present/video-present-model.js +92 -0
- package/apps/studio/client/v2/present/video-present.css +164 -0
- package/apps/studio/client/v2/present/video-present.jsx +331 -0
- package/apps/studio/client/v2/preview/external-link-confirm.jsx +245 -0
- package/apps/studio/client/v2/preview/link-follow.js +109 -0
- package/apps/studio/client/v2/preview/open-in-app.jsx +46 -0
- package/apps/studio/client/v2/preview/preview-back.js +21 -0
- package/apps/studio/client/v2/preview/preview-bar.jsx +86 -0
- package/apps/studio/client/v2/preview/preview-chrome-host.jsx +234 -0
- package/apps/studio/client/v2/preview/preview-history.js +61 -0
- package/apps/studio/client/v2/preview/preview.css +262 -0
- package/apps/studio/client/v2/preview/zoom-only.jsx +58 -0
- package/apps/studio/client/v2/search/help-model.js +275 -0
- package/apps/studio/client/v2/search/moved-keys.js +74 -0
- package/apps/studio/client/v2/search/palette-icons.js +45 -0
- package/apps/studio/client/v2/search/search-ds.js +142 -0
- package/apps/studio/client/v2/search/search-env.js +110 -0
- package/apps/studio/client/v2/search/search-keywords.js +162 -0
- package/apps/studio/client/v2/search/search-model.js +623 -0
- package/apps/studio/client/v2/search/search-projects.js +214 -0
- package/apps/studio/client/v2/search/search-recent.js +94 -0
- package/apps/studio/client/v2/search/search-remote.js +30 -0
- package/apps/studio/client/v2/search/search.css +519 -0
- package/apps/studio/client/v2/settings/account.jsx +164 -0
- package/apps/studio/client/v2/settings/advanced-prefs.js +91 -0
- package/apps/studio/client/v2/settings/advanced-section.jsx +308 -0
- package/apps/studio/client/v2/settings/connection-row.jsx +79 -0
- package/apps/studio/client/v2/settings/connections-model.js +138 -0
- package/apps/studio/client/v2/settings/connections-section.jsx +663 -0
- package/apps/studio/client/v2/settings/general-section.jsx +155 -0
- package/apps/studio/client/v2/settings/parts.jsx +48 -0
- package/apps/studio/client/v2/settings/prefs-migrate.js +141 -0
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +255 -0
- package/apps/studio/client/v2/settings/reset-section.jsx +164 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +46 -0
- package/apps/studio/client/v2/settings/settings-model.js +523 -0
- package/apps/studio/client/v2/settings/settings-sheet.jsx +204 -0
- package/apps/studio/client/v2/settings/settings.css +975 -0
- package/apps/studio/client/v2/settings/theme-auto.js +75 -0
- package/apps/studio/client/v2/settings/use-advanced-prefs.js +32 -0
- package/apps/studio/client/v2/settings/use-connections.js +485 -0
- package/apps/studio/client/v2/share/glyphs.jsx +92 -0
- package/apps/studio/client/v2/share/invite-row.jsx +68 -0
- package/apps/studio/client/v2/share/link-dialog.js +53 -0
- package/apps/studio/client/v2/share/link-row.jsx +38 -0
- package/apps/studio/client/v2/share/move-to-cloud.jsx +88 -0
- package/apps/studio/client/v2/share/people-list.jsx +151 -0
- package/apps/studio/client/v2/share/person.jsx +26 -0
- package/apps/studio/client/v2/share/role-menu.jsx +145 -0
- package/apps/studio/client/v2/share/share-advanced.jsx +411 -0
- package/apps/studio/client/v2/share/share-model.js +469 -0
- package/apps/studio/client/v2/share/share-sheet.jsx +602 -0
- package/apps/studio/client/v2/share/share.css +828 -0
- package/apps/studio/client/v2/shell/account-card-model.js +114 -0
- package/apps/studio/client/v2/shell/account-card.jsx +177 -0
- package/apps/studio/client/v2/shell/annotation-prefs-store.js +105 -0
- package/apps/studio/client/v2/shell/ask-to-edit.js +33 -0
- package/apps/studio/client/v2/shell/callouts-host.jsx +151 -0
- package/apps/studio/client/v2/shell/callouts-model.js +358 -0
- package/apps/studio/client/v2/shell/callouts.css +164 -0
- package/apps/studio/client/v2/shell/callouts.jsx +162 -0
- package/apps/studio/client/v2/shell/canvas-mode.js +393 -0
- package/apps/studio/client/v2/shell/contrast.css +37 -0
- package/apps/studio/client/v2/shell/corner-icons.jsx +153 -0
- package/apps/studio/client/v2/shell/dock-rail-homes.js +106 -0
- package/apps/studio/client/v2/shell/f6-cycle.js +124 -0
- package/apps/studio/client/v2/shell/floating-panels.css +2858 -0
- package/apps/studio/client/v2/shell/fold-ghost.js +70 -0
- package/apps/studio/client/v2/shell/format-update.css +43 -0
- package/apps/studio/client/v2/shell/format-update.js +487 -0
- package/apps/studio/client/v2/shell/format-update.jsx +479 -0
- package/apps/studio/client/v2/shell/held-conflict.js +51 -0
- package/apps/studio/client/v2/shell/image-pick.js +140 -0
- package/apps/studio/client/v2/shell/insets-now.js +35 -0
- package/apps/studio/client/v2/shell/inspector-follow.js +113 -0
- package/apps/studio/client/v2/shell/menu-runner.js +711 -0
- package/apps/studio/client/v2/shell/modal-focus.js +259 -0
- package/apps/studio/client/v2/shell/mode-switch.jsx +418 -0
- package/apps/studio/client/v2/shell/native-doors.js +121 -0
- package/apps/studio/client/v2/shell/occlusion-insets.js +116 -0
- package/apps/studio/client/v2/shell/panel-availability.js +27 -0
- package/apps/studio/client/v2/shell/panel-layout.js +144 -0
- package/apps/studio/client/v2/shell/panel-sizes.js +150 -0
- package/apps/studio/client/v2/shell/paste-forward.js +43 -0
- package/apps/studio/client/v2/shell/present-from-label.js +19 -0
- package/apps/studio/client/v2/shell/project-menu-model.js +216 -0
- package/apps/studio/client/v2/shell/project-pill.css +214 -0
- package/apps/studio/client/v2/shell/project-pill.jsx +456 -0
- package/apps/studio/client/v2/shell/recovery-store.js +139 -0
- package/apps/studio/client/v2/shell/role-denial.js +73 -0
- package/apps/studio/client/v2/shell/role-gate.js +29 -0
- package/apps/studio/client/v2/shell/save-hold-notice.js +69 -0
- package/apps/studio/client/v2/shell/save-status.js +191 -0
- package/apps/studio/client/v2/shell/scroll-lock.js +49 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +389 -0
- package/apps/studio/client/v2/shell/share-cluster.css +608 -0
- package/apps/studio/client/v2/shell/share-cluster.jsx +255 -0
- package/apps/studio/client/v2/shell/shell-error-boundary.jsx +81 -0
- package/apps/studio/client/v2/shell/shell-panels-relay.js +95 -0
- package/apps/studio/client/v2/shell/shell-parity.js +457 -0
- package/apps/studio/client/v2/shell/shell-parity.json +2106 -0
- package/apps/studio/client/v2/shell/single-keys-store.js +49 -0
- package/apps/studio/client/v2/shell/tool-panels.css +39 -0
- package/apps/studio/client/v2/shell/tool-panels.js +156 -0
- package/apps/studio/client/v2/shell/use-account.js +59 -0
- package/apps/studio/client/v2/shell/use-annotation-prefs.js +77 -0
- package/apps/studio/client/v2/shell/use-canvas-mode-lane.js +388 -0
- package/apps/studio/client/v2/shell/use-dismiss-outside.js +35 -0
- package/apps/studio/client/v2/shell/use-fit-on-ai-pin.js +42 -0
- package/apps/studio/client/v2/shell/use-fit-while-ai-drafts.js +37 -0
- package/apps/studio/client/v2/shell/use-occluded-insets.js +107 -0
- package/apps/studio/client/v2/shell/use-panel-layout.js +45 -0
- package/apps/studio/client/v2/shell/use-single-keys.js +56 -0
- package/apps/studio/client/v2/shell/use-tool-panels.js +205 -0
- package/apps/studio/client/v2/signin/CreateLocalSheet.jsx +155 -0
- package/apps/studio/client/v2/signin/SignInCard.jsx +284 -0
- package/apps/studio/client/v2/signin/SignInToast.jsx +22 -0
- package/apps/studio/client/v2/signin/WhatsNewLine.jsx +64 -0
- package/apps/studio/client/v2/signin/advanced-rows.js +40 -0
- package/apps/studio/client/v2/signin/signin-model.js +138 -0
- package/apps/studio/client/v2/signin/signin.css +484 -0
- package/apps/studio/client/v2/signin/use-signin.js +209 -0
- package/apps/studio/client/v2/signin/use-whats-new-line.js +94 -0
- package/apps/studio/client/v2/sync-states/back-online.jsx +61 -0
- package/apps/studio/client/v2/sync-states/conflict-card.jsx +326 -0
- package/apps/studio/client/v2/sync-states/offline-foot.jsx +79 -0
- package/apps/studio/client/v2/sync-states/row-words.js +83 -0
- package/apps/studio/client/v2/sync-states/sync-states-model.js +264 -0
- package/apps/studio/client/v2/sync-states/sync-states.css +232 -0
- package/apps/studio/client/v2/timeline/Timeline.jsx +3194 -0
- package/apps/studio/client/v2/timeline/TimelineHost.jsx +360 -0
- package/apps/studio/client/v2/timeline/advanced/actions.js +27 -0
- package/apps/studio/client/v2/timeline/advanced/advanced-store.js +116 -0
- package/apps/studio/client/v2/timeline/advanced/advanced.css +323 -0
- package/apps/studio/client/v2/timeline/advanced/cut-as-code.jsx +127 -0
- package/apps/studio/client/v2/timeline/advanced/easing-curve.jsx +200 -0
- package/apps/studio/client/v2/timeline/advanced/foot.jsx +210 -0
- package/apps/studio/client/v2/timeline/advanced/model.js +121 -0
- package/apps/studio/client/v2/timeline/advanced/render-settings.jsx +62 -0
- package/apps/studio/client/v2/timeline/advanced/video-cap.js +174 -0
- package/apps/studio/client/v2/timeline/ai-edge-model.js +111 -0
- package/apps/studio/client/v2/timeline/ai-edge.css +104 -0
- package/apps/studio/client/v2/timeline/ai-edge.jsx +113 -0
- package/apps/studio/client/v2/timeline/anchor-lane.js +80 -0
- package/apps/studio/client/v2/timeline/anchor.js +80 -0
- package/apps/studio/client/v2/timeline/assemble-video.js +64 -0
- package/apps/studio/client/v2/timeline/clip-search.js +88 -0
- package/apps/studio/client/v2/timeline/clip-verb.js +224 -0
- package/apps/studio/client/v2/timeline/comment-strip-host.jsx +93 -0
- package/apps/studio/client/v2/timeline/comment-strip-model.js +103 -0
- package/apps/studio/client/v2/timeline/comment-strip.jsx +82 -0
- package/apps/studio/client/v2/timeline/edit/clip-menu.js +118 -0
- package/apps/studio/client/v2/timeline/edit/clip-menu.jsx +48 -0
- package/apps/studio/client/v2/timeline/edit/drop.jsx +101 -0
- package/apps/studio/client/v2/timeline/edit/move.jsx +43 -0
- package/apps/studio/client/v2/timeline/edit/ripple.js +43 -0
- package/apps/studio/client/v2/timeline/edit/trim.jsx +52 -0
- package/apps/studio/client/v2/timeline/edit/words.js +65 -0
- package/apps/studio/client/v2/timeline/fit-fill.jsx +172 -0
- package/apps/studio/client/v2/timeline/fit-model.js +137 -0
- package/apps/studio/client/v2/timeline/fold.js +128 -0
- package/apps/studio/client/v2/timeline/footage-rows.jsx +46 -0
- package/apps/studio/client/v2/timeline/footage-state.js +135 -0
- package/apps/studio/client/v2/timeline/glyphs.jsx +118 -0
- package/apps/studio/client/v2/timeline/island-context.js +29 -0
- package/apps/studio/client/v2/timeline/island-controls.jsx +83 -0
- package/apps/studio/client/v2/timeline/island.jsx +54 -0
- package/apps/studio/client/v2/timeline/joins/join-model.js +133 -0
- package/apps/studio/client/v2/timeline/joins/joins.css +277 -0
- package/apps/studio/client/v2/timeline/joins/transition-picker.jsx +240 -0
- package/apps/studio/client/v2/timeline/keys.js +74 -0
- package/apps/studio/client/v2/timeline/lanes/caption-lane.jsx +149 -0
- package/apps/studio/client/v2/timeline/lanes/music-lane.jsx +294 -0
- package/apps/studio/client/v2/timeline/lanes/music-media.js +200 -0
- package/apps/studio/client/v2/timeline/lanes/music-model.js +190 -0
- package/apps/studio/client/v2/timeline/loop-handle.jsx +70 -0
- package/apps/studio/client/v2/timeline/marker-store.js +117 -0
- package/apps/studio/client/v2/timeline/markers.js +79 -0
- package/apps/studio/client/v2/timeline/marks.jsx +152 -0
- package/apps/studio/client/v2/timeline/music-hint.jsx +98 -0
- package/apps/studio/client/v2/timeline/other-takes-model.js +103 -0
- package/apps/studio/client/v2/timeline/other-takes-store.js +49 -0
- package/apps/studio/client/v2/timeline/other-takes.css +98 -0
- package/apps/studio/client/v2/timeline/other-takes.jsx +269 -0
- package/apps/studio/client/v2/timeline/peers.jsx +246 -0
- package/apps/studio/client/v2/timeline/playhead.js +97 -0
- package/apps/studio/client/v2/timeline/poster.js +109 -0
- package/apps/studio/client/v2/timeline/reframe-island.jsx +478 -0
- package/apps/studio/client/v2/timeline/reframe-model.js +135 -0
- package/apps/studio/client/v2/timeline/reframe.css +150 -0
- package/apps/studio/client/v2/timeline/ruler.js +61 -0
- package/apps/studio/client/v2/timeline/selection.js +110 -0
- package/apps/studio/client/v2/timeline/timeline-empty.jsx +108 -0
- package/apps/studio/client/v2/timeline/timeline-store.js +147 -0
- package/apps/studio/client/v2/timeline/timeline.css +2879 -0
- package/apps/studio/client/v2/timeline/together.css +85 -0
- package/apps/studio/client/v2/timeline/track-toggle.js +56 -0
- package/apps/studio/client/v2/timeline/tracks.js +68 -0
- package/apps/studio/client/v2/timeline/transport.js +66 -0
- package/apps/studio/client/v2/timeline/zoom.js +37 -0
- package/apps/studio/client/v2/transcript/TranscriptHost.jsx +162 -0
- package/apps/studio/client/v2/transcript/TranscriptPanel.jsx +358 -0
- package/apps/studio/client/v2/transcript/captions-api.js +297 -0
- package/apps/studio/client/v2/transcript/captions-file-flag.js +38 -0
- package/apps/studio/client/v2/transcript/comp-media-store.js +89 -0
- package/apps/studio/client/v2/transcript/transcript-model.js +240 -0
- package/apps/studio/client/v2/transcript/transcript.css +262 -0
- package/apps/studio/client/v2/undo/projection.js +291 -0
- package/apps/studio/client/v2/undo/undo-history.jsx +286 -0
- package/apps/studio/client/v2/undo/undo.css +81 -0
- package/apps/studio/client/v2/undo/use-undo-mode-lane.js +96 -0
- package/apps/studio/client/v2/undo/use-undo-projection.jsx +460 -0
- package/apps/studio/client/v2/undo/zoom-undo.jsx +79 -0
- package/apps/studio/client/whats-new-seen.js +40 -0
- package/apps/studio/client/whats-new.jsx +65 -62
- package/apps/studio/clip-ops.ts +38 -6
- package/apps/studio/cloud/config-path.ts +42 -0
- package/apps/studio/cloud/endpoints.ts +212 -50
- package/apps/studio/cloud/renew.ts +29 -16
- package/apps/studio/collab/ai-activity.ts +19 -0
- package/apps/studio/collab/awareness-bridge.ts +131 -4
- package/apps/studio/collab/git-lifecycle.ts +52 -20
- package/apps/studio/collab/holds.ts +69 -0
- package/apps/studio/collab/index.ts +25 -0
- package/apps/studio/collab/protocol.ts +64 -0
- package/apps/studio/collab/registry.ts +59 -6
- package/apps/studio/collab/room.ts +374 -16
- package/apps/studio/collab/timeline-awareness.ts +123 -0
- package/apps/studio/collab/timeline-presence.tsx +219 -0
- package/apps/studio/commands/move-artboards-command.ts +45 -4
- package/apps/studio/comments/anchors.ts +147 -0
- package/apps/studio/comments/author-face.ts +41 -0
- package/apps/studio/comments/from-line.ts +43 -0
- package/apps/studio/comments/imported-from.ts +113 -0
- package/apps/studio/comments/local-author.ts +41 -0
- package/apps/studio/comments/mentions.ts +115 -0
- package/apps/studio/comments/mine-stamp.ts +78 -0
- package/apps/studio/comments/ops.ts +293 -0
- package/apps/studio/comments/people.ts +66 -0
- package/apps/studio/comments/where.ts +136 -0
- package/apps/studio/comments-overlay.tsx +1220 -253
- package/apps/studio/config.schema.json +33 -0
- package/apps/studio/context-menu.tsx +126 -42
- package/apps/studio/context.ts +178 -13
- package/apps/studio/cursors-overlay.tsx +28 -11
- package/apps/studio/debug-bundle.ts +21 -5
- package/apps/studio/describe/batch.ts +414 -0
- package/apps/studio/describe/budget.ts +147 -0
- package/apps/studio/describe/claude.ts +273 -0
- package/apps/studio/describe/consent.ts +120 -0
- package/apps/studio/describe/validate.ts +192 -0
- package/apps/studio/design-setup-readiness.ts +2 -2
- package/apps/studio/diagnostics/store.ts +220 -0
- package/apps/studio/dist/client.bundle.js +2429 -2329
- package/apps/studio/dist/comment-mount.js +12 -9
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/dom-selection.ts +239 -23
- package/apps/studio/drag-bus.ts +211 -0
- package/apps/studio/draw/serialize-animate.ts +4 -4
- package/apps/studio/ds/board/board-specimen.css +199 -0
- package/apps/studio/ds/board/board.css +674 -0
- package/apps/studio/ds/board/brand-notes.ts +92 -0
- package/apps/studio/ds/board/build-model.ts +418 -0
- package/apps/studio/ds/board/component-states.ts +111 -0
- package/apps/studio/ds/board/directions-model.ts +145 -0
- package/apps/studio/ds/board/directions.css +169 -0
- package/apps/studio/ds/board/directions.tsx +100 -0
- package/apps/studio/ds/board/ds-bar.tsx +107 -0
- package/apps/studio/ds/board/index.tsx +71 -0
- package/apps/studio/ds/board/logo-paint.ts +118 -0
- package/apps/studio/ds/board/outline.tsx +127 -0
- package/apps/studio/ds/board/parts.tsx +160 -0
- package/apps/studio/ds/board/section-brand.tsx +148 -0
- package/apps/studio/ds/board/section-colour.tsx +160 -0
- package/apps/studio/ds/board/section-components.tsx +146 -0
- package/apps/studio/ds/board/section-motion.tsx +106 -0
- package/apps/studio/ds/board/section-patterns.tsx +89 -0
- package/apps/studio/ds/board/section-space.tsx +109 -0
- package/apps/studio/ds/board/section-type.tsx +129 -0
- package/apps/studio/ds/board/specimen.tsx +61 -0
- package/apps/studio/ds/board/state.ts +105 -0
- package/apps/studio/ds/board/template.ts +152 -0
- package/apps/studio/ds/board/types.ts +346 -0
- package/apps/studio/ds/canvas-check.ts +914 -0
- package/apps/studio/ds/canvas-cli.ts +346 -0
- package/apps/studio/ds/check-system-verb.ts +88 -0
- package/apps/studio/ds/check-system.ts +293 -0
- package/apps/studio/ds/check.ts +541 -0
- package/apps/studio/ds/cli.ts +348 -0
- package/apps/studio/ds/component-list.ts +150 -0
- package/apps/studio/ds/contrast.ts +438 -0
- package/apps/studio/ds/convert-map.ts +126 -0
- package/apps/studio/ds/convert.ts +603 -0
- package/apps/studio/ds/css-scan.ts +292 -0
- package/apps/studio/ds/default-components.tsx +377 -0
- package/apps/studio/ds/default.ts +58 -0
- package/apps/studio/ds/design-system.tsx.tpl +40 -0
- package/apps/studio/ds/ds-resolver.ts +205 -0
- package/apps/studio/ds/ds-verb.ts +563 -0
- package/apps/studio/ds/edges.ts +412 -0
- package/apps/studio/ds/emit.ts +217 -0
- package/apps/studio/ds/engine.ts +1652 -0
- package/apps/studio/ds/fallbacks.ts +116 -0
- package/apps/studio/ds/generate.ts +746 -0
- package/apps/studio/ds/head.ts +372 -0
- package/apps/studio/ds/instance-info.ts +90 -0
- package/apps/studio/ds/library.ts +1137 -0
- package/apps/studio/ds/make.ts +726 -0
- package/apps/studio/ds/migrate-emitter.ts +42 -0
- package/apps/studio/ds/nearest.ts +163 -0
- package/apps/studio/ds/outside.ts +343 -0
- package/apps/studio/ds/override-map.ts +213 -0
- package/apps/studio/ds/pairing-css.ts +145 -0
- package/apps/studio/ds/pin-scope.ts +268 -0
- package/apps/studio/ds/registry.ts +228 -0
- package/apps/studio/ds/rename.ts +104 -0
- package/apps/studio/ds/render-rev.ts +144 -0
- package/apps/studio/ds/revision.ts +268 -0
- package/apps/studio/ds/shell-fallbacks.ts +84 -0
- package/apps/studio/ds/switch.ts +426 -0
- package/apps/studio/ds/system-files.ts +251 -0
- package/apps/studio/ds/system.ts +312 -0
- package/apps/studio/ds/undo-hook.ts +46 -0
- package/apps/studio/ds/upgrade-apply.ts +258 -0
- package/apps/studio/ds/upgrade-cli.ts +216 -0
- package/apps/studio/ds/upgrade-codemod.ts +116 -0
- package/apps/studio/ds/upgrade-progress.ts +153 -0
- package/apps/studio/ds/upgrade-prove.ts +429 -0
- package/apps/studio/ds/upgrade-stage.ts +387 -0
- package/apps/studio/ds/upgrade.ts +394 -0
- package/apps/studio/ds/value-types.ts +190 -0
- package/apps/studio/edit-ops/align.ts +43 -0
- package/apps/studio/edit-ops/arrange.ts +93 -0
- package/apps/studio/edit-ops/artboard-facts.ts +70 -0
- package/apps/studio/edit-ops/artboard-resize.ts +50 -0
- package/apps/studio/edit-ops/artboard-trash.ts +77 -0
- package/apps/studio/edit-ops/clear-link.ts +16 -0
- package/apps/studio/edit-ops/clip/captions.ts +154 -0
- package/apps/studio/edit-ops/clip/comp.ts +124 -0
- package/apps/studio/edit-ops/clip/cut-source-range.ts +100 -0
- package/apps/studio/edit-ops/clip/cut-to-beat.ts +136 -0
- package/apps/studio/edit-ops/clip/duck.ts +123 -0
- package/apps/studio/edit-ops/clip/easing.ts +76 -0
- package/apps/studio/edit-ops/clip/formats.ts +163 -0
- package/apps/studio/edit-ops/clip/gestures.ts +161 -0
- package/apps/studio/edit-ops/clip/index.ts +543 -0
- package/apps/studio/edit-ops/clip/jsx.ts +251 -0
- package/apps/studio/edit-ops/clip/place.ts +127 -0
- package/apps/studio/edit-ops/clip/reframe.ts +194 -0
- package/apps/studio/edit-ops/clip/take-swap.ts +53 -0
- package/apps/studio/edit-ops/clip/title-motion.ts +103 -0
- package/apps/studio/edit-ops/clip/title-style.ts +177 -0
- package/apps/studio/edit-ops/clip/track.ts +102 -0
- package/apps/studio/edit-ops/clipboard.ts +482 -0
- package/apps/studio/edit-ops/combine.ts +264 -0
- package/apps/studio/edit-ops/constraints.ts +148 -0
- package/apps/studio/edit-ops/convert-kind.ts +203 -0
- package/apps/studio/edit-ops/corner-radius.ts +86 -0
- package/apps/studio/edit-ops/crop.ts +303 -0
- package/apps/studio/edit-ops/czech-ties.ts +84 -0
- package/apps/studio/edit-ops/detach-instance.ts +119 -0
- package/apps/studio/edit-ops/dispatch.ts +552 -0
- package/apps/studio/edit-ops/distribute.ts +31 -0
- package/apps/studio/edit-ops/ds-instance-update.ts +46 -0
- package/apps/studio/edit-ops/ds-use-nearest.ts +72 -0
- package/apps/studio/edit-ops/duplicate-at-width.ts +241 -0
- package/apps/studio/edit-ops/frame.ts +68 -0
- package/apps/studio/edit-ops/guides.ts +67 -0
- package/apps/studio/edit-ops/hide.ts +30 -0
- package/apps/studio/edit-ops/hover-rules.ts +94 -0
- package/apps/studio/edit-ops/image-fit.ts +571 -0
- package/apps/studio/edit-ops/insert-component.ts +344 -0
- package/apps/studio/edit-ops/insert-preset.ts +151 -0
- package/apps/studio/edit-ops/insert-shape.ts +326 -0
- package/apps/studio/edit-ops/instance-model.ts +286 -0
- package/apps/studio/edit-ops/instance-tree.ts +215 -0
- package/apps/studio/edit-ops/layout-patch.ts +81 -0
- package/apps/studio/edit-ops/lock.ts +30 -0
- package/apps/studio/edit-ops/op-label.ts +155 -0
- package/apps/studio/edit-ops/path-model.ts +671 -0
- package/apps/studio/edit-ops/path.ts +172 -0
- package/apps/studio/edit-ops/photo-every-use.ts +64 -0
- package/apps/studio/edit-ops/photo-use.ts +41 -0
- package/apps/studio/edit-ops/place-freely.ts +47 -0
- package/apps/studio/edit-ops/place-plan.ts +60 -0
- package/apps/studio/edit-ops/print.ts +104 -0
- package/apps/studio/edit-ops/references.ts +231 -0
- package/apps/studio/edit-ops/relink.ts +49 -0
- package/apps/studio/edit-ops/reorder.ts +104 -0
- package/apps/studio/edit-ops/reset-overrides.ts +75 -0
- package/apps/studio/edit-ops/revert.ts +63 -0
- package/apps/studio/edit-ops/rotate.ts +58 -0
- package/apps/studio/edit-ops/safe-zones.ts +38 -0
- package/apps/studio/edit-ops/scope-names.ts +151 -0
- package/apps/studio/edit-ops/select-matching.ts +48 -0
- package/apps/studio/edit-ops/set-gap.ts +65 -0
- package/apps/studio/edit-ops/set-id.ts +42 -0
- package/apps/studio/edit-ops/set-link.ts +39 -0
- package/apps/studio/edit-ops/siblings.ts +105 -0
- package/apps/studio/edit-ops/slot-defaults.ts +48 -0
- package/apps/studio/edit-ops/stamp.ts +27 -0
- package/apps/studio/edit-ops/swap-variant.ts +163 -0
- package/apps/studio/edit-ops/text-copy.ts +146 -0
- package/apps/studio/edit-ops/text-detach.ts +62 -0
- package/apps/studio/edit-ops/text-style-ops.ts +131 -0
- package/apps/studio/edit-ops/text-style.ts +141 -0
- package/apps/studio/edit-ops/tidy.ts +72 -0
- package/apps/studio/edit-ops/types.ts +229 -0
- package/apps/studio/edit-ops/unframe.ts +53 -0
- package/apps/studio/edit-ops/words-css.ts +487 -0
- package/apps/studio/edit-ops/words-paint.ts +521 -0
- package/apps/studio/edit-ops/z-order.ts +81 -0
- package/apps/studio/editing/ai-point-ring.tsx +158 -0
- package/apps/studio/editing/ai-scope-outline.tsx +180 -0
- package/apps/studio/editing/align-bar.tsx +510 -0
- package/apps/studio/editing/anchor-report.ts +123 -0
- package/apps/studio/editing/anchor-reporter.tsx +64 -0
- package/apps/studio/editing/aria-live.tsx +162 -0
- package/apps/studio/editing/arrange.ts +345 -0
- package/apps/studio/editing/artboard-actions.ts +275 -0
- package/apps/studio/editing/artboard-commands.tsx +232 -0
- package/apps/studio/editing/artboard-guides.tsx +265 -0
- package/apps/studio/editing/artboard-handles.tsx +524 -0
- package/apps/studio/editing/artboard-menu.tsx +153 -0
- package/apps/studio/editing/artboard-resize.ts +306 -0
- package/apps/studio/editing/ask-bubble.tsx +161 -0
- package/apps/studio/editing/asset-drag.ts +70 -0
- package/apps/studio/editing/click-to-type.ts +207 -0
- package/apps/studio/editing/clipboard-actions.ts +91 -0
- package/apps/studio/editing/clipboard.ts +194 -0
- package/apps/studio/editing/clipped-grab.ts +45 -0
- package/apps/studio/editing/corner-dots.tsx +394 -0
- package/apps/studio/editing/crop-geometry.ts +128 -0
- package/apps/studio/editing/crop-mode.tsx +522 -0
- package/apps/studio/editing/crumbs.ts +158 -0
- package/apps/studio/editing/draw-geometry.ts +151 -0
- package/apps/studio/editing/draw-tools.tsx +490 -0
- package/apps/studio/editing/drop-chip.tsx +105 -0
- package/apps/studio/editing/duplicate-rhythm.ts +166 -0
- package/apps/studio/editing/edit-chrome-gate.tsx +58 -0
- package/apps/studio/editing/edit-op.ts +90 -0
- package/apps/studio/editing/empty-report.ts +182 -0
- package/apps/studio/editing/empty-reporter.tsx +74 -0
- package/apps/studio/editing/figma-paste.ts +71 -0
- package/apps/studio/editing/finder-drop-model.ts +130 -0
- package/apps/studio/editing/finder-drop.tsx +400 -0
- package/apps/studio/editing/focus-model.tsx +429 -0
- package/apps/studio/editing/gap-bands.tsx +257 -0
- package/apps/studio/editing/hold-rings.tsx +461 -0
- package/apps/studio/editing/image-drop.tsx +193 -0
- package/apps/studio/editing/index.tsx +402 -0
- package/apps/studio/editing/instance-actions.ts +152 -0
- package/apps/studio/editing/kids-summary.ts +75 -0
- package/apps/studio/editing/kind-dim.tsx +54 -0
- package/apps/studio/editing/layout-actions.ts +159 -0
- package/apps/studio/editing/lock-badge.tsx +178 -0
- package/apps/studio/editing/long-page.ts +102 -0
- package/apps/studio/editing/minimap-context.tsx +161 -0
- package/apps/studio/editing/nudge.tsx +212 -0
- package/apps/studio/editing/object-actions.ts +156 -0
- package/apps/studio/editing/object-keys.ts +58 -0
- package/apps/studio/editing/object-menu.tsx +216 -0
- package/apps/studio/editing/object-ops.ts +114 -0
- package/apps/studio/editing/paste-bar.tsx +388 -0
- package/apps/studio/editing/pen/combine-run.ts +113 -0
- package/apps/studio/editing/pen/draw.tsx +364 -0
- package/apps/studio/editing/pen/index.tsx +48 -0
- package/apps/studio/editing/pen/overlay.tsx +147 -0
- package/apps/studio/editing/pen/pen-geometry.ts +234 -0
- package/apps/studio/editing/pen/point-store.ts +64 -0
- package/apps/studio/editing/pen/points.tsx +421 -0
- package/apps/studio/editing/place-freely.tsx +389 -0
- package/apps/studio/editing/place-ghost.tsx +418 -0
- package/apps/studio/editing/place-image.tsx +219 -0
- package/apps/studio/editing/preset-ruler.tsx +218 -0
- package/apps/studio/editing/rename-order.ts +58 -0
- package/apps/studio/editing/reorder-slot.tsx +567 -0
- package/apps/studio/editing/rotate-handle.tsx +353 -0
- package/apps/studio/editing/selection.tsx +319 -0
- package/apps/studio/editing/set-gap.ts +55 -0
- package/apps/studio/editing/size-ghost.tsx +343 -0
- package/apps/studio/editing/space-tap.ts +56 -0
- package/apps/studio/editing/sticky-name.tsx +112 -0
- package/apps/studio/editing/tab-order.tsx +298 -0
- package/apps/studio/editing/take-keys.ts +115 -0
- package/apps/studio/editing/text-actions.ts +214 -0
- package/apps/studio/editing/text-in-place.tsx +187 -0
- package/apps/studio/editing/tidy-preview.tsx +83 -0
- package/apps/studio/editing/token-ruler.tsx +231 -0
- package/apps/studio/editing/type-role.ts +122 -0
- package/apps/studio/editing/undo-preview.tsx +120 -0
- package/apps/studio/editing/video-label.ts +66 -0
- package/apps/studio/editing/video-play.ts +65 -0
- package/apps/studio/editing/world-menu.ts +36 -0
- package/apps/studio/element-ids.ts +1030 -0
- package/apps/studio/equal-spacing-handles.tsx +1 -1
- package/apps/studio/exporters/_runtime.ts +64 -24
- package/apps/studio/exporters/audio.ts +136 -0
- package/apps/studio/exporters/door-fingerprint.ts +202 -0
- package/apps/studio/exporters/estimate.ts +314 -0
- package/apps/studio/exporters/file-names.ts +197 -0
- package/apps/studio/exporters/format-scopes.ts +7 -1
- package/apps/studio/exporters/hub-render-door.ts +368 -0
- package/apps/studio/exporters/index.ts +53 -7
- package/apps/studio/exporters/jobs.ts +484 -80
- package/apps/studio/exporters/jpg.ts +21 -0
- package/apps/studio/exporters/pdf-fonts.ts +102 -0
- package/apps/studio/exporters/pdf.ts +133 -14
- package/apps/studio/exporters/png.ts +136 -9
- package/apps/studio/exporters/print-back.ts +92 -0
- package/apps/studio/exporters/print-preflight.ts +373 -0
- package/apps/studio/exporters/rects-runner.ts +130 -0
- package/apps/studio/exporters/remote.ts +726 -3
- package/apps/studio/exporters/render-seconds.ts +57 -0
- package/apps/studio/exporters/replay.ts +48 -0
- package/apps/studio/exporters/scope.ts +560 -15
- package/apps/studio/exporters/spec-run.ts +270 -0
- package/apps/studio/exporters/spec-v2.ts +408 -0
- package/apps/studio/exporters/video-cap.ts +280 -0
- package/apps/studio/exporters/wait-ai.ts +192 -0
- package/apps/studio/figma/client.ts +67 -0
- package/apps/studio/figma/comments-to-pins.ts +249 -0
- package/apps/studio/figma/comments-to-strokes.ts +6 -1
- package/apps/studio/figma/into-board.ts +141 -0
- package/apps/studio/figma/to-strokes.ts +54 -0
- package/apps/studio/format.ts +172 -30
- package/apps/studio/fs-watch.ts +28 -1
- package/apps/studio/generation/adapters/gemini.ts +3 -0
- package/apps/studio/generation/adapters/stub.ts +133 -0
- package/apps/studio/generation/gen-sidecar.ts +108 -0
- package/apps/studio/generation/registry.ts +16 -5
- package/apps/studio/generation/takes.ts +398 -0
- package/apps/studio/generation/types.ts +7 -0
- package/apps/studio/git/service.ts +143 -14
- package/apps/studio/github/endpoints.ts +1 -1
- package/apps/studio/github/identity-cache.ts +53 -14
- package/apps/studio/handoff/blockers.ts +120 -0
- package/apps/studio/handoff/run.ts +233 -0
- package/apps/studio/handoff/targets.ts +334 -0
- package/apps/studio/handoff/write-scopes.ts +57 -0
- package/apps/studio/handoff.ts +24 -5
- package/apps/studio/history/changes.ts +199 -0
- package/apps/studio/history/describe-annotations.ts +216 -0
- package/apps/studio/history/describe-css.ts +592 -0
- package/apps/studio/history/describe-match.ts +866 -0
- package/apps/studio/history/describe-meta.ts +281 -0
- package/apps/studio/history/describe-version.ts +89 -0
- package/apps/studio/history/describe-words.ts +513 -0
- package/apps/studio/history/describe.ts +1452 -0
- package/apps/studio/history/last-good.ts +123 -0
- package/apps/studio/history/links.ts +112 -0
- package/apps/studio/history/object-history.ts +535 -0
- package/apps/studio/history/render-ok-signal.ts +81 -0
- package/apps/studio/history/restore-artboard-action.ts +183 -0
- package/apps/studio/history/restore-artboard.ts +607 -0
- package/apps/studio/history/restore-object.ts +168 -0
- package/apps/studio/history/run-label.ts +18 -0
- package/apps/studio/history/surface-requests.ts +115 -0
- package/apps/studio/history/titles.ts +259 -0
- package/apps/studio/history/trash.ts +314 -0
- package/apps/studio/history/version-lanes.ts +115 -0
- package/apps/studio/history/versions.ts +458 -0
- package/apps/studio/hmr-broadcast.ts +55 -1
- package/apps/studio/home/ai.ts +79 -0
- package/apps/studio/home/cli.ts +221 -0
- package/apps/studio/home/cloud.ts +297 -0
- package/apps/studio/home/create-local.ts +164 -0
- package/apps/studio/home/github.ts +99 -0
- package/apps/studio/home/hub.ts +340 -0
- package/apps/studio/home/index-gc.ts +288 -0
- package/apps/studio/home/index-reader.ts +338 -0
- package/apps/studio/home/invite.ts +204 -0
- package/apps/studio/home/main.ts +159 -0
- package/apps/studio/home/pid.ts +12 -0
- package/apps/studio/home/routes.ts +591 -0
- package/apps/studio/home/signin.ts +285 -0
- package/apps/studio/home/user-state.ts +177 -0
- package/apps/studio/home/whats-new.ts +42 -0
- package/apps/studio/http.ts +2589 -947
- package/apps/studio/index/assets-response.ts +34 -0
- package/apps/studio/index/assets.ts +335 -0
- package/apps/studio/index/ds-usage.ts +983 -0
- package/apps/studio/index/extract.ts +348 -0
- package/apps/studio/index/extractors/asset-usage.ts +349 -0
- package/apps/studio/index/extractors/attribution-cache.ts +225 -0
- package/apps/studio/index/history-refs.ts +301 -0
- package/apps/studio/index/history-source.ts +39 -0
- package/apps/studio/index/match.ts +307 -0
- package/apps/studio/index/scan-kick.ts +47 -0
- package/apps/studio/index/service.ts +367 -0
- package/apps/studio/index/snapshot.ts +135 -0
- package/apps/studio/index/types.ts +139 -0
- package/apps/studio/index/version-feed.ts +71 -0
- package/apps/studio/input-router.tsx +522 -55
- package/apps/studio/inspect-canvas.ts +86 -0
- package/apps/studio/inspect-overlay.tsx +192 -0
- package/apps/studio/inspect.ts +96 -33
- package/apps/studio/kinds/convert.ts +175 -0
- package/apps/studio/kinds/export-defaults.ts +42 -0
- package/apps/studio/kinds/meta.ts +237 -0
- package/apps/studio/kinds/physical.ts +84 -0
- package/apps/studio/kinds/presets.ts +452 -0
- package/apps/studio/kinds/print-custom.ts +165 -0
- package/apps/studio/kinds/print-edit.ts +130 -0
- package/apps/studio/kinds/print-guides.ts +23 -0
- package/apps/studio/kinds/safe-zones.ts +250 -0
- package/apps/studio/kinds/warnings.ts +422 -0
- package/apps/studio/layer-name.ts +148 -0
- package/apps/studio/layout/free-space.ts +131 -0
- package/apps/studio/link-chip-overlay.tsx +175 -0
- package/apps/studio/link-import.ts +617 -0
- package/apps/studio/loopback-listen.ts +105 -0
- package/apps/studio/macro-guard.ts +67 -0
- package/apps/studio/managed-projects.ts +63 -14
- package/apps/studio/marquee-overlay.tsx +2 -2
- package/apps/studio/measure-overlay.tsx +10 -4
- package/apps/studio/migrate/cli.ts +164 -0
- package/apps/studio/migrate/ds-registry.ts +42 -0
- package/apps/studio/migrate/engine.ts +926 -0
- package/apps/studio/migrate/hub.ts +219 -0
- package/apps/studio/migrate/steps.ts +627 -0
- package/apps/studio/notifications.tsx +197 -52
- package/apps/studio/outbox/content.ts +139 -0
- package/apps/studio/outbox/drain.ts +269 -0
- package/apps/studio/outbox/hub-reachability.ts +58 -0
- package/apps/studio/outbox/index.ts +57 -0
- package/apps/studio/outbox/policy.ts +859 -0
- package/apps/studio/outbox/senders/export-cloud.ts +116 -0
- package/apps/studio/outbox/store.ts +336 -0
- package/apps/studio/outbox/types.ts +160 -0
- package/apps/studio/participants-chrome.tsx +178 -60
- package/apps/studio/paths.ts +8 -0
- package/apps/studio/photo-store.ts +230 -1
- package/apps/studio/port.ts +93 -0
- package/apps/studio/presence/canvas-presence.tsx +522 -0
- package/apps/studio/presence/fields.ts +93 -0
- package/apps/studio/presence/model.ts +296 -0
- package/apps/studio/presence/tones.ts +39 -0
- package/apps/studio/present/fit.ts +138 -0
- package/apps/studio/present/follow.ts +142 -0
- package/apps/studio/present/media-presence.ts +105 -0
- package/apps/studio/present/meta-schema.ts +612 -0
- package/apps/studio/present/order.ts +153 -0
- package/apps/studio/present/pointer-dot.tsx +379 -0
- package/apps/studio/present/pointer-point.ts +24 -0
- package/apps/studio/present/present-media.ts +446 -0
- package/apps/studio/present/present-stage.tsx +1018 -0
- package/apps/studio/present/present-zoom.ts +63 -0
- package/apps/studio/present/relay-strip.ts +136 -0
- package/apps/studio/preview/preview-camera.tsx +442 -0
- package/apps/studio/preview/wheel-scroll.ts +85 -0
- package/apps/studio/print/units.ts +3 -0
- package/apps/studio/print-overlay-content.tsx +127 -10
- package/apps/studio/read-only-mode.ts +83 -0
- package/apps/studio/readiness.ts +18 -3
- package/apps/studio/ripple.ts +19 -1
- package/apps/studio/routes/agent.ts +1025 -0
- package/apps/studio/routes/ai.ts +422 -0
- package/apps/studio/routes/annotations.ts +649 -0
- package/apps/studio/routes/asset-details.ts +87 -0
- package/apps/studio/routes/asset-rename.ts +60 -0
- package/apps/studio/routes/asset-state.ts +137 -0
- package/apps/studio/routes/asset-trash.ts +77 -0
- package/apps/studio/routes/assets.ts +217 -0
- package/apps/studio/routes/availability.ts +94 -0
- package/apps/studio/routes/canvas-meta-rider.ts +304 -0
- package/apps/studio/routes/canvas-origin.ts +88 -0
- package/apps/studio/routes/canvas-source.ts +315 -0
- package/apps/studio/routes/chat-attach.ts +335 -0
- package/apps/studio/routes/chat.ts +137 -0
- package/apps/studio/routes/cloud-move.ts +364 -0
- package/apps/studio/routes/cloud-plan.ts +36 -0
- package/apps/studio/routes/comments.ts +118 -0
- package/apps/studio/routes/connections.ts +132 -0
- package/apps/studio/routes/describe.ts +122 -0
- package/apps/studio/routes/diagnostics.ts +118 -0
- package/apps/studio/routes/ds-check.ts +124 -0
- package/apps/studio/routes/ds-convert.ts +55 -0
- package/apps/studio/routes/ds-edges.ts +136 -0
- package/apps/studio/routes/ds-library.ts +194 -0
- package/apps/studio/routes/ds-make.ts +91 -0
- package/apps/studio/routes/ds-switch.ts +68 -0
- package/apps/studio/routes/ds-upgrade.ts +139 -0
- package/apps/studio/routes/ds.ts +808 -0
- package/apps/studio/routes/edit.ts +658 -0
- package/apps/studio/routes/element-links.ts +155 -0
- package/apps/studio/routes/export.ts +486 -0
- package/apps/studio/routes/figma.ts +200 -0
- package/apps/studio/routes/generate.ts +443 -0
- package/apps/studio/routes/handoff.ts +319 -0
- package/apps/studio/routes/help-guides.ts +37 -0
- package/apps/studio/routes/history.ts +739 -0
- package/apps/studio/routes/import-link.ts +186 -0
- package/apps/studio/routes/index.ts +293 -0
- package/apps/studio/routes/kinds.ts +257 -0
- package/apps/studio/routes/links.ts +72 -0
- package/apps/studio/routes/outbox.ts +87 -0
- package/apps/studio/routes/photo-every-use.ts +241 -0
- package/apps/studio/routes/pins.ts +66 -0
- package/apps/studio/routes/present.ts +187 -0
- package/apps/studio/routes/project-format.ts +148 -0
- package/apps/studio/routes/project-undo.ts +497 -0
- package/apps/studio/routes/settings.ts +179 -0
- package/apps/studio/routes/share.ts +463 -0
- package/apps/studio/routes/shell.ts +137 -0
- package/apps/studio/routes/sync-conflicts.ts +150 -0
- package/apps/studio/routes/sync.ts +172 -0
- package/apps/studio/routes/table.ts +224 -0
- package/apps/studio/routes/trash.ts +393 -0
- package/apps/studio/routes/video.ts +395 -0
- package/apps/studio/routes/votes.ts +486 -0
- package/apps/studio/safe-zones-overlay.tsx +269 -0
- package/apps/studio/scaffold-design.ts +72 -124
- package/apps/studio/schema/annotations.v2.schema.json +2303 -0
- package/apps/studio/schema/beats.v1.schema.json +94 -0
- package/apps/studio/schema/canvas-meta.v2.schema.json +264 -0
- package/apps/studio/schema/canvas-tsx.md +357 -0
- package/apps/studio/schema/comments.v2.schema.json +125 -0
- package/apps/studio/schema/ds-components-v1.schema.json +96 -0
- package/apps/studio/schema/ds-formats.md +146 -0
- package/apps/studio/schema/ds-head-v1.schema.json +67 -0
- package/apps/studio/schema/ds-revision-v1.schema.json +31 -0
- package/apps/studio/schema/ds-schema-v1.fallbacks.css +118 -0
- package/apps/studio/schema/ds-schema-v1.json +2029 -0
- package/apps/studio/schema/ds-schema-v1.schema.json +663 -0
- package/apps/studio/schema/ds-tokens-v1.schema.json +210 -0
- package/apps/studio/schema/edl.v1.schema.json +124 -0
- package/apps/studio/schema/formats.ts +175 -0
- package/apps/studio/schema/gen.v1.schema.json +33 -0
- package/apps/studio/schema/transcript.v1.schema.json +133 -0
- package/apps/studio/server.ts +454 -166
- package/apps/studio/shell/info-file.ts +54 -0
- package/apps/studio/shell/parent-watch.ts +97 -0
- package/apps/studio/shell/profile.ts +61 -0
- package/apps/studio/shell-canvas-file.ts +36 -0
- package/apps/studio/skip-dirs.ts +455 -0
- package/apps/studio/spoof-chars.ts +17 -0
- package/apps/studio/static-lane.ts +212 -0
- package/apps/studio/sync/accepted-cold-start.ts +35 -13
- package/apps/studio/sync/accepted-link.ts +524 -27
- package/apps/studio/sync/access-notices.ts +143 -0
- package/apps/studio/sync/action-feed.ts +145 -0
- package/apps/studio/sync/action-stage.ts +831 -165
- package/apps/studio/sync/asset-push.ts +24 -2
- package/apps/studio/sync/asset-state.ts +391 -0
- package/apps/studio/sync/atomic-write.ts +42 -1
- package/apps/studio/sync/availability.ts +185 -0
- package/apps/studio/sync/canvas-path.ts +70 -6
- package/apps/studio/sync/cell-pairing.ts +5 -24
- package/apps/studio/sync/comment-door.ts +104 -0
- package/apps/studio/sync/conflict-record.ts +186 -0
- package/apps/studio/sync/create-collision.ts +297 -0
- package/apps/studio/sync/ctl-provider.ts +13 -1
- package/apps/studio/sync/file-membership.ts +95 -10
- package/apps/studio/sync/file-plane.ts +76 -7
- package/apps/studio/sync/format-sync.ts +13 -7
- package/apps/studio/sync/history-fields.ts +61 -0
- package/apps/studio/sync/hub-link.ts +24 -4
- package/apps/studio/sync/hub-text-undo.ts +178 -0
- package/apps/studio/sync/hubs-config.ts +122 -20
- package/apps/studio/sync/index.ts +1444 -127
- package/apps/studio/sync/journal-client.ts +44 -0
- package/apps/studio/sync/keep-both.ts +187 -0
- package/apps/studio/sync/link-consent.ts +390 -0
- package/apps/studio/sync/local-kernel.ts +2725 -0
- package/apps/studio/sync/media-gate.ts +97 -0
- package/apps/studio/sync/object-conflict.ts +199 -0
- package/apps/studio/sync/poke.ts +20 -0
- package/apps/studio/sync/presentation.ts +14 -1
- package/apps/studio/sync/project-config-push.ts +5 -2
- package/apps/studio/sync/projection.ts +201 -34
- package/apps/studio/sync/resync-trace.ts +220 -0
- package/apps/studio/sync/status.ts +8 -1
- package/apps/studio/sync/supervisor.ts +20 -2
- package/apps/studio/sync/transaction-client.ts +364 -34
- package/apps/studio/sync/trash-clear-copies.ts +120 -0
- package/apps/studio/sync/trash-watch.ts +157 -0
- package/apps/studio/sync/trash.ts +50 -2
- package/apps/studio/sync/undo-target.ts +110 -0
- package/apps/studio/sync/workspace-signin.ts +14 -3
- package/apps/studio/sync/write-hold.ts +238 -0
- package/apps/studio/sync/writer-registry.ts +380 -5
- package/apps/studio/sync-name-key.ts +59 -0
- package/apps/studio/thumbs/keys.ts +147 -0
- package/apps/studio/thumbs/routes.ts +68 -0
- package/apps/studio/thumbs/service.ts +884 -0
- package/apps/studio/thumbs/store.ts +114 -0
- package/apps/studio/thumbs/validate.ts +62 -0
- package/apps/studio/tool-palette.tsx +782 -563
- package/apps/studio/toolbars/marker-tip.ts +22 -0
- package/apps/studio/toolbars/shell-panels.ts +55 -0
- package/apps/studio/toolbars/tool-panel.ts +89 -0
- package/apps/studio/toolbars/toolbar-css.ts +283 -0
- package/apps/studio/toolbars/toolbar-icons.tsx +135 -0
- package/apps/studio/toolbars/toolbar-rect.ts +82 -0
- package/apps/studio/ui-prefs-migrate.ts +467 -0
- package/apps/studio/ui-prefs.ts +305 -3
- package/apps/studio/undo-stack.ts +10 -0
- package/apps/studio/use-annotation-resize.tsx +23 -17
- package/apps/studio/use-artboard-drag.tsx +156 -15
- package/apps/studio/use-canvas-keys.ts +58 -0
- package/apps/studio/use-chrome-visibility.tsx +13 -0
- package/apps/studio/use-collab.tsx +556 -56
- package/apps/studio/use-element-resize.tsx +13 -9
- package/apps/studio/use-governed-mode.ts +23 -0
- package/apps/studio/use-keyboard-discipline.tsx +114 -49
- package/apps/studio/use-selection-set.tsx +110 -9
- package/apps/studio/use-snap-guides.tsx +74 -5
- package/apps/studio/use-spacing-handles.tsx +90 -27
- package/apps/studio/use-tool-mode.tsx +204 -10
- package/apps/studio/use-undo-stack.tsx +19 -23
- package/apps/studio/video/beats.ts +484 -0
- package/apps/studio/video/decode-webaudio.ts +115 -0
- package/apps/studio/video/decode.ts +288 -0
- package/apps/studio/video/derive.ts +647 -0
- package/apps/studio/video/format-ids.ts +158 -0
- package/apps/studio/video/framing.ts +246 -0
- package/apps/studio/video/inject.ts +324 -0
- package/apps/studio/video/keyframes.ts +356 -0
- package/apps/studio/video/link-groups.ts +40 -0
- package/apps/studio/video/linked-formats.ts +142 -0
- package/apps/studio/video/mask-comments.ts +36 -0
- package/apps/studio/video/media-analysis.ts +169 -0
- package/apps/studio/video/reel-place.ts +286 -0
- package/apps/studio/video/reframe-read.ts +90 -0
- package/apps/studio/video/schema.ts +422 -0
- package/apps/studio/video/speech.ts +129 -0
- package/apps/studio/video/title-motion.ts +85 -0
- package/apps/studio/video/transcript-cut.ts +91 -0
- package/apps/studio/video/whisper-parse.ts +123 -0
- package/apps/studio/video/words-run.ts +210 -0
- package/apps/studio/video/words-timing.ts +222 -0
- package/apps/studio/video-comp.tsx +238 -9
- package/apps/studio/video-links-overlay.tsx +272 -0
- package/apps/studio/video-natural.ts +73 -0
- package/apps/studio/video-play-chrome.tsx +229 -0
- package/apps/studio/video-play-overlay.tsx +190 -0
- package/apps/studio/video-vocab.tsx +460 -0
- package/apps/studio/view-only-gesture.tsx +101 -0
- package/apps/studio/viewport-fit.ts +28 -0
- package/apps/studio/web-overlay-content.tsx +4 -2
- package/apps/studio/whats-new.json +55 -20
- package/apps/studio/whats-new.schema.json +10 -0
- package/apps/studio/whats-new.ts +4 -0
- package/apps/studio/workspace-mode.ts +10 -0
- package/apps/studio/ws.ts +299 -8
- package/cli/bin/maude.mjs +1 -0
- package/cli/commands/design.mjs +401 -72
- package/cli/commands/flow.mjs +12 -1
- package/cli/commands/help.mjs +8 -0
- package/cli/commands/migrate.mjs +55 -0
- package/cli/lib/bash-guard.mjs +1691 -0
- package/cli/lib/confine-out.mjs +150 -0
- package/cli/lib/confine-read.mjs +179 -0
- package/cli/lib/confine-root.mjs +157 -0
- package/cli/lib/design-help.gen.mjs +119 -0
- package/cli/lib/design-hook.mjs +1764 -0
- package/cli/lib/design-link.mjs +68 -4
- package/cli/lib/design-open.mjs +238 -0
- package/cli/lib/export-spec.mjs +394 -0
- package/cli/lib/finding-text.mjs +63 -0
- package/cli/lib/flow-usage.mjs +6 -10
- package/cli/lib/gitignore-block.mjs +1 -0
- package/cli/lib/handoff.mjs +285 -0
- package/cli/lib/handoff.schema.json +336 -0
- package/cli/lib/hubs-config.mjs +10 -0
- package/cli/lib/json-schema-lite.mjs +260 -0
- package/cli/lib/project-links.mjs +88 -0
- package/cli/lib/studio-locate.mjs +83 -0
- package/cli/lib/sub-verbs.mjs +111 -0
- package/cli/lib/workspace-plan.mjs +16 -3
- package/package.json +29 -10
- package/plugins/design/README.md +46 -0
- package/plugins/design/templates/_shell.html +749 -69
- package/plugins/design/templates/blank-canvas.tsx.template +26 -0
- package/plugins/design/templates/brief-board.tsx.template +12 -11
- package/plugins/design/templates/canvas.tsx.template +3 -3
- package/plugins/design/templates/design-system-inspiration/core/README.philosophy.md.tpl +104 -0
- package/plugins/design/templates/design-system-inspiration/core/colors_and_type.css.tpl +38 -3
- package/plugins/design/templates/design-system-inspiration/core/components.json.tpl +127 -0
- package/plugins/design/templates/design-system-inspiration/core/config.json.tpl +1 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/_components.css.tpl +111 -0
- package/plugins/flow/.claude-plugin/config.schema.json +6 -1
- package/apps/studio/annotations/ui/edit-actions.ts +0 -551
- package/apps/studio/canvas-header.ts +0 -165
- package/apps/studio/client/hmr.mjs +0 -113
- package/apps/studio/client/hooks/use-keyboard-shortcuts.jsx +0 -297
- package/apps/studio/client/iframe-lazy.mjs +0 -121
- package/apps/studio/client/inspector/artboard-knobs.jsx +0 -456
- package/apps/studio/client/menus/menubar.jsx +0 -856
- package/apps/studio/client/panels/CapabilityBar.jsx +0 -101
- package/apps/studio/client/panels/ClipInspector.jsx +0 -409
- package/apps/studio/client/panels/GitPanel.jsx +0 -1026
- package/apps/studio/client/panels/OnboardingWizard.jsx +0 -642
- package/apps/studio/client/panels/StickerPicker.jsx +0 -160
- package/apps/studio/client/panels/SyncPanel.jsx +0 -1190
- package/apps/studio/client/panels/TimelinePanel.jsx +0 -2259
- package/apps/studio/client/share-dialog.jsx +0 -91
- package/apps/studio/client/shell/collapsed-rail.jsx +0 -23
- package/apps/studio/client/shell/status-bar.jsx +0 -215
- package/apps/studio/client/styles/1-tokens-maude.css +0 -296
- package/apps/studio/client/styles/1-tokens.css +0 -304
- package/apps/studio/client/styles/3-shell-maude.css +0 -3158
- package/apps/studio/client/styles/3-shell.css +0 -1036
- package/apps/studio/client/styles/4-components-maude.css +0 -134
- package/apps/studio/client/styles/4-components.css +0 -2204
- package/apps/studio/client/styles/5-maude-overrides.css +0 -162
- package/apps/studio/client/styles.css +0 -1264
- package/apps/studio/contextual-toolbar.tsx +0 -512
- package/apps/studio/export-dialog.tsx +0 -827
- package/apps/studio/undo-hud.tsx +0 -16
|
@@ -0,0 +1,1652 @@
|
|
|
1
|
+
// The design-system engine — V2-1.6 §5.9–§5.11, S10 Q1. Every review effect of a converted system
|
|
2
|
+
// is ONE action, whatever planes it touches:
|
|
3
|
+
//
|
|
4
|
+
// publish (c) "Update N canvases" revision R → working files → metas (one kernel
|
|
5
|
+
// action) → head.json (head = base = R)
|
|
6
|
+
// cancelPending (c) Cancel the DS canvas meta (one kernel action)
|
|
7
|
+
// mergePending §5.9 propose the DS canvas meta, merged per token
|
|
8
|
+
// keepOutside (a) Keep revision K = the working files → head.json base = K
|
|
9
|
+
// undoOutside (a) Undo the working files rewritten from base
|
|
10
|
+
// pick (b) "Use this" canvas: patch working → K; file: K = working;
|
|
11
|
+
// either way the pending entry goes (kernel) + base = K
|
|
12
|
+
// pickPublished §5.7 "Published in two places" head = base = the chosen copy's head
|
|
13
|
+
// canvasUpdate / canvasLeave (d) a canvas's `dsRev` (+ its `data-ds-rev="head"`)
|
|
14
|
+
// trashToken / restoreToken / clearToken (e) publishes with every follower ticked
|
|
15
|
+
//
|
|
16
|
+
// Plane B (revisions, siblings, working files, head.json) is written by this module in the §5.6
|
|
17
|
+
// order, tmp + rename, head.json LAST and only through `ds/head.ts` against the pointers read.
|
|
18
|
+
// Plane A (canvas metas and TSX) is NEVER written here: it goes through the kernel port as one
|
|
19
|
+
// proposal, so an accepted publish is one Version-history entry and one ⌘Z. The head.json log
|
|
20
|
+
// entry records that action's id, and `ds/undo-hook.ts` moves the pointers back when the kernel
|
|
21
|
+
// undoes (or redoes) it.
|
|
22
|
+
//
|
|
23
|
+
// All operations of one system run one at a time (an in-process lock per system folder). Values,
|
|
24
|
+
// labels and value names are data (DDR-172 D8) — they are compared and written, never obeyed.
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
existsSync,
|
|
28
|
+
mkdirSync,
|
|
29
|
+
readdirSync,
|
|
30
|
+
readFileSync,
|
|
31
|
+
renameSync,
|
|
32
|
+
statSync,
|
|
33
|
+
unlinkSync,
|
|
34
|
+
} from 'node:fs';
|
|
35
|
+
import path from 'node:path';
|
|
36
|
+
|
|
37
|
+
import { atomicWrite } from '../sync/atomic-write.ts';
|
|
38
|
+
import { modesOf } from './board/types.ts';
|
|
39
|
+
import { followedDark } from './contrast.ts';
|
|
40
|
+
import { canvasSystemFor } from './ds-resolver.ts';
|
|
41
|
+
import {
|
|
42
|
+
type ComponentEdit,
|
|
43
|
+
emitTokensJson,
|
|
44
|
+
type GenConfig,
|
|
45
|
+
generateComponentsCss,
|
|
46
|
+
generateTokensCss,
|
|
47
|
+
type Json,
|
|
48
|
+
type ModelToken,
|
|
49
|
+
normalizeModel,
|
|
50
|
+
parseSystem,
|
|
51
|
+
type TokenModel,
|
|
52
|
+
} from './generate.ts';
|
|
53
|
+
import {
|
|
54
|
+
type By,
|
|
55
|
+
HEAD_REL,
|
|
56
|
+
type HeadDoc,
|
|
57
|
+
type LogAction,
|
|
58
|
+
type LogEntry,
|
|
59
|
+
type Pointers,
|
|
60
|
+
publishedInTwoPlaces,
|
|
61
|
+
readHead,
|
|
62
|
+
settleAsideHeads,
|
|
63
|
+
writeHead,
|
|
64
|
+
} from './head.ts';
|
|
65
|
+
import { indexRegistry, loadRegistry } from './registry.ts';
|
|
66
|
+
import {
|
|
67
|
+
type BuiltRevision,
|
|
68
|
+
buildRevision,
|
|
69
|
+
COMPONENTS_CSS_KEY,
|
|
70
|
+
type RevisionBody,
|
|
71
|
+
revisionWritePlan,
|
|
72
|
+
serializeRevision,
|
|
73
|
+
sha256Hex,
|
|
74
|
+
verifyRevision,
|
|
75
|
+
} from './revision.ts';
|
|
76
|
+
import { type SystemConfig, systemConfigsFrom } from './system.ts';
|
|
77
|
+
|
|
78
|
+
export const DS_CANVAS = 'design-system.tsx';
|
|
79
|
+
export const DS_META = 'design-system.meta.json';
|
|
80
|
+
export const TOKENS_JSON_KEY = 'tokens.json';
|
|
81
|
+
export const COMPONENTS_JSON_KEY = 'components.json';
|
|
82
|
+
/** the kernel action kind every DS gesture commits as — a person's edit, so ⌘Z reaches it */
|
|
83
|
+
export const DS_ACTION_KIND = 'edit';
|
|
84
|
+
|
|
85
|
+
/* ------------------------------------------------------------------ errors */
|
|
86
|
+
|
|
87
|
+
export type EngineErrorCode =
|
|
88
|
+
| 'ds-unknown-system'
|
|
89
|
+
| 'ds-not-converted'
|
|
90
|
+
| 'ds-head-moved'
|
|
91
|
+
| 'ds-head-invalid'
|
|
92
|
+
| 'ds-outside-unreviewed'
|
|
93
|
+
| 'ds-conflict'
|
|
94
|
+
| 'ds-two-places'
|
|
95
|
+
| 'ds-library'
|
|
96
|
+
| 'ds-nothing-waiting'
|
|
97
|
+
| 'ds-revision-missing'
|
|
98
|
+
| 'ds-revision-invalid'
|
|
99
|
+
| 'ds-pending-conflict'
|
|
100
|
+
| 'ds-pending-invalid'
|
|
101
|
+
| 'ds-token-locked'
|
|
102
|
+
| 'ds-nothing-to-push'
|
|
103
|
+
| 'ds-no-canvas'
|
|
104
|
+
| 'ds-not-in-system'
|
|
105
|
+
| 'ds-no-outside'
|
|
106
|
+
| 'ds-no-conflict'
|
|
107
|
+
| 'ds-unknown-token'
|
|
108
|
+
| 'ds-trash-tier1'
|
|
109
|
+
| 'ds-not-trashed'
|
|
110
|
+
| 'ds-kernel-unavailable'
|
|
111
|
+
| 'ds-kernel-rejected'
|
|
112
|
+
// S10.16a (making a system)
|
|
113
|
+
| 'ds-making'
|
|
114
|
+
| 'ds-not-making'
|
|
115
|
+
| 'ds-exists'
|
|
116
|
+
| 'ds-unknown-direction'
|
|
117
|
+
| 'ds-unknown-group'
|
|
118
|
+
| 'ds-nothing-made'
|
|
119
|
+
| 'ds-make-invalid';
|
|
120
|
+
|
|
121
|
+
const STATUS: Partial<Record<EngineErrorCode, number>> = {
|
|
122
|
+
'ds-unknown-system': 404,
|
|
123
|
+
'ds-not-in-system': 404,
|
|
124
|
+
'ds-unknown-token': 404,
|
|
125
|
+
'ds-pending-invalid': 422,
|
|
126
|
+
'ds-token-locked': 422,
|
|
127
|
+
'ds-nothing-to-push': 422,
|
|
128
|
+
'ds-revision-invalid': 422,
|
|
129
|
+
'ds-head-invalid': 422,
|
|
130
|
+
'ds-kernel-unavailable': 503,
|
|
131
|
+
'ds-unknown-direction': 404,
|
|
132
|
+
'ds-unknown-group': 422,
|
|
133
|
+
'ds-nothing-made': 422,
|
|
134
|
+
'ds-make-invalid': 422,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export class DsEngineError extends Error {
|
|
138
|
+
readonly code: EngineErrorCode;
|
|
139
|
+
readonly status: number;
|
|
140
|
+
readonly detail?: Record<string, unknown>;
|
|
141
|
+
constructor(code: EngineErrorCode, message: string, detail?: Record<string, unknown>) {
|
|
142
|
+
super(message);
|
|
143
|
+
this.name = 'DsEngineError';
|
|
144
|
+
this.code = code;
|
|
145
|
+
this.status = STATUS[code] ?? 409;
|
|
146
|
+
if (detail) this.detail = detail;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
let roles: Set<string> | null = null;
|
|
151
|
+
/** the V2-1.13 registry's Tier-1 role names (they can't be trashed) */
|
|
152
|
+
const tier1 = (): Set<string> => {
|
|
153
|
+
if (!roles) roles = new Set(indexRegistry(loadRegistry()).roles.keys());
|
|
154
|
+
return roles;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const fail = (code: EngineErrorCode, m: string, d?: Record<string, unknown>) =>
|
|
158
|
+
new DsEngineError(code, m, d);
|
|
159
|
+
|
|
160
|
+
/* ------------------------------------------------------------- the kernel */
|
|
161
|
+
|
|
162
|
+
export interface KernelOutcome {
|
|
163
|
+
status: 'accepted' | 'rejected';
|
|
164
|
+
code?: string;
|
|
165
|
+
actionId?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** The Plane-A half: several canvas files proposed as ONE action (S10 Q1). */
|
|
169
|
+
export interface DsKernelPort {
|
|
170
|
+
/** null: no home answers right now (a linked project not in accepted mode) */
|
|
171
|
+
propose(
|
|
172
|
+
files: { rel: string; text: string }[],
|
|
173
|
+
action: { kind: string; label: string }
|
|
174
|
+
): Promise<KernelOutcome | null>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The port over `ctx.syncControl.current()`: the local home answers `proposeFiles` (S10.2), and
|
|
179
|
+
* so does a linked hub's sync runtime in accepted mode (S10.3b; null outside it). A runtime
|
|
180
|
+
* without it answers null, and every DS write that needs the kernel refuses
|
|
181
|
+
* `ds-kernel-unavailable` rather than writing metas behind the log's back.
|
|
182
|
+
*/
|
|
183
|
+
export function kernelPortFrom(control: () => unknown): () => DsKernelPort | null {
|
|
184
|
+
return () => {
|
|
185
|
+
const rt = control() as
|
|
186
|
+
| { proposeFiles?: (f: unknown, a: unknown) => Promise<KernelOutcome | null> }
|
|
187
|
+
| null
|
|
188
|
+
| undefined;
|
|
189
|
+
if (!rt || typeof rt.proposeFiles !== 'function') return null;
|
|
190
|
+
const fn = rt.proposeFiles.bind(rt);
|
|
191
|
+
return { propose: (files, action) => fn(files, action) };
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* ------------------------------------------------------------------- types */
|
|
196
|
+
|
|
197
|
+
export interface ThemeValues {
|
|
198
|
+
[theme: string]: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface PendingToken {
|
|
202
|
+
/** per theme: the concrete value (§5.3) */
|
|
203
|
+
[theme: string]: unknown;
|
|
204
|
+
valueNames?: Record<string, string>;
|
|
205
|
+
darkFollows?: boolean;
|
|
206
|
+
trash?: { replacement: string };
|
|
207
|
+
add?: { tier?: number; type?: string; label?: string };
|
|
208
|
+
by?: By;
|
|
209
|
+
at?: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface PendingComponents {
|
|
213
|
+
[component: string]: {
|
|
214
|
+
[selector: string]: { [property: string]: { value: string; by?: By; at?: string } };
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface DsPending {
|
|
219
|
+
base?: string | null;
|
|
220
|
+
tokens?: Record<string, PendingToken>;
|
|
221
|
+
components?: PendingComponents;
|
|
222
|
+
[k: string]: unknown;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface TokenChange {
|
|
226
|
+
css: string;
|
|
227
|
+
label: string | null;
|
|
228
|
+
before: ThemeValues | null;
|
|
229
|
+
after: ThemeValues | null;
|
|
230
|
+
trashed?: { replacement: string } | null;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface CanvasRow {
|
|
234
|
+
/** design-root-relative */
|
|
235
|
+
path: string;
|
|
236
|
+
folder: string;
|
|
237
|
+
state: 'follows' | 'left-out' | 'pinned';
|
|
238
|
+
dsRev: string | null;
|
|
239
|
+
ticked: boolean;
|
|
240
|
+
reason?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface Conflict {
|
|
244
|
+
css: string;
|
|
245
|
+
label: string | null;
|
|
246
|
+
canvas: ThemeValues;
|
|
247
|
+
file: ThemeValues;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface DsState {
|
|
251
|
+
name: string;
|
|
252
|
+
path: string;
|
|
253
|
+
converted: boolean;
|
|
254
|
+
headState: 'ok' | 'absent' | 'invalid' | 'unreadable';
|
|
255
|
+
head: string | null;
|
|
256
|
+
base: string | null;
|
|
257
|
+
drafts: HeadDoc['drafts'];
|
|
258
|
+
library: Record<string, unknown> | null;
|
|
259
|
+
/** base revision unavailable here (not delivered yet, or invalid) */
|
|
260
|
+
baseMissing: boolean;
|
|
261
|
+
outside: {
|
|
262
|
+
files: string[];
|
|
263
|
+
changes: TokenChange[];
|
|
264
|
+
otherChanges: { path: string; count: number }[];
|
|
265
|
+
} | null;
|
|
266
|
+
pending: DsPending;
|
|
267
|
+
waiting: TokenChange[];
|
|
268
|
+
conflicts: Conflict[];
|
|
269
|
+
leftOut: { count: number; canvases: string[] };
|
|
270
|
+
trashed: {
|
|
271
|
+
kind: 'token';
|
|
272
|
+
system: string;
|
|
273
|
+
css: string;
|
|
274
|
+
label: string | null;
|
|
275
|
+
replacement: string;
|
|
276
|
+
at: string | null;
|
|
277
|
+
by: By | null;
|
|
278
|
+
}[];
|
|
279
|
+
publishedInTwoPlaces: ReturnType<typeof publishedInTwoPlaces>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface DsResult {
|
|
283
|
+
action: string;
|
|
284
|
+
rev: string | null;
|
|
285
|
+
actionId: string | null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface PublishResult extends DsResult {
|
|
289
|
+
updated: number;
|
|
290
|
+
leftOut: number;
|
|
291
|
+
summary: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface EngineOptions {
|
|
295
|
+
/** absolute design root */
|
|
296
|
+
designRoot: string;
|
|
297
|
+
kernel: DsKernelPort | null | (() => DsKernelPort | null);
|
|
298
|
+
now?: () => number;
|
|
299
|
+
log?: Pick<Console, 'warn' | 'error'>;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* ----------------------------------------------------------------- helpers */
|
|
303
|
+
|
|
304
|
+
const isObj = (v: unknown): v is Record<string, unknown> =>
|
|
305
|
+
!!v && typeof v === 'object' && !Array.isArray(v);
|
|
306
|
+
|
|
307
|
+
const CSS_NAME_RE = /^--[A-Za-z0-9_-]{1,128}$/;
|
|
308
|
+
const DISPLAY_RE = /^\P{Cc}{0,64}$/u;
|
|
309
|
+
const VALUE_MAX = 2000;
|
|
310
|
+
const UNSAFE = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp};{}]/u;
|
|
311
|
+
const STRIP_HEAD_PIN = /\s+data-ds-rev=(?:"head"|'head'|\{\s*["']head["']\s*\})/g;
|
|
312
|
+
|
|
313
|
+
function setOwn(o: Record<string, unknown>, k: string, v: unknown): void {
|
|
314
|
+
Object.defineProperty(o, k, { value: v, enumerable: true, writable: true, configurable: true });
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** One lock per system folder, shared by every engine in this process. */
|
|
318
|
+
const locks = new Map<string, Promise<unknown>>();
|
|
319
|
+
export function withLock<T>(key: string, fn: () => Promise<T>): Promise<T> {
|
|
320
|
+
const prev = locks.get(key) ?? Promise.resolve();
|
|
321
|
+
const run = prev.then(fn, fn);
|
|
322
|
+
const tail = run.catch(() => {});
|
|
323
|
+
locks.set(key, tail);
|
|
324
|
+
void tail.then(() => {
|
|
325
|
+
if (locks.get(key) === tail) locks.delete(key);
|
|
326
|
+
});
|
|
327
|
+
return run;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function readText(abs: string): string | null {
|
|
331
|
+
try {
|
|
332
|
+
return readFileSync(abs, 'utf8');
|
|
333
|
+
} catch {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function readJsonObj(abs: string): Record<string, unknown> | null {
|
|
339
|
+
const t = readText(abs);
|
|
340
|
+
if (t === null) return null;
|
|
341
|
+
try {
|
|
342
|
+
const v = JSON.parse(t);
|
|
343
|
+
return isObj(v) ? v : null;
|
|
344
|
+
} catch {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const metaText = (o: Record<string, unknown>) => `${JSON.stringify(o, null, 2)}\n`;
|
|
350
|
+
const metaRelOf = (canvasRel: string) => canvasRel.replace(/\.tsx$/i, '.meta.json');
|
|
351
|
+
|
|
352
|
+
function sameValues(a: ThemeValues | null, b: ThemeValues | null): boolean {
|
|
353
|
+
const ka = Object.keys(a ?? {}).sort();
|
|
354
|
+
const kb = Object.keys(b ?? {}).sort();
|
|
355
|
+
if (ka.join('\0') !== kb.join('\0')) return false;
|
|
356
|
+
return ka.every((k) => (a as ThemeValues)[k] === (b as ThemeValues)[k]);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const labelOf = (t: ModelToken | undefined): string | null =>
|
|
360
|
+
t && typeof t.data.label === 'string' ? t.data.label : null;
|
|
361
|
+
|
|
362
|
+
const trashOf = (t: ModelToken | undefined): { replacement: string } | null => {
|
|
363
|
+
const tr = t?.data.trashed;
|
|
364
|
+
return isObj(tr) && typeof tr.replacement === 'string' ? { replacement: tr.replacement } : null;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
/** The token-level diff a → b (both normalised), per theme; trash state counts as a change. */
|
|
368
|
+
export function tokenDiff(a: TokenModel | null, b: TokenModel | null): TokenChange[] {
|
|
369
|
+
const A = a ? normalizeModel(a).tokens : {};
|
|
370
|
+
const B = b ? normalizeModel(b).tokens : {};
|
|
371
|
+
const out: TokenChange[] = [];
|
|
372
|
+
for (const css of [...new Set([...Object.keys(A), ...Object.keys(B)])].sort()) {
|
|
373
|
+
const before = A[css]?.values ?? null;
|
|
374
|
+
const after = B[css]?.values ?? null;
|
|
375
|
+
const ta = trashOf(A[css]);
|
|
376
|
+
const tb = trashOf(B[css]);
|
|
377
|
+
if (sameValues(before, after) && (ta?.replacement ?? null) === (tb?.replacement ?? null))
|
|
378
|
+
continue;
|
|
379
|
+
out.push({
|
|
380
|
+
css,
|
|
381
|
+
label: labelOf(B[css]) ?? labelOf(A[css]),
|
|
382
|
+
before,
|
|
383
|
+
after,
|
|
384
|
+
...(ta || tb ? { trashed: tb } : {}),
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
return out;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function themeValuesOf(entry: PendingToken, themes: string[]): ThemeValues {
|
|
391
|
+
const out: ThemeValues = {};
|
|
392
|
+
for (const t of themes) if (typeof entry[t] === 'string') out[t] = (entry[t] as string).trim();
|
|
393
|
+
return out;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function summaryOf(changes: TokenChange[], comps: number): string {
|
|
397
|
+
const n = changes.length + comps;
|
|
398
|
+
if (n === 1 && changes.length === 1) {
|
|
399
|
+
const c = changes[0];
|
|
400
|
+
const name = c.label ?? c.css;
|
|
401
|
+
if (c.trashed) return `${name} → the trash`.slice(0, 200);
|
|
402
|
+
const after = c.after ? Object.values(c.after)[0] : null;
|
|
403
|
+
return `${name} → ${after ?? 'removed'}`.slice(0, 200);
|
|
404
|
+
}
|
|
405
|
+
return n === 1 ? '1 change' : `${n} changes`;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* ------------------------------------------------------------------ engine */
|
|
409
|
+
|
|
410
|
+
export function createDsEngine(opts: EngineOptions) {
|
|
411
|
+
const designRoot = path.resolve(opts.designRoot);
|
|
412
|
+
const now = opts.now ?? Date.now;
|
|
413
|
+
const log = opts.log ?? console;
|
|
414
|
+
const kernelNow = (): DsKernelPort | null =>
|
|
415
|
+
typeof opts.kernel === 'function' ? opts.kernel() : opts.kernel;
|
|
416
|
+
const iso = () => new Date(now()).toISOString();
|
|
417
|
+
|
|
418
|
+
function config(): Record<string, unknown> {
|
|
419
|
+
return readJsonObj(path.join(designRoot, 'config.json')) ?? {};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
function systems(): SystemConfig[] {
|
|
423
|
+
return systemConfigsFrom(config());
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function system(ds: string): SystemConfig {
|
|
427
|
+
const s = systems().find((x) => x.name === ds);
|
|
428
|
+
if (!s) throw fail('ds-unknown-system', `no design system named ${String(ds).slice(0, 64)}`);
|
|
429
|
+
return s;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const dsAbs = (s: SystemConfig) => path.join(designRoot, s.path);
|
|
433
|
+
const tokensKey = (s: SystemConfig) => path.posix.relative(s.path, s.tokensCssRel);
|
|
434
|
+
const workingKeys = (s: SystemConfig) => [
|
|
435
|
+
tokensKey(s),
|
|
436
|
+
TOKENS_JSON_KEY,
|
|
437
|
+
COMPONENTS_JSON_KEY,
|
|
438
|
+
COMPONENTS_CSS_KEY,
|
|
439
|
+
];
|
|
440
|
+
const genConfig = (s: SystemConfig): GenConfig => ({
|
|
441
|
+
name: s.name,
|
|
442
|
+
rootClass: s.rootClass,
|
|
443
|
+
themes: s.themes,
|
|
444
|
+
defaultTheme: s.themeDefault,
|
|
445
|
+
colorSpace: s.colorSpace,
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
function working(s: SystemConfig): Record<string, string> {
|
|
449
|
+
const out: Record<string, string> = {};
|
|
450
|
+
for (const k of workingKeys(s)) {
|
|
451
|
+
const t = readText(path.join(dsAbs(s), k));
|
|
452
|
+
if (t !== null) setOwn(out, k, t);
|
|
453
|
+
}
|
|
454
|
+
return out;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** A verified revision's body; null when it has not arrived; throws when invalid. */
|
|
458
|
+
function loadRevision(s: SystemConfig, id: string | null): RevisionBody | null {
|
|
459
|
+
if (!id) return null;
|
|
460
|
+
const t = readText(path.join(dsAbs(s), 'revisions', `${id}.json`));
|
|
461
|
+
if (t === null) return null;
|
|
462
|
+
const v = verifyRevision(id, t);
|
|
463
|
+
if (!v.ok) {
|
|
464
|
+
if (v.reason === 'unreadable') return null;
|
|
465
|
+
throw fail('ds-revision-invalid', `revision ${id.slice(0, 12)} is invalid (${v.detail})`);
|
|
466
|
+
}
|
|
467
|
+
return v.body;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const filesOf = (b: RevisionBody | null): Record<string, string> => {
|
|
471
|
+
const out: Record<string, string> = {};
|
|
472
|
+
if (b) for (const [k, f] of Object.entries(b.files)) setOwn(out, k, f.text);
|
|
473
|
+
return out;
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
function modelOf(s: SystemConfig, files: Record<string, string> | null): TokenModel | null {
|
|
477
|
+
if (!files) return null;
|
|
478
|
+
return parseSystem({
|
|
479
|
+
config: genConfig(s),
|
|
480
|
+
tokensCss: files[tokensKey(s)] ?? null,
|
|
481
|
+
tokensJson: files[TOKENS_JSON_KEY] ?? null,
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const dsCanvasRel = (s: SystemConfig) => `${s.path}/${DS_CANVAS}`;
|
|
486
|
+
const dsMetaRel = (s: SystemConfig) => `${s.path}/${DS_META}`;
|
|
487
|
+
|
|
488
|
+
function dsMeta(s: SystemConfig): Record<string, unknown> {
|
|
489
|
+
return readJsonObj(path.join(designRoot, dsMetaRel(s))) ?? {};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
function pendingOf(s: SystemConfig): DsPending {
|
|
493
|
+
const p = dsMeta(s).dsPending;
|
|
494
|
+
return isObj(p) ? (structuredClone(p) as DsPending) : {};
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const hasPending = (p: DsPending) =>
|
|
498
|
+
Object.keys(p.tokens ?? {}).length > 0 || Object.keys(p.components ?? {}).length > 0;
|
|
499
|
+
|
|
500
|
+
/* --------------------------------------------------------- the canvases */
|
|
501
|
+
|
|
502
|
+
function canvasRoots(): string[] {
|
|
503
|
+
const groups = Array.isArray(config().canvasGroups)
|
|
504
|
+
? (config().canvasGroups as unknown[])
|
|
505
|
+
.map((g) =>
|
|
506
|
+
isObj(g) && typeof g.path === 'string' ? g.path.replace(/^\/+|\/+$/g, '') : ''
|
|
507
|
+
)
|
|
508
|
+
.filter(Boolean)
|
|
509
|
+
: [];
|
|
510
|
+
if (groups.length) return [...new Set(groups)];
|
|
511
|
+
try {
|
|
512
|
+
return readdirSync(designRoot, { withFileTypes: true })
|
|
513
|
+
.filter((d) => d.isDirectory() && !d.name.startsWith('_') && !d.name.startsWith('.'))
|
|
514
|
+
.map((d) => d.name);
|
|
515
|
+
} catch {
|
|
516
|
+
return [];
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/** Every canvas (design-root-relative) that renders under `s`, the system's own files excluded. */
|
|
521
|
+
function canvasesOf(s: SystemConfig): string[] {
|
|
522
|
+
const out = new Set<string>();
|
|
523
|
+
const walk = (rel: string, depth: number) => {
|
|
524
|
+
if (depth > 8) return;
|
|
525
|
+
let entries: import('node:fs').Dirent[];
|
|
526
|
+
try {
|
|
527
|
+
entries = readdirSync(path.join(designRoot, rel), { withFileTypes: true });
|
|
528
|
+
} catch {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
for (const e of entries) {
|
|
532
|
+
if (e.name.startsWith('_') || e.name.startsWith('.') || e.name === 'node_modules') continue;
|
|
533
|
+
const r = `${rel}/${e.name}`;
|
|
534
|
+
if (e.isDirectory()) walk(r, depth + 1);
|
|
535
|
+
else if (e.isFile() && /\.tsx$/i.test(e.name)) {
|
|
536
|
+
if (r === `${s.path}/${DS_CANVAS}` || r.startsWith(`${s.path}/`)) continue;
|
|
537
|
+
if (canvasSystemFor(designRoot, path.join(designRoot, r))?.name === s.name) out.add(r);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
for (const g of canvasRoots()) walk(g, 1);
|
|
542
|
+
return [...out].sort();
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function canvasRows(s: SystemConfig): CanvasRow[] {
|
|
546
|
+
return canvasesOf(s).map((rel) => {
|
|
547
|
+
const meta = readJsonObj(path.join(designRoot, metaRelOf(rel))) ?? {};
|
|
548
|
+
const dsRev = typeof meta.dsRev === 'string' ? meta.dsRev : null;
|
|
549
|
+
const folder = rel.includes('/') ? rel.slice(0, rel.lastIndexOf('/')) : '';
|
|
550
|
+
if (meta.dsPinned === true || meta.opt_out_scope === 'full')
|
|
551
|
+
return { path: rel, folder, state: 'pinned', dsRev, ticked: false, reason: 'pinned' };
|
|
552
|
+
// any dsRev = left out by a person ("Keep this version"): unticked by default, even while
|
|
553
|
+
// it still equals head; the update dot (§5.10 leftOut) shows only once head moves on
|
|
554
|
+
if (dsRev) return { path: rel, folder, state: 'left-out', dsRev, ticked: false };
|
|
555
|
+
return { path: rel, folder, state: 'follows', dsRev, ticked: true };
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/* -------------------------------------------------------------- state */
|
|
560
|
+
|
|
561
|
+
interface Loaded {
|
|
562
|
+
s: SystemConfig;
|
|
563
|
+
abs: string;
|
|
564
|
+
head: HeadDoc;
|
|
565
|
+
baseBody: RevisionBody;
|
|
566
|
+
headBody: RevisionBody | null;
|
|
567
|
+
work: Record<string, string>;
|
|
568
|
+
baseModel: TokenModel;
|
|
569
|
+
workModel: TokenModel;
|
|
570
|
+
outsideFiles: string[];
|
|
571
|
+
pending: DsPending;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* S12.16 (S10) — a folder (unconverted) system has no review: files are the API (V2-1.18). The
|
|
576
|
+
* refusal names the token file to edit and the verb that refreshes its manifest.
|
|
577
|
+
*/
|
|
578
|
+
function folderSystemWords(s: SystemConfig): string {
|
|
579
|
+
const css = `${path.basename(designRoot)}/${s.tokensCssRel}`;
|
|
580
|
+
return `${s.name} is a folder system (not converted), so it has no review to propose to: change its tokens by editing ${css} directly, then run \`maude design ds-check ${s.name} --emit\` to refresh its tokens.json (never edit tokens.json by hand)`;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function load(ds: string): Loaded {
|
|
584
|
+
const s = system(ds);
|
|
585
|
+
const abs = dsAbs(s);
|
|
586
|
+
const h = readHead(abs);
|
|
587
|
+
if (h.state === 'absent') throw fail('ds-not-converted', folderSystemWords(s));
|
|
588
|
+
if (h.state !== 'ok')
|
|
589
|
+
throw fail('ds-head-invalid', `${ds}: head.json is ${h.state} (${h.detail})`);
|
|
590
|
+
// S10.16a: a system still being made has no revision to review, publish or keep (head = base = null)
|
|
591
|
+
if (h.doc.head === null && h.doc.base === null)
|
|
592
|
+
throw fail('ds-making', `${ds} is still being made — finish it first`);
|
|
593
|
+
const baseBody = loadRevision(s, h.doc.base);
|
|
594
|
+
if (!baseBody)
|
|
595
|
+
throw fail('ds-revision-missing', `${ds}: the base revision has not arrived on this Mac yet`);
|
|
596
|
+
const headBody = h.doc.head === h.doc.base ? baseBody : loadRevision(s, h.doc.head);
|
|
597
|
+
const work = working(s);
|
|
598
|
+
const baseFiles = filesOf(baseBody);
|
|
599
|
+
const outsideFiles = [...new Set([...Object.keys(baseFiles), ...Object.keys(work)])]
|
|
600
|
+
.filter((k) => workingKeys(s).includes(k))
|
|
601
|
+
.filter((k) => baseFiles[k] !== work[k])
|
|
602
|
+
.sort();
|
|
603
|
+
return {
|
|
604
|
+
s,
|
|
605
|
+
abs,
|
|
606
|
+
head: h.doc,
|
|
607
|
+
baseBody,
|
|
608
|
+
headBody,
|
|
609
|
+
work,
|
|
610
|
+
baseModel: modelOf(s, baseFiles) as TokenModel,
|
|
611
|
+
workModel: modelOf(s, work) as TokenModel,
|
|
612
|
+
outsideFiles,
|
|
613
|
+
pending: pendingOf(s),
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function outsideOf(L: Loaded): DsState['outside'] {
|
|
618
|
+
if (!L.outsideFiles.length) return null;
|
|
619
|
+
const changes = tokenDiff(L.baseModel, L.workModel);
|
|
620
|
+
const baseFiles = filesOf(L.baseBody);
|
|
621
|
+
const tk = tokensKey(L.s);
|
|
622
|
+
const otherChanges: { path: string; count: number }[] = [];
|
|
623
|
+
for (const f of L.outsideFiles) {
|
|
624
|
+
// a byte change that moved no token (a comment, a new rule) is never silent
|
|
625
|
+
if (f === tk || f === TOKENS_JSON_KEY) {
|
|
626
|
+
if (!changes.length) otherChanges.push({ path: f, count: 1 });
|
|
627
|
+
} else otherChanges.push({ path: f, count: baseFiles[f] === undefined ? 1 : 1 });
|
|
628
|
+
}
|
|
629
|
+
return { files: L.outsideFiles, changes, otherChanges };
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function conflictsOf(L: Loaded): { conflicts: Conflict[]; equal: string[] } {
|
|
633
|
+
const conflicts: Conflict[] = [];
|
|
634
|
+
const equal: string[] = [];
|
|
635
|
+
if (!L.outsideFiles.length) return { conflicts, equal };
|
|
636
|
+
const changed = new Map(tokenDiff(L.baseModel, L.workModel).map((c) => [c.css, c]));
|
|
637
|
+
for (const [css, entry] of Object.entries(L.pending.tokens ?? {})) {
|
|
638
|
+
const c = changed.get(css);
|
|
639
|
+
if (!c) continue;
|
|
640
|
+
const mine = themeValuesOf(entry, L.s.themes);
|
|
641
|
+
const file: ThemeValues = {};
|
|
642
|
+
for (const t of Object.keys(mine)) {
|
|
643
|
+
const v = normalizeModel(L.workModel).tokens[css]?.values[t];
|
|
644
|
+
if (v !== undefined) file[t] = v;
|
|
645
|
+
}
|
|
646
|
+
if (Object.keys(mine).length && sameValues(mine, file) && !entry.trash) equal.push(css);
|
|
647
|
+
else
|
|
648
|
+
conflicts.push({
|
|
649
|
+
css,
|
|
650
|
+
label: c.label,
|
|
651
|
+
canvas: mine,
|
|
652
|
+
file: normalizeModel(L.workModel).tokens[css]?.values ?? {},
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
return { conflicts, equal };
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function trashedOf(s: SystemConfig, model: TokenModel | null): DsState['trashed'] {
|
|
659
|
+
if (!model) return [];
|
|
660
|
+
const out: DsState['trashed'] = [];
|
|
661
|
+
for (const t of Object.values(model.tokens)) {
|
|
662
|
+
const tr = t.data.trashed;
|
|
663
|
+
if (!isObj(tr) || typeof tr.replacement !== 'string') continue;
|
|
664
|
+
out.push({
|
|
665
|
+
kind: 'token',
|
|
666
|
+
system: s.name,
|
|
667
|
+
css: t.css,
|
|
668
|
+
label: labelOf(t),
|
|
669
|
+
replacement: tr.replacement,
|
|
670
|
+
at: typeof tr.at === 'string' ? tr.at : null,
|
|
671
|
+
by: isObj(tr.by) ? (tr.by as unknown as By) : null,
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
return out;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/** §5.10 derived states — computed, never stored. */
|
|
678
|
+
function state(ds: string): DsState {
|
|
679
|
+
const s = system(ds);
|
|
680
|
+
const abs = dsAbs(s);
|
|
681
|
+
const h = readHead(abs);
|
|
682
|
+
const blank: DsState = {
|
|
683
|
+
name: s.name,
|
|
684
|
+
path: s.path,
|
|
685
|
+
converted: h.state !== 'absent',
|
|
686
|
+
headState: h.state,
|
|
687
|
+
head: null,
|
|
688
|
+
base: null,
|
|
689
|
+
drafts: [],
|
|
690
|
+
library: null,
|
|
691
|
+
baseMissing: false,
|
|
692
|
+
outside: null,
|
|
693
|
+
pending: pendingOf(s),
|
|
694
|
+
waiting: [],
|
|
695
|
+
conflicts: [],
|
|
696
|
+
leftOut: { count: 0, canvases: [] },
|
|
697
|
+
trashed: [],
|
|
698
|
+
publishedInTwoPlaces: null,
|
|
699
|
+
};
|
|
700
|
+
if (h.state !== 'ok') return blank;
|
|
701
|
+
const rows = canvasRows(s);
|
|
702
|
+
const leftOut = rows.filter((r) => r.dsRev && r.dsRev !== h.doc.head);
|
|
703
|
+
const common = {
|
|
704
|
+
...blank,
|
|
705
|
+
head: h.doc.head,
|
|
706
|
+
base: h.doc.base,
|
|
707
|
+
drafts: h.doc.drafts,
|
|
708
|
+
library: h.doc.library,
|
|
709
|
+
leftOut: { count: leftOut.length, canvases: leftOut.map((r) => r.path) },
|
|
710
|
+
publishedInTwoPlaces: publishedInTwoPlaces(abs),
|
|
711
|
+
};
|
|
712
|
+
let L: Loaded;
|
|
713
|
+
try {
|
|
714
|
+
L = load(ds);
|
|
715
|
+
} catch (err) {
|
|
716
|
+
if (err instanceof DsEngineError && err.code === 'ds-making') return common;
|
|
717
|
+
if (
|
|
718
|
+
err instanceof DsEngineError &&
|
|
719
|
+
(err.code === 'ds-revision-missing' || err.code === 'ds-revision-invalid')
|
|
720
|
+
)
|
|
721
|
+
return { ...common, baseMissing: true };
|
|
722
|
+
throw err;
|
|
723
|
+
}
|
|
724
|
+
const headModel = L.headBody ? modelOf(s, filesOf(L.headBody)) : null;
|
|
725
|
+
const waiting = tokenDiff(headModel, L.baseModel);
|
|
726
|
+
const seen = new Set(waiting.map((c) => c.css));
|
|
727
|
+
for (const [css, entry] of Object.entries(L.pending.tokens ?? {})) {
|
|
728
|
+
if (seen.has(css)) continue;
|
|
729
|
+
const before = normalizeModel(L.baseModel).tokens[css]?.values ?? null;
|
|
730
|
+
waiting.push({
|
|
731
|
+
css,
|
|
732
|
+
label: labelOf(L.baseModel.tokens[css]) ?? entry.add?.label ?? null,
|
|
733
|
+
before,
|
|
734
|
+
after: entry.trash ? before : themeValuesOf(entry, s.themes),
|
|
735
|
+
...(entry.trash ? { trashed: { replacement: entry.trash.replacement } } : {}),
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
return {
|
|
739
|
+
...common,
|
|
740
|
+
outside: outsideOf(L),
|
|
741
|
+
waiting,
|
|
742
|
+
conflicts: conflictsOf(L).conflicts,
|
|
743
|
+
trashed: trashedOf(s, L.baseModel),
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/* -------------------------------------------------------- Plane B writes */
|
|
748
|
+
|
|
749
|
+
/** Revision + siblings (+ the working files when `materialise`) in the §5.6 order. */
|
|
750
|
+
function writeRevision(L: Pick<Loaded, 's' | 'abs'>, rev: BuiltRevision, materialise: boolean) {
|
|
751
|
+
const read = (rel: string) => readText(path.join(L.abs, rel));
|
|
752
|
+
const plan = revisionWritePlan(read, rev, materialise ? filesOf(rev.body) : {}, tokensKey(L.s));
|
|
753
|
+
const before: Record<string, string | null> = {};
|
|
754
|
+
for (const w of plan) {
|
|
755
|
+
const abs = path.join(L.abs, w.path);
|
|
756
|
+
if (!w.path.startsWith('revisions/')) before[w.path] = read(w.path);
|
|
757
|
+
mkdirSync(path.dirname(abs), { recursive: true });
|
|
758
|
+
atomicWrite(abs, w.text);
|
|
759
|
+
}
|
|
760
|
+
return before;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** Put working files back to `prior` — only those still holding what this engine wrote. */
|
|
764
|
+
function restoreWorking(
|
|
765
|
+
L: Pick<Loaded, 'abs'>,
|
|
766
|
+
wrote: Record<string, string>,
|
|
767
|
+
prior: Record<string, string | null>
|
|
768
|
+
) {
|
|
769
|
+
for (const [k, was] of Object.entries(prior)) {
|
|
770
|
+
const abs = path.join(L.abs, k);
|
|
771
|
+
if (readText(abs) !== wrote[k]) continue;
|
|
772
|
+
if (was === null)
|
|
773
|
+
unlinkSync(abs); // a file this engine just created
|
|
774
|
+
else atomicWrite(abs, was);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
function buildFrom(s: SystemConfig, files: Record<string, string>): BuiltRevision {
|
|
779
|
+
return buildRevision(s.name, files);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/* ---------------------------------------------------------- the kernel */
|
|
783
|
+
|
|
784
|
+
async function propose(
|
|
785
|
+
files: { rel: string; text: string }[],
|
|
786
|
+
label: string
|
|
787
|
+
): Promise<string | null> {
|
|
788
|
+
if (!files.length) return null;
|
|
789
|
+
const k = kernelNow();
|
|
790
|
+
if (!k)
|
|
791
|
+
throw fail(
|
|
792
|
+
'ds-kernel-unavailable',
|
|
793
|
+
'no project home answers right now — nothing was changed'
|
|
794
|
+
);
|
|
795
|
+
const r = await k.propose(files, { kind: DS_ACTION_KIND, label: label.slice(0, 200) });
|
|
796
|
+
if (!r)
|
|
797
|
+
throw fail(
|
|
798
|
+
'ds-kernel-unavailable',
|
|
799
|
+
'no project home answers right now — nothing was changed'
|
|
800
|
+
);
|
|
801
|
+
if (r.status !== 'accepted')
|
|
802
|
+
throw fail('ds-kernel-rejected', `the project refused the change (${r.code ?? 'rejected'})`, {
|
|
803
|
+
kernel: r.code ?? null,
|
|
804
|
+
});
|
|
805
|
+
return r.actionId ?? null;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function withPending(s: SystemConfig, next: DsPending): { rel: string; text: string } {
|
|
809
|
+
const meta = dsMeta(s);
|
|
810
|
+
const clean: DsPending = { ...next };
|
|
811
|
+
if (clean.tokens && !Object.keys(clean.tokens).length) delete clean.tokens;
|
|
812
|
+
if (clean.components && !Object.keys(clean.components).length) delete clean.components;
|
|
813
|
+
const empty = !clean.tokens && !clean.components;
|
|
814
|
+
if (empty) delete meta.dsPending;
|
|
815
|
+
else {
|
|
816
|
+
if (!clean.base) delete clean.base;
|
|
817
|
+
meta.dsPending = clean;
|
|
818
|
+
}
|
|
819
|
+
return { rel: dsMetaRel(s), text: metaText(meta) };
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function writeLog(
|
|
823
|
+
L: Pick<Loaded, 'abs' | 'head'>,
|
|
824
|
+
pointers: Pointers,
|
|
825
|
+
entry: Omit<LogEntry, 'at' | 'was' | 'is'>
|
|
826
|
+
) {
|
|
827
|
+
const was: Pointers = { head: L.head.head, base: L.head.base };
|
|
828
|
+
const next: HeadDoc = {
|
|
829
|
+
...L.head,
|
|
830
|
+
head: pointers.head,
|
|
831
|
+
base: pointers.base,
|
|
832
|
+
log: [{ ...entry, at: iso(), was, is: pointers } as LogEntry, ...L.head.log],
|
|
833
|
+
};
|
|
834
|
+
writeHead(L.abs, next, was);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/* ------------------------------------------------------------- publish */
|
|
838
|
+
|
|
839
|
+
function applyPending(
|
|
840
|
+
L: Loaded,
|
|
841
|
+
pending: DsPending,
|
|
842
|
+
by: By
|
|
843
|
+
): { model: TokenModel; edits: ComponentEdit[] } {
|
|
844
|
+
const model = structuredClone(L.baseModel);
|
|
845
|
+
const at = iso();
|
|
846
|
+
for (const [css, entry] of Object.entries(pending.tokens ?? {})) {
|
|
847
|
+
if (!CSS_NAME_RE.test(css))
|
|
848
|
+
throw fail('ds-pending-invalid', `not a token name: ${css.slice(0, 80)}`);
|
|
849
|
+
const cur = model.tokens[css];
|
|
850
|
+
if (entry.trash) {
|
|
851
|
+
if (!cur) throw fail('ds-unknown-token', `${css} is not in the system`);
|
|
852
|
+
const values =
|
|
853
|
+
normalizeModel({ ...model, tokens: { [css]: cur } }).tokens[css]?.values ?? {};
|
|
854
|
+
setOwn(cur.data, 'trashed', {
|
|
855
|
+
replacement: entry.trash.replacement,
|
|
856
|
+
at: entry.at ?? at,
|
|
857
|
+
by: (entry.by ?? by) as unknown as Json,
|
|
858
|
+
previous: values as unknown as Json,
|
|
859
|
+
});
|
|
860
|
+
continue;
|
|
861
|
+
}
|
|
862
|
+
const values = themeValuesOf(entry, L.s.themes);
|
|
863
|
+
const tok: ModelToken = cur ?? { css, values: {}, data: {}, extra: {} };
|
|
864
|
+
if (!cur) {
|
|
865
|
+
if (!entry.add)
|
|
866
|
+
throw fail('ds-unknown-token', `${css} is not in the system (add it first)`);
|
|
867
|
+
if (typeof entry.add.label === 'string') setOwn(tok.data, 'label', entry.add.label);
|
|
868
|
+
setOwn(model.tokens, css, tok);
|
|
869
|
+
}
|
|
870
|
+
if (tok.data.locked === true) throw fail('ds-pending-invalid', `${css} is locked`);
|
|
871
|
+
// a value on a trashed token takes it out of the trash: Restore puts `previous` back, Clear
|
|
872
|
+
// out writes `var(<replacement>)` itself (the alias line stays) — §5.11 e
|
|
873
|
+
if (isObj(tok.data.trashed)) delete tok.data.trashed;
|
|
874
|
+
for (const [t, v] of Object.entries(values)) setOwn(tok.values, t, v);
|
|
875
|
+
if (isObj(entry.valueNames)) {
|
|
876
|
+
const vn = isObj(tok.data.valueNames) ? (tok.data.valueNames as Record<string, Json>) : {};
|
|
877
|
+
for (const [t, n] of Object.entries(entry.valueNames))
|
|
878
|
+
if (typeof n === 'string') setOwn(vn, t, n);
|
|
879
|
+
setOwn(tok.data, 'valueNames', vn);
|
|
880
|
+
}
|
|
881
|
+
if (typeof entry.darkFollows === 'boolean')
|
|
882
|
+
setOwn(tok.data, 'darkFollows', entry.darkFollows);
|
|
883
|
+
}
|
|
884
|
+
const edits: ComponentEdit[] = [];
|
|
885
|
+
for (const sels of Object.values(pending.components ?? {}))
|
|
886
|
+
for (const [selector, props] of Object.entries(sels ?? {}))
|
|
887
|
+
for (const [property, e] of Object.entries(props ?? {}))
|
|
888
|
+
if (isObj(e) && typeof e.value === 'string')
|
|
889
|
+
edits.push({ selector, property, value: e.value });
|
|
890
|
+
return { model, edits };
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/** R = snapshot(generate(base files, all waiting changes)) — built, not written. */
|
|
894
|
+
function generateFrom(L: Loaded, pending: DsPending, by: By): BuiltRevision {
|
|
895
|
+
const base = filesOf(L.baseBody);
|
|
896
|
+
// nothing to apply → R is base itself (G2: an empty publish writes nothing new)
|
|
897
|
+
if (!hasPending(pending)) return buildFrom(L.s, base);
|
|
898
|
+
const { model, edits } = applyPending(L, pending, by);
|
|
899
|
+
const tk = tokensKey(L.s);
|
|
900
|
+
const files: Record<string, string> = { ...base };
|
|
901
|
+
setOwn(files, tk, generateTokensCss(base[tk] ?? null, model, genConfig(L.s)));
|
|
902
|
+
setOwn(files, TOKENS_JSON_KEY, emitTokensJson(model));
|
|
903
|
+
if (edits.length || base[COMPONENTS_CSS_KEY] !== undefined)
|
|
904
|
+
setOwn(
|
|
905
|
+
files,
|
|
906
|
+
COMPONENTS_CSS_KEY,
|
|
907
|
+
generateComponentsCss(base[COMPONENTS_CSS_KEY] ?? '', edits)
|
|
908
|
+
);
|
|
909
|
+
return buildFrom(L.s, files);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
function preconditions(L: Loaded, expectHead: string | null | undefined) {
|
|
913
|
+
if (L.head.library) throw fail('ds-library', 'a linked library is view only here');
|
|
914
|
+
if (expectHead !== undefined && expectHead !== L.head.head)
|
|
915
|
+
throw fail('ds-head-moved', 'the system was published since this review opened', {
|
|
916
|
+
head: L.head.head,
|
|
917
|
+
});
|
|
918
|
+
// a conflict is an outside change that also touches a pending token: the more specific refusal
|
|
919
|
+
if (conflictsOf(L).conflicts.length)
|
|
920
|
+
throw fail('ds-conflict', 'a change waits for a pick first');
|
|
921
|
+
if (L.outsideFiles.length)
|
|
922
|
+
throw fail(
|
|
923
|
+
'ds-outside-unreviewed',
|
|
924
|
+
'the system files changed outside the app — review that first',
|
|
925
|
+
{
|
|
926
|
+
files: L.outsideFiles,
|
|
927
|
+
}
|
|
928
|
+
);
|
|
929
|
+
if (publishedInTwoPlaces(L.abs))
|
|
930
|
+
throw fail('ds-two-places', 'the system was published in two places — pick one first');
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/** The §5.11 c review body with its defaults (followers ticked, left-out and pinned unticked). */
|
|
934
|
+
function review(ds: string) {
|
|
935
|
+
const L = load(ds);
|
|
936
|
+
const pendingR =
|
|
937
|
+
hasPending(L.pending) || L.head.head !== L.head.base
|
|
938
|
+
? generateFrom(L, L.pending, { kind: 'person' })
|
|
939
|
+
: null;
|
|
940
|
+
const headModel = L.headBody ? modelOf(L.s, filesOf(L.headBody)) : null;
|
|
941
|
+
const changes = pendingR ? tokenDiff(headModel, modelOf(L.s, filesOf(pendingR.body))) : [];
|
|
942
|
+
return {
|
|
943
|
+
system: L.s.name,
|
|
944
|
+
expectHead: L.head.head,
|
|
945
|
+
changes,
|
|
946
|
+
canvases: canvasRows(L.s),
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
interface PublishInput {
|
|
951
|
+
expectHead: string | null;
|
|
952
|
+
/** overrides of the default ticks, by design-root-relative path */
|
|
953
|
+
canvases?: { path: string; ticked: boolean }[];
|
|
954
|
+
by: By;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
async function publishLocked(ds: string, inp: PublishInput): Promise<PublishResult> {
|
|
958
|
+
const L = load(ds);
|
|
959
|
+
preconditions(L, inp.expectHead);
|
|
960
|
+
const pending = L.pending;
|
|
961
|
+
const rev = generateFrom(L, pending, inp.by);
|
|
962
|
+
if (rev.id === L.head.head) throw fail('ds-nothing-waiting', 'nothing waits to be published');
|
|
963
|
+
const oldHead = L.head.head;
|
|
964
|
+
const headModel = L.headBody ? modelOf(L.s, filesOf(L.headBody)) : null;
|
|
965
|
+
const changes = tokenDiff(headModel, modelOf(L.s, filesOf(rev.body)));
|
|
966
|
+
const compCount = Object.values(pending.components ?? {}).reduce(
|
|
967
|
+
(n, sels) =>
|
|
968
|
+
n + Object.values(sels ?? {}).reduce((m, p) => m + Object.keys(p ?? {}).length, 0),
|
|
969
|
+
0
|
|
970
|
+
);
|
|
971
|
+
const summary = summaryOf(changes, compCount);
|
|
972
|
+
// the ticks: defaults, then the review's overrides
|
|
973
|
+
const over = new Map((inp.canvases ?? []).map((c) => [c.path, c.ticked === true]));
|
|
974
|
+
const rows = canvasRows(L.s).map((r) =>
|
|
975
|
+
over.has(r.path) ? { ...r, ticked: over.get(r.path) as boolean } : r
|
|
976
|
+
);
|
|
977
|
+
const files: { rel: string; text: string }[] = [];
|
|
978
|
+
for (const r of rows) {
|
|
979
|
+
const metaAbs = path.join(designRoot, metaRelOf(r.path));
|
|
980
|
+
const meta = readJsonObj(metaAbs) ?? {};
|
|
981
|
+
if (r.ticked && typeof meta.dsRev === 'string') {
|
|
982
|
+
delete meta.dsRev;
|
|
983
|
+
delete meta.dsKept; // a Keep (p8-dead-reasons) goes with the pin
|
|
984
|
+
files.push({ rel: metaRelOf(r.path), text: metaText(meta) });
|
|
985
|
+
const src = readText(path.join(designRoot, r.path));
|
|
986
|
+
if (src !== null && STRIP_HEAD_PIN.test(src))
|
|
987
|
+
files.push({ rel: r.path, text: src.replace(STRIP_HEAD_PIN, '') });
|
|
988
|
+
STRIP_HEAD_PIN.lastIndex = 0;
|
|
989
|
+
} else if (!r.ticked && typeof meta.dsRev !== 'string' && oldHead) {
|
|
990
|
+
setOwn(meta, 'dsRev', oldHead);
|
|
991
|
+
files.push({ rel: metaRelOf(r.path), text: metaText(meta) });
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
if (hasPending(L.pending)) files.push(withPending(L.s, {}));
|
|
995
|
+
// 1–2: R + siblings, then the working files
|
|
996
|
+
const wrote = filesOf(rev.body);
|
|
997
|
+
const prior = writeRevision(L, rev, true);
|
|
998
|
+
// 3–4: metas + pending, one kernel action
|
|
999
|
+
let actionId: string | null;
|
|
1000
|
+
try {
|
|
1001
|
+
actionId = await propose(files, summary);
|
|
1002
|
+
} catch (err) {
|
|
1003
|
+
restoreWorking(L, wrote, prior);
|
|
1004
|
+
throw err;
|
|
1005
|
+
}
|
|
1006
|
+
// 5: head.json last
|
|
1007
|
+
const updated = rows.filter((r) => r.ticked).length;
|
|
1008
|
+
const leftOut = rows.length - updated;
|
|
1009
|
+
writeLog(
|
|
1010
|
+
L,
|
|
1011
|
+
{ head: rev.id, base: rev.id },
|
|
1012
|
+
{
|
|
1013
|
+
rev: rev.id,
|
|
1014
|
+
parent: oldHead,
|
|
1015
|
+
action: 'publish',
|
|
1016
|
+
by: inp.by,
|
|
1017
|
+
summary,
|
|
1018
|
+
updated,
|
|
1019
|
+
leftOut,
|
|
1020
|
+
actionId,
|
|
1021
|
+
}
|
|
1022
|
+
);
|
|
1023
|
+
return { action: 'publish', rev: rev.id, actionId, updated, leftOut, summary };
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
function publish(ds: string, inp: PublishInput): Promise<PublishResult> {
|
|
1027
|
+
// A linked project whose home cannot be reached (offline, or not in accepted mode) cannot take the
|
|
1028
|
+
// one publish action: refuse up front, before the lock and before any revision is written, in the
|
|
1029
|
+
// person's words (decision v2-lead-ds-publish-offline-refuses). A local project's home always answers.
|
|
1030
|
+
if (!kernelNow())
|
|
1031
|
+
return Promise.reject(
|
|
1032
|
+
fail(
|
|
1033
|
+
'ds-kernel-unavailable',
|
|
1034
|
+
"No project home answers right now — publish when you're back online."
|
|
1035
|
+
)
|
|
1036
|
+
);
|
|
1037
|
+
return withLock(dsAbs(system(ds)), () => publishLocked(ds, inp));
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/* ------------------------------------------------------------- pending */
|
|
1041
|
+
|
|
1042
|
+
interface PendingInput {
|
|
1043
|
+
tokens?: Record<string, PendingToken | null>;
|
|
1044
|
+
components?: PendingComponents;
|
|
1045
|
+
by: By;
|
|
1046
|
+
/** per token: the `at` of the entry the editor read (null = none); a mismatch refuses */
|
|
1047
|
+
expect?: Record<string, string | null>;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
function checkEntry(s: SystemConfig, css: string, e: PendingToken) {
|
|
1051
|
+
if (!CSS_NAME_RE.test(css))
|
|
1052
|
+
throw fail('ds-pending-invalid', `not a token name: ${css.slice(0, 80)}`);
|
|
1053
|
+
if (!isObj(e)) throw fail('ds-pending-invalid', `${css}: not an entry`);
|
|
1054
|
+
for (const t of s.themes) {
|
|
1055
|
+
const v = e[t];
|
|
1056
|
+
if (v === undefined) continue;
|
|
1057
|
+
if (typeof v !== 'string' || !v.trim() || v.length > VALUE_MAX || UNSAFE.test(v))
|
|
1058
|
+
throw fail('ds-pending-invalid', `${css} (${t}): not a value`);
|
|
1059
|
+
}
|
|
1060
|
+
if (e.valueNames !== undefined) {
|
|
1061
|
+
if (!isObj(e.valueNames)) throw fail('ds-pending-invalid', `${css}: valueNames`);
|
|
1062
|
+
for (const n of Object.values(e.valueNames))
|
|
1063
|
+
if (typeof n !== 'string' || !DISPLAY_RE.test(n))
|
|
1064
|
+
throw fail('ds-pending-invalid', `${css}: a value name`);
|
|
1065
|
+
}
|
|
1066
|
+
if (
|
|
1067
|
+
e.add?.label !== undefined &&
|
|
1068
|
+
!(typeof e.add.label === 'string' && DISPLAY_RE.test(e.add.label))
|
|
1069
|
+
)
|
|
1070
|
+
throw fail('ds-pending-invalid', `${css}: a label`);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* S10.21b — Dark follows, here (decision v2-S10.21-dark-follows-in-engine): an entry that moves Light on a token whose
|
|
1075
|
+
* Dark follows gets the followed Dark, so an agent's Light-only file lands what the token editor sends. Mirrors
|
|
1076
|
+
* `ds/edges.ts` `entryFor` and `token-write.js` `buildEntry`: the pair "as it is now" is the waiting value over the
|
|
1077
|
+
* working file's, Dark falling back to Light; a Dark the entry names wins; `darkFollows: true` alone re-follows from
|
|
1078
|
+
* the Light on screen; and `darkFollows` is kept only when it differs from the file.
|
|
1079
|
+
*/
|
|
1080
|
+
function followIn(L: Loaded, css: string, have: PendingToken | undefined, entry: PendingToken) {
|
|
1081
|
+
const { light, dark } = modesOf(L.s.themes, L.s.themeDefault);
|
|
1082
|
+
if (!dark || entry.trash) return;
|
|
1083
|
+
const file = L.workModel.tokens[css] ?? L.baseModel.tokens[css];
|
|
1084
|
+
const fileFollows = file?.data?.darkFollows !== false;
|
|
1085
|
+
const wait = have && !have.trash ? have : undefined;
|
|
1086
|
+
const str = (v: unknown) => (typeof v === 'string' ? v : undefined);
|
|
1087
|
+
const now = (t: string) => str(wait?.[t]) ?? file?.values?.[t] ?? file?.values?.[light];
|
|
1088
|
+
const said =
|
|
1089
|
+
typeof entry.darkFollows === 'boolean'
|
|
1090
|
+
? entry.darkFollows
|
|
1091
|
+
: typeof wait?.darkFollows === 'boolean'
|
|
1092
|
+
? wait.darkFollows
|
|
1093
|
+
: fileFollows;
|
|
1094
|
+
const d = followedDark({
|
|
1095
|
+
follows: said,
|
|
1096
|
+
nextLight: str(entry[light]) ?? (entry.darkFollows === true ? now(light) : undefined),
|
|
1097
|
+
ownDark: str(entry[dark]),
|
|
1098
|
+
prev: { light: now(light), dark: now(dark) },
|
|
1099
|
+
});
|
|
1100
|
+
if (d) entry[dark] = d;
|
|
1101
|
+
if (entry.darkFollows === fileFollows) delete entry.darkFollows;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
async function mergePendingLocked(ds: string, inp: PendingInput): Promise<DsResult> {
|
|
1105
|
+
const L = load(ds);
|
|
1106
|
+
if (L.head.library) throw fail('ds-library', 'a linked library is view only here');
|
|
1107
|
+
if (!existsSync(path.join(designRoot, dsCanvasRel(L.s))))
|
|
1108
|
+
throw fail('ds-no-canvas', `${ds} has no Design system canvas`);
|
|
1109
|
+
const next: DsPending = structuredClone(L.pending);
|
|
1110
|
+
next.tokens = next.tokens ?? {};
|
|
1111
|
+
const at = iso();
|
|
1112
|
+
const baseTokens = normalizeModel(L.baseModel).tokens;
|
|
1113
|
+
for (const [css, e] of Object.entries(inp.tokens ?? {})) {
|
|
1114
|
+
const have = next.tokens[css];
|
|
1115
|
+
const expected = inp.expect?.[css];
|
|
1116
|
+
if (have && expected !== (have.at ?? null))
|
|
1117
|
+
throw fail('ds-pending-conflict', `${css} was changed by someone else — read it again`, {
|
|
1118
|
+
css,
|
|
1119
|
+
});
|
|
1120
|
+
if (e === null) {
|
|
1121
|
+
delete next.tokens[css];
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
checkEntry(L.s, css, e);
|
|
1125
|
+
if (!baseTokens[css] && !e.add) throw fail('ds-unknown-token', `${css} is not in the system`);
|
|
1126
|
+
// a frozen brand value (V2-1.6 §5.3 `locked`): the editor refuses until it is unlocked — here,
|
|
1127
|
+
// before a pending entry exists that the publish would then refuse (S10.7)
|
|
1128
|
+
if (L.baseModel.tokens[css]?.data.locked === true)
|
|
1129
|
+
throw fail('ds-token-locked', `${css} is a locked brand colour — unlock it first`, { css });
|
|
1130
|
+
if (e.trash) {
|
|
1131
|
+
const repl = e.trash.replacement;
|
|
1132
|
+
if (tier1().has(css))
|
|
1133
|
+
throw fail('ds-trash-tier1', `${css} is a Tier-1 role and can't go to the trash`);
|
|
1134
|
+
if (trashOf(L.baseModel.tokens[css]))
|
|
1135
|
+
throw fail('ds-pending-invalid', `${css} is already in the trash`);
|
|
1136
|
+
if (
|
|
1137
|
+
typeof repl !== 'string' ||
|
|
1138
|
+
!CSS_NAME_RE.test(repl) ||
|
|
1139
|
+
repl === css ||
|
|
1140
|
+
!baseTokens[repl] ||
|
|
1141
|
+
trashOf(L.baseModel.tokens[repl])
|
|
1142
|
+
)
|
|
1143
|
+
throw fail('ds-pending-invalid', `${String(repl).slice(0, 80)} can't replace ${css}`);
|
|
1144
|
+
}
|
|
1145
|
+
// the followed Dark goes in before `by`/`at`, where the page's own entry carries it
|
|
1146
|
+
const entry: PendingToken = { ...e };
|
|
1147
|
+
followIn(L, css, have, entry);
|
|
1148
|
+
entry.by = inp.by;
|
|
1149
|
+
entry.at = at;
|
|
1150
|
+
const values = themeValuesOf(entry, L.s.themes);
|
|
1151
|
+
// an entry equal to base's value is dropped (§5.9)
|
|
1152
|
+
if (
|
|
1153
|
+
!entry.add &&
|
|
1154
|
+
!entry.trash &&
|
|
1155
|
+
baseTokens[css] &&
|
|
1156
|
+
!trashOf(L.baseModel.tokens[css]) &&
|
|
1157
|
+
Object.keys(values).length &&
|
|
1158
|
+
Object.entries(values).every(([t, v]) => baseTokens[css].values[t] === v) &&
|
|
1159
|
+
entry.valueNames === undefined
|
|
1160
|
+
) {
|
|
1161
|
+
delete next.tokens[css];
|
|
1162
|
+
continue;
|
|
1163
|
+
}
|
|
1164
|
+
setOwn(next.tokens, css, entry);
|
|
1165
|
+
}
|
|
1166
|
+
for (const [comp, sels] of Object.entries(inp.components ?? {})) {
|
|
1167
|
+
if (!isObj(sels)) throw fail('ds-pending-invalid', `${comp}: not a component entry`);
|
|
1168
|
+
next.components = next.components ?? {};
|
|
1169
|
+
next.components[comp] = next.components[comp] ?? {};
|
|
1170
|
+
const c = next.components[comp];
|
|
1171
|
+
for (const [sel, props] of Object.entries(sels))
|
|
1172
|
+
for (const [prop, e] of Object.entries(props ?? {})) {
|
|
1173
|
+
if (
|
|
1174
|
+
!isObj(e) ||
|
|
1175
|
+
typeof e.value !== 'string' ||
|
|
1176
|
+
e.value.length > VALUE_MAX ||
|
|
1177
|
+
UNSAFE.test(e.value)
|
|
1178
|
+
)
|
|
1179
|
+
throw fail('ds-pending-invalid', `${comp} ${sel} ${prop}: not a value`);
|
|
1180
|
+
c[sel] = c[sel] ?? {};
|
|
1181
|
+
setOwn(c[sel], prop, { value: e.value, by: inp.by, at });
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
if (!next.base) next.base = L.head.base;
|
|
1185
|
+
const file = withPending(L.s, next);
|
|
1186
|
+
const cur = readText(path.join(designRoot, dsMetaRel(L.s)));
|
|
1187
|
+
const actionId = cur === file.text ? null : await propose([file], 'Design system change');
|
|
1188
|
+
return { action: 'pending', rev: null, actionId };
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
function mergePending(ds: string, inp: PendingInput): Promise<DsResult> {
|
|
1192
|
+
return withLock(dsAbs(system(ds)), () => mergePendingLocked(ds, inp));
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
/** Cancel: the pending entries the review covered go ("Cancel puts the swatch back"). */
|
|
1196
|
+
function cancelPending(ds: string, inp: { by: By; tokens?: string[] }): Promise<DsResult> {
|
|
1197
|
+
return withLock(dsAbs(system(ds)), async () => {
|
|
1198
|
+
const L = load(ds);
|
|
1199
|
+
if (!hasPending(L.pending)) return { action: 'cancel', rev: null, actionId: null };
|
|
1200
|
+
const next: DsPending = structuredClone(L.pending);
|
|
1201
|
+
if (inp.tokens) for (const css of inp.tokens) delete next.tokens?.[css];
|
|
1202
|
+
else {
|
|
1203
|
+
delete next.tokens;
|
|
1204
|
+
delete next.components;
|
|
1205
|
+
}
|
|
1206
|
+
const actionId = await propose([withPending(L.s, next)], 'Cancel design system changes');
|
|
1207
|
+
return { action: 'cancel', rev: null, actionId };
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/* ------------------------------------------------------- outside (a) */
|
|
1212
|
+
|
|
1213
|
+
function keepOutside(ds: string, inp: { by: By }): Promise<DsResult> {
|
|
1214
|
+
return withLock(dsAbs(system(ds)), async () => {
|
|
1215
|
+
const L = load(ds);
|
|
1216
|
+
if (L.head.library) throw fail('ds-library', 'a linked library is view only here');
|
|
1217
|
+
if (!L.outsideFiles.length) throw fail('ds-no-outside', 'no outside change waits');
|
|
1218
|
+
const { conflicts, equal } = conflictsOf(L);
|
|
1219
|
+
if (conflicts.length) throw fail('ds-conflict', 'a change waits for a pick first');
|
|
1220
|
+
const K = buildFrom(L.s, L.work);
|
|
1221
|
+
writeRevision(L, K, false);
|
|
1222
|
+
// equal values auto-resolve: the entry is dropped with the keep (§5.10)
|
|
1223
|
+
let actionId: string | null = null;
|
|
1224
|
+
if (equal.length) {
|
|
1225
|
+
const next = structuredClone(L.pending);
|
|
1226
|
+
for (const css of equal) delete next.tokens?.[css];
|
|
1227
|
+
actionId = await propose([withPending(L.s, next)], 'Keep the outside change');
|
|
1228
|
+
}
|
|
1229
|
+
writeLog(
|
|
1230
|
+
L,
|
|
1231
|
+
{ head: L.head.head, base: K.id },
|
|
1232
|
+
{
|
|
1233
|
+
rev: K.id,
|
|
1234
|
+
parent: L.head.base,
|
|
1235
|
+
action: 'keep',
|
|
1236
|
+
by: inp.by,
|
|
1237
|
+
summary: summaryOf(tokenDiff(L.baseModel, L.workModel), 0),
|
|
1238
|
+
actionId,
|
|
1239
|
+
}
|
|
1240
|
+
);
|
|
1241
|
+
return { action: 'keep', rev: K.id, actionId };
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
function undoOutside(ds: string, inp: { by: By }): Promise<DsResult> {
|
|
1246
|
+
void inp;
|
|
1247
|
+
return withLock(dsAbs(system(ds)), async () => {
|
|
1248
|
+
const L = load(ds);
|
|
1249
|
+
// a linked library's outside edit offers ONLY Undo (V2-1.6 §5.14): the library's values come back
|
|
1250
|
+
if (!L.outsideFiles.length) throw fail('ds-no-outside', 'no outside change waits');
|
|
1251
|
+
const base = filesOf(L.baseBody);
|
|
1252
|
+
for (const k of L.outsideFiles) {
|
|
1253
|
+
const abs = path.join(L.abs, k);
|
|
1254
|
+
if (base[k] !== undefined) atomicWrite(abs, base[k]);
|
|
1255
|
+
else if (existsSync(abs)) {
|
|
1256
|
+
// a file the base never had: moved aside, never deleted
|
|
1257
|
+
const dir = path.join(designRoot, '_trash', 'ds-outside', L.s.name);
|
|
1258
|
+
mkdirSync(dir, { recursive: true });
|
|
1259
|
+
renameSync(abs, path.join(dir, `${now()}-${path.basename(k)}`));
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
return { action: 'undo', rev: null, actionId: null };
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/* ------------------------------------------------------- conflict (b) */
|
|
1267
|
+
|
|
1268
|
+
function pick(
|
|
1269
|
+
ds: string,
|
|
1270
|
+
inp: { css: string; use: 'canvas' | 'file'; by: By }
|
|
1271
|
+
): Promise<DsResult> {
|
|
1272
|
+
return withLock(dsAbs(system(ds)), async () => {
|
|
1273
|
+
const L = load(ds);
|
|
1274
|
+
if (L.head.library) throw fail('ds-library', 'a linked library is view only here');
|
|
1275
|
+
const c = conflictsOf(L).conflicts.find((x) => x.css === inp.css);
|
|
1276
|
+
if (!c) throw fail('ds-no-conflict', `${inp.css} has no conflict to pick`);
|
|
1277
|
+
let K: BuiltRevision;
|
|
1278
|
+
if (inp.use === 'canvas') {
|
|
1279
|
+
// patch the working files to the pending value (§5.5), from the working files
|
|
1280
|
+
const entry = (L.pending.tokens ?? {})[inp.css];
|
|
1281
|
+
const model = structuredClone(L.workModel);
|
|
1282
|
+
const tok = model.tokens[inp.css] ?? { css: inp.css, values: {}, data: {}, extra: {} };
|
|
1283
|
+
for (const [t, v] of Object.entries(themeValuesOf(entry, L.s.themes)))
|
|
1284
|
+
setOwn(tok.values, t, v);
|
|
1285
|
+
setOwn(model.tokens, inp.css, tok);
|
|
1286
|
+
const files = { ...L.work };
|
|
1287
|
+
const tk = tokensKey(L.s);
|
|
1288
|
+
setOwn(files, tk, generateTokensCss(L.work[tk] ?? null, model, genConfig(L.s)));
|
|
1289
|
+
setOwn(files, TOKENS_JSON_KEY, emitTokensJson(model));
|
|
1290
|
+
K = buildFrom(L.s, files);
|
|
1291
|
+
} else K = buildFrom(L.s, L.work);
|
|
1292
|
+
const wrote = filesOf(K.body);
|
|
1293
|
+
const prior = writeRevision(L, K, inp.use === 'canvas');
|
|
1294
|
+
const next = structuredClone(L.pending);
|
|
1295
|
+
delete next.tokens?.[inp.css];
|
|
1296
|
+
let actionId: string | null;
|
|
1297
|
+
try {
|
|
1298
|
+
actionId = await propose(
|
|
1299
|
+
[withPending(L.s, next)],
|
|
1300
|
+
`${c.label ?? c.css}: use the ${inp.use === 'canvas' ? 'canvas' : 'file'} value`
|
|
1301
|
+
);
|
|
1302
|
+
} catch (err) {
|
|
1303
|
+
restoreWorking(L, wrote, prior);
|
|
1304
|
+
throw err;
|
|
1305
|
+
}
|
|
1306
|
+
writeLog(
|
|
1307
|
+
L,
|
|
1308
|
+
{ head: L.head.head, base: K.id },
|
|
1309
|
+
{
|
|
1310
|
+
rev: K.id,
|
|
1311
|
+
parent: L.head.base,
|
|
1312
|
+
action: 'pick',
|
|
1313
|
+
by: inp.by,
|
|
1314
|
+
summary:
|
|
1315
|
+
`${c.label ?? c.css}: ${inp.use === 'canvas' ? 'the canvas value' : 'the file value'}`.slice(
|
|
1316
|
+
0,
|
|
1317
|
+
200
|
|
1318
|
+
),
|
|
1319
|
+
actionId,
|
|
1320
|
+
}
|
|
1321
|
+
);
|
|
1322
|
+
return { action: 'pick', rev: K.id, actionId };
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/** "Published in two places" → "Use this": a publish whose expectHead is the surviving head. */
|
|
1327
|
+
function pickPublished(ds: string, inp: { head: string; by: By }): Promise<DsResult> {
|
|
1328
|
+
return withLock(dsAbs(system(ds)), async () => {
|
|
1329
|
+
const s = system(ds);
|
|
1330
|
+
const abs = dsAbs(s);
|
|
1331
|
+
const places = publishedInTwoPlaces(abs);
|
|
1332
|
+
if (!places) throw fail('ds-no-conflict', 'the system is published in one place');
|
|
1333
|
+
const chosen = places.find((p) => p.head === inp.head);
|
|
1334
|
+
if (!chosen) throw fail('ds-no-conflict', 'that head is not one of the two');
|
|
1335
|
+
const h = readHead(abs);
|
|
1336
|
+
if (h.state !== 'ok') throw fail('ds-head-invalid', 'head.json is not readable');
|
|
1337
|
+
const body = loadRevision(s, inp.head);
|
|
1338
|
+
if (!body) throw fail('ds-revision-missing', 'that revision has not arrived on this Mac yet');
|
|
1339
|
+
// nothing is lost: the other copy's log entries join this one's
|
|
1340
|
+
const logs = [
|
|
1341
|
+
h.doc.log,
|
|
1342
|
+
...places.filter((p) => p.file).map((p) => asideLog(abs, p.file as string)),
|
|
1343
|
+
];
|
|
1344
|
+
const seen = new Set<string>();
|
|
1345
|
+
const merged = logs
|
|
1346
|
+
.flat()
|
|
1347
|
+
.filter((e) => {
|
|
1348
|
+
const k = `${e.rev}\0${e.action}\0${e.at}`;
|
|
1349
|
+
if (seen.has(k)) return false;
|
|
1350
|
+
seen.add(k);
|
|
1351
|
+
return true;
|
|
1352
|
+
})
|
|
1353
|
+
.sort((a, b) => (a.at < b.at ? 1 : a.at > b.at ? -1 : 0));
|
|
1354
|
+
const L = { s, abs, head: { ...h.doc, log: merged } };
|
|
1355
|
+
if (inp.head !== h.doc.head)
|
|
1356
|
+
writeRevision(L, { id: inp.head, body, bytes: serializeRevision(body) }, true);
|
|
1357
|
+
writeLog(
|
|
1358
|
+
L,
|
|
1359
|
+
{ head: inp.head, base: inp.head },
|
|
1360
|
+
{
|
|
1361
|
+
rev: inp.head,
|
|
1362
|
+
parent: h.doc.head,
|
|
1363
|
+
action: 'publish',
|
|
1364
|
+
by: inp.by,
|
|
1365
|
+
summary: 'Published in two places: one kept',
|
|
1366
|
+
actionId: null,
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1369
|
+
settleAsideHeads(designRoot, abs, s.name);
|
|
1370
|
+
return { action: 'pick', rev: inp.head, actionId: null };
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
function asideLog(abs: string, file: string): LogEntry[] {
|
|
1375
|
+
const t = readText(path.join(abs, file));
|
|
1376
|
+
if (!t) return [];
|
|
1377
|
+
try {
|
|
1378
|
+
const d = JSON.parse(t);
|
|
1379
|
+
return isObj(d) && Array.isArray(d.log) ? (d.log as LogEntry[]) : [];
|
|
1380
|
+
} catch {
|
|
1381
|
+
return [];
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
/* ------------------------------------------------- canvas update / leave (d) */
|
|
1386
|
+
|
|
1387
|
+
function canvasSystem(canvasRel: string): SystemConfig {
|
|
1388
|
+
const rel = canvasRel.replace(/\\/g, '/').replace(/^\/+/, '');
|
|
1389
|
+
if (
|
|
1390
|
+
!/\.tsx$/i.test(rel) ||
|
|
1391
|
+
rel.split('/').some((c) => c === '..' || c.startsWith('_') || c.startsWith('.'))
|
|
1392
|
+
)
|
|
1393
|
+
throw fail('ds-not-in-system', 'not a canvas');
|
|
1394
|
+
const abs = path.join(designRoot, rel);
|
|
1395
|
+
if (!existsSync(abs) || !statSync(abs).isFile())
|
|
1396
|
+
throw fail('ds-not-in-system', 'no such canvas');
|
|
1397
|
+
const s = canvasSystemFor(designRoot, abs);
|
|
1398
|
+
if (!s || rel.startsWith(`${s.path}/`))
|
|
1399
|
+
throw fail('ds-not-in-system', 'this canvas follows no converted system');
|
|
1400
|
+
return s;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
function canvasUpdate(canvasRel: string, inp: { by: By }): Promise<DsResult> {
|
|
1404
|
+
void inp;
|
|
1405
|
+
const s = canvasSystem(canvasRel);
|
|
1406
|
+
return withLock(dsAbs(s), async () => {
|
|
1407
|
+
const h = readHead(dsAbs(s));
|
|
1408
|
+
if (h.state !== 'ok') throw fail('ds-not-converted', `${s.name} is not converted`);
|
|
1409
|
+
const rel = canvasRel.replace(/^\/+/, '');
|
|
1410
|
+
const meta = readJsonObj(path.join(designRoot, metaRelOf(rel))) ?? {};
|
|
1411
|
+
const files: { rel: string; text: string }[] = [];
|
|
1412
|
+
// p8-dead-reasons — the update a person declined with Keep goes with the pin it was about
|
|
1413
|
+
if (typeof meta.dsRev === 'string' || meta.dsKept !== undefined) {
|
|
1414
|
+
delete meta.dsRev;
|
|
1415
|
+
delete meta.dsKept;
|
|
1416
|
+
files.push({ rel: metaRelOf(rel), text: metaText(meta) });
|
|
1417
|
+
}
|
|
1418
|
+
const src = readText(path.join(designRoot, rel));
|
|
1419
|
+
if (src !== null && src.replace(STRIP_HEAD_PIN, '') !== src)
|
|
1420
|
+
files.push({ rel, text: src.replace(STRIP_HEAD_PIN, '') });
|
|
1421
|
+
const actionId = await propose(files, 'Update to the design system');
|
|
1422
|
+
return { action: 'canvas-update', rev: h.doc.head, actionId };
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
function canvasLeave(canvasRel: string, inp: { by: By }): Promise<DsResult> {
|
|
1427
|
+
void inp;
|
|
1428
|
+
const s = canvasSystem(canvasRel);
|
|
1429
|
+
return withLock(dsAbs(s), async () => {
|
|
1430
|
+
const h = readHead(dsAbs(s));
|
|
1431
|
+
if (h.state !== 'ok' || !h.doc.head)
|
|
1432
|
+
throw fail('ds-not-converted', `${s.name} is not converted`);
|
|
1433
|
+
const rel = canvasRel.replace(/^\/+/, '');
|
|
1434
|
+
const meta = readJsonObj(path.join(designRoot, metaRelOf(rel))) ?? {};
|
|
1435
|
+
if (meta.dsRev === h.doc.head)
|
|
1436
|
+
return { action: 'canvas-leave', rev: h.doc.head, actionId: null };
|
|
1437
|
+
// p8-dead-reasons — "Keep this version" on a canvas already left out: it STAYS on its version (dsRev is
|
|
1438
|
+
// not moved to head) and remembers the head it declined (`dsKept`, versioned, so peers see it), so the
|
|
1439
|
+
// update card stays away until the system moves on again; Update (canvasUpdate) still works and clears both
|
|
1440
|
+
if (typeof meta.dsRev === 'string' && meta.dsRev) {
|
|
1441
|
+
if (meta.dsKept === h.doc.head)
|
|
1442
|
+
return { action: 'canvas-leave', rev: meta.dsRev as string, actionId: null };
|
|
1443
|
+
setOwn(meta, 'dsKept', h.doc.head);
|
|
1444
|
+
const keptId = await propose(
|
|
1445
|
+
[{ rel: metaRelOf(rel), text: metaText(meta) }],
|
|
1446
|
+
'Keep this version of the design system'
|
|
1447
|
+
);
|
|
1448
|
+
return { action: 'canvas-leave', rev: meta.dsRev as string, actionId: keptId };
|
|
1449
|
+
}
|
|
1450
|
+
setOwn(meta, 'dsRev', h.doc.head);
|
|
1451
|
+
const actionId = await propose(
|
|
1452
|
+
[{ rel: metaRelOf(rel), text: metaText(meta) }],
|
|
1453
|
+
'Keep this version of the design system'
|
|
1454
|
+
);
|
|
1455
|
+
return { action: 'canvas-leave', rev: h.doc.head, actionId };
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/* ------------------------------------------------------------ trash (e) */
|
|
1460
|
+
|
|
1461
|
+
/** refuse before writing a pending entry the publish would then refuse */
|
|
1462
|
+
function expectHeadNow(ds: string, expectHead: string | null) {
|
|
1463
|
+
const h = readHead(dsAbs(system(ds)));
|
|
1464
|
+
if (h.state === 'ok' && h.doc.head !== expectHead)
|
|
1465
|
+
throw fail('ds-head-moved', 'the system was published since');
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
function tokenOf(ds: string, css: string) {
|
|
1469
|
+
const L = load(ds);
|
|
1470
|
+
const t = L.baseModel.tokens[css];
|
|
1471
|
+
if (!t) throw fail('ds-unknown-token', `${css} is not in the system`);
|
|
1472
|
+
return { L, t };
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* A token to the trash (§5.11 e): a pending `trash` entry, then a publish with every follower
|
|
1477
|
+
* ticked (the defaults — a canvas a person left out stays out). Two actions, like every swatch
|
|
1478
|
+
* edit + "Update N canvases": ⌘Z takes the publish back first, then the entry.
|
|
1479
|
+
*/
|
|
1480
|
+
async function trashToken(
|
|
1481
|
+
ds: string,
|
|
1482
|
+
inp: { css: string; replacement: string; expectHead: string | null; by: By }
|
|
1483
|
+
): Promise<PublishResult> {
|
|
1484
|
+
expectHeadNow(ds, inp.expectHead);
|
|
1485
|
+
await mergePending(ds, {
|
|
1486
|
+
tokens: { [inp.css]: { trash: { replacement: inp.replacement } } },
|
|
1487
|
+
by: inp.by,
|
|
1488
|
+
});
|
|
1489
|
+
return publish(ds, { expectHead: inp.expectHead, by: inp.by });
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
/** Restore: a publish that puts `previous` back. */
|
|
1493
|
+
async function restoreToken(
|
|
1494
|
+
ds: string,
|
|
1495
|
+
inp: { css: string; expectHead: string | null; by: By }
|
|
1496
|
+
): Promise<PublishResult> {
|
|
1497
|
+
const { L, t } = tokenOf(ds, inp.css);
|
|
1498
|
+
if (L.head.head !== inp.expectHead)
|
|
1499
|
+
throw fail('ds-head-moved', 'the system was published since');
|
|
1500
|
+
const tr = t.data.trashed;
|
|
1501
|
+
if (!isObj(tr)) throw fail('ds-not-trashed', `${inp.css} is not in the trash`);
|
|
1502
|
+
const prev = isObj(tr.previous) ? (tr.previous as Record<string, unknown>) : {};
|
|
1503
|
+
const entry: PendingToken = {};
|
|
1504
|
+
for (const [th, v] of Object.entries(prev)) if (typeof v === 'string') entry[th] = v;
|
|
1505
|
+
if (!Object.keys(entry).length)
|
|
1506
|
+
throw fail('ds-not-trashed', `${inp.css} has no previous value`);
|
|
1507
|
+
await mergePending(ds, { tokens: { [inp.css]: entry }, by: inp.by });
|
|
1508
|
+
return publish(ds, { expectHead: inp.expectHead, by: inp.by });
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Clear out (owner — the route checks): the tombstone record goes, the alias line
|
|
1513
|
+
* `--name: var(--replacement)` stays (the usage index may still show a reference).
|
|
1514
|
+
*/
|
|
1515
|
+
async function clearToken(
|
|
1516
|
+
ds: string,
|
|
1517
|
+
inp: { css: string; expectHead: string | null; by: By }
|
|
1518
|
+
): Promise<PublishResult> {
|
|
1519
|
+
const { L, t } = tokenOf(ds, inp.css);
|
|
1520
|
+
if (L.head.head !== inp.expectHead)
|
|
1521
|
+
throw fail('ds-head-moved', 'the system was published since');
|
|
1522
|
+
const tr = t.data.trashed;
|
|
1523
|
+
if (!isObj(tr) || typeof tr.replacement !== 'string')
|
|
1524
|
+
throw fail('ds-not-trashed', `${inp.css} is not in the trash`);
|
|
1525
|
+
const entry: PendingToken = {};
|
|
1526
|
+
for (const th of Object.keys(t.values)) entry[th] = `var(${tr.replacement})`;
|
|
1527
|
+
await mergePending(ds, { tokens: { [inp.css]: entry }, by: inp.by });
|
|
1528
|
+
return publish(ds, { expectHead: inp.expectHead, by: inp.by });
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
/* ---------------------------------------------------------- undo hook */
|
|
1532
|
+
|
|
1533
|
+
/**
|
|
1534
|
+
* The head.json half of an accepted kernel undo / redo (S10 Q1): `ids` are what it undid (a redo
|
|
1535
|
+
* names the undo it re-applies). For each, the newest log entry recorded with that action id is
|
|
1536
|
+
* reverted — pointers back to `was`, working files re-materialised from that base — and a
|
|
1537
|
+
* `restore` entry records `byAction`. Only when nothing moved since (`is` still holds) and the
|
|
1538
|
+
* working files are still base's; otherwise that system is reported in `skipped`.
|
|
1539
|
+
*/
|
|
1540
|
+
async function revertActions(ids: string[], byAction: string, redo: boolean) {
|
|
1541
|
+
const skipped: { doc: string; reason: string }[] = [];
|
|
1542
|
+
const reverted: { system: string; rev: string | null }[] = [];
|
|
1543
|
+
if (!ids.length) return { skipped, reverted };
|
|
1544
|
+
const want = new Set(ids);
|
|
1545
|
+
for (const s of systems()) {
|
|
1546
|
+
const abs = dsAbs(s);
|
|
1547
|
+
if (readHead(abs).state !== 'ok') continue;
|
|
1548
|
+
await withLock(abs, async () => {
|
|
1549
|
+
const h = readHead(abs);
|
|
1550
|
+
if (h.state !== 'ok') return;
|
|
1551
|
+
// newest first; each id reverts its newest entry only
|
|
1552
|
+
const todo: LogEntry[] = [];
|
|
1553
|
+
const done = new Set<string>();
|
|
1554
|
+
for (const e of h.doc.log)
|
|
1555
|
+
if (e.actionId && want.has(e.actionId) && !done.has(e.actionId)) {
|
|
1556
|
+
done.add(e.actionId);
|
|
1557
|
+
todo.push(e);
|
|
1558
|
+
}
|
|
1559
|
+
let doc = h.doc;
|
|
1560
|
+
for (const e of todo) {
|
|
1561
|
+
const where = `${s.path}/${HEAD_REL}`;
|
|
1562
|
+
if (!e.was || !e.is) {
|
|
1563
|
+
skipped.push({ doc: where, reason: 'ds-not-undoable' });
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
if (doc.head !== e.is.head || doc.base !== e.is.base) {
|
|
1567
|
+
skipped.push({ doc: where, reason: 'ds-head-moved' });
|
|
1568
|
+
continue;
|
|
1569
|
+
}
|
|
1570
|
+
const curBase = loadRevision(s, e.is.base);
|
|
1571
|
+
const target = e.was.base ? loadRevision(s, e.was.base) : null;
|
|
1572
|
+
if (!curBase || (e.was.base && !target)) {
|
|
1573
|
+
skipped.push({ doc: where, reason: 'ds-revision-missing' });
|
|
1574
|
+
continue;
|
|
1575
|
+
}
|
|
1576
|
+
const work = working(s);
|
|
1577
|
+
const cur = filesOf(curBase);
|
|
1578
|
+
const dirty = [...new Set([...Object.keys(cur), ...Object.keys(work)])].some(
|
|
1579
|
+
(k) => cur[k] !== work[k]
|
|
1580
|
+
);
|
|
1581
|
+
if (dirty) {
|
|
1582
|
+
skipped.push({ doc: where, reason: 'ds-outside-unreviewed' });
|
|
1583
|
+
continue;
|
|
1584
|
+
}
|
|
1585
|
+
if (target) {
|
|
1586
|
+
const want2 = filesOf(target);
|
|
1587
|
+
for (const [k, t] of Object.entries(want2))
|
|
1588
|
+
if (work[k] !== t) atomicWrite(path.join(abs, k), t);
|
|
1589
|
+
// a working file the target never had (tokens.json a first publish emitted): its bytes
|
|
1590
|
+
// are the current base's, kept in that revision — so removing it loses nothing
|
|
1591
|
+
for (const k of Object.keys(work))
|
|
1592
|
+
if (want2[k] === undefined) unlinkSync(path.join(abs, k));
|
|
1593
|
+
}
|
|
1594
|
+
const original = String(e.summary ?? e.action).replace(/^(Undo|Redo): /, '');
|
|
1595
|
+
const entry: LogEntry = {
|
|
1596
|
+
rev: e.was.head ?? e.was.base ?? e.rev,
|
|
1597
|
+
parent: e.is.head,
|
|
1598
|
+
action: 'restore' as LogAction,
|
|
1599
|
+
at: iso(),
|
|
1600
|
+
by: e.by,
|
|
1601
|
+
summary: `${redo ? 'Redo' : 'Undo'}: ${original}`.slice(0, 200),
|
|
1602
|
+
actionId: byAction,
|
|
1603
|
+
was: { ...e.is },
|
|
1604
|
+
is: { ...e.was },
|
|
1605
|
+
};
|
|
1606
|
+
const next: HeadDoc = {
|
|
1607
|
+
...doc,
|
|
1608
|
+
head: e.was.head,
|
|
1609
|
+
base: e.was.base,
|
|
1610
|
+
log: [entry, ...doc.log],
|
|
1611
|
+
};
|
|
1612
|
+
writeHead(abs, next, { head: doc.head, base: doc.base });
|
|
1613
|
+
const again = readHead(abs);
|
|
1614
|
+
if (again.state === 'ok') doc = again.doc;
|
|
1615
|
+
reverted.push({ system: s.name, rev: e.was.head });
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
if (skipped.length)
|
|
1620
|
+
log.warn?.(`[ds] undo left ${skipped.length} design-system change(s) in place`);
|
|
1621
|
+
return { skipped, reverted };
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
return {
|
|
1625
|
+
designRoot,
|
|
1626
|
+
/** the Plane-A port now (null = no home answers) and the clock — `ds/make.ts` reuses both */
|
|
1627
|
+
kernel: kernelNow,
|
|
1628
|
+
now,
|
|
1629
|
+
systems,
|
|
1630
|
+
state,
|
|
1631
|
+
review,
|
|
1632
|
+
publish,
|
|
1633
|
+
mergePending,
|
|
1634
|
+
cancelPending,
|
|
1635
|
+
keepOutside,
|
|
1636
|
+
undoOutside,
|
|
1637
|
+
pick,
|
|
1638
|
+
pickPublished,
|
|
1639
|
+
canvasUpdate,
|
|
1640
|
+
canvasLeave,
|
|
1641
|
+
trashToken,
|
|
1642
|
+
restoreToken,
|
|
1643
|
+
clearToken,
|
|
1644
|
+
revertActions,
|
|
1645
|
+
canvasesOf: (ds: string) => canvasesOf(system(ds)),
|
|
1646
|
+
/** the working files' sha256s, for diagnostics and the outside watcher (S10.3) */
|
|
1647
|
+
workingHashes: (ds: string) =>
|
|
1648
|
+
Object.fromEntries(Object.entries(working(system(ds))).map(([k, t]) => [k, sha256Hex(t)])),
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
export type DsEngine = ReturnType<typeof createDsEngine>;
|