6092 Commits

Author SHA1 Message Date
.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
.CooCoo e25243aeb4 Merge pull request #9135 from dotCooCoo/feat/js-es2015-proxy-reflect
JavaScript: ES2015 realms have Proxy and Reflect
2026-12-02 11:15:55 -08:00
.CooCoo 5cfc4cf100 Merge pull request #9041 from dotCooCoo/feat/scripts-api-d2-paths-colors
Scripts: documents give scripts their paths, path points and colors
2026-12-02 11:15:31 -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
.CooCoo 5d22b25bb7 Merge pull request #10333 from dotCooCoo/fix/script-new-document-overprint-links
Scripts: file.new takes Overprint Preview and reads the profile's linked files
2026-12-02 11:15:14 -08:00
.CooCoo 0a14ee1d23 Merge pull request #10363 from dotCooCoo/fix/close-native-range
Scripts: close with SaveOptions.SAVECHANGES saves a native file whose last save named a range
2026-12-02 11:15:06 -08:00
.CooCoo 942cfbdfd9 Merge pull request #10582 from dotCooCoo/fix/for-in-fresh-prototype-proxy
Scripts: for-in visits a name when a getPrototypeOf trap returns a new proxy each time
2026-12-02 11:14:59 -08:00
.CooCoo 9fe1d7ecfb Merge pull request #10586 from dotCooCoo/fix/script-back-document-bounds
Scripts: geometry read from a document in the back matches what the setters measure
2026-12-02 11:14:48 -08:00
.CooCoo d22a7330e1 Merge pull request #10589 from dotCooCoo/fix/pg9087-2
Scripts: a script chosen after the startup scripts may print to a printer
2026-12-02 11:09:18 -08:00
.CooCoo 491d1324cf Merge pull request #10572 from dotCooCoo/fix/pg9087-3
Print: maxPages turns a job away before raster effects are flattened
2026-12-02 11:09:01 -08:00
dotCooCoo c0b4413a5a JS: fix async function review points
- AsyncFunction.prototype has Symbol.toStringTag "AsyncFunction",
  configurable only.
- await checks the room for the awaited promise's reaction or job and
  the suspended frame's bytes before it attaches the reaction, so a
  suspension stays within the heap limit.
- An async function's return pops its frame before resolving its
  promise, so a then getter on the returned value runs without it.
  Returning the function's own promise rejects it at the return.
- Block functions whose variable was not declared are kept in a hash
  set, so each block function's lookup takes constant time.
- A shorthand await in an object pattern of an async arrow function's
  head is a syntax error, and the head accepts patterns with defaults
  such as async ({a = 1}) => a. async({a = 1}) without an arrow is
  still a syntax error.
- docs: .jsx files and source strings run with module: true have
  Promise and the async syntax; await is an identifier only in script
  code.
2026-12-02 08:30:09 -08:00
dotCooCoo b727487d80 Docs: pathItems.removeAll() reports hidden or locked paths first
pathItems.removeAll() throws "cannot delete hidden or locked paths" when
any path is hidden or locked or is inside a hidden or locked object, and
only otherwise "cannot delete objects on a locked artboard". Both
messages end with a colon and up to 20 path ids. docs/mcp.md now says
so in both places that describe removeAll().
2026-12-02 08:00:53 -08:00
dotCooCoo 31d02e4821 Scripts: startup scripts at launch list no printers, and spool failures stay shown
The startup scripts run at launch no longer list the print service's
printers, so the first window does not wait on it; a script.startup.run
with any other reason still lists them. A script's print jobs that the
desktop's worker fails to send are shown in the status bar even when a
later line, a later batch that was sent or a startup script's failure
took it, and the startup script's notes stay in the hover.
script.startup.run's params text describes the print wait and the
launch rule.
2026-12-02 07:39:44 -08:00
dotCooCoo f8eb542e04 Scripts: geometry read from a document in the back matches what the setters measure
The bounds getters (position, left, top, width, height and the bounds
arrays) read an item in a document in the back without measuring its type,
while the setters measure it after the switch to that document since
#10538. A script that read t.width and assigned it back could resize the
item, and every geometry assignment switched to the document and back even
when nothing changed.

The getters now measure type not measured yet in a document in the back
for an item that holds type, a symbol instance or a placed document, the
way the switch measures it, and the check is skipped while the document is
unchanged. An assignment equal to the current value of an object without
such content in a document in the back returns without switching
documents, and no undo step is made.
2026-12-02 07:21:25 -08:00
dotCooCoo 444c46c515 Scripts: for-in visits a name when a getPrototypeOf trap returns a new proxy each time
A for-in loop asks only the proxies whose ownKeys trap listed a name for
its descriptor. When a getPrototypeOf trap returned a new proxy of the
same target on each call, the proxy met before each name was not the one
that listed it, so the name was skipped. The loop now records, for each
proxy, the proxy its prototype lookup returned, and a new proxy of that
same target in its place answers for it. Proxies that list nothing are
recorded too, so another proxy of their target does not answer for them,
and the listing proxies stay rooted until the iterator holds them.

Follows #10185.
2026-12-02 07:12:47 -08:00
dotCooCoo 096b3b0e24 Scripts: a script chosen after the startup scripts may print to a printer
With Run Startup Scripts on, File › Scripts runs the chosen script
through script.startup.run, and only script.run listed the print
service's printers, so app.printerList and Document.print to a printer
threw "not available here" in the chosen script. script.startup.run now
lists the printers, each queued run takes them as it starts, and a
startup script's print jobs are asked about before the next run starts.

Follows up on #9087.
2026-12-02 06:26:17 -08:00
dotCooCoo 337b47a309 JavaScript: with scopes honor Symbol.unscopables; concat reads isConcatSpreadable
- A `with` scope reads `Symbol.unscopables` after it finds a name, through
  a proxy's `get` trap, and skips the binding when that object's property
  for the name is truthy.
- `concat` reads `Symbol.isConcatSpreadable`, through proxy traps; a
  defined value decides whether the object is spread.
- `Object.keys` and `Object.getOwnPropertyNames` keep the target's order
  through empty-handler proxies.
- `%TypedArray%.from` and `of` construct through a proxy constructor and
  check that the result is a typed array long enough.
2026-12-02 06:23:12 -08:00
dotCooCoo 080f3c4a84 JavaScript: legacy reflect find skips proxy traps; replacer lists charge kept names
- `reflect.find` reads the reflection object and its lists with ordinary
  [[GetOwnProperty]], so a proxy receiver throws a TypeError without its
  getOwnPropertyDescriptor trap running.
- `JSON.stringify` charges each distinct name a replacer array keeps for
  the length of the call, instead of reserving bytes for the whole length,
  so a long sparse replacer list no longer hits the heap limit.
- A test checks that an outer proxy reads an inner proxy target's
  descriptors in its trap's combined order of names and Symbols.
2026-12-02 06:01:07 -08:00
dotCooCoo 5886c70c8d Print: maxPages turns a job away before raster effects are flattened
file.print with maxPages flattened every raster effect in the document
before it counted the pages, so a job it then turned away still paid
for rendering each effect. The page count from the artboards now runs
first, on the artboards alone, and raster effects are flattened only
for a job that fits.

Follows up on #9087.
2026-12-02 05:55:33 -08:00
dotCooCoo 549a383942 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 05:32:57 -08:00
dotCooCoo c2a2f38a4e Merge main into feat/js-es2017-async-await 2026-12-02 05:32:01 -08:00
dotCooCoo d359bb7e1a Print: Document.print throws for CUSTOMPROFILE without a profile name
A script that set PrintColorManagementOptions.colorProfileMode to
CUSTOMPROFILE and assigned no name printed with the base settings'
profile, as though no custom profile had been asked for. The job now
throws before anything is written, as it does for an empty name.

Follows up on #9087.
2026-12-02 05:13:50 -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
.CooCoo d100d66a06 Merge pull request #10250 from dotCooCoo/fix/retype-period-font-order
Retype: glyphs drawn alike in several fonts count as one outline in near matching
2026-12-02 02:22:02 -08:00
dotCooCoo 3ea259e6b9 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 02:20:34 -08:00
.CooCoo d753c48d2e Merge pull request #10483 from dotCooCoo/fix/windows-evalfile-uri
Scripts: $.evalFile reads the URI paths File.parent gives, on Windows too
2026-12-02 02:02:31 -08:00
.CooCoo 907db2002f Merge pull request #10487 from dotCooCoo/fix/mark-bounds-tiny-objects
Arrange Tools: Mark Bounds of Each draws no empty group for an object too small for corner legs
2026-12-02 02:02:23 -08:00
.CooCoo 0c6aaa074d Merge pull request #10448 from dotCooCoo/fix/make-numbers-sequence
Type Tools: Make Numbers Sequence numbers the selected type objects
2026-12-02 01:10:32 -08:00
dotCooCoo 9b40798f6a Merge main into fix/retype-period-font-order 2026-12-02 00:40:20 -08:00
dotCooCoo 8c78d72c9f Scripts: for-in asks only the proxies that listed a name
- A for-in loop now records, for each proxy whose ownKeys trap it called,
  the positions of the names that proxy returned, and asks a proxy for a
  name's descriptor only when that proxy listed the name. A proxy that did
  not list a name no longer hides an inherited one, and the proxy that did
  is still asked after a prototype change moves it on the chain. The
  records keep their proxies reachable and count against the heap limit.
- The check before each name walks own properties object by object, so a
  typed array without the element a name gives no longer hides that name
  on its prototypes.
- Function.prototype.apply reads the list's length with ToLength in a run
  with the ES2015 option, so a negative length gives no arguments; other
  runs keep ToUint32.
- Docs: typeof on a revoked proxy does not throw, and a setPrototypeOf
  trap that returns true may leave the prototype unchanged.
2026-12-01 21:07:58 -08:00
dotCooCoo 02077bb5a3 Merge main into feat/js-object-set-prototype-of 2026-12-01 20:25:00 -08:00
dotCooCoo 18b8e71086 Docs: the ownKeys invariant check charges code units only for names it looks up
For an extensible target whose own properties are all configurable, the
check reads each property's descriptor for one unit of fuel and returns
before it looks any name up, so it does not charge for code units. The
paragraph in docs/mcp.md now says which part of the check charges per key
and which part charges per code unit.
2026-12-01 20:25:00 -08:00
dotCooCoo f2d6ea0c51 Merge main into fix/make-numbers-sequence 2026-12-01 20:00:19 -08:00
dotCooCoo 6e6a9a6d2f Merge main into fix/craft-fonts-pin-main 2026-12-01 19:29:33 -08:00
.CooCoo 3860a8025c Merge pull request #10502 from dotCooCoo/fix/common-tangents-metaball
Path Precision Tools: Common Tangents and Smooth Bridge are one dialog
2026-12-01 18:28:19 -08:00
.CooCoo 44522e9b7e Merge pull request #10506 from dotCooCoo/fix/include-bleed-native-files
Export for Screens: Include Bleed files of an artboard hold the bleed once
2026-12-01 17:32:13 -08:00
FredApps 559a2205d5 Merge branch 'main' into svg/export-length-unit 2026-12-02 00:35:06 +01:00
.CooCoo 3852fa4afb Merge pull request #10484 from dotCooCoo/fix/pathops-cap-reports
Pathfinder: Divide and Live Paint report paths too complex to map
2026-12-01 15:33:36 -08:00
FredApps 5a4a558f5c Merge branch 'main' into svg/export-length-unit 2026-12-02 00:29:33 +01:00
.CooCoo aa557da659 Merge pull request #8808 from dotCooCoo/feat/quick-pen-scroll-arc
Quick Pen: Ctrl+wheel over the canvas changes the arc size
2026-12-01 14:57:33 -08:00
dotCooCoo 86a5efd04c Export for Screens: Include Bleed files of an artboard hold the bleed once
With Include Bleed, a .vectorcraft, .ai or EPS row wrote the artboard
already grown by the document's bleed and kept the document's bleed as
well. Opened again, the file had the bleed outside the grown artboard, so
a PDF with the document's bleed came out with it twice: a 3 mm bleed made
a 6 mm one.

These files now hold the grown artboard with a bleed of 0. PDF rows and
Full Document files are unchanged. The params text and docs/mcp.md say so.
2026-12-01 14:38:27 -08:00
dotCooCoo 9bf07c220e Merge main into fix/script-new-document-overprint-links 2026-12-01 13:53:12 -08:00
dotCooCoo 6230cf282a Merge main into fix/common-tangents-metaball 2026-12-01 13:17:02 -08:00
dotCooCoo 813ef9b3e7 Merge main into fix/pathops-cap-reports 2026-12-01 13:16:59 -08:00
.CooCoo a5a3e40c5e Merge pull request #9087 from dotCooCoo/feat/scripts-print-printer
Scripts: Document.print prints to an installed printer and app.printerList lists the printers
2026-12-01 13:11:17 -08:00
dotCooCoo 988e5ca919 Merge main into fix/common-tangents-metaball 2026-12-01 11:16:00 -08:00
dotCooCoo 6f684e6da9 Path Precision Tools: Common Tangents and Smooth Bridge are one dialog
Common Tangents… now also does what Smooth Bridge… did (#10465).

- Connect tangents joins the two tangents of each kind into one closed
  shape, along the chords between where they touch each path (a point's
  two lines make a triangle). `connect` on
  `addon.pathtools.commonTangents`.
- With External, the dialog shows Straight and Curved. Straight keeps
  the tangent lines; Curved joins the circles along concave arcs, as
  Smooth Bridge did, with Radius, Constant Gap, Reach and Keep
  Originals, which take input only with Curved. `curved`, `radius`,
  `gap`, `reach` and `keepOriginals` on the command; options of the
  other mode are an error.
- The Smooth Bridge… menu item is gone. `addon.pathtools.bridge` still
  runs for scripts and actions, opens the merged dialog with External
  and Curved, and is left out of the command palette and Keyboard
  Shortcuts. A palette search for "metaball" or "smooth bridge" finds
  Common Tangents.

Docs: docs/mcp.md, docs/ui-parity.md, ROADMAP.
2026-12-01 11:16:00 -08:00
dotCooCoo ce596d4f57 Arrange Tools: Mark Bounds of Each draws no empty group for an object too small for corner legs
Each corner leg is at most half the side it runs along. An object wider or
taller than the flat limit but with both half-sides under it got a Corner Marks
group with no paths in it. Such an object now gets no corner marks, and a
selection of only such objects is refused with "nothing to mark: the selection
is too small for corner marks" and no undo step. The Rectangle style still
marks it.

Follows up #10148.
2026-12-01 09:47:43 -08:00
.CooCoo 7936fd6f67 Merge pull request #10153 from dotCooCoo/fix/file-new-rejects-bad-rows
New Document: file.new refuses artboard counts that are not whole numbers
2026-12-01 09:47:36 -08:00
.CooCoo 9a9cdbcf33 Merge pull request #10140 from dotCooCoo/feat/symbol-drop-keeps-art
Symbols: art dropped on a symbol with Alt+Shift redefines it and stays as it was
2026-12-01 09:47:19 -08:00