Commit Graph
114 Commits
Author SHA1 Message Date
dotCooCoo e81d7d9b3a Merge main into feat/font-sheet 2026-12-04 21:37:34 -08:00
dotCooCoo 31876d6775 Merge main into feat/font-sheet 2026-12-04 20:36:17 -08:00
dotCooCoo 05ed058fb1 Shaper: new groups and clipping masks no longer delete a Shaper group
A Shaper group keeps its source art at the bottom and rebuilds the rest
from it. object.newGroup with a Shaper group as parent at index 0, and
layer.clippingMask.toggle (also a script's clipped = true) on a Shaper
group, put a new object where the source art was. The group then read
no sources and was deleted. Both commands now refuse a Shaper group and
leave the document as it is; the clipping check runs before the edit
opens, so a refused call leaves typing as it is.
2026-12-04 18:02:53 -08:00
dotCooCoo 983a7a2522 Merge main into feat/font-sheet 2026-12-03 11:02:31 -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 7e8c6bae5c Merge main into feat/scripts-api-layer-path-items 2026-12-03 02:24:07 -08:00
dotCooCoo 4010eb5be2 Merge main into feat/scripts-api-layer-path-items 2026-12-02 18:24:31 -08:00
dotCooCoo e4e6dd517d Merge main into feat/scripts-layer-text-frames 2026-12-02 17:49:12 -08:00
dotCooCoo a447847245 Merge main into feat/scripts-layer-text-frames
Main took its own host class engine, member descriptions for reflect, a
topmost-first pageItems order, revert-aware handles and the New Document
More Settings rework. The merge keeps main's versions of crates/js and
crates/ui-egui/src/dialogs/new_document.rs and moves the branch onto them:

- The layers, groups, compound paths and artboards members carry their
  reflect types, and Layer gains toString. The Layer class from layers.rs
  replaces main's name-only Layer class.
- Layer, Layers, Artboard and container collection handles carry the
  document's revert count, so they go stale after File > Revert as page
  items do (a layer then throws "Stale page item", as main's tests expect).
- A layer's or group's pageItems and the GroupItems and CompoundPathItems
  collections read names, index and toString as the document's pageItems
  does on main.
- controlBounds keeps the branch's rule (anchors and handles of shown
  paths, a clip group's clipping path only) and main's zeros for an empty
  object.
- areaText and pathText into a layer or group keep main's threading.
- group.clipped is refused on a locked artboard, a compound path keeps
  itself when its pathItems are cleared, a path in a locked layer is not
  converted into a layer's textFrames, layers.removeAll refuses more rows
  than layer.delete takes, and a path moved into a pixel-aligned compound
  path is snapped.
- A compound path's pathItems read the typename PageItems, the class they
  are, and the TextFrames reflect types name a TextFrame from index and any
  type from parent.

Tests whose rule main changed now assert main's rule: pageItems and
textFrames list topmost first, an empty selection is an empty list, a
segment-only path is restored with no anchors (the objects stay selected,
order not asserted), and the members not available yet are swatches, not
views or layers. The branch's tests of its own host class engine in
crates/js were dropped with that engine, since main's implementation
replaces it.
2026-11-30 04:27:16 -08:00
dotCooCoo e58c1f2a07 Type Tools: Create Font Sheet's artboard guard covers every artboard deletion
Cut Artboard, Delete Empty Artboards and Artwork Cleanup's Empty Artboards
now return the guard's error, with nothing changed, when they would delete
the artboard an open Create Font Sheet dialog uses, as Delete Artboard
already did. `families` with any `filter`, an empty one included, is an
error. docs/mcp.md says that `null` is the same as an omitted parameter for
`addon.type.fontSheet`, and the progress line says labels are optional.
2026-11-30 03:07:02 -08:00
dotCooCoo 6308fefe2e Merge main into feat/scripts-api-layer-path-items 2026-11-29 22:20:13 -08:00
dotCooCoo 2198519cc7 Type Tools: Create Font Sheet keeps its opening artboard and sizes rows by ink
Preview and OK now place the sheet on the artboard that was active when
the dialog opened, and the view's active artboard is restored afterwards.
Deleting that artboard while the dialog is open is refused; if it is gone,
Preview and OK stop and ask to reopen the dialog. Other add-on dialogs keep
using the current artboard.

Rows are sized from each run's laid-out ink, so composite fonts whose
sample uses fallback faces get rows tall enough for what they draw. The
layout keeps per-run ink bounds so labeled sheets measure each glyph
outline once.
2026-11-29 22:18:10 -08:00
dotCooCoo 3f27eace1c Merge main into feat/scripts-api-d3-layers-artboards
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/src/script/mod.rs
#	crates/engine/tests/it/script_host_vs_scriptcheck.rs
#	crates/js/src/interp.rs
#	crates/ui-egui/src/script_runs.rs
#	docs/gaps.md
#	docs/mcp.md
#	docs/target-app-parity.md
2026-11-28 15:42:04 -08:00
dotCooCoo b14b61835d Undo: a move by 0 and Layer Options that change nothing add no step
path.moveAnchors with dx and dy both 0 (omitted, null or 0) ran the edit
anyway and added a Move step that changed nothing. It now returns before
the edit, as object.nudge does for a move by 0, and its params text
says so.

layer.setProps with no options, or with every option a row already has,
added a Layer Options step that changed nothing. It now applies the
options to a copy of each row first and records no step when no row
changes. As object.setProps does, a call that hides, locks or makes a
template still deselects the art that is no longer editable.

The Command Palette test that checks what a pick of a left-out command
does no longer skips the two commands.
2026-11-28 04:28:48 -08:00
dotCooCoo 0e4afdad8c Merge main into feat/scripts-api-layer-path-items 2026-11-25 23:02:42 -08:00
dotCooCoo 61d4b11d20 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-25 22:13:49 -08:00
dotCooCoo a8cd6180ce Scripts: fix further review findings in the layer and path items
- Point changes that add, remove or replace points deselect the path's
  direct-selected anchors even when the counts come out the same;
  path.setAnchors takes `reshaped` for this and refuses a non-boolean.
- Moving points or handles, changing a point's type or setting `closed`
  keeps the index of where each subpath's points start.
- A failed write keeps the waiting point changes.
- Restoring the selection keeps a segment-only path to its segments.
- getIsFileOpen folds `\` and letter case only on Windows.
- Assigning `undefined` to Document.selection throws with nothing changed.
- A document's path list is charged for the objects it looks at.
- A made path keeps an id above 2^53.
- A host object's handle is charged to the heap limit.
- docs/mcp.md states that node.move into a compound path also needs its
  layer and groups shown and unlocked and no locked artboard.
2026-11-25 20:47:22 -08:00
dotCooCoo d84b1cb565 Scripts: a clipping path stays out of compound paths, and near opacities are set
node.move refuses to put a clip group's or clipping layer's clipping path
into a compound path, so the next object up does not become the clipping
path. The art the group clips still moves in.

An item's or a layer's opacity assignment is skipped or replaced by the
stored value only when it equals the value the getter reports. A value
such as 0.00009 on an item at 0% is now set instead of being dropped.
2026-11-25 20:34:39 -08:00
BFlat 050f7cf407 Merge pull request #9019 from dotCooCoo/feat/scripts-api-d1a-app-documents
Scripts: app gives scripts the open documents, their selection and page items
2026-11-26 08:50:54 +07:00
BFlat 8bf4a7d58f Merge pull request #9331 from dotCooCoo/feat/layers-range-select-art
Layers: Shift-click in the selection column selects the art of a range of rows
2026-11-26 08:48:31 +07:00
dotCooCoo 8359b6acba Merge main into feat/scripts-layer-text-frames 2026-11-25 15:29:02 -08:00
dotCooCoo 02b065e285 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-25 14:48:25 -08:00
dotCooCoo 36d3cd0a15 Layers: Shift-click in the selection column selects the art of a range of rows
After a selection square is clicked, Shift-clicking another selects the
art of every row listed from the last square clicked to this one, down or
up and across sublayers and groups. Shift+Ctrl/Cmd-click adds that art to
the selection. Hidden and locked rows and art outside the isolated group
are left out, and a range does not move where the next Shift-click
starts. Before any square is clicked, Shift-click still adds one row's
art or takes it out. Ctrl/Cmd-click on a square now does the same; it
used to select the row's art alone, as a plain click does.

The panel menu's Select Art of Highlighted Rows selects the art of the
highlighted rows by the same rules.

- layer.selectAll takes {range: [id...], add?}, gathered with
  Selection::target_range as the target circles' ranges are.
- layer.selectHighlighted {add?} is new. Neither is an undo step, and
  the highlighted rows stay.
- Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-25 11:38:03 -08:00
dotCooCoo 80c33ec810 Scripts: fix review findings in the layer and path items
- controlBounds takes in the paths' direction handles. A clipping
  group's are its clipping path's.
- A compound path's pathItems is a PathItems collection: add() and the
  shape methods make the path inside it.
- resize() scales and sets the stroke weight as one step, so a failed
  stroke change undoes the scale too.
- A point change that adds or removes anchors deselects the path's
  direct-selected anchors, from a script and from path.setAnchors, so
  other anchors are not left selected in their place.
- A script that ends past the allowance of the last answer is asked
  again before its changes are kept.
- documents.addDocument starts from the built-in preset when a saved
  preset has its name, and Recent keeps the built-in preset's name.
- Saved preset rows past the artboard limit read as the limit.
- Host classes that do not fit the heap end with the heap limit.
- Layers keep their list while the document is unchanged, and getByName
  charges its scan on a kept list too.
- Selection ids are deduplicated with a set.
- A path made on the current layer is made in one step, so a failed
  stroke or reversal after it undoes the path too.
- Path points are found through a kept index of where each subpath's
  points start, rebuilt when the path's points change, so reading every
  point of a path with many subpaths is no longer quadratic.
- A pixel-aligned compound path snaps a path moved into it.
2026-11-25 04:38:31 -08:00
dotCooCoo f0c2c946b9 Scripts: keep clipping paths at the bottom and take handles into controlBounds
- node.move refuses to move the clipping path of a clip group or clipping
  layer until the mask is released, and a row moved to index 0 of a clip
  group goes directly above the clipping path. PageItem.move refuses a
  place behind a clipping path.
- controlBounds takes in the anchors and direction handles of the shown
  paths in the item; hidden paths, guides and clipped art are left out.
- Setting opacity to a value that differs from the current one only past
  the reported precision now sets it.
- Text added after a range that ends inside a character goes after the
  whole character.
- textFrames.removeAll() throws and deletes nothing when a type object is
  on a locked artboard.
- Layer lists are kept while the document is unchanged and are charged by
  the rows they look at; getByName is charged by the items it scans.
- The offset tables of text frame indexes are kept within 64 MiB per run;
  tables past it are made again when the frame is next read.
- The handles of host class objects count toward the script heap limit.
- Tests: the file-open test quotes the path as a JS string, the font
  lookup test clears the message between its two checks, and the
  collection test pins its host-call count. A new test covers a path
  node.move puts into a pixel-aligned compound path.
- Docs: docs/mcp.md, the M13 roadmap row and the scripts entries in
  docs/target-app-parity.md describe what scripts have now.
2026-11-25 03:58:43 -08:00
Zaxaerith 10a03396d1 docs(cli): clarify artboard fill for selected artwork 2026-11-25 14:58:16 +08:00
dotCooCoo 331acb4a90 Scripts: a path moved between compound paths keeps its pixel alignment
A path in a pixel-aligned compound path has no pixel alignment of its
own. When node.move or move put it into another compound path, the new
compound path did not become pixel-aligned, although it takes the paint
the path was drawn with. It now becomes pixel-aligned when the path or
the compound path it leaves was. The node.move params text and
docs/mcp.md say so.
2026-11-24 14:55:24 -08:00
dotCooCoo ff2ceab181 Scripts: paths keep the paint they are drawn with as they enter or leave a compound path
- A path that node.move, move or duplicate puts into a compound path
  loses its own paint, live shape and pixel alignment, as Make Compound
  Path leaves its paths; the compound path becomes pixel-aligned when
  the path was. An empty compound path takes the paint the first path
  was drawn with: the path's own, or that of the compound path it
  leaves.
- A path that node.move or move takes out of a compound path into a
  layer or a group takes the compound path's paint and pixel alignment,
  as Release Compound Path gives them to its paths. Before, it kept the
  empty paint Make Compound Path left it and drew nothing.
- Artboard.name = '' gives the artboard its default name, Artboard N, as
  artboard.setProps gives a blank name, instead of throwing.
- The undo step of object.newGroup is named through `label`, so the
  translators' list reads Compound Path as well as Group.
- Tests: a compound path's pathItems list the topmost path first, and a
  path duplicated into a compound path keeps no paint, live shape or
  pixel alignment of its own.

Docs: docs/mcp.md (the order rule names the document's lists; move,
duplicate and node.move name a compound path as a place).
2026-11-23 19:07:47 -08:00
dotCooCoo de38412a63 Scripts: new layers stay current, lists start at the top, empty compound paths
- layers.add() and activeLayer = layer keep the layer the script made
  current after the call, instead of putting the earlier current layer
  back with the selection.
- A layer's or artboard's name takes a number or a boolean as String()
  writes it. Two artboards may now have the same name.
- A layer's or group's pageItems, groupItems and compoundPathItems, and a
  compound path's pathItems, list the topmost object first.
- compoundPathItems.add() makes an empty compound path
  (https://ai-scripting.docsforadobe.dev/jsobjref/CompoundPathItems/).
  object.newGroup takes compound: true for it, and node.move and
  PageItem.move put paths into it; the first path gives an empty
  compound path its paint. Other objects are refused.
2026-11-23 12:19:59 -08:00
dotCooCoo 3d460c1697 Scripts: guide, layer, move and addDocument fixes for the object model
- Document.selection and PageItem.selected refuse a path made into a
  guide while Lock Guides is on, instead of passing the check and then
  selecting nothing. The locked artboards are measured once per
  assignment.
- An edit whose command selects the objects it changes puts the current
  layer and the highlighted Layers panel rows back as they were.
  layer.setCurrent takes keepRows, which leaves the highlighted rows as
  they are.
- move on an object on a locked artboard throws Cannot move, as editable
  reads false for it. duplicate, with or without a relative object, on a
  hidden or locked object or an object on a locked artboard throws
  Cannot duplicate and makes no copy.
- When move takes the last path out of a compound path, the empty
  compound path is deleted in the same undo step.
- addDocument writes each warning from reading the profile's file to the
  Script Console as addDocument: <warning>, and a previewMode of
  PixelPreview throws an error that says it is not available yet.
2026-11-22 15:33:08 -08:00
Zaxaerith cc3a8775ad docs(cli): correct artboard color export help (#8850) 2026-11-21 18:46:43 +08:00
datatimp e38e92e0d1 Layers: clear the target circles' Shift-click anchor on a document switch; check editability once per range 2026-11-18 23:16:54 -05:00
datatimp 10a7fac40e Merge remote-tracking branch 'upstream/main' into fix/8639-target-circle-modifiers
# Conflicts:
#	docs/target-app-parity.md
2026-11-18 22:55:08 -05:00
datatimp 2c78f2e2cb Layers: target circles take Ctrl/Cmd-click to add and Shift-Click to select a range (#8639) 2026-11-18 22:42:59 -05:00
BFlat f0af46d070 Merge pull request #8508 from dotCooCoo/perf/layer-highlight-set
Layers: a Shift-click range looks rows up in a set instead of searching them for each row
2026-11-19 00:43:12 +07:00
dotCooCoo bf2ca2cf80 Merge main into perf/layer-highlight-set 2026-11-18 07:39:22 -08:00
dotCooCoo c745eed567 Merge main into feat/layers-drag-into-live-paint 2026-11-18 07:33:28 -08:00
BFlat 9d59b6b885 Merge pull request #8510 from dotCooCoo/feat/layers-draw-behind-new-layer
Layers: in Draw Behind a new layer goes directly below the current layer
2026-11-18 13:04:43 +07:00
BFlat 3bc6bf441b Merge pull request #8075 from dotCooCoo/perf/layer-select-all-one-pass
Layers: a Shift-click in the selection column adds or removes a layer's art in one pass
2026-11-18 13:04:07 +07:00
dotCooCoo c66272a9e3 Layers: in Draw Behind a new layer goes directly below the current layer
layer.new without `top` or `below` now reads the drawing mode: in Draw
Behind the new layer goes directly below the current layer, at its level
(a sibling below a current sublayer), as the help page describes
(https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=234).
The Layers panel button, the panel menu, Ctrl/Cmd+L and the Layer
Options dialog all go through layer.new. `top` and `below` keep their
meaning in every mode, Draw Normal and Draw Inside keep a new layer
above the current one, and New Sublayer is not affected.
2026-11-17 18:19:14 -08:00
dotCooCoo 688baab2db Layers: a Shift-click range looks rows up in a set instead of searching them for each row
layer.highlight searched the highlighted rows once for every id it was
given, so a range of n rows took about n^2/2 comparisons, and the panel's
preview of the rows (apply_row_click) did the same before sending the
command. Both now keep a set of the highlighted rows beside the ordered
list. layer.highlight builds the set only for more than 8 ids, so a
one-row Ctrl/Cmd-click toggle does not pay for it.

The rows, their order, the returned rows, the current layer and the
revision are unchanged; tests compare the command with the per-id search
on 3,000 rows and the widget with it on 5,000 rows.
2026-11-17 17:52:43 -08:00
dotCooCoo bc56d2b49b Merge main into perf/layer-select-all-one-pass 2026-11-17 12:26:57 -08:00
dotCooCoo f0d4abcdcc Live Paint: paths in a Live Paint group can't take the names Face and Edge
A path directly in a Live Paint group named Face or Edge is taken for one of
the group's faces or edges, so the next rebuild (Merge, Gap Options, a path
dragged in or out, leaving isolation mode) drops it. layer.setProps and
object.setProps now return an error when they would give either name to a
path in the group that does not have it already, and a path pasted directly
into the group under either name is pasted without its name.
2026-11-17 10:07:22 -08:00
dotCooCoo f47035a6bb Merge main into feat/layers-drag-into-live-paint
# Conflicts:
#	crates/engine/src/cmd/layer.rs
2026-11-17 09:07:33 -08:00
dotCooCoo a2c91044e0 Layers: dragging a path into a Live Paint group adds it to the group as Live Paint › Merge does
A path, compound path or group of them dropped inside a Live Paint group
in the Layers panel, or above or below one of its rows, now joins the
group's paths as livePaint.merge adds them, in one "Merge Live Paint"
undo step that selects the group. An Alt-drag adds copies, and node.move
into the group does the same. With type, an image or another object
among the rows, the drop is refused with Merge's message and nothing
moves.

A row moved into or out of the group's hidden sources makes the group's
faces and edges again, keeping the paint of those that stay; with no
path left the group has no faces until a path joins it again. Before, a
dropped path became a plain child that cut no faces, and a source dragged
out left stale faces behind.
2026-11-17 09:06:36 -08:00
datatimp 47c3de29f1 Merge upstream/main into fix/8237-layers-alt-drop-copy-beside-itself 2026-11-17 01:39:23 -05:00
datatimp ea69ba0b97 Layers: a c opy never goes inside a top-level layer it copies; roadmap row (#8237) 2026-11-16 17:52:20 -05:00
datatimp 79906094b6 Layers panel: an Alt-drag copies a row above or below itself (#8237) 2026-11-16 16:44:20 -05:00
dotCooCoo 9d722b8342 Layers: a Shift-click in the selection column adds or removes a layer's art in one pass
layer.selectAll {id, add: true} checked each of the row's K objects with
a scan of the S selected objects, then removed or added them one id at a
time, each removal rebuilding the selection and each addition scanning
it again, so a Shift-click on a large layer took O(K*S + K^2). It now checks
the row's art against a set of the selected objects and calls
Selection::remove_all or Selection::add_all once. The resulting
selection, its order, the reply and the highlighted rows are the same
as before.

crates/engine/examples/layer_select_bench.rs times the old loop against
the new command in one process. On a layer of 50,000 objects the whole
command took a median of 733 ms before and 6.9 ms after with all of the
layer's art selected, and 369 ms before and 24 ms after with every other
object selected (7 runs, wall clock on Linux while other builds were
running).
2026-11-16 00:06:39 -08:00
dotCooCoo 1957c18c02 Layers: dragging objects into an Intertwine group adds them to it
An Intertwine group's row in the Layers panel now takes dragged rows and
selected art inside it, as a group's row does, and an object dropped
beside one of its members joins the group too. The new member has no
arranged areas and is drawn in its row's order; the other members keep
theirs. Alt-drag adds copies. layer.move and node.move refuse an object
that is or holds an Intertwine group, a Repeat, a graph or a Live Paint
group with the reason Make gives. For such an object the panel shows no
inside box on the group's row and no drop line beside a member's row.

A member moved out of the group, by a drag, node.move or Send to Current
Layer, drops its arranged areas. A group left with one member is
replaced by that member, or becomes a plain group of it when the group
has an opacity, blending, appearance, mask, lock or hidden state of its
own; a group left with none is removed. Each move is one undo step.
2026-11-15 23:54:08 -08:00