@parity-app/cli 0.5.1 → 0.6.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/dist/bin.mjs +22 -3
- package/package.json +1 -1
- package/skills/SKILL.md +3 -2
- package/skills/execute.md +30 -6
package/dist/bin.mjs
CHANGED
|
@@ -180,7 +180,7 @@ const warningGroupsSchema = {
|
|
|
180
180
|
properties: {
|
|
181
181
|
category: {
|
|
182
182
|
type: "string",
|
|
183
|
-
description: "Stable: render_failed, unknown_component, unknown_component_design, unknown_prop, invalid_option, not_a_token, not_a_length_token, overlap, kind_changed or unnamed_layout."
|
|
183
|
+
description: "Stable: render_failed, unknown_component, unknown_component_design, unknown_prop, invalid_option, not_a_token, not_a_length_token, overlap, title_clearance, canvas_overlaps, kind_changed or unnamed_layout. overlap and title_clearance cover boards this call created, changed or moved: overlap when two boards collide, title_clearance when they're clear but one's title covers the other. canvas_overlaps counts the rest of the canvas's; call Overlaps() to check every board."
|
|
184
184
|
},
|
|
185
185
|
severity: {
|
|
186
186
|
type: "string",
|
|
@@ -922,10 +922,29 @@ const stateSchema = object({
|
|
|
922
922
|
},
|
|
923
923
|
overlaps: {
|
|
924
924
|
type: "array",
|
|
925
|
+
description: "Every pair of boards on the canvas that's too close, as execute's Overlaps() lists them. A pair with titleOnly doesn't collide: the lower board's title covers the upper one.",
|
|
925
926
|
items: object({
|
|
926
927
|
designs: strings,
|
|
927
|
-
names: strings
|
|
928
|
-
|
|
928
|
+
names: strings,
|
|
929
|
+
width: {
|
|
930
|
+
...number,
|
|
931
|
+
description: "How far they share, title band included."
|
|
932
|
+
},
|
|
933
|
+
height: number,
|
|
934
|
+
titleOnly: {
|
|
935
|
+
...boolean_,
|
|
936
|
+
description: "Only the lower board's title covers the other; the boards are clear."
|
|
937
|
+
},
|
|
938
|
+
estimated: {
|
|
939
|
+
...boolean_,
|
|
940
|
+
description: "One isn't drawn yet, so its size is estimated from its frames. Absent: both measured."
|
|
941
|
+
}
|
|
942
|
+
}, [
|
|
943
|
+
"width",
|
|
944
|
+
"height",
|
|
945
|
+
"titleOnly",
|
|
946
|
+
"estimated"
|
|
947
|
+
])
|
|
929
948
|
},
|
|
930
949
|
modes: {
|
|
931
950
|
type: "array",
|
package/package.json
CHANGED
package/skills/SKILL.md
CHANGED
|
@@ -132,8 +132,9 @@ parity status --summary
|
|
|
132
132
|
Lorem ipsum hides layout problems.
|
|
133
133
|
- **Reuse what repeats.** When a row, card or list item appears more than twice, make it a component design with
|
|
134
134
|
`ExtractComponent`, so each copy is an instance with its own content.
|
|
135
|
-
- **Leave the canvas tidy.** New designs go into empty space (`FindEmptySpace`)
|
|
136
|
-
|
|
135
|
+
- **Leave the canvas tidy.** New designs go into empty space (`FindEmptySpace`). A call warns only about the boards it
|
|
136
|
+
moves; `Overlaps()` checks every board, telling collisions from a title too close (`titleOnly`) and boards sized from
|
|
137
|
+
their frames because the canvas hasn't drawn them (`estimated: true`).
|
|
137
138
|
|
|
138
139
|
## When something fails
|
|
139
140
|
|
package/skills/execute.md
CHANGED
|
@@ -459,12 +459,22 @@ size checks measure the same in `Measure` and `Screenshot` as on the canvas, eve
|
|
|
459
459
|
|
|
460
460
|
## The canvas
|
|
461
461
|
|
|
462
|
-
`FindEmptySpace({ width, height })` finds room for a
|
|
463
|
-
or next to the design named in `near`. `
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
462
|
+
`FindEmptySpace({ width, height })` finds room for a board that size, to the right of the others unless
|
|
463
|
+
`direction: "below"`, or next to the design named in `near`. Its default `padding` of 240 leaves room for the board's
|
|
464
|
+
title. Give it the size the board will be: `Designs()` has a drawn board's `width` and `height`.
|
|
465
|
+
|
|
466
|
+
`Overlaps()` checks every board on the canvas and lists each pair that's too close, in one of two kinds:
|
|
467
|
+
|
|
468
|
+
- **A collision:** the boards themselves overlap.
|
|
469
|
+
- **Title clearance:** `titleOnly: true`. The boards are clear, but the lower one starts less than 160 below the upper
|
|
470
|
+
one, so the title the canvas draws above it covers the upper board.
|
|
471
|
+
|
|
472
|
+
`width` and `height` are the area they share, title band included. Move one with `UpdateDesign(design, { x, y })`.
|
|
473
|
+
|
|
474
|
+
A board is as big as the canvas last drew it, so its size is measured. One it hasn't drawn yet is sized from its frames,
|
|
475
|
+
laid out as the canvas lays them out: each shown mode's frame size (`frames` on the design, else the mode's width),
|
|
476
|
+
companions shrunk to 640 wide, and a frame without a fixed height as tall as its window. A pair with an estimated board
|
|
477
|
+
says `estimated: true`; without it, both sizes are measured.
|
|
468
478
|
|
|
469
479
|
```js
|
|
470
480
|
// With the default modes: a 1280 main frame, the dark one beside it at half size and the 390 phone, 2505 wide in all.
|
|
@@ -474,6 +484,20 @@ CreateDesign({ name: "Settings", x: 2200, y: 0 })
|
|
|
474
484
|
Print(Overlaps(dashboard)) // Dashboard and Settings, 305 across, estimated: true
|
|
475
485
|
```
|
|
476
486
|
|
|
487
|
+
An execute call's own warnings cover only the boards it creates, changes or moves: `overlap` for a collision and
|
|
488
|
+
`title_clearance` for a title too close. Other crowded boards are counted in one `canvas_overlaps` suggestion, so a call
|
|
489
|
+
that changes nothing, or only reads, doesn't make a crowded canvas look clear. To audit the canvas, call `Overlaps()`:
|
|
490
|
+
|
|
491
|
+
```js
|
|
492
|
+
for (const { names, titleOnly, estimated } of Overlaps()) {
|
|
493
|
+
const kind = titleOnly ? "a title covers a board" : "the boards collide"
|
|
494
|
+
Print(`${names.join(" and ")}: ${kind}, ${estimated ? "estimated" : "measured"}`)
|
|
495
|
+
}
|
|
496
|
+
// Room below Settings for a board 1400 wide and 1000 tall, and its title above it.
|
|
497
|
+
const room = FindEmptySpace({ width: 1400, height: 1000, near: "settings", direction: "below" })
|
|
498
|
+
CreateDesign({ name: "Plans", x: room.x, y: room.y })
|
|
499
|
+
```
|
|
500
|
+
|
|
477
501
|
## Examples
|
|
478
502
|
|
|
479
503
|
A new screen, checked in every state and mode:
|