Commit Graph
256 Commits
Author SHA1 Message Date
dotCooCoo c4a737f255 Merge main into feat/scripts-scriptui-palettes 2026-12-03 09:29:28 -08:00
.CooCoo fff1c92179 Merge pull request #10682 from dotCooCoo/fix/script-point-scan-charged
Scripts: the look for changed path points after each command is charged
2026-12-03 08:22:32 -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 a7c7dae179 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 17:25:26 -08:00
dotCooCoo d8caffae61 Merge main into feat/scripts-scriptui-palettes 2026-12-02 17:15:19 -08:00
dotCooCoo e369013463 Merge main into feat/scripts-api-d3-layers-artboards 2026-12-02 15:37:51 -08:00
dotCooCoo 60383e1ac1 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 15:28:08 -08:00
dotCooCoo e1558e7e4a Merge main into feat/scripts-scriptui-palettes 2026-12-02 15:27:42 -08:00
dotCooCoo d73dad7ee0 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 14:38:27 -08:00
dotCooCoo 326c88a8f3 Merge main into feat/scripts-api-d3-layers-artboards 2026-12-02 14:12:01 -08:00
dotCooCoo cb98b72a58 Scripts: fix a run's linked files at its first step
A run whose first step is an exact document.open still reads the open
documents' linked files then, so a link retargeted while the run is paused
gives a later command no read access to the new target. The open itself
still gets no linked-file access.
2026-12-02 14:10:57 -08:00
dotCooCoo d583b8053f Merge main into feat/scripts-pageitem-transforms 2026-12-02 13:09:44 -08:00
dotCooCoo 930c02ce8f Merge main into feat/scripts-pageitem-transforms 2026-12-02 12:20:10 -08:00
dotCooCoo 46b0d0def6 Merge main into feat/scripts-scriptui-palettes 2026-12-02 12:08:01 -08:00
dotCooCoo cd3a0da644 Merge main into feat/scripts-api-d3-layers-artboards 2026-12-02 11:39:00 -08:00
.CooCoo d0d73ff553 Merge pull request #9131 from dotCooCoo/feat/js-es2017-async-await
JavaScript: .js scripts run async functions and await
2026-12-02 11:37:17 -08:00
dotCooCoo b14d841476 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-02 11:28:17 -08:00
.CooCoo dcb7085b2a Merge pull request #9139 from dotCooCoo/feat/plugin-api-events
Plug-ins: react to selection, layer, open and save events
2026-12-02 11:15:23 -08:00
dotCooCoo 2cf9f56194 Scripts: palette events keep their file access, hide and enabled checks
- update() takes a waiting palette event only when the run's file access
  roots reach the same files as the event's, so a handler never runs with
  less access than its palette was shown with.
- A palette event is no longer delivered to a handler after its palette
  was hidden and shown again, or after a capturing listener disabled or
  hid the control or a group above it.
- A limit that ends a handler update() took restores the run's own
  actions before the end-of-run refresh.
- A palette refresh that fails reports no unhandled rejection.
- A refused palette field text no longer replaces text typed after it.
- The script.run, script.palette.event and docs texts describe update()
  delivery, list staleness after item edits, and repeating a click or
  close dropped with an oversized text.
2026-12-02 10:49:08 -08:00
dotCooCoo c2a2f38a4e Merge main into feat/js-es2017-async-await 2026-12-02 05:32:01 -08:00
dotCooCoo d091abbf53 Scripts: palette handlers that update() runs play their palette's actions
- A handler that a palette's update() runs in a later run of the same
  engine plays the actions of the run that showed the palette, as a
  handler's own run does. After the handler ends, or throws out of
  update(), app.doScript plays the run's own actions again.
- script_palette_start gives the app the error of an open edit that
  cannot be settled, and the waiting events keep waiting; it no longer
  returns None, which showed nothing.
- A palette event runs no handler or listener once a getter or an
  earlier listener took its control out of the palette, and a click or
  change is dropped when a getter read for the event disabled or hid
  the control or a container above it.
- A palette list's change ends its run with an error when an item's
  text comes from a getter, an inherited property or an object.
- The run's report of unhandled rejections is made again after the
  palettes are refreshed, leaving out a rejection that a getter gave a
  handler, and stays empty after a failed run.
- A text a palette's field gave stays in the field until no change of
  that field waits, also while a run before the change set the field to
  the same text.
- The report test replaces a waiting change ahead of another field's
  change, and the modal-wait test requires that no later frame is asked
  for.
- docs/mcp.md: a list's change made before the app puts it in line is
  dropped without an error; an error a handler throws out of update()
  can be caught, and the run then keeps the handler's changes.
2026-12-01 21:45:22 -08:00
dotCooCoo 9cff79a9ec Merge main into feat/scripts-api-d3-layers-artboards 2026-12-01 15:07:13 -08:00
dotCooCoo c012eb8ee9 Merge main into feat/scripts-pageitem-transforms 2026-12-01 15:00:42 -08:00
dotCooCoo 856d1a3870 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-12-01 14:59:55 -08:00
dotCooCoo 44c5c4ccd9 Scripts: insert returns nothing, stale collections fail toString, charges and reports fixed
- `artboards.insert` returns nothing, as the scripting reference says; `add`
  still returns the new artboard.
- `toString` of `Layers`, `GroupItems`, `CompoundPathItems` and `Artboards`
  checks the collection as `typename` does, so a collection whose container
  is gone throws instead of stringifying.
- The collections' `index` is described as returning their element class,
  with an `itemKey` of any type. `PageItems.parent` and `PathItems.parent`
  are described as any type, since scoped collections return a layer or
  group.
- `hasSelectedArtwork` charges the selection and every node of the layer it
  looks at to the script budget, also when it runs no command.
- A document made during the run whose active artboard the run chose is
  reported when an artboard inserted before it moves it.
- Tests: a test-only counter of built art lists bounds the group loop test,
  and the rejected-parameter checks of `object.newGroup` compare the whole
  layer tree.
2026-12-01 14:18:46 -08:00
dotCooCoo 682f27810a Merge main into feat/scripts-scriptui-palettes 2026-12-01 14:04:42 -08:00
dotCooCoo 9bf07c220e Merge main into fix/script-new-document-overprint-links 2026-12-01 13:53:12 -08:00
dotCooCoo 316a4b6bfa Scripts: file.new takes Overprint Preview and reads the profile's linked files
A script's addDocument with previewMode OverprintPreview failed: file.new
turned the view on with view.overprintPreview, which scripts may not
run. A script's file.new now asks for the view, and the run turns
Overprint Preview on when it ends; a run that fails does not turn it on.

The images a New Document profile's symbols, patterns and brushes link
to were read under the script's file gate, after the profile's own file
was read outside it, so images beside the profile showed only their
preview. They are now read the way the profile's file is, under the
automation roots in force.
2026-11-30 15:54:19 -08:00
dotCooCoo 77cc99b2bd Scripts: palette refreshes run their getters' promise jobs, and events keep their place
- A prompt, confirm or alert answer that cannot reach the script is listed
  in the report with the answer "error" instead of the answer given.
- After a named-engine run, point changes that a palette getter makes
  while the palettes are refreshed are written before the run ends.
- The promise jobs a palette getter queues during that refresh run in the
  same fuel, the host gets the controls once more after them, and their
  unhandled rejections are part of the run's report. An update() they
  call takes no waiting event.
- A waiting text change merges with a newer one only when no click or
  close of its palette waits after it.
- With nobody to ask, an open edit that cannot be finished before the run
  ends script.palette.event with that error, and the event does not wait.
- A click whose onClick getter hid the palette runs no handler, and a list
  choice whose list a text getter removed, or whose earlier item text a
  later getter changed, is refused.
- add() and remove() on a shown palette return their result when a getter
  throws while the host's copy is updated; the host gets the controls at
  the next update or when the run ends.
- In the app, a palette event whose run cannot begin shows its own error
  instead of an earlier stopped run's message.
- The overview comments, docs/mcp.md and the progress line describe the
  update() handling, the merge rule, onClose returning false and the
  named engine a palette needs.
2026-11-30 15:05:36 -08:00
dotCooCoo 0c13a1edb2 Scripts: close the review gaps in print, saveAs, File paths and presets
- The 1000% scale limit applies only when Fit to Page is off, since the
  scale factors are not used with it on.
- A script run clears the print command allowance when it ends, so a
  panic inside print cannot leave file.print open to later runs.
- saveAs without options takes the format from the path the script
  names, so a link at that path cannot change it.
- A File the host gives back charges its path to the heap.
- DocumentPreset.typename throws for a preset from an earlier run.
- Documents.addDocumentNoUI throws that it is not available yet.
- The print tests remove their folders when an assertion fails.
2026-11-30 14:54:47 -08:00
dotCooCoo 24bd70fa08 Merge main into feat/scripts-api-d3-layers-artboards 2026-11-30 11:45:53 -08:00
dotCooCoo b3def332ff Merge main into feat/scripts-print-printer 2026-11-30 11:40:16 -08:00
dotCooCoo 8afd855040 Merge main into feat/plugin-api-events 2026-11-30 11:40:02 -08:00
dotCooCoo b6a9e8f363 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-30 11:34:24 -08:00
dotCooCoo b3b3e78a36 Merge main into feat/scripts-pageitem-transforms 2026-11-30 11:07:22 -08:00
dotCooCoo 30188730b8 Merge main into feat/scripts-scriptui-palettes 2026-11-30 10:02:43 -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 c0eb5b898b Merge main into feat/scripts-pageitem-transforms
PathItem now takes PageItem's translate, rotate and resize: main's PathItem versions are removed, and resize on a path keeps main's changeLineWidths percent for the stroke weight. Hidden objects are refused, and an identity transform of an empty path checks its Transformation value and does nothing.
2026-11-29 17:19:24 -08:00
dotCooCoo 60c1eb34af Merge main into feat/scripts-print-printer 2026-11-29 14:36:49 -08:00
dotCooCoo c85d16f3c5 Merge main into feat/plugin-api-events 2026-11-29 14:32:55 -08:00
dotCooCoo 05ec7e98e2 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-29 14:09:48 -08:00
dotCooCoo 52879dd78f Merge main into feat/scripts-api-d3-layers-artboards 2026-11-29 14:02:24 -08:00
dotCooCoo fda48b02d0 Merge main into feat/scripts-app-select-tool 2026-11-29 10:25:17 -08:00
dotCooCoo 4929a4beb6 Merge main into feat/scripts-scriptui-palettes 2026-11-29 10:23:01 -08:00
dotCooCoo 5ec50ca863 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-29 09:29:37 -08:00
dotCooCoo a620aee2ea Merge main into feat/plugin-api-events 2026-11-29 09:27:26 -08:00
ruchirguitar a4659724f6 Merge main into feat/spell-check
Cargo.toml: #10049 moved craft-libs to 186a229c; the font store crates this
branch adds move with it, so every craft-libs crate stays at one rev.
2026-11-29 22:41:45 +05:30
dotCooCoo 97952e98a0 Merge main into feat/scripts-api-d8c-rasterize-capture 2026-11-28 23:21:47 -08:00
dotCooCoo 0bd735f53d Merge main into feat/scripts-doc-defaults 2026-11-28 23:20:21 -08:00
dotCooCoo 6227297ae4 Merge main into feat/plugin-api-events
# Conflicts:
#	crates/engine/src/cmd/plugin.rs
#	crates/plugins/src/lib.rs
#	crates/plugins/src/manifest.rs
#	crates/ui-egui/src/tests/plugins.rs
#	docs/plugins.md
2026-11-28 23:13:20 -08:00