@dexhq/canvas 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +21 -18
- package/app/canvas/activity.tsx +8 -15
- package/app/canvas/anchoring.ts +3 -5
- package/app/canvas/canvas-input.ts +151 -14
- package/app/canvas/canvas-keys.ts +9 -0
- package/app/canvas/canvas-model.ts +5 -42
- package/app/canvas/canvas-panels.ts +1 -17
- package/app/canvas/canvas-scene.ts +7 -3
- package/app/canvas/canvas-ui.ts +2 -1
- package/app/canvas/canvas.css +61 -26
- package/app/canvas/change-notice.tsx +10 -1
- package/app/canvas/comment-layer.tsx +2 -1
- package/app/canvas/comments.tsx +204 -82
- package/app/canvas/element-picker.ts +200 -27
- package/app/canvas/engine/canvas-gestures.ts +72 -17
- package/app/canvas/engine/canvas-store.ts +17 -1
- package/app/canvas/engine/engine.css +6 -3
- package/app/canvas/find-bar.tsx +817 -0
- package/app/canvas/find-model.ts +135 -0
- package/app/canvas/flow-canvas.tsx +18 -2
- package/app/canvas/follow-pin.ts +26 -6
- package/app/canvas/frame-node.tsx +43 -26
- package/app/canvas/imported-reviews.tsx +12 -22
- package/app/canvas/layout.ts +27 -0
- package/app/canvas/live-page.ts +142 -19
- package/app/canvas/page-find.ts +220 -0
- package/app/canvas/page-style.ts +23 -0
- package/app/canvas/section-node.tsx +2 -0
- package/app/canvas/spec-threads.ts +24 -23
- package/app/canvas/thread-focus.tsx +14 -12
- package/app/canvas/tool-cursors.ts +16 -16
- package/app/canvas/use-activity.ts +0 -8
- package/app/canvas/use-agent-changes.tsx +34 -40
- package/app/canvas/use-canvas-clipboard.tsx +11 -14
- package/app/canvas/xray.ts +3 -12
- package/app/frame.tsx +5 -0
- package/app/i18n/locales/en/messages.po +114 -12
- package/app/i18n/locales/en/messages.ts +1 -1
- package/app/i18n/locales/pseudo/messages.po +114 -12
- package/app/i18n/locales/pseudo/messages.ts +1 -1
- package/app/icons/{sets/lucide.tsx → glyphs.tsx} +7 -5
- package/app/icons/index.tsx +3 -3
- package/app/icons/types.ts +3 -10
- package/app/index.html +3 -3
- package/app/main.tsx +3 -0
- package/app/pages/canvas-settings.tsx +35 -0
- package/app/pages/canvas.tsx +27 -8
- package/app/pages/commands-settings.tsx +16 -2
- package/app/shell/about.tsx +5 -4
- package/app/shell/feedback-details.ts +0 -3
- package/app/shell/feedback-form.tsx +10 -21
- package/app/shell/feedback-link.tsx +2 -1
- package/app/shell/instructions-editor.tsx +1 -1
- package/app/shell/presence-style.ts +59 -0
- package/app/shell/presence.tsx +6 -3
- package/app/shell/scaled-frame.tsx +21 -9
- package/app/shell/settings-sections.ts +12 -0
- package/app/shell/sidebar.tsx +1 -1
- package/app/studio-ui.d.ts +0 -9
- package/app/types.ts +21 -205
- package/app/ui/file-drop.ts +128 -0
- package/app/ui/prompt-editor.tsx +1 -1
- package/app/ui/shadcn/input-group.tsx +2 -2
- package/dist/cli/banner.d.mts +4 -2
- package/dist/cli/banner.mjs +34 -11
- package/dist/cli/commands/app.mjs +19 -11
- package/dist/cli/commands/create.d.mts +26 -14
- package/dist/cli/commands/create.mjs +13 -7
- package/dist/cli/commands/dev.mjs +2 -3
- package/dist/cli/commands/hook.mjs +2 -1
- package/dist/cli/commands/init.d.mts +11 -6
- package/dist/cli/help.d.mts +1 -1
- package/dist/cli/help.mjs +3 -3
- package/dist/cli/main.d.mts +22 -12
- package/dist/config/index.d.mts +6 -5
- package/dist/config/project-files.d.mts +6 -3
- package/dist/config/project-files.mjs +14 -5
- package/dist/config/renamed.d.mts +0 -2
- package/dist/config/renamed.mjs +1 -3
- package/dist/config/schema.d.mts +0 -5
- package/dist/config/schema.mjs +0 -5
- package/dist/content/capture.d.mts +2 -2
- package/dist/content/capture.mjs +2 -2
- package/dist/content/content.d.mts +3 -141
- package/dist/content/content.mjs +7 -65
- package/dist/content/flow-specs.mjs +1 -1
- package/dist/content/prototype-summary.d.mts +3 -39
- package/dist/content/prototype-summary.mjs +2 -3
- package/dist/content/prototypes.mjs +1 -1
- package/dist/content/snapshot-client.mjs +1 -1
- package/dist/content/text-replace.d.mts +30 -0
- package/dist/content/text-replace.mjs +309 -0
- package/dist/content/thread-module.mjs +1 -1
- package/dist/content/threads.mjs +1 -1
- package/dist/paths.d.mts +0 -2
- package/dist/paths.mjs +1 -3
- package/dist/server/agent-env.d.mts +5 -1
- package/dist/server/agent-env.mjs +7 -2
- package/dist/server/agent-session.d.mts +14 -1
- package/dist/server/agent-session.mjs +84 -19
- package/dist/server/brief.mjs +3 -3
- package/dist/server/build-pictures.mjs +1 -1
- package/dist/server/channel.d.mts +19 -24
- package/dist/server/channel.mjs +70 -37
- package/dist/server/claimed-presence.d.mts +18 -0
- package/dist/server/claimed-presence.mjs +58 -0
- package/dist/server/close-check.mjs +2 -2
- package/dist/server/comments/actions.d.mts +153 -0
- package/dist/server/comments/actions.mjs +154 -0
- package/dist/server/comments/routes.d.mts +25 -0
- package/dist/server/comments/routes.mjs +88 -0
- package/dist/server/comments/tools.d.mts +6 -0
- package/dist/server/comments/tools.mjs +154 -0
- package/dist/server/dev-server.mjs +36 -13
- package/dist/server/file-errors.d.mts +7 -2
- package/dist/server/file-errors.mjs +31 -8
- package/dist/server/file-lock.d.mts +2 -2
- package/dist/server/file-lock.mjs +130 -36
- package/dist/server/mcp.d.mts +0 -2
- package/dist/server/mcp.mjs +7 -8
- package/dist/server/me.d.mts +1 -1
- package/dist/server/open-page.d.mts +22 -0
- package/dist/server/open-page.mjs +20 -2
- package/dist/server/outcome.d.mts +22 -0
- package/dist/server/outcome.mjs +8 -0
- package/dist/server/own-copies.mjs +2 -2
- package/dist/server/people.d.mts +1 -1
- package/dist/server/port.d.mts +12 -0
- package/dist/server/port.mjs +66 -14
- package/dist/server/presence.d.mts +4 -1
- package/dist/server/presence.mjs +2 -2
- package/dist/server/requests.d.mts +5 -1
- package/dist/server/requests.mjs +32 -47
- package/dist/server/studio-for.d.mts +5 -0
- package/dist/server/studio-for.mjs +18 -4
- package/dist/server/sync-install.d.mts +8 -12
- package/dist/server/sync-install.mjs +12 -30
- package/dist/server/thread-source.mjs +2 -2
- package/dist/server/tools/describe.d.mts +1 -1
- package/dist/server/tools/describe.mjs +1 -1
- package/dist/server/tools/feedback.d.mts +1 -1
- package/dist/server/tools/reading.mjs +13 -4
- package/dist/server/tools/show.d.mts +1 -1
- package/dist/server/tools/snapshot.d.mts +1 -1
- package/dist/server/tools/thread-list.mjs +1 -1
- package/dist/server/tools/watch.mjs +5 -3
- package/dist/server/vite.mjs +28 -31
- package/dist/server/web-app.mjs +7 -10
- package/dist/server/work-groups.mjs +1 -1
- package/dist/setup/apply.mjs +8 -14
- package/dist/setup/create.d.mts +4 -2
- package/dist/setup/create.mjs +118 -36
- package/dist/setup/design-system-checks.mjs +3 -12
- package/dist/setup/desktop-app-script.mjs +4 -3
- package/dist/setup/desktop-app-start.d.mts +8 -2
- package/dist/setup/desktop-app-start.mjs +64 -29
- package/dist/setup/desktop-app.d.mts +8 -0
- package/dist/setup/desktop-app.mjs +20 -4
- package/dist/setup/detect.d.mts +14 -7
- package/dist/setup/detect.mjs +56 -10
- package/dist/setup/doctor.mjs +2 -4
- package/dist/setup/existing-setup.d.mts +1 -3
- package/dist/setup/existing-setup.mjs +10 -11
- package/dist/setup/migrate/row-titles.mjs +1 -1
- package/dist/setup/own-app.d.mts +1 -2
- package/dist/setup/own-app.mjs +4 -5
- package/dist/setup/plan.d.mts +8 -6
- package/dist/setup/plan.mjs +64 -48
- package/dist/setup/project.d.mts +6 -17
- package/dist/setup/project.mjs +17 -61
- package/dist/setup/prompts.d.mts +5 -5
- package/dist/setup/prompts.mjs +28 -61
- package/dist/setup/questions.d.mts +12 -4
- package/dist/setup/questions.mjs +10 -25
- package/dist/setup/starters.d.mts +2 -0
- package/dist/setup/starters.mjs +26 -9
- package/dist/setup/workspace-setup.d.mts +1 -2
- package/dist/setup/workspace-setup.mjs +4 -6
- package/dist/setup/write.d.mts +15 -5
- package/dist/setup/write.mjs +35 -9
- package/dist/shared/annotations-core.mjs +1 -1
- package/dist/shared/canvas-core.mjs +1 -1
- package/dist/shared/canvas-file.d.mts +201 -0
- package/dist/shared/canvas-file.mjs +1 -0
- package/dist/shared/comments/routes.d.mts +53 -0
- package/dist/shared/comments/routes.mjs +37 -0
- package/dist/shared/feedback.d.mts +8 -0
- package/dist/shared/feedback.mjs +10 -2
- package/dist/shared/page-review.d.mts +2 -11
- package/dist/shared/page-review.mjs +4 -13
- package/dist/shared/presence-core.d.mts +11 -0
- package/dist/shared/presence-core.mjs +11 -2
- package/dist/shared/review-file.d.mts +5 -0
- package/dist/shared/review-file.mjs +23 -13
- package/dist/shared/server-page.mjs +7 -1
- package/dist/shared/signup.d.mts +2 -5
- package/dist/shared/signup.mjs +2 -35
- package/dist/shared/studio-events.d.mts +0 -6
- package/dist/shared/studio-events.mjs +1 -5
- package/dist/shared/studio-files.d.mts +12 -0
- package/dist/shared/studio-files.mjs +6 -1
- package/dist/shared/studio-routes.d.mts +16 -62
- package/dist/shared/studio-routes.mjs +1 -69
- package/dist/shared/threads-core.d.mts +2 -2
- package/dist/shared/threads-core.mjs +1 -1
- package/extension/dist/feedback.js +148 -138
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/picker.js +146 -136
- package/package.json +3 -20
- package/src/cli/banner.ts +45 -11
- package/src/cli/commands/app.ts +23 -8
- package/src/cli/commands/create.ts +17 -9
- package/src/cli/commands/dev.ts +0 -3
- package/src/cli/commands/hook.ts +4 -1
- package/src/cli/help.ts +3 -3
- package/src/config/index.ts +6 -5
- package/src/config/project-files.ts +21 -11
- package/src/config/renamed.ts +0 -3
- package/src/config/schema.ts +0 -1
- package/src/content/capture.ts +6 -12
- package/src/content/content.ts +7 -244
- package/src/content/flow-specs.ts +2 -1
- package/src/content/prototype-summary.ts +4 -44
- package/src/content/review-pages.ts +2 -1
- package/src/content/snapshot-client.ts +1 -1
- package/src/content/text-replace.ts +449 -0
- package/src/paths.ts +0 -8
- package/src/server/agent-env.ts +12 -2
- package/src/server/agent-session.ts +124 -34
- package/src/server/brief.ts +8 -3
- package/src/server/channel.ts +121 -52
- package/src/server/claimed-presence.ts +93 -0
- package/src/server/comments/actions.ts +352 -0
- package/src/server/comments/routes.ts +176 -0
- package/src/server/comments/tools.ts +317 -0
- package/src/server/dev-server.ts +49 -15
- package/src/server/file-errors.ts +47 -13
- package/src/server/file-lock.ts +205 -54
- package/src/server/mcp.ts +13 -14
- package/src/server/me.ts +2 -5
- package/src/server/open-page.ts +54 -4
- package/src/server/outcome.ts +26 -0
- package/src/server/people.ts +2 -1
- package/src/server/port.ts +94 -20
- package/src/server/presence.ts +11 -3
- package/src/server/requests.ts +60 -70
- package/src/server/studio-for.ts +27 -3
- package/src/server/sync-install.ts +35 -26
- package/src/server/thread-place.ts +2 -4
- package/src/server/tools/reading.ts +16 -3
- package/src/server/tools/watch.ts +7 -7
- package/src/server/vite.ts +37 -40
- package/src/server/web-app.ts +14 -12
- package/src/setup/apply.ts +10 -16
- package/src/setup/create.ts +143 -37
- package/src/setup/design-system-checks.ts +7 -15
- package/src/setup/desktop-app-script.ts +4 -3
- package/src/setup/desktop-app-start.ts +94 -26
- package/src/setup/desktop-app.ts +24 -3
- package/src/setup/detect.ts +56 -14
- package/src/setup/doctor.ts +4 -4
- package/src/setup/existing-setup.ts +10 -12
- package/src/setup/own-app.ts +2 -5
- package/src/setup/plan.ts +93 -84
- package/src/setup/project.ts +25 -118
- package/src/setup/prompts.ts +44 -127
- package/src/setup/questions.ts +27 -29
- package/src/setup/starters.ts +35 -10
- package/src/setup/workspace-setup.ts +8 -18
- package/src/setup/write.ts +52 -9
- package/src/shared/canvas-file.ts +205 -0
- package/src/shared/comments/routes.ts +79 -0
- package/src/shared/feedback.ts +14 -4
- package/src/shared/page-review.ts +11 -16
- package/src/shared/presence-core.ts +16 -2
- package/src/shared/review-file.ts +28 -12
- package/src/shared/server-page.ts +11 -1
- package/src/shared/signup.ts +4 -28
- package/src/shared/studio-events.ts +0 -13
- package/src/shared/studio-files.ts +14 -0
- package/src/shared/studio-routes.ts +21 -64
- package/src/shared/threads-core.ts +2 -2
- package/templates/methods/review.md +2 -2
- package/templates/rules/canvas-frames.md +104 -0
- package/templates/rules/canvas.md +8 -142
- package/templates/rules/prototypes.md +1 -1
- package/templates/rules/snapshots.md +52 -0
- package/templates/starters/standalone/README.md +7 -7
- package/templates/starters/standalone/components.json +1 -1
- package/templates/starters/standalone/package.json +1 -2
- package/templates/starters/turborepo/README.md +6 -6
- package/templates/starters/turborepo/apps/web/components.json +1 -1
- package/templates/starters/turborepo/apps/web/package.json +1 -2
- package/templates/starters/turborepo/apps/web/src/app.tsx +4 -5
- package/templates/starters/turborepo/packages/ui/components.json +1 -1
- package/templates/starters/turborepo/packages/ui/package.json +1 -2
- package/templates/starters/vite/README.md +7 -6
- package/templates/starters/vite/components.json +1 -1
- package/templates/starters/vite/package.json +1 -2
- package/templates/starters/vite/src/app.tsx +3 -4
- package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
- package/templates/starters/vite/src/components/ui/attachment.tsx +1 -1
- package/templates/starters/vite/src/components/ui/badge.tsx +2 -2
- package/templates/starters/vite/src/components/ui/button.tsx +17 -12
- package/templates/starters/vite/src/components/ui/card.tsx +1 -1
- package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
- package/templates/starters/vite/src/components/ui/dialog.tsx +5 -5
- package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +17 -14
- package/templates/starters/vite/src/components/ui/field.tsx +3 -1
- package/templates/starters/vite/src/components/ui/input-group.tsx +5 -3
- package/templates/starters/vite/src/components/ui/input.tsx +1 -1
- package/templates/starters/vite/src/components/ui/label.tsx +2 -0
- package/templates/starters/vite/src/components/ui/native-select.tsx +3 -4
- package/templates/starters/vite/src/components/ui/popover.tsx +1 -1
- package/templates/starters/vite/src/components/ui/separator.tsx +2 -0
- package/templates/starters/vite/src/components/ui/spinner.tsx +3 -7
- package/templates/starters/vite/src/components/ui/switch.tsx +1 -1
- package/templates/starters/vite/src/components/ui/textarea.tsx +1 -1
- package/templates/starters/vite/src/components/ui/toggle.tsx +4 -2
- package/templates/starters/vite/src/index.css +533 -111
- package/app/icons/sets/hugeicons.tsx +0 -259
- package/app/icons/sets/phosphor.tsx +0 -251
- package/dist/server/icon-set.d.mts +0 -15
- package/dist/server/icon-set.mjs +0 -31
- package/dist/server/tools/close-reply.d.mts +0 -6
- package/dist/server/tools/close-reply.mjs +0 -138
- package/dist/server/tools/comment.d.mts +0 -6
- package/dist/server/tools/comment.mjs +0 -49
- package/dist/shared/icon-sets.d.mts +0 -9
- package/dist/shared/icon-sets.mjs +0 -21
- package/src/server/icon-set.ts +0 -56
- package/src/server/tools/close-reply.ts +0 -271
- package/src/server/tools/comment.ts +0 -96
- package/src/shared/icon-sets.ts +0 -23
- /package/app/public/{sudio-192.png → dex-192.png} +0 -0
- /package/app/public/{sudio-512.png → dex-512.png} +0 -0
- /package/app/public/{apple-touch-icon.png → dex-apple-touch-icon.png} +0 -0
- /package/app/public/{favicon-32.png → dex-icon-32.png} +0 -0
- /package/app/public/{favicon.svg → dex-icon.svg} +0 -0
- /package/app/public/{sudio-maskable-512.png → dex-maskable-512.png} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { features } from "virtual:studio-ui";
|
|
2
1
|
import type { MessageDescriptor } from "@lingui/core";
|
|
3
2
|
import { msg } from "@lingui/core/macro";
|
|
4
3
|
import type { IconName } from "@studio/icons";
|
|
@@ -6,11 +5,7 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
6
5
|
import type { CanvasTool } from "./canvas-context";
|
|
7
6
|
|
|
8
7
|
// The canvas's floating panels, each attached under the group it opens from:
|
|
9
|
-
// what each is
|
|
10
|
-
// is open at a time.
|
|
11
|
-
|
|
12
|
-
/** One of the studio's unreleased features. */
|
|
13
|
-
type Feature = keyof typeof features;
|
|
8
|
+
// what each is and where it opens. One panel per side is open at a time.
|
|
14
9
|
|
|
15
10
|
export type PanelSide = "left" | "right";
|
|
16
11
|
|
|
@@ -30,8 +25,6 @@ export type PanelId =
|
|
|
30
25
|
| "removed";
|
|
31
26
|
|
|
32
27
|
export interface CanvasPanel {
|
|
33
|
-
/** The feature that shows it; none, always there. */
|
|
34
|
-
feature?: Feature;
|
|
35
28
|
group: PanelGroup;
|
|
36
29
|
icon: IconName;
|
|
37
30
|
id: PanelId;
|
|
@@ -55,7 +48,6 @@ export const CANVAS_PANELS: readonly CanvasPanel[] = [
|
|
|
55
48
|
label: msg`Components`,
|
|
56
49
|
side: "left",
|
|
57
50
|
group: "toolbar",
|
|
58
|
-
feature: "stickers",
|
|
59
51
|
},
|
|
60
52
|
{
|
|
61
53
|
id: "wireframe",
|
|
@@ -63,7 +55,6 @@ export const CANVAS_PANELS: readonly CanvasPanel[] = [
|
|
|
63
55
|
label: msg`Wireframe`,
|
|
64
56
|
side: "left",
|
|
65
57
|
group: "mode",
|
|
66
|
-
feature: "wireframes",
|
|
67
58
|
tool: "wireframe",
|
|
68
59
|
},
|
|
69
60
|
{
|
|
@@ -72,7 +63,6 @@ export const CANVAS_PANELS: readonly CanvasPanel[] = [
|
|
|
72
63
|
label: msg`Inspect`,
|
|
73
64
|
side: "left",
|
|
74
65
|
group: "mode",
|
|
75
|
-
feature: "inspector",
|
|
76
66
|
tool: "inspect",
|
|
77
67
|
},
|
|
78
68
|
{
|
|
@@ -100,12 +90,6 @@ export const panelRow = (id: PanelId): CanvasPanel => {
|
|
|
100
90
|
return row;
|
|
101
91
|
};
|
|
102
92
|
|
|
103
|
-
/** The panels whose feature is on, in the table's order. */
|
|
104
|
-
export const panelsOn = (
|
|
105
|
-
features: Partial<Record<Feature, boolean>>
|
|
106
|
-
): CanvasPanel[] =>
|
|
107
|
-
CANVAS_PANELS.filter((row) => !row.feature || Boolean(features[row.feature]));
|
|
108
|
-
|
|
109
93
|
/** The panel a mode's tool keeps open, if the tool is a mode's. */
|
|
110
94
|
export const panelOfTool = (tool: CanvasTool): PanelId | undefined =>
|
|
111
95
|
CANVAS_PANELS.find((row) => row.tool === tool)?.id;
|
|
@@ -91,10 +91,14 @@ export const threadItemId = (thread: Thread, canvas: Canvas) => {
|
|
|
91
91
|
if (target.kind === "view" || target.kind === "flow") {
|
|
92
92
|
return sectionNodeId(target.section);
|
|
93
93
|
}
|
|
94
|
-
// A spec's words are in its frame: the first showing that spec
|
|
94
|
+
// A spec's words are in its frame: the first showing that spec, or that
|
|
95
|
+
// document (docs/<name>.md).
|
|
95
96
|
if (target.kind === "spec") {
|
|
96
|
-
return canvasFrames(canvas).find(
|
|
97
|
-
|
|
97
|
+
return canvasFrames(canvas).find(
|
|
98
|
+
({ frame }) =>
|
|
99
|
+
frame.spec === target.spec ||
|
|
100
|
+
(frame.doc !== undefined && `docs/${frame.doc}.md` === target.spec)
|
|
101
|
+
)?.key;
|
|
98
102
|
}
|
|
99
103
|
return frameOf(thread, canvas);
|
|
100
104
|
};
|
package/app/canvas/canvas-ui.ts
CHANGED
|
@@ -53,7 +53,8 @@ export const createCanvasUi = (initial: Partial<CanvasUiState> = {}) => {
|
|
|
53
53
|
...(options?.quick ? { quick: true } : {}),
|
|
54
54
|
},
|
|
55
55
|
}),
|
|
56
|
-
|
|
56
|
+
/** Open a thread's card at `at`; left out, at its pin. */
|
|
57
|
+
openThread: (id: string, at?: ScreenPoint) =>
|
|
57
58
|
set({ floating: { kind: "thread", id, at } }),
|
|
58
59
|
/** Ask an agent for a new view in a cell: its card, near the top middle. */
|
|
59
60
|
requestView: (cell: { row?: string; section: string; step: number }) =>
|
package/app/canvas/canvas.css
CHANGED
|
@@ -96,6 +96,14 @@
|
|
|
96
96
|
visibility: hidden;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/* Further out, section names would reach into the section above
|
|
100
|
+
(sectionNamesZoom in layout.ts): they hide as well, so a press there
|
|
101
|
+
reaches what shows. A name being typed stays. */
|
|
102
|
+
.studio-canvas[data-section-names="false"]
|
|
103
|
+
.studio-section-handle:not(:has(input)) {
|
|
104
|
+
visibility: hidden;
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
/* Sections are a name over open canvas, on a surface a shade off the canvas's
|
|
100
108
|
so each reads as one piece: surfaces, not borders. Their controls show on
|
|
101
109
|
hover (see .studio-reveal). Square, like the frames in them. */
|
|
@@ -135,11 +143,23 @@
|
|
|
135
143
|
background: var(--muted);
|
|
136
144
|
}
|
|
137
145
|
|
|
146
|
+
/* What fades or comes in on the canvas does it by --studio-shown, never by
|
|
147
|
+
a transition of opacity or keyframes of opacity or transform: WebKit runs
|
|
148
|
+
those on the compositor, promoting what moves and with it the canvas, and
|
|
149
|
+
leaves the canvas promoted, blurred zoomed in, after they end
|
|
150
|
+
(promoted-layers.test.ts). */
|
|
151
|
+
@property --studio-shown {
|
|
152
|
+
syntax: "<number>";
|
|
153
|
+
inherits: false;
|
|
154
|
+
initial-value: 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
138
157
|
/* Controls around frames, rows and sections show when you reach for them: on
|
|
139
158
|
hover, when selected, or with the keyboard. Names and states always show. */
|
|
140
159
|
.studio-reveal {
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
--studio-shown: 0;
|
|
161
|
+
opacity: var(--studio-shown);
|
|
162
|
+
transition: --studio-shown 120ms ease-out;
|
|
143
163
|
}
|
|
144
164
|
|
|
145
165
|
.studio-canvas-item:hover .studio-frame .studio-reveal,
|
|
@@ -148,12 +168,12 @@
|
|
|
148
168
|
.studio-reveal-group:hover .studio-reveal,
|
|
149
169
|
.studio-reveal:focus-within,
|
|
150
170
|
.studio-reveal:has([data-popup-open]) {
|
|
151
|
-
|
|
171
|
+
--studio-shown: 1;
|
|
152
172
|
}
|
|
153
173
|
|
|
154
174
|
@media (hover: none) {
|
|
155
175
|
.studio-reveal {
|
|
156
|
-
|
|
176
|
+
--studio-shown: 1;
|
|
157
177
|
}
|
|
158
178
|
}
|
|
159
179
|
|
|
@@ -181,10 +201,11 @@
|
|
|
181
201
|
}
|
|
182
202
|
|
|
183
203
|
.studio-canvas-item[data-dragging="true"] .studio-artboard {
|
|
204
|
+
--studio-shown: 0.9;
|
|
184
205
|
box-shadow:
|
|
185
206
|
0 0 0 calc(1px / var(--zoom)) var(--studio-accent),
|
|
186
207
|
0 calc(12px / var(--zoom)) calc(32px / var(--zoom)) rgb(0 0 0 / 0.14);
|
|
187
|
-
opacity:
|
|
208
|
+
opacity: var(--studio-shown);
|
|
188
209
|
}
|
|
189
210
|
|
|
190
211
|
/* What a ⌥-drag holds is a copy of the frame, the frame staying in its
|
|
@@ -274,6 +295,7 @@
|
|
|
274
295
|
left: 0;
|
|
275
296
|
z-index: 1500;
|
|
276
297
|
pointer-events: none;
|
|
298
|
+
opacity: var(--studio-shown);
|
|
277
299
|
animation: studio-insert-in 120ms ease-out;
|
|
278
300
|
}
|
|
279
301
|
|
|
@@ -308,9 +330,10 @@
|
|
|
308
330
|
}
|
|
309
331
|
|
|
310
332
|
:is(.studio-insert, .studio-add-beside) .studio-add .studio-icon {
|
|
333
|
+
--studio-shown: 0;
|
|
311
334
|
position: relative;
|
|
312
|
-
opacity:
|
|
313
|
-
transition:
|
|
335
|
+
opacity: var(--studio-shown);
|
|
336
|
+
transition: --studio-shown 100ms ease-out;
|
|
314
337
|
}
|
|
315
338
|
|
|
316
339
|
:is(.studio-insert, .studio-add-beside)
|
|
@@ -327,7 +350,7 @@
|
|
|
327
350
|
:is(.studio-insert, .studio-add-beside)
|
|
328
351
|
.studio-add:is(:hover, :focus-visible, [data-popup-open])
|
|
329
352
|
.studio-icon {
|
|
330
|
-
|
|
353
|
+
--studio-shown: 1;
|
|
331
354
|
}
|
|
332
355
|
|
|
333
356
|
/* One + at a time: the selected frame's gives way to the pointer's. */
|
|
@@ -342,19 +365,20 @@
|
|
|
342
365
|
}
|
|
343
366
|
|
|
344
367
|
.studio-add-beside .studio-add .studio-icon {
|
|
345
|
-
|
|
368
|
+
--studio-shown: 1;
|
|
346
369
|
}
|
|
347
370
|
}
|
|
348
371
|
|
|
349
372
|
@keyframes studio-insert-in {
|
|
350
373
|
from {
|
|
351
|
-
|
|
374
|
+
--studio-shown: 0;
|
|
352
375
|
}
|
|
353
376
|
}
|
|
354
377
|
|
|
355
378
|
/* A row's handle, in the section's margin at its left: there while the pointer
|
|
356
379
|
is level with the row, or the handle is held or has the keyboard. */
|
|
357
380
|
.studio-row-handle {
|
|
381
|
+
--studio-shown: 0;
|
|
358
382
|
display: flex;
|
|
359
383
|
align-items: center;
|
|
360
384
|
justify-content: center;
|
|
@@ -365,9 +389,9 @@
|
|
|
365
389
|
background: var(--background);
|
|
366
390
|
border-radius: 999px;
|
|
367
391
|
box-shadow: 0 0 0 1px var(--border);
|
|
368
|
-
opacity:
|
|
392
|
+
opacity: var(--studio-shown);
|
|
369
393
|
transition:
|
|
370
|
-
|
|
394
|
+
--studio-shown 120ms ease-out,
|
|
371
395
|
color 120ms ease-out,
|
|
372
396
|
background-color 120ms ease-out,
|
|
373
397
|
box-shadow 120ms ease-out;
|
|
@@ -387,7 +411,7 @@
|
|
|
387
411
|
.studio-canvas-item[data-dragging="true"] .studio-row-handle,
|
|
388
412
|
.studio-row-handle:hover,
|
|
389
413
|
.studio-row-handle:focus-visible {
|
|
390
|
-
|
|
414
|
+
--studio-shown: 1;
|
|
391
415
|
}
|
|
392
416
|
|
|
393
417
|
/* Under the pointer or held, it is the blue of the + in a gap. */
|
|
@@ -412,6 +436,7 @@
|
|
|
412
436
|
/* A stack's handle: the row's, turned on its side, above the stack's first
|
|
413
437
|
frame. It shows while the pointer is over the stack, and when held. */
|
|
414
438
|
.studio-stack-handle {
|
|
439
|
+
--studio-shown: 0;
|
|
415
440
|
display: flex;
|
|
416
441
|
align-items: center;
|
|
417
442
|
justify-content: center;
|
|
@@ -422,8 +447,8 @@
|
|
|
422
447
|
background: var(--background);
|
|
423
448
|
border-radius: 999px;
|
|
424
449
|
box-shadow: 0 0 0 1px var(--border);
|
|
425
|
-
opacity:
|
|
426
|
-
transition:
|
|
450
|
+
opacity: var(--studio-shown);
|
|
451
|
+
transition: --studio-shown 120ms ease-out;
|
|
427
452
|
}
|
|
428
453
|
|
|
429
454
|
.studio-stack-dots {
|
|
@@ -439,7 +464,7 @@
|
|
|
439
464
|
.studio-canvas-item[data-dragging="true"] .studio-stack-handle,
|
|
440
465
|
.studio-stack-handle:hover,
|
|
441
466
|
.studio-stack-handle:focus-visible {
|
|
442
|
-
|
|
467
|
+
--studio-shown: 1;
|
|
443
468
|
}
|
|
444
469
|
|
|
445
470
|
.studio-stack-handle:hover,
|
|
@@ -463,7 +488,7 @@
|
|
|
463
488
|
@media (hover: none) {
|
|
464
489
|
.studio-row-handle,
|
|
465
490
|
.studio-stack-handle {
|
|
466
|
-
|
|
491
|
+
--studio-shown: 1;
|
|
467
492
|
}
|
|
468
493
|
}
|
|
469
494
|
|
|
@@ -739,6 +764,7 @@
|
|
|
739
764
|
cursor: ns-resize;
|
|
740
765
|
}
|
|
741
766
|
|
|
767
|
+
/* How far it reaches past the frame is layout's RESIZE_REACH. */
|
|
742
768
|
.studio-resize[data-edge="corner"] {
|
|
743
769
|
right: calc(-6px / var(--zoom));
|
|
744
770
|
bottom: calc(-6px / var(--zoom));
|
|
@@ -781,37 +807,45 @@
|
|
|
781
807
|
and dark, that resizes both ways, shown while the frame is selected. The
|
|
782
808
|
edges resize too, with only the cursor to say so. */
|
|
783
809
|
.studio-resize[data-edge="corner"]::after {
|
|
810
|
+
--studio-shown: 0;
|
|
784
811
|
position: absolute;
|
|
785
812
|
inset: calc(2px / var(--zoom));
|
|
786
813
|
content: "";
|
|
787
814
|
background: white;
|
|
788
815
|
border: calc(1px / var(--zoom)) solid var(--studio-accent);
|
|
789
816
|
border-radius: calc(1px / var(--zoom));
|
|
790
|
-
opacity:
|
|
791
|
-
transition:
|
|
817
|
+
opacity: var(--studio-shown);
|
|
818
|
+
transition: --studio-shown 120ms ease-out;
|
|
792
819
|
}
|
|
793
820
|
|
|
794
821
|
.studio-frame[data-selected="true"] .studio-resize[data-edge="corner"]::after,
|
|
795
822
|
.studio-section-region[data-selected="true"]
|
|
796
823
|
.studio-resize[data-edge="corner"]::after {
|
|
797
|
-
|
|
824
|
+
--studio-shown: 1;
|
|
798
825
|
}
|
|
799
826
|
|
|
800
|
-
/* A selected frame's size, floating under it.
|
|
827
|
+
/* A selected frame's size, floating under it. Opaque, with no backdrop blur,
|
|
828
|
+
which would promote it (promoted-layers.test.ts). */
|
|
801
829
|
.studio-size-pill {
|
|
802
830
|
padding: 0.25rem;
|
|
803
|
-
background:
|
|
831
|
+
background: var(--background);
|
|
804
832
|
border-radius: 0.5rem;
|
|
805
833
|
box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
|
|
806
|
-
backdrop-filter: blur(8px);
|
|
807
834
|
transform-origin: top center;
|
|
808
835
|
animation: studio-pill-in 160ms cubic-bezier(0.2, 0, 0, 1);
|
|
809
836
|
}
|
|
810
837
|
|
|
838
|
+
/* In from a little above and a little smaller, by --studio-shown: by
|
|
839
|
+
transform, which a button's press (its scale) stacks with. */
|
|
840
|
+
:is(.studio-size-pill, .studio-size-reset) {
|
|
841
|
+
opacity: var(--studio-shown);
|
|
842
|
+
transform: translateY(calc((var(--studio-shown) - 1) * 4px))
|
|
843
|
+
scale(calc(0.97 + 0.03 * var(--studio-shown)));
|
|
844
|
+
}
|
|
845
|
+
|
|
811
846
|
@keyframes studio-pill-in {
|
|
812
847
|
from {
|
|
813
|
-
|
|
814
|
-
transform: translateY(-4px) scale(0.97);
|
|
848
|
+
--studio-shown: 0;
|
|
815
849
|
}
|
|
816
850
|
}
|
|
817
851
|
|
|
@@ -838,8 +872,9 @@
|
|
|
838
872
|
|
|
839
873
|
/* And comes back down onto the canvas as it gets there. */
|
|
840
874
|
.studio-canvas[data-settling="true"] .studio-artboard {
|
|
875
|
+
opacity: var(--studio-shown);
|
|
841
876
|
transition:
|
|
842
|
-
|
|
877
|
+
--studio-shown 200ms ease-out,
|
|
843
878
|
box-shadow 200ms ease-out;
|
|
844
879
|
}
|
|
845
880
|
|
|
@@ -5,6 +5,7 @@ import { cn } from "cn";
|
|
|
5
5
|
import type { ReactNode } from "react";
|
|
6
6
|
import type { Thread } from "../types";
|
|
7
7
|
import { commentWords } from "./agent-changes";
|
|
8
|
+
import { useIsHiddenThread } from "./comments";
|
|
8
9
|
import type { Notice } from "./inspect-tools";
|
|
9
10
|
|
|
10
11
|
// The canvas's notices at the top centre (what the person just did, such
|
|
@@ -109,7 +110,11 @@ export const ActionNotice = ({ notice }: { notice?: Notice }) => (
|
|
|
109
110
|
</>
|
|
110
111
|
);
|
|
111
112
|
|
|
112
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Where an agent's change landed: a green pin with a tick, opening the
|
|
115
|
+
* comment. It hides with the comment's pin (⇧C), and shows with it again
|
|
116
|
+
* when the comment is opened since.
|
|
117
|
+
*/
|
|
113
118
|
export const AgentPin = ({
|
|
114
119
|
onOpen,
|
|
115
120
|
thread,
|
|
@@ -118,6 +123,10 @@ export const AgentPin = ({
|
|
|
118
123
|
thread: Thread;
|
|
119
124
|
}) => {
|
|
120
125
|
const { t } = useLingui();
|
|
126
|
+
const hidden = useIsHiddenThread(thread.id);
|
|
127
|
+
if (hidden) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
121
130
|
const words = commentWords(thread);
|
|
122
131
|
return (
|
|
123
132
|
<button
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import type { Frame, ThreadTarget } from "../types";
|
|
9
9
|
import { elementTarget, frameTarget, type Point } from "./anchoring";
|
|
10
10
|
import { useCanvas } from "./canvas-context";
|
|
11
|
+
import { takeKeyboardFrom } from "./canvas-input";
|
|
11
12
|
import { type CommentKey, commentKey } from "./canvas-keys";
|
|
12
13
|
import { useCanvasUi } from "./canvas-ui";
|
|
13
14
|
import { useLoadedCommands } from "./command-menu";
|
|
@@ -294,7 +295,7 @@ export const CommentLayer = ({
|
|
|
294
295
|
}
|
|
295
296
|
const focused = document.activeElement;
|
|
296
297
|
if (focused instanceof HTMLIFrameElement) {
|
|
297
|
-
focused
|
|
298
|
+
takeKeyboardFrom(focused);
|
|
298
299
|
}
|
|
299
300
|
const onKeyDown = (event: KeyboardEvent) => {
|
|
300
301
|
const action = isTyping(event.target) ? undefined : commentKey(event);
|