@dexhq/canvas 0.17.0 → 0.18.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 +31 -0
- package/app/canvas/canvas-commands.ts +2 -10
- package/app/canvas/canvas-context.tsx +11 -2
- package/app/canvas/canvas-document.ts +5 -1
- package/app/canvas/canvas-keys.ts +1 -1
- package/app/canvas/canvas-model.ts +195 -20
- package/app/canvas/canvas-scene.ts +176 -171
- package/app/canvas/canvas-ui.ts +4 -11
- package/app/canvas/canvas.css +159 -179
- package/app/canvas/change-pictures.tsx +156 -0
- package/app/canvas/comment-drafts.ts +31 -0
- package/app/canvas/comment-layer.tsx +125 -71
- package/app/canvas/comments.tsx +38 -2
- package/app/canvas/element-picker.ts +20 -0
- package/app/canvas/engine/canvas-gestures.ts +15 -3
- package/app/canvas/engine/canvas-store.ts +5 -0
- package/app/canvas/engine/canvas-view.tsx +22 -5
- package/app/canvas/find-bar.tsx +57 -41
- package/app/canvas/flow-canvas.tsx +147 -272
- package/app/canvas/frame-copies.ts +14 -17
- package/app/canvas/frame-drops.ts +15 -7
- package/app/canvas/frame-inspector.ts +192 -41
- package/app/canvas/frame-node.tsx +123 -75
- package/app/canvas/frame-resize.tsx +321 -83
- package/app/canvas/insert-hint.tsx +5 -15
- package/app/canvas/inspect-layer.tsx +73 -19
- package/app/canvas/label-action.tsx +13 -2
- package/app/canvas/layout.ts +233 -98
- package/app/canvas/live-page.ts +5 -0
- package/app/canvas/new-frame.ts +10 -25
- package/app/canvas/note-placing.ts +55 -84
- package/app/canvas/picked-box.tsx +5 -0
- package/app/canvas/picks-menu.tsx +3 -9
- package/app/canvas/readable-colour.ts +52 -0
- package/app/canvas/request-node.tsx +19 -10
- package/app/canvas/scrolling-page.ts +45 -0
- package/app/canvas/section-node.tsx +36 -53
- package/app/canvas/settle.ts +21 -0
- package/app/canvas/snapping.ts +96 -8
- package/app/canvas/spec-frame.tsx +8 -5
- package/app/canvas/spot-pins.tsx +15 -3
- package/app/canvas/stack-frame.tsx +13 -57
- package/app/canvas/stack-model.ts +5 -0
- package/app/canvas/stack-toggle.tsx +89 -0
- package/app/canvas/styles-layer.tsx +23 -43
- package/app/canvas/text-layer.tsx +26 -10
- package/app/canvas/thread-focus.tsx +18 -1
- package/app/canvas/tool-cursors.ts +2 -2
- package/app/canvas/toolbar-parts.tsx +48 -8
- package/app/canvas/toolbar.tsx +12 -10
- package/app/canvas/use-canvas-clipboard.tsx +13 -5
- package/app/canvas/use-reveal.ts +86 -0
- package/app/editor/extensions.ts +2 -0
- package/app/editor/line-break-caret.ts +57 -0
- package/app/git/branch-panel.tsx +61 -20
- package/app/i18n/locales/en/messages.po +64 -17
- package/app/i18n/locales/en/messages.ts +1 -1
- package/app/i18n/locales/pseudo/messages.po +64 -17
- package/app/i18n/locales/pseudo/messages.ts +1 -1
- package/app/icons/glyphs.tsx +2 -0
- package/app/live/studio-live.ts +29 -9
- package/app/pages/canvas.tsx +1 -1
- package/app/pages/commands-settings.tsx +70 -76
- package/app/pages/play-bar.tsx +6 -11
- package/app/pages/play.tsx +52 -33
- package/app/shell/feedback-form.tsx +29 -5
- package/app/ui/prompt-editor.tsx +2 -0
- package/app/ui/use-field-list.ts +90 -0
- package/dist/cli/commands/mcp.mjs +6 -4
- package/dist/cli/mcp-relay.mjs +10 -6
- package/dist/content/content.d.mts +26 -9
- package/dist/content/content.mjs +65 -8
- package/dist/content/screenshot.d.mts +2 -0
- package/dist/content/screenshot.mjs +3 -0
- package/dist/content/snapshot-client.d.mts +2 -0
- package/dist/content/snapshot-client.mjs +12 -1
- package/dist/inspector.js +96 -19
- package/dist/paste/paste.d.mts +5 -0
- package/dist/paste/paste.mjs +7 -2
- package/dist/server/agent-tools.d.mts +1 -0
- package/dist/server/agent-tools.mjs +4 -3
- package/dist/server/change-picture-store.d.mts +13 -0
- package/dist/server/change-picture-store.mjs +42 -0
- package/dist/server/change-pictures.d.mts +25 -0
- package/dist/server/change-pictures.mjs +104 -0
- package/dist/server/close-check.d.mts +11 -0
- package/dist/server/close-check.mjs +37 -5
- package/dist/server/comments/agent-actions.d.mts +8 -4
- package/dist/server/comments/agent-actions.mjs +16 -7
- package/dist/server/comments/close-tools.mjs +7 -5
- package/dist/server/comments/files.d.mts +5 -1
- package/dist/server/comments/hand-out.d.mts +1 -1
- package/dist/server/comments/hand-out.mjs +4 -1
- package/dist/server/comments/push.d.mts +19 -10
- package/dist/server/comments/push.mjs +45 -30
- package/dist/server/comments/studio-files.d.mts +14 -1
- package/dist/server/comments/studio-files.mjs +44 -31
- package/dist/server/comments/tools.d.mts +1 -1
- package/dist/server/comments/workspace.mjs +1 -0
- package/dist/server/dev-server.mjs +34 -0
- package/dist/server/own-copies.mjs +4 -23
- package/dist/server/requests.mjs +57 -3
- package/dist/server/response-budget.d.mts +2 -1
- package/dist/server/response-budget.mjs +4 -3
- package/dist/server/roster.d.mts +19 -8
- package/dist/server/roster.mjs +50 -22
- package/dist/server/studio-for.d.mts +7 -0
- package/dist/server/studio-for.mjs +23 -7
- package/dist/server/thread-forms.d.mts +3 -0
- package/dist/server/thread-forms.mjs +21 -1
- package/dist/server/tools/place-frame.d.mts +1 -0
- package/dist/server/tools/place-frame.mjs +33 -9
- package/dist/server/tools/result.mjs +2 -2
- package/dist/server/tools/snapshot.d.mts +1 -1
- package/dist/server/tools/snapshot.mjs +2 -1
- package/dist/server/tools/studio-context.d.mts +2 -1
- package/dist/server/tools/studio-context.mjs +2 -1
- package/dist/server/tools/watch.mjs +29 -12
- package/dist/server/work-groups.mjs +1 -1
- package/dist/shared/canvas-core.d.mts +39 -5
- package/dist/shared/canvas-core.mjs +60 -15
- package/dist/shared/canvas-file.d.mts +7 -4
- package/dist/shared/change-pictures-core.d.mts +6 -0
- package/dist/shared/change-pictures-core.mjs +5 -0
- package/dist/shared/page-looks.d.mts +12 -0
- package/dist/shared/page-looks.mjs +49 -0
- package/dist/shared/snapshot-clipboard.d.mts +6 -0
- package/dist/shared/studio-routes.d.mts +11 -0
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/picker.js +114 -108
- package/package.json +4 -3
- package/src/cli/commands/mcp.ts +18 -8
- package/src/cli/mcp-relay.ts +13 -6
- package/src/content/content.ts +90 -16
- package/src/content/screenshot.ts +9 -1
- package/src/content/snapshot-client.ts +17 -0
- package/src/paste/paste.ts +18 -1
- package/src/server/agent-tools.ts +5 -4
- package/src/server/change-picture-store.ts +71 -0
- package/src/server/change-pictures.ts +244 -0
- package/src/server/close-check.ts +69 -6
- package/src/server/comments/agent-actions.ts +51 -12
- package/src/server/comments/close-tools.ts +20 -10
- package/src/server/comments/files.ts +10 -2
- package/src/server/comments/hand-out.ts +2 -2
- package/src/server/comments/push.ts +94 -46
- package/src/server/comments/studio-files.ts +77 -46
- package/src/server/comments/workspace.ts +1 -0
- package/src/server/dev-server.ts +70 -0
- package/src/server/own-copies.ts +5 -33
- package/src/server/requests.ts +84 -4
- package/src/server/response-budget.ts +5 -3
- package/src/server/roster.ts +78 -28
- package/src/server/studio-for.ts +32 -7
- package/src/server/thread-forms.ts +41 -1
- package/src/server/tools/place-frame.ts +71 -14
- package/src/server/tools/result.ts +2 -2
- package/src/server/tools/snapshot.ts +2 -1
- package/src/server/tools/studio-context.ts +24 -14
- package/src/server/tools/watch.ts +38 -13
- package/src/server/work-groups.ts +1 -1
- package/src/shared/canvas-core.ts +119 -27
- package/src/shared/canvas-file.ts +7 -4
- package/src/shared/change-pictures-core.ts +8 -0
- package/src/shared/page-looks.ts +133 -0
- package/src/shared/snapshot-clipboard.ts +6 -0
- package/src/shared/studio-routes.ts +7 -1
- package/templates/agents/dex-worker.md +9 -7
- package/templates/feedback-workflow.md +1 -1
- package/templates/methods/review.md +7 -6
- package/templates/rules/canvas-frames.md +8 -7
- package/templates/rules/canvas.md +10 -8
- package/templates/rules/prototypes.md +5 -3
- package/app/canvas/stack-node.tsx +0 -100
package/app/canvas/find-bar.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import { flushSync } from "react-dom";
|
|
|
17
17
|
import { withBase } from "../base";
|
|
18
18
|
import { problemsOf } from "../live/studio-action";
|
|
19
19
|
import { studioRequest } from "../live/studio-request";
|
|
20
|
+
import { type FieldList, useFieldList } from "../ui/use-field-list.ts";
|
|
20
21
|
import { COVERS_CANVAS } from "./canvas-clipboard.ts";
|
|
21
22
|
import { useCanvas } from "./canvas-context";
|
|
22
23
|
import { isFindKey } from "./canvas-keys.ts";
|
|
@@ -294,38 +295,31 @@ const HitRow = ({
|
|
|
294
295
|
current,
|
|
295
296
|
hit,
|
|
296
297
|
length,
|
|
297
|
-
|
|
298
|
+
option,
|
|
298
299
|
}: {
|
|
299
300
|
current: boolean;
|
|
300
301
|
hit: Hit;
|
|
301
302
|
length: number;
|
|
302
|
-
|
|
303
|
+
option: ReturnType<FieldList["option"]>;
|
|
303
304
|
}) => {
|
|
304
305
|
const { before, match, after } = snippet(hit, length);
|
|
305
306
|
|
|
306
307
|
return (
|
|
307
|
-
<
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
<div
|
|
309
|
+
{...option}
|
|
310
|
+
className="studio-small text-muted-foreground hover:bg-studio-hover aria-selected:bg-studio-hover aria-selected:text-foreground block w-full cursor-default truncate rounded-md px-2 py-1 text-left"
|
|
311
|
+
>
|
|
312
|
+
{before}
|
|
313
|
+
<mark
|
|
310
314
|
className={cn(
|
|
311
|
-
"
|
|
312
|
-
current
|
|
315
|
+
"rounded-xs text-[#0a0a0a]",
|
|
316
|
+
current ? "bg-[#ffd34d]" : "bg-[#ffd34d]/45"
|
|
313
317
|
)}
|
|
314
|
-
onClick={onPick}
|
|
315
|
-
type="button"
|
|
316
318
|
>
|
|
317
|
-
{
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
current ? "bg-[#ffd34d]" : "bg-[#ffd34d]/45"
|
|
322
|
-
)}
|
|
323
|
-
>
|
|
324
|
-
{match}
|
|
325
|
-
</mark>
|
|
326
|
-
{after}
|
|
327
|
-
</button>
|
|
328
|
-
</li>
|
|
319
|
+
{match}
|
|
320
|
+
</mark>
|
|
321
|
+
{after}
|
|
322
|
+
</div>
|
|
329
323
|
);
|
|
330
324
|
};
|
|
331
325
|
|
|
@@ -672,13 +666,14 @@ const HitList = ({
|
|
|
672
666
|
at,
|
|
673
667
|
hits,
|
|
674
668
|
length,
|
|
675
|
-
|
|
669
|
+
list,
|
|
676
670
|
}: {
|
|
677
671
|
at: number;
|
|
678
672
|
hits: readonly Hit[];
|
|
679
673
|
length: number;
|
|
680
|
-
|
|
674
|
+
list: FieldList;
|
|
681
675
|
}) => {
|
|
676
|
+
const { t } = useLingui();
|
|
682
677
|
const groups = hitsByFrame(hits.slice(0, LISTED));
|
|
683
678
|
|
|
684
679
|
if (groups.length === 0) {
|
|
@@ -686,24 +681,29 @@ const HitList = ({
|
|
|
686
681
|
}
|
|
687
682
|
|
|
688
683
|
return (
|
|
689
|
-
<div
|
|
684
|
+
<div
|
|
685
|
+
{...list.listbox}
|
|
686
|
+
aria-label={t`Matches`}
|
|
687
|
+
className="border-studio-edge mt-[3px] max-h-64 overflow-y-auto overscroll-contain border-t px-1 pt-1 pb-0.5"
|
|
688
|
+
>
|
|
690
689
|
{groups.map((group) => (
|
|
691
|
-
<
|
|
692
|
-
<
|
|
690
|
+
<div {...list.group(group.title)} key={group.frame}>
|
|
691
|
+
<div
|
|
692
|
+
aria-hidden
|
|
693
|
+
className="studio-label text-muted-foreground truncate px-2 pt-1.5 pb-0.5"
|
|
694
|
+
>
|
|
693
695
|
{group.title}
|
|
694
|
-
</
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
</ul>
|
|
706
|
-
</section>
|
|
696
|
+
</div>
|
|
697
|
+
{group.hits.map(({ at: index, hit }) => (
|
|
698
|
+
<HitRow
|
|
699
|
+
current={index === at}
|
|
700
|
+
hit={hit}
|
|
701
|
+
key={`${hit.frame}:${hit.index}`}
|
|
702
|
+
length={length}
|
|
703
|
+
option={list.option(index)}
|
|
704
|
+
/>
|
|
705
|
+
))}
|
|
706
|
+
</div>
|
|
707
707
|
))}
|
|
708
708
|
</div>
|
|
709
709
|
);
|
|
@@ -771,11 +771,22 @@ export const FindBar = ({ writable }: { writable: boolean }) => {
|
|
|
771
771
|
|
|
772
772
|
const stepBy = (by: 1 | -1) => go(stepHit(at, by, count));
|
|
773
773
|
|
|
774
|
+
const listedAt = at < LISTED ? at : undefined;
|
|
775
|
+
|
|
776
|
+
const list = useFieldList({
|
|
777
|
+
active: listedAt,
|
|
778
|
+
expanded: open && count > 0,
|
|
779
|
+
onMove: stepBy,
|
|
780
|
+
onPick: go,
|
|
781
|
+
});
|
|
782
|
+
|
|
774
783
|
const close = () => {
|
|
775
784
|
setOpen(false);
|
|
776
785
|
setStatus(undefined);
|
|
777
786
|
};
|
|
778
787
|
|
|
788
|
+
const findKeys = fieldKeys(close, (shift) => stepBy(shift ? -1 : 1));
|
|
789
|
+
|
|
779
790
|
const replace = () => {
|
|
780
791
|
if (busy || reading || count === 0) {
|
|
781
792
|
return;
|
|
@@ -845,13 +856,18 @@ export const FindBar = ({ writable }: { writable: boolean }) => {
|
|
|
845
856
|
/>
|
|
846
857
|
)}
|
|
847
858
|
<input
|
|
859
|
+
{...list.field}
|
|
848
860
|
aria-label={t`Find`}
|
|
849
861
|
className={FIELD}
|
|
850
862
|
onChange={(event) => {
|
|
851
863
|
setQuery(event.target.value);
|
|
852
864
|
go(0);
|
|
853
865
|
}}
|
|
854
|
-
onKeyDown={
|
|
866
|
+
onKeyDown={(event) => {
|
|
867
|
+
if (!list.moves(event)) {
|
|
868
|
+
findKeys(event);
|
|
869
|
+
}
|
|
870
|
+
}}
|
|
855
871
|
placeholder={t`Find on the frames`}
|
|
856
872
|
ref={findField}
|
|
857
873
|
spellCheck={false}
|
|
@@ -908,7 +924,7 @@ export const FindBar = ({ writable }: { writable: boolean }) => {
|
|
|
908
924
|
{status ? (
|
|
909
925
|
<StatusLine busy={busy} onUndo={undo} status={status} />
|
|
910
926
|
) : null}
|
|
911
|
-
<HitList at={at} hits={found.hits} length={query.length}
|
|
927
|
+
<HitList at={at} hits={found.hits} length={query.length} list={list} />
|
|
912
928
|
</search>
|
|
913
929
|
</div>
|
|
914
930
|
);
|