Commit Graph
93 Commits
Author SHA1 Message Date
dotCooCoo 96e66b5e8d Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-04 16:27:43 -08:00
dotCooCoo 7dc78396e0 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-04 15:11:24 -08:00
dotCooCoo 49186cb426 Merge main into feat/scripts-api-layer-path-items 2026-12-04 12:28:26 -08:00
.CooCoo 4db38b885e Merge pull request #9300 from dotCooCoo/feat/scripts-show-color-picker
Scripts: app.showColorPicker asks for a color
2026-12-04 11:42:06 -08:00
dotCooCoo 1ae7a5d5cb Merge main into feat/scripts-api-layer-path-items 2026-12-04 08:00:07 -08:00
dotCooCoo 516b7eb321 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-04 07:56:23 -08:00
dotCooCoo 232b9e1597 Merge main into feat/scripts-show-color-picker 2026-12-04 01:13:39 -08:00
dotCooCoo 69afdf9194 Merge main into feat/scripts-api-layer-path-items 2026-12-04 01:01:08 -08:00
dotCooCoo 8245421df6 Merge main into fix/script-paths-locked-layer 2026-12-03 11:27:43 -08:00
dotCooCoo 8e23837867 Merge main into feat/scripts-api-layer-path-items 2026-12-03 11:15:06 -08:00
dotCooCoo 78a3861135 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-03 11:13:42 -08:00
dotCooCoo 6100517eab Merge main into feat/scripts-show-color-picker 2026-12-03 11:12:25 -08:00
dotCooCoo d027865eea Merge main into fix/script-paths-locked-layer 2026-12-03 10:44:44 -08:00
dotCooCoo 5ff65970f9 Merge main into fix/global-edit-stale-points 2026-12-03 08:56:53 -08:00
dotCooCoo 06fc659299 Scripts: empty paths scale their strokes and refuse a compound's pattern
resize and transform with changeLineWidths equal to the scale now scale the
strokes, dashes and effects of a path with no anchors, as they do for a path
with anchors. A member with no anchors of a compound path or compound shape
that shows a pattern is refused when the call transforms patterns, as a path
with a pattern of its own is.

node.move's description and docs/mcp.md now say that a compound path on a
locked artboard takes a path while it is new art there and still selected.
2026-12-03 04:19:34 -08:00
dotCooCoo 6318369391 Scripts: a pattern on a path with no points is not left untransformed
rotate, resize and transform on a path with no points returned success
after setting only the stroke weight, even when the call asked to
transform a fill or stroke pattern the path uses. The pattern stayed as
it was. Such a call now throws "the object has no bounds", as it did
before empty paths were accepted, and leaves the document unchanged.
docs/mcp.md states the exception.
2026-12-03 01:34:27 -08:00
dotCooCoo 7a480a7524 Scripts: new paths skip a locked or hidden active layer
Document.pathItems.add() and the shape creators passed the active layer
as onLayer even when it was locked or hidden, so path.create refused it
and the script threw, while textFrames.add() and the app's own creation
commands put the new art on the topmost shown, unlocked layer. The path
creators now choose that layer the same way. While an opacity mask,
pattern or symbol is being edited, they use that edit's layer, and a
locked or hidden editing layer still throws. When every layer is locked
or hidden, the call throws and makes no path.

The creators came in with #9304.
2026-12-02 23:31:52 -08:00
dotCooCoo aeb11d6809 Merge main into feat/scripts-api-layer-path-items 2026-12-02 23:30:42 -08:00
dotCooCoo ced550ebef Scripts: path points of other Global Edit members go stale when Global Edit changes them
While Global Edit is on, an object model edit of one member (or a move
of a group that holds it) is given to the other members, but the check
that marks read PathPoint handles stale only looked at the edited
object's own subtree. A script that read a point of another member kept
a valid handle after the edit, even when an undo then put the member
back. The check now also looks at each Global Edit member, or the
outermost Objects on Path group that holds it, and skips subtrees the
command left as they were. The stale-point check came in with #9288.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-12-02 22:34:57 -08:00
dotCooCoo e62b425aa9 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-02 21:51:58 -08:00
dotCooCoo 74e7109026 Scripts: the look for changed path points after each command is charged
After a script reads a path's points, each command makes the run look
through the changed layers and groups of the document for those paths.
That look was not counted toward the script's operation budget, so a
loop of commands on a large layer did unbounded work. It now charges the
objects it looks at, as the layer scans in layers.rs do.

- The look pairs each object with the one of the same id under the same
  parent now, and lists the document once for a group that moved, so no
  object is searched for through the whole document.
- A document none of whose read paths remain is no longer looked at.

The look was added in #9288.
2026-12-02 21:28:43 -08:00
dotCooCoo 1c64f808ba Scripts: list the paths again after an edit inside a Shaper group
An edit to a Shaper source regenerates the group's paths. When the
regeneration drops a generated path and makes none, the document's next
id does not change, so the kept list of pathItems still held the removed
path. Edits to a path inside a Shaper group no longer keep the list.
2026-12-02 21:26:35 -08:00
dotCooCoo 8696df27f6 Merge main into feat/scripts-show-color-picker 2026-12-02 21:09:03 -08:00
dotCooCoo b81ede3532 Scripts: pathItems.removeAll keeps clipping paths; empty paths refuse stroke-only scaling
- pathItems.removeAll() now throws and deletes nothing when it would delete
  the clipping path of a group or layer that keeps other objects, as
  pageItems.removeAll() does. The check is shared with the art collections,
  and the document's collection counts compound paths that edit.clear
  empties and deletes.
- rotate, resize and transform check changeLineWidths at the
  transformation's own scale with changePositions false before the early
  return for a path with no points, so an empty path is refused as one with
  bounds is instead of having its stroke weight set.
- docs/mcp.md describes both.
2026-12-02 20:54:39 -08:00
dotCooCoo 44b238b814 Merge main into feat/scripts-text-paint 2026-12-02 15:51:24 -08:00
dotCooCoo dfff55991f Merge main into feat/scripts-api-layer-path-items 2026-12-02 15:42:39 -08:00
dotCooCoo 1a4b4be93e Merge main into feat/scripts-show-color-picker 2026-12-02 15:27:47 -08:00
dotCooCoo dc0992f740 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-02 15:26:27 -08:00
dotCooCoo e12e9074f1 Tests: check the point count before checking every point moved
CI's test-lint step failed the gate's sixth test shard: the all-unguarded
rule flagged reading_and_moving_points_counts_the_subpaths_a_few_times,
whose assert!(…all(…)) would also pass on a path with no anchors. The
test now asserts the path still has 1000 anchors first.
2026-12-02 14:10:55 -08:00
dotCooCoo 930c02ce8f Merge main into feat/scripts-pageitem-transforms 2026-12-02 12:20:10 -08:00
dotCooCoo a1c853897b Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-02 12:04:30 -08:00
dotCooCoo 5b5ed84c9f Merge main into feat/scripts-text-paint 2026-12-02 11:55:37 -08:00
dotCooCoo 9aa675bcd0 Merge main into feat/scripts-show-color-picker 2026-12-02 11:50:39 -08:00
dotCooCoo c5682d380c Merge main into feat/scripts-api-layer-path-items 2026-12-02 11:50:37 -08:00
dotCooCoo 549a383942 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 05:32:57 -08:00
dotCooCoo c1a2df3912 Scripts: numeric names in scoped collections, stale artboards after Revert
- A layer's, group's or compound path's pageItems, pathItems, groupItems,
  compoundPathItems and layers, and the document's artboards, look up a key
  such as "-1" or 1.5 as a name, as the document's pageItems does.
  index() still takes a number as a position only.
- pageItems.index() on a layer, group or compound path reads that
  container's list instead of throwing a type error.
- An Artboard read before File > Revert throws Stale artboard instead of
  changing the loaded artboard with the same id. A retained artboards
  collection still lists the loaded artboards.
- Opening a path with some of its selected segments left drops the anchors
  that only ended the removed segments and keeps the segments that are left.
- PathPoint.selected writes waiting point changes first when they replaced
  the path's points, so the read matches the selection after the write.
- PageItems.parent is described as any container.
2026-12-01 20:43:18 -08:00
dotCooCoo 8798591572 Scripts: closing an empty path refuses one on a locked artboard
PathItem.closed on an empty path checked only that the path was
editable, so an empty path in a group on a locked artboard accepted
closed = true. The setter now uses the same check as other path edits;
an assignment of the value the path has still does nothing.

Also splits the M14 roadmap row that a merge joined with the next row.
2026-12-01 12:22:18 -08:00
dotCooCoo c6b1625700 Merge main into feat/scripts-pageitem-transforms 2026-12-01 11:23:01 -08:00
dotCooCoo f1fbe6319c Merge main into feat/scripts-show-color-picker 2026-12-01 09:03:16 -08:00
dotCooCoo d52d8ff354 Merge main into feat/scripts-api-layer-path-items 2026-12-01 09:03:00 -08:00
dotCooCoo f9ca50a603 Merge main into feat/scripts-api-d5-swatches-symbols 2026-12-01 09:01:29 -08:00
dotCooCoo 5f0b0456d2 Merge main into feat/scripts-text-paint 2026-12-01 09:01:23 -08:00
dotCooCoo 5530339d99 Merge main into feat/scripts-pageitem-transforms 2026-12-01 09:00:46 -08:00
dotCooCoo 4082035b82 Scripts: locked artboards stop path edits, and move and zOrder respect clipping paths
- PathItem point, paint, stroke and transform changes on a path on a locked
  artboard now throw `Cannot edit` and change nothing, as the PageItem
  setters do. `pathItems.removeAll()` deletes nothing when a path is on a
  locked artboard, as `pageItems.removeAll()` does; it used to delete them.
- `move` and `duplicate` with `PLACEAFTER` and the clipping path of a clip
  group or clipping layer as the relative object throw instead of putting
  the object above the clipping path, or reporting success without moving it.
- `zOrder` counts the art above a clipping path and below the layer's ruler
  guides, as the Arrange commands do, so a method that leaves the object
  where it is runs no command.

Docs: docs/mcp.md.
2026-11-30 15:51:02 -08:00
dotCooCoo 38342a5c6f Scripts: reshaped and opened paths keep the right selection
- path.setAnchors on a member of a compound path drops the compound
  path from the selection too, unless another member still has anchors
  or segments selected, so a following Join does not act on the
  unselected sibling paths. A script's put-back selection follows the
  same rule.
- Opening a path in a script drops its segments and the anchors that
  only ended them; other selected anchors stay selected.
- Removing a point that waits to be written with replaced points no
  longer puts the old selection back on the new points.
2026-11-30 14:26:13 -08:00
dotCooCoo 39a0fd6923 Scripts: objectOnly paint, empty closed paths and style applyTo keep their rules
- An objectOnly paint during an open interaction also restores the paint
  waiting for the commit, so it no longer reaches Recent Colors.
- setEntirePath([]) on a closed path keeps an empty closed subpath, so
  the path stays closed.
- A character or paragraph style's applyTo throws Cannot edit, with
  nothing changed, on a hidden or locked text frame or one on a locked
  artboard, as other text edits do.
2026-11-30 12:01:00 -08:00
dotCooCoo 75d4c949d2 Scripts: transform scales a compound member's stroke, and the warning confirm is known by its origin
- PageItem.transform with changeLineWidths at the matrix's own scale sets
  the stroke weight of a path whose paint the compound holds, as resize
  does.
  resize and transform set that weight by the scale itself, and an explicit
  100 keeps the weights even for a scale within the tolerance of 100%.
- A changeLineWidths of 0 no longer matches a tiny scale; a positive value
  is compared with the scale relative to its size.
- translate refuses an offset past the canvas only when the call moves the
  object or a pattern it uses; a non-finite offset is still refused.
- Number conversion of preference text no longer trims U+0085, as
  JavaScript does not.
- A real preference changes between 0 and -0: values are compared by their
  bits in the setter and when the run's keys are merged.
- A clipboard.importSvg whose result cannot reach the script puts the
  clipboard back.
- Moving an object works out its index without copying the list of its
  siblings.
- The app's question before the external script warning turns off is known
  by the confirm the app opened, not by its text, so a script's confirm
  with the same text answers Yes through automation and is not translated.
- docs: only calls that move or reshape the object run
  object.transform, and transform sets a compound member's stroke.
2026-11-29 23:14:06 -08:00
dotCooCoo b893fce701 Scripts: emptying a path keeps an unrelated selection, and point removal keeps the layer
Writing a path's points removes it from the selection only when it, its
anchors or its segments are selected, so emptying an unselected path keeps
a targeted layer. Removing a point that changes the selection puts back the
current layer and the highlighted Layers rows. The New Document test reads
fractional rows as rounded, as file.new does.
2026-11-29 23:08:04 -08:00
dotCooCoo 6308fefe2e Merge main into feat/scripts-api-layer-path-items 2026-11-29 22:20:13 -08:00
dotCooCoo a4bd58e181 Merge main into feat/scripts-text-paint 2026-11-29 22:15:06 -08:00