mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 01:53:57 +00:00
CSS: css.export refuses a scope or path that is not a string
css.export read `scope` and `path` with a lenient string lookup, so a
value of the wrong type (`5`, `true`, `["all"]`, `null`) was treated as
left out: the selection was exported, or the CSS came back as data
instead of being written. Both keys are now checked before anything is
generated or written, and a supplied value that is not a string is an
error ("`scope` must be a string", "`path` must be a string"). A
left-out scope still exports the selection, and a left-out path still
returns the CSS.
css.generate and css.export with scope "all" do not use `ids` or `id`,
but a malformed one is now an error there too, as it already is for the
selection.
This commit is contained in:
+5
-3
@@ -6851,9 +6851,11 @@ says when CSS can't describe the art exactly (`unsupported`: other shapes, image
|
||||
written as its box, or with `rasterize: true` as `background-image: url(<class>.png)`. `units` is `px` (1 px per
|
||||
point, as in SVG export), `pt`, `mm`, `cm` or `in`; `unnamed: false` leaves out unnamed objects (counted in
|
||||
`skipped`). `css.generate` does the same for the whole document, and `css.export {path?, scope?: selection|all}`
|
||||
writes the `.css` file with the PNGs of rasterized art next to it (no path: `data` and `images` as base64). Its
|
||||
`warnings` add the PNGs' notes to the CSS's, each once (an image that couldn't be decoded, type written in the
|
||||
fallback font…). In the app, `css.copy` copies the CSS and `css.exportFile` writes it through a save panel (the web
|
||||
writes the `.css` file with the PNGs of rasterized art next to it (no path: `data` and `images` as base64). A left-out
|
||||
`scope` exports the selection; a `path` or `scope` given as anything but a string, `null` included, is an error, and
|
||||
nothing is written. `css.generate` and `css.export {scope: "all"}` do not use `ids` or `id`, but a malformed one is still
|
||||
an error. Its `warnings` add the PNGs' notes to the CSS's, each once (an image that couldn't be decoded,
|
||||
type written in the fallback font…). In the app, `css.copy` copies the CSS and `css.exportFile` writes it through a save panel (the web
|
||||
downloads it) and shows the first note in the status bar, with how many there are; resting the pointer on the
|
||||
message lists up to 30 of them, fewer when the list would not fit in the window, with how many were left out.
|
||||
|
||||
|
||||
@@ -957,6 +957,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
The command palette lists `select.key` as Cancel Key Object, and a pick cancels the key object (#541).
|
||||
Agent selection commands validate every object id before changing the selection and report the resulting count and ids (#784).
|
||||
Commands that act on `id` or else the selection, the highlighted layer row or a new object (`css.export`, `object.isolate`, `layer.locate`, `layer.releaseToLayers`, the graphic, character and paragraph style commands, `image.info`, the `links.*` and `shaper.*` commands that take an `id`, opacity mask editing and viewing, `symbol.edit`, the blend spine commands and `path.curvature`) refuse an `id` that is not an object id (`"abc"`, `"5"`, `true`) and change nothing; `effect.apply` with the effect given as `id` still applies it to the selection.
|
||||
`css.export` refuses a `scope` or `path` that is not a string (`5`, `true`, `["all"]`, `null`) before writing anything, instead of exporting the selection or returning the CSS as data; a left-out `scope` still exports the selection, and a left-out `path` still returns the CSS. `css.generate` and `css.export {scope: "all"}` refuse a malformed `ids` or `id`, which they do not use, as the selection's export does.
|
||||
Agents read the key object: `select.key` returns it, and `document.inspect` and the `ui.pointer` and `pointer_gesture` replies report it as `key`. `select.key` with an id that isn't a selected top-level object returns an error and leaves the key unchanged.
|
||||
The Select menu's Same commands, its Object commands that select art, Next Object Above and Below, saved selections and the Magic Wand (#2655) select only objects that Select All selects and objects inside them: nothing hidden or locked, nothing in a hidden or locked group, layer or sublayer, nothing on a template layer, and in isolation mode nothing outside the isolated group or layer. In isolation mode Select All, All on Active Artboard and Inverse select nothing while the isolated group or layer, or a group or layer it is in, is hidden, locked or a template layer.
|
||||
Select ▸ Object ▸ Bristle Brush Strokes selects the objects whose topmost stroke has a bristle brush, whatever the brush is named, and leaves out objects whose brush is of another type, also when its name has "Bristle" in it.
|
||||
|
||||
Reference in New Issue
Block a user