Merge main into fix/script-remove-trace-source

This commit is contained in:
dotCooCoo committed 2026-12-02 15:21:59 -08:00
commit 8b38ff8a4e
66 files changed
+3135 -256

No files matched your search

+84 -14
View File
@@ -3072,7 +3072,7 @@ through `$`:
`add` throws a `RangeError`), and `addDocument(startupPreset, presetSettings?, showOptionsDialog?)`, which runs `file.new`
with the New Document profile `startupPreset` names (`Print`, `Web`, `Mobile`, `Video`, another profile of
`file.newPresets`, or `Basic CMYK` and `Basic RGB` for no profile), starting from the first preset
`file.newPresets` lists for that profile, and the settings of a `new DocumentPreset()`
`file.newPresets` lists for that profile (a saved preset of the same name is not used), and the settings of a `new DocumentPreset()`
(https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/) in place of the preset's. A `DocumentPreset`
starts with the defaults that page gives. Assigning one of its settings checks the value's kind: a value of the
setting's enumeration, a finite number, a `title` string, `true` or `false` for `documentBleedLink`, or an array
@@ -3129,13 +3129,13 @@ through `$`:
or placed document already has is not applied, and its document stays in the back), `editable` (false for an
object that is hidden or locked, in a hidden or locked layer or group, or on a locked artboard), `zOrderPosition`,
`duplicate(relativeObject?, insertionLocation?)`,
`move(relativeObject, insertionLocation?)`, `remove()` and `zOrder(method)`
(https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). `move` runs `node.move` unless the object is already in
the place it names. `duplicate` runs `edit.duplicate`, and with a relative object it then runs `node.move` on the
copy the same way; without one, the copy stays where `edit.duplicate` puts it. The relative object is a page item or a layer of the same
`move(relativeObject, insertionLocation?)`, `remove()`, `zOrder(method)`, `translate`, `rotate`, `resize` and
`transform` (https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). `move` runs `node.move` unless the object is
already in the place it names. `duplicate` runs `edit.duplicate`, and with a relative object it then runs `node.move`
on the copy the same way; without one, the copy stays where `edit.duplicate` puts it. The relative object is a page item or a layer of the same
document; `ElementPlacement.INSIDE` and `PLACEATBEGINNING` (the default) put the object on top of a layer's or a
group's contents, `PLACEATEND` under them, `PLACEBEFORE` directly above the relative object and `PLACEAFTER`
directly below it. The clipping path of a clip group or clipping layer stays at its bottom: `PLACEATEND` puts the
directly below it. A move that leaves the object where it is runs no command. The clipping path of a clip group or clipping layer stays at its bottom: `PLACEATEND` puts the
object directly above the clipping path, and `PLACEAFTER` with the clipping path as the relative object throws
`an object cannot go below a clipping mask` and moves or copies nothing (VectorCraft's own rule). The one exception
is `mask.move(mask, ElementPlacement.PLACEAFTER)` on the clipping path itself, which succeeds and leaves the
@@ -3169,8 +3169,35 @@ through `$`:
`Reordering a path inside a compound path is not available yet` and leaves the document unchanged. When a placed image is embedded, an
object a script holds for it is stale, and the next read gives a new `RasterItem` object. The
enumerations `ElementPlacement`, `ZOrderMethod`, `BlendModes`, `RulerUnits`, `DocumentColorSpace`, `CoordinateSystem`,
`DocumentArtboardLayout`, `DocumentPresetType`, `DocumentPreviewMode`, `DocumentRasterResolution` and
`Transformation`, `DocumentArtboardLayout`, `DocumentPresetType`, `DocumentPreviewMode`, `DocumentRasterResolution` and
`DocumentTransparencyGrid` hold strings such as `"ZOrderMethod.BRINGTOFRONT"`.
`translate(deltaX?, deltaY?, transformObjects?, transformFillPatterns?, transformFillGradients?,
transformStrokePatterns?)` moves the object by the offsets in points, `rotate(angle, changePositions?,
changeFillPatterns?, changeFillGradients?, changeStrokePattern?, rotateAbout?)` turns it by `angle` degrees,
`resize(scaleX, scaleY, changePositions?, changeFillPatterns?, changeFillGradients?, changeStrokePattern?,
changeLineWidths?, scaleAbout?)` scales it by the percentages, and `transform(transformationMatrix, changePositions?,
changeFillPatterns?, changeFillGradients?, changeStrokePattern?, changeLineWidths?, transformAbout?)` applies a
`Matrix` record (https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/). Each one runs `object.transform` on the
object. VectorCraft's own rules for them: offsets, angles and matrices have Y up whatever `app.coordinateSystem` is,
so `translate(0, 10)` moves the object up and a positive angle turns it counterclockwise. `rotate`, `resize` and
`transform` act about the center of the geometric bounds unless a `Transformation` value names another point of
them; `Transformation.DOCUMENTORIGIN` is the bottom-left corner of the first artboard. Positions and gradients
default to `true` and patterns to the Transform Pattern Tiles preference. Fill and stroke patterns with different
values, and gradients different from positions, counting the defaults of arguments left out, throw an error that
says they are not available yet.
`changeLineWidths` is 100 (the default; stroke weights stay) or the transformation's own scale in percent, the
square root of the area it scales by (stroke weights and effects scale with it). `resize` on a path also takes any
other percent from 0 to 100000, which sets the stroke weight to that percent of what it was (through `stroke.set`,
at most 1000 points). On a member of a compound path or compound shape, the compound's stroke weight follows the
percent through `stroke.set`; when the percent is the resize's own scale, the member's own strokes and effects also
scale with it. `transform` with `changeLineWidths` at the matrix's own scale sets the compound's stroke weight the
same way, which changes the stroke every member of the compound shows. Another value throws the same
error. A locked object, one inside a locked layer or group, a
group that holds one, a hidden object or one inside a hidden layer or group, and an object on a locked artboard
throw `cannot transform locked objects`, `cannot transform hidden objects` or
`cannot transform objects on a locked artboard`. A scale of 0, a
matrix whose determinant is 0 and a transformation that would take the object past the canvas also throw an error.
In each of these cases the document does not change. A call that changes nothing runs no command.
`pageItems` lists the art topmost first, as the example on
[CMYKColor](https://ai-scripting.docsforadobe.dev/jsobjref/CMYKColor/) reads the frontmost path as `pathItems[0]`,
and a document's `selection` lists the selected objects in the same order, whatever order they were selected or
@@ -3223,7 +3250,7 @@ through `$`:
`..`, a network path, a NUL character or more than 4,096 bytes throws an error. `app.redraw()` returns `undefined`
and does not change the documents or add an undo step. In the app, the documents are drawn as they were before the
run until the run ends, with or without the call. Some members the Application,
Document and PageItem pages list, such as `Document.layers`, `PageItem.isIsolated`, `PageItem.rotate` and
Document and PageItem pages list, such as `Document.layers`, `PageItem.isIsolated`, `PageItem.bringInPerspective` and
`app.beep`, throw an error that says they are not available yet when they are read or assigned.
`hasOwnProperty` and `propertyIsEnumerable` are false for those members and true for every other member of an
object's class, so `item.hasOwnProperty("opacity")` is true on a page item, and `for (k in item)` lists the
@@ -3233,6 +3260,45 @@ through `$`:
strict-mode code, which throws a `TypeError`. On a collection it throws `Not found`, except for the text of a number that is not an array index, as described above. Other members
those pages list, such as `app.version` and `Document.save()`, and the members of the pages of the page-item kinds
themselves that this page does not describe are not defined yet and read as `undefined`.
- `app.preferences` (https://ai-scripting.docsforadobe.dev/jsobjref/Preferences/) has `getBooleanPreference(key)`,
`getIntegerPreference(key)`, `getRealPreference(key)`, `getStringPreference(key)`, the four matching `set…(key,
value)` and `removePreference(key)`. The key `ShowExternalJSXWarning` is the preference `showExternalScriptWarning`.
Setting it to `true` or removing it turns the warning on. VectorCraft's own rule: setting it to `false` while the
warning is on shows a confirm, with No as its default, and turns the warning off only after Yes; with nobody to ask
(a run with `script.run` outside the app, or a call from a callback of a built-in function) it throws an error that
names `ShowExternalJSXWarning` and changes nothing, and `answers` cannot answer that confirm. Other keys are
stored with the preferences under `scriptPreferences`, with the type they were set as, and are kept across runs and restarts; a run that fails or is stopped puts them back.
VectorCraft's own rules: a key that was never set reads as `false`, `0`, `0` or `""`; a getter of another type
converts the value as `Boolean`, `Number` and `String` do, and `getIntegerPreference` drops the fraction and gives
`0` for a value that is not a number. A key has a `length` of 1 to 256 UTF-16 code units (a character outside
the Basic Multilingual Plane, such as an emoji, counts 2) and no control characters, a string value at most
65,536 bytes, and the store at most 4,096 keys and 1,048,576 bytes (each value that is not a string counts 8);
`setIntegerPreference` takes a whole number within ±2^53 and `setRealPreference` a finite number. A value of the
wrong type or past a limit throws an error and stores nothing, and removing a key that is not stored does nothing.
- `app.getIdentityMatrix()`, `getTranslationMatrix(deltaX?, deltaY?)` (points), `getScaleMatrix(scaleX?, scaleY?)`
(percent), `getRotationMatrix(angle?)` (degrees, counterclockwise), `concatenateMatrix(matrix, secondMatrix)`,
`concatenateTranslationMatrix(matrix, deltaX?, deltaY?)`, `concatenateScaleMatrix(matrix, scaleX?, scaleY?)`,
`concatenateRotationMatrix(matrix, angle?)`, `invertMatrix(matrix)`, `isEqualMatrix(matrix, secondMatrix)` and
`isSingularMatrix(matrix)` work on `Matrix` records (https://ai-scripting.docsforadobe.dev/jsobjref/Matrix/): plain
objects with `mValueA`, `mValueB`, `mValueC`, `mValueD`, `mValueTX`, `mValueTY` and `typename` `"Matrix"`. Each
function other than `isEqualMatrix` and `isSingularMatrix` gives a new record; those two give `true` or `false`.
No function changes the records passed to it. A record maps `(x, y)` to
`(a·x + c·y + tx, b·x + d·y + ty)`, as a PDF `cm` matrix does (ISO 32000-1, 8.3.4), with Y up. VectorCraft's own
rules: `concatenateMatrix(m, n)` applies `m` and then `n`, and the other `concatenate…` functions apply the record
and then the transformation they make; a left-out move or angle is 0, a left-out `scaleX` is 100 and a left-out
`scaleY` is `scaleX`; quarter turns are exact; each value `concatenateMatrix` gives is its exact sum of products
rounded once; a matrix whose determinant is 0 is singular, and `invertMatrix` of one
throws; `isEqualMatrix` compares the six values exactly. A value that is not a finite number throws a `TypeError`,
and a result too large for a number throws a `RangeError`.
- `app.copy()`, `app.cut()` and `app.paste()` (https://ai-scripting.docsforadobe.dev/jsobjref/Application/) run
`edit.copy`, `edit.cut` and `edit.paste` on the active document inside the run's transaction. With nothing selected
`copy` and `cut` do nothing, and with the clipboard empty `paste` does nothing; `paste` with no document open throws
`No active document`. VectorCraft's own rules: `paste` takes what VectorCraft's clipboard holds (a Copy or Cut in
VectorCraft, or what the last Paste took from another app), not art another app copied since. A run that finishes
after a Copy or Cut (these functions, or `edit.copy`, `edit.cut`, `artboard.copy` or `artboard.cut` through
`vc.run`, also inside `command.batch` or an action), with the clipboard still holding what the Copy or Cut put
there and not what a `clipboard.import…` command put there since, has `copied: true` in its report, and the desktop
app then offers the clipboard to other apps as Edit › Copy does.
- `Document.saveAs(file, options?)` runs `file.saveAs`, and the document then has the new file.
When the format is selected by a `.vctemplate` path, `saveAs` writes a template copy and leaves the document's
file and saved state unchanged.
@@ -3476,11 +3542,10 @@ through `$`:
members `pathPoints`, `closed`, `evenodd`, `area` (negative for a path that runs counterclockwise), `length`,
`guides`, `clipping`, `selectedPathPoints`, `setEntirePath(points)`, `filled`, `fillColor`, `fillOverprint`,
`stroked`, `strokeColor`, `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to
500), `strokeDashes`, `strokeDashOffset`, `translate(deltaX?, deltaY?, ...)`, `rotate(angle, ..., rotateAbout?)`
(counterclockwise for a positive angle) and `resize(scaleX, scaleY, ..., changeLineWidths?, scaleAbout?)`. The
500), `strokeDashes` and `strokeDashOffset`, and takes the page item transforms above. The
geometry changes through `path.setAnchors`, the fill and stroke through `paint.setFill` and `paint.setStroke`, the
stroke options through `stroke.set`, the fill rule through `path.setFillRule`, overprint through
`object.setOverprint` and the transforms through `object.move`, `object.rotate` and `object.scale`. Changes to the
`object.setOverprint`. Changes to the
points of a path (`closed`, `setEntirePath`, `pathPoints` and each `PathPoint`) are written together with one
`path.setAnchors` before the script uses any other member or command, edits the points of another path, or reads
the points of another path in the same Objects on Path group, and when the script ends;
@@ -3941,7 +4006,9 @@ while the run went on keeps that change. On an uncaught error, a limit or `scrip
session go back to their state before the run. A script can write files through the commands it runs, such as
export commands. A file written before the run failed stays on disk, and the error names it. A run from the menu
shows a warning first, unless you ticked Do not show this warning again or set the preference
`showExternalScriptWarning` to false.
`showExternalScriptWarning` to false. A script asks for it with
`app.preferences.setBooleanPreference("ShowExternalJSXWarning", false)`, which turns the warning off only after you
answer Yes.
While a script runs, every other command that changes anything ends with the error `a script is running: stop it or
wait for it to finish`. MCP reports that error as JSON-RPC error `-32003`. `script.stop {}` stops the run and
@@ -4026,7 +4093,8 @@ In the app, a script past the growth limit stops at a question to continue or to
`ui.dialog.cancel` all stop the run. A run with nobody to ask, such as a call over MCP or the command line, ends
with an error at that limit. The headless reply is `{ok: true, name, changed, written, log, fuelUsed, hostCalls,
runTimeMs, timingAvailable, hostCallCounts, slowestCommands, console, dialogs, dialogCount, dialogsTruncated}`, with
`unhandledRejections` and `unhandledRejectionCount` as well when a `.js` script left rejected promises unhandled. In
`copied: true` after a Copy or Cut whose art the clipboard still holds, and `unhandledRejections` and
`unhandledRejectionCount` as well when a `.js` script left rejected promises unhandled. In
the app the reply is `{running: true, name}`, and the report appears later as `scriptReport` in `ui.inspect`, with
`prints`, the number of jobs the run prepared for a printer, when it prepared any. The
report of a failed run has the same fields after `kind`, `message`, `messageOrigin`, `line`, `column`, `file` (when
@@ -10919,7 +10987,9 @@ and goes back to Document Setup, whose OK runs `document.setup`; its Cancel goes
## New Document
`file.new` takes everything New Document sets: `preset` (a name from `file.newPresets`), `name`, `width`/`height`
`file.new` takes everything New Document sets: `preset` (a name from `file.newPresets`, a saved preset before a
built-in one of the same name; with `presetCategory`, a category of `file.newPresets`, the preset of that name in
that category), `name`, `width`/`height`
(points, or lengths such as `"210 mm"`), `units`, `orientation`, `artboards` with `artboardLayout {layout, columns,
rows, spacing, rightToLeft}` (`artboards`, `columns` and `rows` are whole numbers from 1 to 1000, and any other number is an error; `rows` gives a `gridByColumn` layout that many rows, at most one for each artboard, in place of `columns`, and is
an error with another layout; a preset keeps the rows, and `file.newPresets` lists them as set even when there are
+3 -1
View File
@@ -1114,9 +1114,11 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709).
- The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s.
- Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`.
- Scripts: a page item's `translate`, `rotate`, `resize` and `transform` move, turn, scale and transform the object by offsets, an angle, percentages or a `Matrix` record, about its center or a `Transformation` point, with positions, patterns, gradients and line widths following their arguments (https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/). Each call that moves or reshapes the object runs `object.transform` inside the run's transaction, a call that changes only a path's stroke weight runs `stroke.set`, and a call that changes nothing runs no command. `resize` and `transform` on a member of a compound path with `changeLineWidths` at their own scale set the compound's stroke weight; locked art, art on a locked artboard and bad arguments throw an error with nothing changed (`docs/mcp.md`). `crates/engine/src/tests/script_dom_transform.rs`.
- Scripts: `app.preferences` reads, stores and removes values by key with the type they were set as, keeps them across runs and restarts, and turns the warning before a picked script on with the key `ShowExternalJSXWarning`, and off only after the person answers Yes to a confirm (https://ai-scripting.docsforadobe.dev/jsobjref/Preferences/; the confirm is VectorCraft's own rule); `app` makes, joins, inverts and compares `Matrix` records (https://ai-scripting.docsforadobe.dev/jsobjref/Matrix/), rounding each joined value once from its exact sum of products, and runs Copy, Cut and Paste on the active document inside the run's transaction (https://ai-scripting.docsforadobe.dev/jsobjref/Application/). `crates/engine/src/tests/script_dom_prefs.rs`.
- Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, guide state, selected points, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). `pathItems["name"]` reads a path by name as `pageItems` does, and `removeAll()` deletes nothing and throws when any path is on a locked artboard. A path takes the page item transforms, and `resize` also sets its stroke weight to a `changeLineWidths` percent from 0 to 100000 (at most 1000 points; a member of a compound sets the compound's stroke); gradients move with positions, so a `changeFillGradients` different from `changePositions` throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values (`docs/mcp.md` lists these limits). Gradient stops are not there yet. A `PathPoint` of a path in an Objects on Path group goes stale when an edit of another path in the group moves it. `crates/engine/src/tests/script_dom_paths.rs`.
- Scripts: `Document.placedItems` and `Document.rasterItems` list a document's linked and embedded images; `placedItems.add()` with a `File` assigned to `file` places an image linked, and `PlacedItem.relink(file)` and `embed()` relink and embed it, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/PlacedItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PlacedItem/, https://ai-scripting.docsforadobe.dev/jsobjref/RasterItems/ and https://ai-scripting.docsforadobe.dev/jsobjref/RasterItem/ describe them. A raster item's bits per channel, channels, color space and transparency come from its encoded pixels' header. Only files the script may read, of at most 256 MiB and holding an image, are placed or relinked. Rasterizing and capturing are not there yet. `crates/engine/src/tests/script_dom_images.rs`.
- Scripts: `PlacedItem.trace()` and `RasterItem.trace()` make an Image Trace object and return it as a `PluginItem` whose `tracing` gives its path, anchor and color counts, the source image's resolution, `expandTracing()`, `releaseTracing()` and its `TracingOptions`; assigning an option or loading a preset traces it again, except that the view options (`viewRaster` and `viewVector`) only change the view, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/PluginItem/, https://ai-scripting.docsforadobe.dev/jsobjref/TracingObject/ and https://ai-scripting.docsforadobe.dev/jsobjref/TracingOptions/ describe them. Option values are checked for type and range before any trace, a script cannot save a preset, and the options without a VectorCraft setting throw. The source image of a traced item is left out of `pageItems`, `placedItems` and `rasterItems`; a script reaches it through `PluginItem.tracing.sourceArt`. `remove()` also refuses a shown source image. Renaming an ordinary group that holds an image first to `Image Trace`, or moving or duplicating an image to the bottom of an ordinary group with that name, throws an error. `crates/engine/src/tests/script_dom_tracing.rs`.
- Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, guide state, selected points, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). `pathItems["name"]` reads a path by name as `pageItems` does, and `removeAll()` deletes nothing and throws when any path is on a locked artboard. The transforms move gradients with the art: `changeFillGradients` false throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values, and `transform` is not there yet (`docs/mcp.md` lists these limits). Gradient stops are not there yet. A `PathPoint` of a path in an Objects on Path group goes stale when an edit of another path in the group moves it. `crates/engine/src/tests/script_dom_paths.rs`.
- Scripts: a document's `default*` members (https://ai-scripting.docsforadobe.dev/jsobjref/Document/) read and set the fill, stroke and stroke options of the next object drawn through `appearance.setNewArt`, leaving the selection and its art as they were, and `scaleFactor` reads 1 (`docs/mcp.md`). `crates/engine/src/tests/script_dom_defaults.rs`.
- Scripts: `app.undo()` and `app.redo()` undo and redo the edits the run made, and each document open before and after the run that it changed gets one undo step. `crates/engine/src/tests/script_dom.rs`.
- Scripts: `document.textFrames` makes point type, area type and type on a path, and each text frame gives its kind, its contents, its text as text ranges with their characters, words and paragraphs (which can add text), their character attributes (size, leading, tracking, baseline shift, scales, rotation, underline, strikethrough, font) and paragraph attributes (alignment, indents, space before and after), outlines and point and area conversion; `app.textFonts` lists the fonts, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/TextFrameItems/, https://ai-scripting.docsforadobe.dev/jsobjref/TextFrameItem/, https://ai-scripting.docsforadobe.dev/jsobjref/TextRange/ and https://ai-scripting.docsforadobe.dev/jsobjref/TextFonts/ describe them (`docs/mcp.md`). Offsets count UTF-16 units, VectorCraft's own rule. Lines, tab stops and colors are not there yet. `crates/engine/src/tests/script_text.rs`.