Commit Graph
78 Commits
Author SHA1 Message Date
dotCooCoo 8e23837867 Merge main into feat/scripts-api-layer-path-items 2026-12-03 11:15:06 -08:00
dotCooCoo d73dad7ee0 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 14:38:27 -08:00
dotCooCoo 32bb7f1228 Merge main into feat/scripts-api-layer-path-items 2026-12-02 14:01:14 -08:00
dotCooCoo c5682d380c Merge main into feat/scripts-api-layer-path-items 2026-12-02 11:50:37 -08:00
dotCooCoo c2a2f38a4e Merge main into feat/js-es2017-async-await 2026-12-02 05:32:01 -08:00
dotCooCoo edb70b666c Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 05:18:44 -08:00
.CooCoo 2498ef4682 Merge pull request #10185 from dotCooCoo/feat/js-object-set-prototype-of
Scripts: ES2015 realms have Object.setPrototypeOf
2026-12-02 02:36:46 -08:00
dotCooCoo f01f2ce6c0 Fix #10463: $.evalFile reads File URI paths
File.parent gives a folder in URI notation (/c/Users/..., with %20 for a
space). $.evalFile joined that text to the script's folder as written, so
on Windows $.evalFile(File($.fileName).parent + '/more.jsx') looked under
C:\c\Users\... and reported "include file not found".

When an absolute path starting with one / names no file the script may
read, $.evalFile now also tries it with its escapes decoded and, on
Windows, with /c/... as the drive C:. The path as written is still tried
first, and the scope check, the .. refusal and the file limits apply to
every form. Share and device paths are not converted, and #include lines
are read as before.
2026-12-01 09:30:34 -08:00
dotCooCoo d52d8ff354 Merge main into feat/scripts-api-layer-path-items 2026-12-01 09:03:00 -08:00
dotCooCoo 10e107e464 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-30 21:12:56 -08:00
dotCooCoo d74312bedc Merge main into feat/js-object-set-prototype-of 2026-11-30 20:44:43 -08:00
dotCooCoo 0a56d7df9d Tests: script DOM and New Document tests check what they name
- The grid-by-column test now checks each artboard's row and column, so
  RLGridByCol must fill from the rightmost column. It compared only the
  number of distinct rows and columns before, which a left-to-right fill
  also passes.
- The keepEmpty test asserts that keepEmpty false deletes the compound
  path, instead of accepting any state other than an empty compound.
- The addDocument profile test closes the profile document before the
  script reads the profile, so the read goes through the app-folder
  exemption and not through the rule for open documents' files.
- The report-origin test adds authored ReferenceError controls for
  Window and activeDocument, and for BridgeTalk thrown as an error
  object, so a hint list that grows to those names cannot change a
  message the script wrote.
- New Document profile tests, and the temporary folders and files in
  script_dom.rs and script_run.rs, use vectorcraft_testkit::TempDir, so
  a failing assertion no longer leaves process-id folders behind. The
  linked-profile test keeps its link target in the same temporary
  folder.
2026-11-30 15:50:56 -08:00
dotCooCoo 6308fefe2e Merge main into feat/scripts-api-layer-path-items 2026-11-29 22:20:13 -08:00
dotCooCoo 5ec50ca863 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-29 09:29:37 -08:00
dotCooCoo 614881e874 Merge main into feat/js-es2017-async-await 2026-11-28 21:17:39 -08:00
dotCooCoo 3d063a486a Merge main into feat/js-es2017-async-await
Async function activations now save and restore this_in_env, strict_class, new_target and this_env with main's Frame fields. The string spread test sets its fuel above what main's iterator-based spread takes.
2026-11-28 20:09:17 -08:00
dotCooCoo b0e8c2055f Merge main into feat/js-es2015-proxy-reflect-m
Proxies join main's construct path in class_ops.rs: new and Reflect.construct both run the construct trap there, with new.target passed through. A Symbol-key lookup passes through a proxy to its target, so spread and for-of read a proxy of an array with the array iterator.
2026-11-28 18:47:57 -08:00
dotCooCoo 70dab81925 Merge main into feat/scripts-api-d8c-rasterize-capture
Ports the branch's Document, Application and options-class members to
main's described member form (name, HostMember, MemberInfo).
2026-11-28 18:45:21 -08:00
dotCooCoo d471933b0d Merge main into feat/scripts-doc-defaults 2026-11-28 18:11:42 -08:00
dotCooCoo 9c0945545b Merge main into feat/scripts-scriptui-dialogs
# Conflicts:
#	crates/js/src/scriptui.rs
#	crates/js/src/scriptui_tests.rs
#	crates/ui-egui/src/script_runs.rs
2026-11-28 14:23:52 -08:00
.CooCoo c2e4966407 Merge pull request #9255 from dotCooCoo/feat/scripts-scriptui-resources
Scripts: ScriptUI builds windows and controls from resource strings
2026-11-28 08:03:55 -08:00
dotCooCoo 1d3e835927 Scripts: ScriptUI review fixes for heap-limit adds and removes, listeners, list texts, Enter, the run's questions and automation requests
- Adding a control or an item, and removing items, builds both arrays
  before the first write, so a run that ends at the heap limit leaves the
  lists and the dialog's counts as they were.
- A listener registered after an event started does not hear it in a later
  phase, a capturing container's re-registration included.
- show() reads the dialog again when a getter changes a list item's text
  after the item was read.
- Enter and Escape skip an OK or Cancel button inside a hidden or disabled
  container.
- A resource string of a name and a type without braces throws a
  SyntaxError, and a \u escape pair of surrogates reads as one character.
- In the app, queued events wait while another dialog is open over the
  script's dialog, and the run's own questions wait while a popup, such as
  an open drop-down list, is over it. ui.dialog.confirm and
  ui.dialog.cancel take only the dialog, ui.dialog.set needs a field or an
  action and answers with the dialog it set, and OK is refused while a
  dialog open over it waits. A cancel after typed text clicks the cancel
  button the dialog has when its turn comes, and an immediate cancel the
  run refuses is an error.
- A click on a list box row gives the list the keyboard focus.
- The vc hint test names BridgeTalk, since Window now exists; the params
  text and docs/mcp.md say that a show() in a handler notify runs throws
  only in the app, and define_script_ui says when end is not called.
2026-11-28 02:43:06 -08:00
dotCooCoo 9acde80654 Tests: name BridgeTalk where a run needs an object scripts here do not have
Window is defined now that ScriptUI dialogs run, so new Window('dialog') no longer fails with the advice that names the `vc` object. an_error_names_the_script_its_place_and_kind and failed_script_report_keeps_message_and_adds_origin use new BridgeTalk() instead, which still fails with that advice.
2026-11-27 23:08:16 -08:00
dotCooCoo 09c58a297d Merge main into feat/js-es2015-classes
# Conflicts:
#	crates/js/src/ast.rs
#	crates/js/src/bytecode.rs
#	crates/js/src/compiler.rs
#	crates/js/src/es2015_tests.rs
#	crates/js/src/interp.rs
#	crates/js/src/interp_tests.rs
#	crates/js/src/lib.rs
#	crates/js/src/parser.rs
#	crates/js/tests/test262.rs
#	docs/mcp.md
#	docs/target-app-parity.md
2026-11-27 22:40:21 -08:00
dotCooCoo 98905abadf Merge main into feat/scripts-api-layer-path-items 2026-11-27 22:29:35 -08:00
dotCooCoo f85adad24e Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-27 22:16:17 -08:00
dotCooCoo c98c18c563 Scripts: name lookups in every collection, and growth checked at the end
- `pageItems`, `pathItems`, `groupItems` and `compoundPathItems` of a
  layer or group, the document's `pathItems`, `layers` and `artboards`
  read with a name give what `getByName` gives, and a name nothing has
  is not `in` them. Before, only the document's `pageItems` did.
- A compound path's `pathItems.removeAll()` keeps the compound path,
  empty, as `remove()` of its last path does. Before, the compound path
  was deleted too and the collection went stale.
- A Live Paint group's `pathItems`, `groupItems` and
  `compoundPathItems` throw `Cannot add an object to a Live Paint group`
  and make nothing. Before, a new path joined the group's source paths
  and the script got back an object that was not in the collection.
- After each command, the points the run read are checked only for the
  paths in the parts of the document that changed, so a script that
  reads points of many paths and then edits each one no longer looks at
  every path after every edit.
- A script that ends with nothing left to write, past the growth
  allowance the last answer gave, is asked again before its changes are
  kept, as one that writes point changes at the end is.
- A new object of a host class adds its handle to the heap's total, as
  a collection counts it, so objects made between collections cannot
  go past the heap limit.

Docs: docs/mcp.md (collection errors, artboard index errors).
2026-11-27 18:37:26 -08:00
dotCooCoo dd2e92f4ec Merge main into feat/js-es2015-generators
Promise jobs resume generator callbacks. Promise.resolve and Promise.reject reject direct and bound generator functions as constructors.
2026-11-26 09:54:27 -08:00
dotCooCoo 0e4afdad8c Merge main into feat/scripts-api-layer-path-items 2026-11-25 23:02:42 -08:00
dotCooCoo df3d7ab275 Scripts: stale page item lists throw from toString; unavailable members stop hasOwnProperty
- `toString()` on a page item list from a closed or replaced document throws
  "Stale document", as its other members do.
- A member a host class declares unavailable is not reported by
  `hasOwnProperty` or `propertyIsEnumerable` even when a parent class has it.
- Assigning a name an object of a host class inherits from a prototype no
  longer calls the class's indexer, so a non-strict assignment is ignored
  instead of throwing.
- Assigning a selection checks repeated objects with a set instead of
  scanning the list for each object.
- The script report test throws a text that names `Window` for the case of
  an error the script wrote itself.
2026-11-25 21:50:05 -08:00
dotCooCoo 192a041ec8 Merge main into feat/js-es2015-generators 2026-11-25 18:09:25 -08:00
dotCooCoo 581f70be24 Merge main into feat/js-es2015-generators 2026-11-25 13:52:14 -08:00
dotCooCoo 948ebd6adb Merge main into feat/scripts-api-d1a-app-documents 2026-11-25 10:21:51 -08:00
BFlat 5d00bb8fbf Merge pull request #9308 from dotCooCoo/feat/scripts-e4x
Scripts: every script reads E4X and has the XML objects
2026-11-26 00:31:24 +07:00
dotCooCoo 18118db9c7 Merge main into feat/js-es2015-generators 2026-11-25 09:11:32 -08:00
dotCooCoo a61c4d87e8 Merge main into feat/scripts-doc-defaults 2026-11-25 08:57:50 -08:00
dotCooCoo 0c90d0d5c1 Merge main into feat/scripts-api-layer-path-items 2026-11-25 04:45:05 -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
.CooCoo d51c4b92fb Scripts: .js object literals take methods and __proto__, and functions get names (#9138) 2026-11-25 19:25:17 +07:00
dotCooCoo 8b05d98951 Scripts: every script reads E4X and has the XML objects
The script host ran its realm with E4X off, so XML literals were syntax
errors and XML, XMLList, Namespace, QName, isXMLName and
setDefaultXMLNamespace were missing from every script, although
vectorcraft-js has them. script.run and File › Scripts now turn E4X on
for .js and .jsx files, script text, #include files, $.evalFile, eval
and Function, and for a #targetengine engine.

script.check lists the e4x and xml features under the language need
instead of hostOnly, since VectorCraft runs them.
2026-11-25 04:23:32 -08:00
dotCooCoo 53179a19fc Merge main into feat/scripts-api-d2-paths-colors 2026-11-24 21:56:32 -08:00
dotCooCoo 1f1c8ccf8c Merge main into feat/scripts-api-d1a-app-documents 2026-11-24 20:48:43 -08:00
dotCooCoo e89ffa7666 Merge main into feat/scripts-api-layer-path-items
New Document moved to the craft UI framework on main. More Settings'
Columns now shows the columns a preset's rows give the current number
of artboards, a new column count replaces those rows, and a new layout
keeps the columns they showed.
2026-11-24 19:16:40 -08:00
dotCooCoo b0516ec95e Merge main into feat/js-es2017-async-await 2026-11-24 10:49:53 -08:00
dotCooCoo cb663e8711 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-24 10:43:23 -08:00
dotCooCoo 0b841d9bf5 Merge main into feat/js-es2015-proxy-reflect 2026-11-24 10:21:42 -08:00
BFlat 11a26acb0b Merge pull request #9109 from dotCooCoo/feat/js-es2020-optional-chaining-nullish
Scripts: .js scripts read optional chains and the ?? operator
2026-11-24 16:09:45 +07:00
BFlat 7696b503e6 Merge pull request #9079 from dotCooCoo/feat/js-es2015-block-arrow-template
Scripts: .js scripts run let, const, arrows, templates, default and rest parameters and spread
2026-11-24 16:06:07 +07:00
dotCooCoo 9872e6b679 Scripts: page items report their own members, and lists start with the topmost object
Scripts that check a member with hasOwnProperty before using it skipped
every page item, because the members live on the class prototype. Now
hasOwnProperty and propertyIsEnumerable are true for each member of an
object's class that is available, and for-in lists its properties but
not its methods. Members that only throw "not available yet" stay false.

- An empty selection is an empty list instead of null.
- pageItems lists art topmost first, as the CMYKColor example reads the
  frontmost path as pathItems[0]
  (https://ai-scripting.docsforadobe.dev/jsobjref/CMYKColor/). A
  document's selection lists the selected objects in that order too,
  whatever order they were picked in. That selection order is
  VectorCraft's own rule.
- A collection read with a name, such as pageItems["Logo"], gives what
  getByName gives, as
  https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/
  shows. A name nothing has throws Not found, and assigning to such a
  name throws the same error.
- activeDocument, documents and selection can be named without app., as
  that page describes for the application's members.
- move() with the object itself and PLACEBEFORE or PLACEAFTER leaves it
  where it is and adds no undo step.
- move() keeps a compound path whose last path moves out, so a script
  that holds it can still read it.
- Assigning opacity to an object in a hidden or locked layer throws
  Cannot edit and changes nothing.
- name takes a number or a Boolean as its text.
- String() of an object gives its class and name, such as
  [PathItem Logo].

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-23 13:24:32 -08:00
dotCooCoo 831c19121c JavaScript: a kept engine gets Proxy and Reflect at its first .js run
A realm made without Options::es2015 adds Proxy and Reflect at its first run with the option, and keeps them when the option is turned off. A Proxy or Reflect global that an earlier run defined stays as it is.
2026-11-22 12:11:30 -08:00