@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
|
@@ -209,16 +209,19 @@ const kinded = (frame) => ({
|
|
|
209
209
|
/** Whether a frame is a note: a spec frame whose file is a note's. */
|
|
210
210
|
const isNoteFrame = (frame) => frameKind(frame) === "spec" && isNotePath(frame.spec);
|
|
211
211
|
/**
|
|
212
|
-
* Whether a frame is a section header: a note marked `header`,
|
|
213
|
-
*
|
|
212
|
+
* Whether a frame is a section header: a note marked `header`, its words
|
|
213
|
+
* large, placed as any note is and filling what it is in (layout.ts).
|
|
214
214
|
*/
|
|
215
215
|
const isHeaderFrame = (frame) => frame.header === true && isNoteFrame(frame);
|
|
216
216
|
/**
|
|
217
217
|
* A section's one frame, when it stands on its own (`at`) with nothing else:
|
|
218
|
-
* where a section header
|
|
218
|
+
* where a section header across the canvas is.
|
|
219
219
|
*/
|
|
220
220
|
const aloneIn = (section, frames) => placedAt(section) && frames.length === 1 ? frames[0] : void 0;
|
|
221
|
-
/**
|
|
221
|
+
/**
|
|
222
|
+
* Whether a section is a section header standing on its own: a band across
|
|
223
|
+
* the canvas's content, splitting it into parts (layout.ts).
|
|
224
|
+
*/
|
|
222
225
|
const isHeaderSection = (section) => {
|
|
223
226
|
const frame = aloneIn(section, section.rows.flatMap((row) => row.frames));
|
|
224
227
|
return frame !== void 0 && isHeaderFrame(frame);
|
|
@@ -600,7 +603,8 @@ const stackSectionPiles = (section) => {
|
|
|
600
603
|
/**
|
|
601
604
|
* The cell a request for a new view fills: a step in its row, or in a new
|
|
602
605
|
* row, right above the row `above` names (a step in a row has no row to go
|
|
603
|
-
* above), else at the end of the section.
|
|
606
|
+
* above), else at the end of the section. An agent's may leave the step out
|
|
607
|
+
* (AskedCell).
|
|
604
608
|
*/
|
|
605
609
|
const requestCell = ({ above, row, section, step }) => {
|
|
606
610
|
if (row) return {
|
|
@@ -617,6 +621,55 @@ const requestCell = ({ above, row, section, step }) => {
|
|
|
617
621
|
step
|
|
618
622
|
};
|
|
619
623
|
};
|
|
624
|
+
/** A row's frames, or none when the section or row is not there. */
|
|
625
|
+
const rowFrames = (canvas, section, row) => canvas.sections.find((entry) => entry.id === section)?.rows.find((entry) => row !== void 0 && entry.id === row)?.frames ?? [];
|
|
626
|
+
/**
|
|
627
|
+
* The step of a cell an agent asks for: its own, when given; else the step
|
|
628
|
+
* right of `after`, or the free step at the end of its row and of `past`
|
|
629
|
+
* (the row it was asked in, when the frame goes in a row of the person's
|
|
630
|
+
* own below it). A frame for the view already in the row from there on is
|
|
631
|
+
* kept where it is, so asking again finds it. A new row's free step is its
|
|
632
|
+
* first.
|
|
633
|
+
*/
|
|
634
|
+
function stepAsked(canvas, cell, view, past) {
|
|
635
|
+
if (cell.step !== void 0) return cell.step;
|
|
636
|
+
const frames = rowFrames(canvas, cell.section, cell.row);
|
|
637
|
+
const steps = stepsOf(frames);
|
|
638
|
+
const from = (cell.after ?? 0) + 1;
|
|
639
|
+
const kept = steps.find((step, index) => {
|
|
640
|
+
const frame = frames[index];
|
|
641
|
+
return step >= from && frame !== void 0 && frameKind(frame) === "view" && frame.view === view;
|
|
642
|
+
});
|
|
643
|
+
if (kept !== void 0) return kept;
|
|
644
|
+
if (cell.after !== void 0) return cell.after + 1;
|
|
645
|
+
const ends = [cell.row, past].map((row) => Math.max(0, ...stepsOf(rowFrames(canvas, cell.section, row))));
|
|
646
|
+
return Math.max(...ends) + 1;
|
|
647
|
+
}
|
|
648
|
+
/** Where the frame with a key is in its row; undefined when none has it. */
|
|
649
|
+
const whereInRow = (canvas, key) => {
|
|
650
|
+
const { section, row, frame } = parseFrameKey(key);
|
|
651
|
+
const frames = rowFrames(canvas, section, row);
|
|
652
|
+
const steps = stepsOf(frames);
|
|
653
|
+
const step = steps[frames.findIndex((entry) => entry.id === frame)];
|
|
654
|
+
if (step === void 0) return;
|
|
655
|
+
const left = Math.max(0, ...frames.flatMap((entry, index) => {
|
|
656
|
+
const at = steps[index] ?? 0;
|
|
657
|
+
return at < step && !isWordsFrame(entry) ? [at] : [];
|
|
658
|
+
}));
|
|
659
|
+
const top = left > 0 ? stackTopIn({ frames }, {
|
|
660
|
+
section,
|
|
661
|
+
row,
|
|
662
|
+
step: left
|
|
663
|
+
}) : void 0;
|
|
664
|
+
return top === void 0 ? { step } : {
|
|
665
|
+
step,
|
|
666
|
+
rightOf: frameKey({
|
|
667
|
+
section,
|
|
668
|
+
row,
|
|
669
|
+
frame: top
|
|
670
|
+
})
|
|
671
|
+
};
|
|
672
|
+
};
|
|
620
673
|
/**
|
|
621
674
|
* Put a new row among a section's rows: right above the row `above` names,
|
|
622
675
|
* as the + on the line between two rows asks, else below the others.
|
|
@@ -909,14 +962,6 @@ const placeProblems = (section, where) => {
|
|
|
909
962
|
if (size !== void 0 && !(isPositive(size?.width) && isPositive(size?.height))) problems.push(`${where}: "size" needs a width and height in pixels`);
|
|
910
963
|
return problems;
|
|
911
964
|
};
|
|
912
|
-
/**
|
|
913
|
-
* A section header is a band across the whole canvas: it stands on its own,
|
|
914
|
-
* the one frame of a section with `at`, never in a section's cells.
|
|
915
|
-
*/
|
|
916
|
-
const headerPlaceProblems = (section, where) => {
|
|
917
|
-
const frames = (section?.rows ?? []).flatMap((row) => row?.frames ?? []);
|
|
918
|
-
return frames.some((frame) => frame?.header !== void 0) && aloneIn(section ?? {}, frames) === void 0 ? [`${where}: a section header stands on its own, outside any section`] : [];
|
|
919
|
-
};
|
|
920
965
|
/** Check a canvas against the views and docs that exist. */
|
|
921
966
|
function canvasProblems(canvas, known) {
|
|
922
967
|
const sections = canvas?.sections;
|
|
@@ -928,7 +973,7 @@ function canvasProblems(canvas, known) {
|
|
|
928
973
|
if (!isSlug(section?.id) || sectionIds.has(section?.id)) problems.push(`${where}: "id" must be unique and kebab-case`);
|
|
929
974
|
sectionIds.add(section?.id);
|
|
930
975
|
if (!isText(section?.title)) problems.push(`${where}: "title" is required`);
|
|
931
|
-
problems.push(...placeProblems(section, where)
|
|
976
|
+
problems.push(...placeProblems(section, where));
|
|
932
977
|
const rowIds = /* @__PURE__ */ new Set();
|
|
933
978
|
for (const row of section?.rows ?? []) {
|
|
934
979
|
if (!isText(row?.id) || rowIds.has(row.id)) problems.push(`${where} › row "${row?.id}": "id" must be unique`);
|
|
@@ -997,4 +1042,4 @@ function foldRowTitles(canvas) {
|
|
|
997
1042
|
};
|
|
998
1043
|
}
|
|
999
1044
|
//#endregion
|
|
1000
|
-
export { NOTE_SIZE, OWN_FRAME_TITLE, SLIDE_GRID, SLIDE_LAYOUTS, SLIDE_SIZE, SPEC_SIZE, VIEWPORTS, addRowAbove, appendOwnFrame, appendRow, appendSection, canvasFormProblems, canvasFrames, canvasProblems, emptyRow, foldRowTitles, foldedTitle, frameKey, frameKind, frameTitle, humanise, idFor, insertAt, insertInCell, insertRowBelow, insertUnder, isFrameUid, isHeaderFrame, isHeaderSection, isNoteFrame, isNotePath, isSlideFrame, isSlideLayout, isSlidePath, isSnapshotImage, isSpecPath, isWordsFrame, kinded, legacyFrameUid, madeInNewerDex, newFrameUid, newerKindOf, normaliseRow, parseFrameKey, pinSteps, placeFrameInCell, placeViewInCell, placedAt, requestCell, sameCell, sectionPosition, sizeForCell, sizedView, specName, specSizeOf, stackPiles, stepsOf, uniqueId, unknownReason, viewFramePage, viewOf };
|
|
1045
|
+
export { NOTE_SIZE, OWN_FRAME_TITLE, SLIDE_GRID, SLIDE_LAYOUTS, SLIDE_SIZE, SPEC_SIZE, VIEWPORTS, addRowAbove, appendOwnFrame, appendRow, appendSection, canvasFormProblems, canvasFrames, canvasProblems, emptyRow, foldRowTitles, foldedTitle, frameKey, frameKind, frameTitle, humanise, idFor, insertAt, insertInCell, insertRowBelow, insertUnder, isFrameUid, isHeaderFrame, isHeaderSection, isNoteFrame, isNotePath, isSlideFrame, isSlideLayout, isSlidePath, isSnapshotImage, isSpecPath, isWordsFrame, kinded, legacyFrameUid, madeInNewerDex, newFrameUid, newerKindOf, normaliseRow, parseFrameKey, pinSteps, placeFrameInCell, placeViewInCell, placedAt, requestCell, sameCell, sectionPosition, sizeForCell, sizedView, specName, specSizeOf, stackPiles, stepAsked, stepsOf, uniqueId, unknownReason, viewFramePage, viewOf, whereInRow };
|
|
@@ -78,10 +78,13 @@ export interface DocFrame extends FrameBase {
|
|
|
78
78
|
export interface SpecFrame extends FrameBase {
|
|
79
79
|
doc?: undefined;
|
|
80
80
|
/**
|
|
81
|
-
* A note drawn as a section header
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
81
|
+
* A note drawn as a section header, its words large. It goes where any
|
|
82
|
+
* note goes: in a section's cells, where it fills the section from its
|
|
83
|
+
* column to the right edge of its frames; or on its own (a section with
|
|
84
|
+
* `at`), a band across the canvas's content that splits it into parts.
|
|
85
|
+
* Its `size.width`, once resized, is its own. Only a note
|
|
86
|
+
* (people/<person>/notes/) has one; an older Dex shows it as the note it
|
|
87
|
+
* is.
|
|
85
88
|
*/
|
|
86
89
|
header?: true;
|
|
87
90
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/shared/change-pictures-core.d.ts
|
|
2
|
+
export declare const MOMENTS: readonly ["before", "after"];
|
|
3
|
+
export type Moment = (typeof MOMENTS)[number];
|
|
4
|
+
export type KeptPictures = Partial<Record<Moment, number>>;
|
|
5
|
+
export declare const isMoment: (value: string | null) => value is Moment;
|
|
6
|
+
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/shared/page-looks.d.ts
|
|
2
|
+
export interface PageLooks {
|
|
3
|
+
blank: boolean;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LooksSelectors {
|
|
7
|
+
brokenViewNote: string;
|
|
8
|
+
viewRoot: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LOOKS_SELECTORS: LooksSelectors;
|
|
11
|
+
export declare const pageLooks: ({ brokenViewNote, viewRoot }: LooksSelectors) => PageLooks;
|
|
12
|
+
//#endregion
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { VIEW_BROKE, VIEW_ROOT } from "./page-messages.mjs";
|
|
2
|
+
//#region src/shared/page-looks.ts
|
|
3
|
+
const LOOKS_SELECTORS = {
|
|
4
|
+
brokenViewNote: `[${VIEW_BROKE}]`,
|
|
5
|
+
viewRoot: `[${VIEW_ROOT}]`
|
|
6
|
+
};
|
|
7
|
+
const pageLooks = ({ brokenViewNote, viewRoot }) => {
|
|
8
|
+
const longestError = 500;
|
|
9
|
+
const textNode = 3;
|
|
10
|
+
const spaces = /\s+/gu;
|
|
11
|
+
const pixels = /px$/u;
|
|
12
|
+
const media = "img, svg, canvas, video, picture, iframe, object, embed, input, textarea, select, button, [role=img]";
|
|
13
|
+
const unpainted = /* @__PURE__ */ new Set([
|
|
14
|
+
"",
|
|
15
|
+
"none",
|
|
16
|
+
"transparent",
|
|
17
|
+
"rgba(0, 0, 0, 0)"
|
|
18
|
+
]);
|
|
19
|
+
const tidy = (text) => (text ?? "").replaceAll(spaces, " ").trim();
|
|
20
|
+
const note = document.querySelector(brokenViewNote);
|
|
21
|
+
const overlay = document.querySelector("vite-error-overlay");
|
|
22
|
+
const noteLines = note ? [...note.children].flatMap((line) => {
|
|
23
|
+
const text = tidy(line.textContent);
|
|
24
|
+
return text ? [text] : [];
|
|
25
|
+
}).join(" ") : void 0;
|
|
26
|
+
const overlayMessage = overlay ? tidy((overlay.shadowRoot?.querySelector(".message") ?? overlay).textContent) || "Vite's error overlay shows." : void 0;
|
|
27
|
+
const error = noteLines ?? overlayMessage;
|
|
28
|
+
const view = document.querySelector(viewRoot) ?? document.body;
|
|
29
|
+
const pageBackground = getComputedStyle(view).backgroundColor;
|
|
30
|
+
const paintedApart = (element) => {
|
|
31
|
+
const style = getComputedStyle(element);
|
|
32
|
+
const { backgroundColor, backgroundImage, boxShadow } = style;
|
|
33
|
+
return [
|
|
34
|
+
[style.borderTopStyle, style.borderTopWidth],
|
|
35
|
+
[style.borderRightStyle, style.borderRightWidth],
|
|
36
|
+
[style.borderBottomStyle, style.borderBottomWidth],
|
|
37
|
+
[style.borderLeftStyle, style.borderLeftWidth]
|
|
38
|
+
].some(([lineStyle, width]) => !unpainted.has(lineStyle) && Number(width.replace(pixels, "")) > 0) || !unpainted.has(boxShadow) || !unpainted.has(backgroundImage) || !unpainted.has(backgroundColor) && backgroundColor !== pageBackground;
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
blank: ![view, ...view.querySelectorAll("*")].filter((element) => {
|
|
42
|
+
const { height, width } = element.getBoundingClientRect();
|
|
43
|
+
return height > 0 && width > 0;
|
|
44
|
+
}).some((element) => [...element.childNodes].some((node) => node.nodeType === textNode && tidy(node.textContent) !== "") || element.matches(media) || element.shadowRoot !== null || paintedApart(element)),
|
|
45
|
+
...error !== void 0 && { error: error.slice(0, longestError) }
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { LOOKS_SELECTORS, pageLooks };
|
|
@@ -46,6 +46,12 @@ export interface Capture {
|
|
|
46
46
|
height: number;
|
|
47
47
|
width: number;
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* How many of its elements the page sized or placed on the element, in
|
|
51
|
+
* pixels, as its scripts do when they lay it out: they keep that size, and
|
|
52
|
+
* don't reflow when the frame is resized.
|
|
53
|
+
*/
|
|
54
|
+
sizedByScripts?: number;
|
|
49
55
|
source?: {
|
|
50
56
|
title?: string;
|
|
51
57
|
url?: string;
|
|
@@ -8,7 +8,9 @@ import { Devices } from "./devices.mjs";
|
|
|
8
8
|
import { AgentLaunch, Launched } from "../harness/src/connect/launched.mjs";
|
|
9
9
|
import { AvatarFile } from "./avatar-file.mjs";
|
|
10
10
|
import { BuildSettings } from "./build-settings.mjs";
|
|
11
|
+
import { KeptPictures } from "./change-pictures-core.mjs";
|
|
11
12
|
import { CommentAnswers, CommentBodies } from "./comments/routes.mjs";
|
|
13
|
+
import { PageLooks } from "./page-looks.mjs";
|
|
12
14
|
import { RemovedView } from "./removed-views-core.mjs";
|
|
13
15
|
import { ReviewImport } from "./review-file.mjs";
|
|
14
16
|
import { ConnectedAgent } from "../harness/src/events/connected-agent.mjs";
|
|
@@ -441,6 +443,14 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> extends CommentA
|
|
|
441
443
|
large?: true;
|
|
442
444
|
};
|
|
443
445
|
};
|
|
446
|
+
"change-picture": {
|
|
447
|
+
GET: Blob;
|
|
448
|
+
PUT: Done;
|
|
449
|
+
DELETE: Done;
|
|
450
|
+
};
|
|
451
|
+
"change-pictures": {
|
|
452
|
+
GET: KeptPictures;
|
|
453
|
+
};
|
|
444
454
|
/**
|
|
445
455
|
* Comment commands: Dex's and the team's. POST saves one's file, PUT
|
|
446
456
|
* turns one on or off in the / menu, DELETE ?name= removes the team's file.
|
|
@@ -697,6 +707,7 @@ export interface StudioAnswers<Own extends OwnTypes = OwnTypes> extends CommentA
|
|
|
697
707
|
snapshot: {
|
|
698
708
|
POST: {
|
|
699
709
|
image: string;
|
|
710
|
+
looks: PageLooks;
|
|
700
711
|
problems: string[];
|
|
701
712
|
};
|
|
702
713
|
};
|