pixi-silk 0.1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/README.md +48 -68
  3. package/dist/SilkGraphics.d.ts +270 -55
  4. package/dist/SilkGraphics.js +909 -147
  5. package/dist/app.d.ts +32 -16
  6. package/dist/app.js +44 -10
  7. package/dist/atlas.d.ts +13 -6
  8. package/dist/atlas.js +13 -6
  9. package/dist/batch.d.ts +63 -0
  10. package/dist/batch.js +327 -0
  11. package/dist/color.d.ts +4 -1
  12. package/dist/color.js +9 -4
  13. package/dist/constants.js +31 -5
  14. package/dist/curves.d.ts +9 -3
  15. package/dist/curves.js +11 -5
  16. package/dist/glass/Glass.d.ts +62 -0
  17. package/dist/glass/Glass.js +135 -0
  18. package/dist/glass/GlassFilter.d.ts +33 -0
  19. package/dist/glass/GlassFilter.js +264 -0
  20. package/dist/glass/glass-wgsl.js +129 -0
  21. package/dist/glass/options.d.ts +63 -0
  22. package/dist/glass/options.js +55 -0
  23. package/dist/glass.d.ts +4 -0
  24. package/dist/glass.js +4 -0
  25. package/dist/glow/Glow.d.ts +60 -0
  26. package/dist/glow/Glow.js +65 -0
  27. package/dist/glow/aurora.d.ts +66 -0
  28. package/dist/glow/aurora.js +133 -0
  29. package/dist/glow/light.d.ts +38 -0
  30. package/dist/glow/light.js +83 -0
  31. package/dist/glow/recipes.d.ts +37 -0
  32. package/dist/glow/recipes.js +154 -0
  33. package/dist/glow/shapes.d.ts +13 -0
  34. package/dist/glow/shapes.js +34 -0
  35. package/dist/glow.d.ts +6 -0
  36. package/dist/glow.js +6 -0
  37. package/dist/gradient.d.ts +57 -4
  38. package/dist/gradient.js +142 -4
  39. package/dist/history.d.ts +194 -0
  40. package/dist/history.js +350 -0
  41. package/dist/hit.js +160 -26
  42. package/dist/index.d.ts +6 -5
  43. package/dist/index.js +4 -3
  44. package/dist/layout/flex.js +409 -0
  45. package/dist/layout/node.d.ts +53 -0
  46. package/dist/layout/node.js +117 -0
  47. package/dist/layout/style.d.ts +115 -0
  48. package/dist/layout.d.ts +3 -0
  49. package/dist/layout.js +2 -0
  50. package/dist/motion.d.ts +14 -10
  51. package/dist/motion.js +14 -10
  52. package/dist/path.d.ts +150 -0
  53. package/dist/path.js +761 -0
  54. package/dist/selection.d.ts +133 -0
  55. package/dist/selection.js +194 -0
  56. package/dist/shader-slot.js +9 -0
  57. package/dist/shader-wgsl.js +946 -0
  58. package/dist/shader.js +480 -55
  59. package/dist/signal.d.ts +49 -0
  60. package/dist/signal.js +79 -0
  61. package/dist/stroke.js +271 -0
  62. package/dist/text/SilkText.d.ts +249 -0
  63. package/dist/text/SilkText.js +568 -0
  64. package/dist/text/atlas.d.ts +153 -0
  65. package/dist/text/atlas.js +316 -0
  66. package/dist/text/edt.d.ts +14 -0
  67. package/dist/text/edt.js +97 -0
  68. package/dist/text/label.d.ts +19 -0
  69. package/dist/text/label.js +38 -0
  70. package/dist/text/layout.d.ts +150 -0
  71. package/dist/text/layout.js +270 -0
  72. package/dist/text/segment.d.ts +34 -0
  73. package/dist/text/segment.js +98 -0
  74. package/dist/text/shader.js +355 -0
  75. package/dist/text.d.ts +7 -0
  76. package/dist/text.js +7 -0
  77. package/dist/ui/ButtonDock.d.ts +47 -0
  78. package/dist/ui/ButtonDock.js +110 -0
  79. package/dist/ui/RadialMenu.d.ts +222 -0
  80. package/dist/ui/RadialMenu.js +680 -0
  81. package/dist/ui/SilkButton.d.ts +149 -0
  82. package/dist/ui/SilkButton.js +323 -0
  83. package/dist/ui/ValuePill.d.ts +48 -0
  84. package/dist/ui/ValuePill.js +77 -0
  85. package/dist/ui/arc.d.ts +32 -0
  86. package/dist/ui/arc.js +58 -0
  87. package/dist/ui/brush.d.ts +117 -0
  88. package/dist/ui/brush.js +280 -0
  89. package/dist/ui/camera.d.ts +250 -0
  90. package/dist/ui/camera.js +634 -0
  91. package/dist/ui/color/ColorPicker.d.ts +72 -0
  92. package/dist/ui/color/ColorPicker.js +125 -0
  93. package/dist/ui/color/ColorSlider.d.ts +81 -0
  94. package/dist/ui/color/ColorSlider.js +227 -0
  95. package/dist/ui/color/ColorWheel.d.ts +34 -0
  96. package/dist/ui/color/ColorWheel.js +117 -0
  97. package/dist/ui/color/Eyedropper.d.ts +57 -0
  98. package/dist/ui/color/Eyedropper.js +159 -0
  99. package/dist/ui/color/OklchPicker.d.ts +45 -0
  100. package/dist/ui/color/OklchPicker.js +137 -0
  101. package/dist/ui/color/SwatchPalette.d.ts +60 -0
  102. package/dist/ui/color/SwatchPalette.js +160 -0
  103. package/dist/ui/color/SwatchPopup.d.ts +68 -0
  104. package/dist/ui/color/SwatchPopup.js +237 -0
  105. package/dist/ui/color/draw.d.ts +22 -0
  106. package/dist/ui/color/draw.js +128 -0
  107. package/dist/ui/color/model.d.ts +94 -0
  108. package/dist/ui/color/model.js +193 -0
  109. package/dist/ui/color/rings.d.ts +75 -0
  110. package/dist/ui/color/rings.js +247 -0
  111. package/dist/ui/color.d.ts +11 -0
  112. package/dist/ui/color.js +11 -0
  113. package/dist/ui/dial.d.ts +229 -0
  114. package/dist/ui/dial.js +553 -0
  115. package/dist/ui/driver.d.ts +24 -0
  116. package/dist/ui/driver.js +46 -0
  117. package/dist/ui/gesture.d.ts +66 -0
  118. package/dist/ui/gesture.js +116 -0
  119. package/dist/ui/gizmo.d.ts +198 -0
  120. package/dist/ui/gizmo.js +933 -0
  121. package/dist/ui/grid.d.ts +106 -0
  122. package/dist/ui/grid.js +228 -0
  123. package/dist/ui/group.d.ts +81 -0
  124. package/dist/ui/group.js +144 -0
  125. package/dist/ui/guides.d.ts +142 -0
  126. package/dist/ui/guides.js +379 -0
  127. package/dist/ui/halo.d.ts +164 -0
  128. package/dist/ui/halo.js +438 -0
  129. package/dist/ui/icon.d.ts +14 -0
  130. package/dist/ui/icon.js +40 -0
  131. package/dist/ui/index.d.ts +62 -0
  132. package/dist/ui/index.js +56 -0
  133. package/dist/ui/input.d.ts +28 -0
  134. package/dist/ui/input.js +49 -0
  135. package/dist/ui/inspector.d.ts +4 -0
  136. package/dist/ui/inspector.js +4 -0
  137. package/dist/ui/keys.d.ts +20 -0
  138. package/dist/ui/keys.js +65 -0
  139. package/dist/ui/label.d.ts +18 -0
  140. package/dist/ui/layers.d.ts +5 -0
  141. package/dist/ui/layers.js +5 -0
  142. package/dist/ui/layout/debug.d.ts +38 -0
  143. package/dist/ui/layout/debug.js +299 -0
  144. package/dist/ui/layout/flex-container.d.ts +150 -0
  145. package/dist/ui/layout/flex-container.js +441 -0
  146. package/dist/ui/layout/simulate.d.ts +49 -0
  147. package/dist/ui/layout/simulate.js +92 -0
  148. package/dist/ui/layout/smart-container.d.ts +180 -0
  149. package/dist/ui/layout/smart-container.js +302 -0
  150. package/dist/ui/layout.d.ts +5 -0
  151. package/dist/ui/layout.js +5 -0
  152. package/dist/ui/marquee.d.ts +124 -0
  153. package/dist/ui/marquee.js +321 -0
  154. package/dist/ui/measure.d.ts +138 -0
  155. package/dist/ui/measure.js +351 -0
  156. package/dist/ui/minimap.d.ts +2 -0
  157. package/dist/ui/minimap.js +2 -0
  158. package/dist/ui/modes.d.ts +186 -0
  159. package/dist/ui/modes.js +380 -0
  160. package/dist/ui/odometer.d.ts +104 -0
  161. package/dist/ui/odometer.js +244 -0
  162. package/dist/ui/outline.d.ts +104 -0
  163. package/dist/ui/outline.js +310 -0
  164. package/dist/ui/paint.js +22 -0
  165. package/dist/ui/panel.d.ts +4 -0
  166. package/dist/ui/panel.js +4 -0
  167. package/dist/ui/panels/Inspector.d.ts +228 -0
  168. package/dist/ui/panels/Inspector.js +516 -0
  169. package/dist/ui/panels/LayerTree.d.ts +193 -0
  170. package/dist/ui/panels/LayerTree.js +878 -0
  171. package/dist/ui/panels/Minimap.d.ts +140 -0
  172. package/dist/ui/panels/Minimap.js +412 -0
  173. package/dist/ui/panels/Panel.d.ts +273 -0
  174. package/dist/ui/panels/Panel.js +767 -0
  175. package/dist/ui/panels/ScrollView.d.ts +126 -0
  176. package/dist/ui/panels/ScrollView.js +358 -0
  177. package/dist/ui/panels/binding.d.ts +59 -0
  178. package/dist/ui/panels/binding.js +84 -0
  179. package/dist/ui/panels/fields.d.ts +265 -0
  180. package/dist/ui/panels/fields.js +760 -0
  181. package/dist/ui/panels/icons.d.ts +7 -0
  182. package/dist/ui/panels/icons.js +136 -0
  183. package/dist/ui/panels/pixi-tree.d.ts +35 -0
  184. package/dist/ui/panels/pixi-tree.js +82 -0
  185. package/dist/ui/panels/theme.d.ts +79 -0
  186. package/dist/ui/panels/theme.js +91 -0
  187. package/dist/ui/panels/tree.d.ts +130 -0
  188. package/dist/ui/panels/tree.js +199 -0
  189. package/dist/ui/pathgizmo.d.ts +253 -0
  190. package/dist/ui/pathgizmo.js +932 -0
  191. package/dist/ui/pill.d.ts +3 -0
  192. package/dist/ui/pill.js +2 -0
  193. package/dist/ui/ruler.d.ts +113 -0
  194. package/dist/ui/ruler.js +371 -0
  195. package/dist/ui/snap.d.ts +151 -0
  196. package/dist/ui/snap.js +380 -0
  197. package/dist/ui/spacing.d.ts +122 -0
  198. package/dist/ui/spacing.js +346 -0
  199. package/dist/ui/textedit.d.ts +304 -0
  200. package/dist/ui/textedit.js +1085 -0
  201. package/dist/ui/timeline.d.ts +175 -0
  202. package/dist/ui/timeline.js +488 -0
  203. package/dist/webgpu.d.ts +25 -0
  204. package/dist/webgpu.js +32 -0
  205. package/package.json +172 -1
  206. package/skills/pixi-silk/SKILL.md +138 -0
  207. package/skills/pixi-silk-app-rendering/SKILL.md +114 -0
  208. package/skills/pixi-silk-drawing/SKILL.md +154 -0
  209. package/skills/pixi-silk-editor/SKILL.md +200 -0
  210. package/skills/pixi-silk-layout/SKILL.md +150 -0
  211. package/skills/pixi-silk-migrate-from-graphics/SKILL.md +115 -0
  212. package/skills/pixi-silk-paint/SKILL.md +132 -0
  213. package/skills/pixi-silk-text/SKILL.md +127 -0
  214. package/skills/pixi-silk-widgets/SKILL.md +139 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,113 @@
1
1
  # pixi-silk
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#12](https://github.com/schmooky/pixi-silk/pull/12) [`4ef6597`](https://github.com/schmooky/pixi-silk/commit/4ef65970955dc8e8f4ad92892d12a65fa5120968) Thanks [@igaming-bulochka](https://github.com/igaming-bulochka)! - SilkGraphics render on Chrome and Edge for Windows again. ANGLE's Direct3D 11 backend could not compile the WebGL2 program and lost the context: FXC failed on the discard inside the path stroke loop. The shader now discards after the loop.
8
+
9
+ - [#12](https://github.com/schmooky/pixi-silk/pull/12) [`4ef6597`](https://github.com/schmooky/pixi-silk/commit/4ef65970955dc8e8f4ad92892d12a65fa5120968) Thanks [@igaming-bulochka](https://github.com/igaming-bulochka)! - `createSilkApp({ preference: 'webgpu' })` retries on WebGL2 when WebGPU is offered but fails to start, and logs a warning, instead of rejecting.
10
+
11
+ ## 1.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - pixi-silk 1.0. The core API (`SilkGraphics`, `createSilkApp`, gradients, paint effects, `pixi-silk/glass`, `pixi-silk/glow`, `pixi-silk/text`, `pixi-silk/layout`, `pixi-silk/webgpu`) is now stable and follows semver. The editor kit under `pixi-silk/ui` (camera, rulers, guides, marquee, gizmos, text editor, path gizmo, panels and the other editor widgets) is marked `@experimental` and may change in a minor release. The package ships agent skills in `skills/`.
16
+
17
+ ### Fixes in 1.0.0
18
+
19
+ - `Glass` panes rotate and take an uneven scale: the shape, rim and refraction follow the transform on WebGL2 and WebGPU. `GlassFilter.setRotation()` sets the angle when you use the filter alone.
20
+ - `ChannelSliders` built without a `model` share one model across their tracks and expose it as `model`.
21
+ - `MiniTimeline` takes `fontSize`, `fontFamily` and a `label` factory for its ruler numbers.
22
+ - `Camera` sets the CSS `touch-action` of its element to `none` while it lives, so a pinch zooms the camera, not the page. Two-finger flings glide at finger speed.
23
+ - `createSilkApp` ends drags when the browser cancels a pointer, so a touch the page takes over for a scroll no longer leaves a scrubber, gizmo or panel stuck mid-drag.
24
+ - `SdfAtlas` moves to a new texture when it grows and frees the old one after the frame, which removes a WebGPU "Destroyed texture used in a submit" warning.
25
+
26
+ ### Minor Changes
27
+
28
+ - New `pixi-silk/ui/camera`. `Camera` pans and zooms a world container like a design tool: pinch, ctrl or cmd + wheel, scroll, middle, right and Space drags, two-finger touch and flings. `fit`, `zoomTo` and `centerOn` animate, and zoom and position are signals. `ZoomControl` draws a `- 100% +` bar for it.
29
+
30
+ New `pixi-silk/ui/measure`. `Measure` draws Figma-style redlines between two objects and a `W x H` size badge, in world units at any zoom.
31
+ - `Camera` leaves plain scrolls to a scrolling page until the canvas is clicked (`pageScroll`, default `auto`), and `fit()` takes padding per side to centre content between docked panels. The layout debug overlay stays on its boxes under a camera.
32
+ - Canvas tools for the camera, each its own entry point. `pixi-silk/ui/grid`: `CanvasGrid` draws an infinite lines or dots grid whose levels fade with the zoom, two silk shapes per level. `pixi-silk/ui/ruler`: `Ruler` draws top and left rulers with 1, 2, 5 labels, a selection band and a cursor marker. `pixi-silk/ui/guides`: `Guides` are dragged out of the rulers, snap to a `SnapEngine` and feed it back.
33
+
34
+ `pixi-silk/ui/marquee`: `Marquee` is rubber-band selection on empty canvas, with Shift to add, Alt to take away, and intersect or contain modes. `pixi-silk/ui/group`: `SelectionGroup` lets the `TransformGizmo` move, resize and rotate several objects about a common pivot. `pixi-silk/ui/spacing`: `findSpacing` and `SpacingMarkers` show Figma-style equal gaps and alignment lines. `Camera` gains `world` and `element` getters and `state.width` and `state.height` signals that follow resizes.
35
+ - Add effects drawn from the distance field in the same draw call, plus glass and glow.
36
+
37
+ - Fills and strokes take `spread` (grow before blur), `blend: 'add'` (plus lighter) and a progressive `blur: { from, to, angle }`.
38
+ - `innerShadow` draws one or more inset shadows with offset, blur, spread, colour and blend on any closed shape.
39
+ - `mesh(cols, rows, colors)` is a smooth gradient mesh, blended in OKLab.
40
+ - `pixi-silk/glass`: a frosted glass pane with backdrop blur, refraction, dispersion, a lit rim and grain.
41
+ - `pixi-silk/glow`: stacked glow passes, neon and halo recipes, an animated aurora, light rays and spectrum helpers.
42
+ - Strokes support `join: 'miter' | 'bevel' | 'round'` and `miterLimit`, as in Canvas 2D. The default is now `miter`, so stroked rects without a radius have sharp corners. Use `join: 'round'` for the old look. A stroked path is one distance field, with caps, joins and dashes, and no double blending at its corners. `union: true` on a fill or stroke paints several shapes as one, with no seam where they meet. The gizmo arrows and handles use it. `enableSilkBatching()` draws runs of consecutive SilkGraphics in one draw call. `new SilkGraphics({ batch: false })` opts an object out.
43
+ - New `pixi-silk/layout`. `LayoutNode` is a small flex layout engine with no Pixi in it. It covers direction, wrap, gap, padding, margins, grow and shrink with min and max, justify and align, percents, aspect ratio, absolute anchors and measured leaves. Layout is incremental: clean subtrees are skipped and measured leaves cache their size.
44
+
45
+ New `pixi-silk/ui/layout`. `SmartContainer` places a design box in the window from `portraitData` and `landscapeData` records, for portrait and landscape screens against a reference resolution. It adds named breakpoints, a viewport source instead of window listeners, safe-area insets, `extendWidth` and `extendHeight`, and an optional glide when the breakpoint changes. `FlexContainer` lays out children with the flex engine, inside a SmartContainer or on its own, with fit modes, text shrink-to-fit, responsive styles and spring transitions. `layoutDebug` draws boxes, breakpoints, scales, anchors, safe areas, padding, gaps and overflow, with a hover readout. `simulateViewport` previews device sizes inside a page.
46
+ - New editor panels, drawn on the canvas with no DOM. Each has its own entry point.
47
+
48
+ `pixi-silk/ui/panel` has `Panel`: a title bar, a body that scrolls, edges to resize and a chevron that folds it. Drag it by the title, and drop it near a screen edge or corner to dock it there. `ScrollView` scrolls with glide, flings and a slim scrollbar. `panelHitTest` keeps camera wheels and pans off the panels.
49
+
50
+ `pixi-silk/ui/layers` has `LayerTree`, a virtualised layer list over any tree through a `TreeAdapter`. It selects with a `Selection` store, drags rows to reorder and reparent them, renames in place and moves with the arrow keys. `pixiTreeAdapter` shows a Pixi scene graph.
51
+
52
+ `pixi-silk/ui/inspector` has `Inspector`, built from a schema of number, text, toggle, choice, colour and vector fields in folding sections. It edits objects or signals, shows Mixed for differing values and records one undo step per drag.
53
+
54
+ `pixi-silk/ui/minimap` has `Minimap`, a view of a camera's world with a frame you drag, click and scroll.
55
+
56
+ `Camera` takes an `ignore` option for points it should leave alone.
57
+ - `fill()` now fills free-form paths (`poly()`, `moveTo` and curves) as one exact shape, even-odd, so blur, spread, progressive blur and inner shadows work on any outline. Pointer hits follow the outline. `neon()` follows the five-layer Figma recipe. New in `pixi-silk/glow`: `bolt()`, `drop()` and `shadowStack()`.
58
+ - Add `pixi-silk/text`: text that stays sharp at any zoom, drawn from signed distance fields.
59
+
60
+ - `SilkText` is a display object with the PixiJS `Text` options you use for labels: font, size, weight, style, fill (colour or gradient), letter spacing, line height, alignment and word wrap. It is one instanced draw call per text, on WebGL2 and WebGPU.
61
+ - Outlines, drop shadows, glows, weight changes and tabular numbers come from the same distance field, with no filters.
62
+ - `SdfAtlas` bakes glyphs of any CSS font at runtime with Canvas2D and an exact distance transform, into one shared texture that grows as needed. `layoutText` and `sdfFromAlpha` are exported too.
63
+ - `ValuePill` takes a `label` factory. Pass `silkLabel()` for pills that stay sharp under a zooming camera. Widgets keep PixiJS `Text` by default and never import SilkText on their own.
64
+ - New `pixi-silk/selection`. `Selection` keeps the selected items in order, the primary item and the hovered one as signals. `bindOutline`, `bindGizmo` and `bindMeasure` make the widgets follow it with one call each.
65
+
66
+ New `pixi-silk/history`. `History` is an undo stack with transactions, merging, labels, a depth limit and `canUndo` and `canRedo` signals. `recordSignals` makes signal changes undoable without commands, `recordGizmo` turns each gizmo drag into one step, and `bindHistoryKeys` binds cmd or ctrl + Z. Widgets take any `HistoryLike`, so an app can bring its own store.
67
+
68
+ New `pixi-silk/path` and `pixi-silk/ui/pathgizmo`. Bezier paths are plain data with helpers to draw, split, insert, delete and convert from and to SVG. `PathGizmo` edits them like a design tool, with a pen tool, and every edit is undoable.
69
+ - Shape operations. `fill({ op })` and `stroke({ op })` combine the closed shapes of the active path with `union`, `subtract`, `intersect` or `exclude` into one exact shape. `boolean(op, a, b)` combines what two callbacks draw and nests. The result is one instance with a sharp outline, and it takes strokes, gradients, blur, spread and inner shadows. Hit tests follow it.
70
+
71
+ `svgPath(d)` reads an SVG path string into the active path, for fills, strokes and shape operations.
72
+
73
+ Hit tests of hearts, stars and sectors now follow their exact shape instead of their bounds.
74
+ - Add `pixi-silk/ui/textedit`: text you can click and edit on the canvas, like a design tool text layer.
75
+
76
+ - `TextEditor` wraps a `SilkText` with a caret and rounded selection boxes drawn with silk, so both stay crisp under a zooming camera. The caret moves by grapheme cluster, blinks softly and holds still while you type.
77
+ - Typing goes through a hidden `<textarea>` at the caret, so input methods, dead keys, mobile keyboards, autocorrect, the emoji picker and the clipboard work. Composed text shows underlined.
78
+ - Click, drag, Shift + click, double click for a word and triple click for a paragraph. Touch taps place the caret and a long press selects a word, with optional handles.
79
+ - Arrows, Home and End, word jumps, select all, word deletes, Enter, Tab and Escape. Undo merges consecutive typing, and the `history` option shares the app's undo stack.
80
+ - Single-line inputs that scroll, text areas, placeholders, `maxLength`, read-only text and `TextEditor.chain()` for Tab order. Events `focus`, `blur`, `input`, `change` and `submit`, and the same state as signals.
81
+ - `SilkText` gains `layout`, `caretAt()`, `caretRect()` and `rangeRects()`. `pixi-silk/text` exports the layout hit testing (`caretAtPoint`, `caretRect`, `rangeRects`, `lineOfIndex`) and grapheme and word helpers. Layout lines and glyphs now carry their source offsets and caret stops.
82
+ - Add tree-shakeable UI widgets, each under its own entry point.
83
+
84
+ - `pixi-silk/ui/radial`: radial and marking menus with nested rings, angular falloff and per-device input profiles.
85
+ - `pixi-silk/ui/button` and `pixi-silk/ui/dock`: buttons that animate in and out and refuse input while moving, and a row that reflows as they hide.
86
+ - `pixi-silk/ui/gizmo`, `pixi-silk/ui/outline` and `pixi-silk/ui/snap`: transform gizmos in every mode, animated selection outlines and smart guides.
87
+ - `pixi-silk/ui/color`: colour pickers that share one colour model. Hue triangle and square, wheel, OKLCH, channel sliders, swatches and an eyedropper.
88
+ - `pixi-silk/ui/halo`, `pixi-silk/ui/brush` and `pixi-silk/ui/modes`: a context halo, a brush cursor, a hold-to-show mode ring and a segmented switch.
89
+ - `pixi-silk/ui/dial`, `pixi-silk/ui/timeline` and `pixi-silk/ui/odometer`: jog dials, scrub fields, a mini timeline and rolling counters.
90
+ - `pixi-silk/ui/gesture`, `pixi-silk/ui/arc`, `pixi-silk/ui/keys` and `pixi-silk/ui/pill`: the shared building blocks.
91
+ - `pixi-silk/signal`: the tiny signal store the widgets keep their state in.
92
+ - `enableSilkBatching()` batches on WebGPU too. Runs of SilkGraphics share one draw call under Pixi's WebGPU renderer, with the same packing as on WebGL2 and the same pixels. It needs the WGSL shader from `enableWebGPU()`, which `createSilkApp` loads for you.
93
+ - Render on Pixi's WebGPU renderer. WebGL2 stays the default and the fallback.
94
+
95
+ - The uber shader has a WGSL port with the same shapes, strokes, dashes, effects and gradients as the GLSL one.
96
+ - `createSilkApp({ preference: 'webgpu' })` uses WebGPU where the browser has it. It loads the WGSL shader on demand, so WebGL2 apps do not download it.
97
+ - `pixi-silk/webgpu` exports `enableWebGPU()` for apps that create the Pixi application themselves.
98
+ - `Glass` now frosts the backdrop on WebGPU too, instead of drawing a plain fill.
99
+ - WebGPU draws joined path strokes and shape unions the same as WebGL2. `Measure`, `ZoomControl`, `Ruler` and `Guides` take a `label` option. Pass `silkLabel()` from `pixi-silk/text` and their text is drawn with SilkText, sharp at any zoom.
100
+
101
+ ### Patch Changes
102
+
103
+ - The package ships agent skills in `skills/`. Point your coding agent at `node_modules/pixi-silk/skills/pixi-silk/SKILL.md`: it routes to skills for drawing, paint, app setup and rendering, text, layout, widgets, the editor kit and migrating from PixiJS Graphics.
104
+ - Glass no longer triggers a WebGL `GL_INVALID_OPERATION` warning on its first frame over an opaque canvas. It skips that one frame while the back buffer turns on.
105
+
106
+ The editor kit is marked experimental for 1.0: camera, measure, grid, ruler, guides, marquee, group, spacing, snap, halo, brush, modes, dial, timeline, textedit, the panels and pathgizmo. Their API may change in a minor release.
107
+
108
+ The JSDoc now states units, defaults and side effects, and fixes wrong facts. For example, the instance stride is 44 floats.
109
+ - Stroked paths shade every pixel once in the hard cases too. A long translucent path that crosses itself far along its length no longer blends twice where it overlaps: each chunk of a path also checks the segments of other chunks near it. Fold-backs on chunk boundaries keep exact coverage. Square dash caps that run through a round corner keep the corner round.
110
+
3
111
  ## 0.1.0
4
112
 
5
113
  ### Minor Changes
package/README.md CHANGED
@@ -1,103 +1,83 @@
1
1
  # pixi-silk
2
2
 
3
- **Smooth vector graphics for PixiJS v8.** pixi-silk draws shapes as exact signed distance fields.
4
- Every edge is anti-aliased per pixel, so it stays smooth at any zoom, rotation and device pixel
5
- ratio. No MSAA, no triangles, one draw call per object.
3
+ Smooth vector graphics for PixiJS v8. `SilkGraphics` has an API close to `Graphics`, and it
4
+ draws each shape as a distance field that the shader anti-aliases per pixel.
6
5
 
7
6
  [Docs](https://pixi-silk.schmooky.dev/docs/) |
7
+ [Getting started](https://pixi-silk.schmooky.dev/docs/getting-started/) |
8
8
  [API reference](https://pixi-silk.schmooky.dev/api/) |
9
- [Lab](https://pixi-silk.schmooky.dev/lab/) |
10
- [Showcase](https://pixi-silk.schmooky.dev/showcase/) |
11
- [llms.txt](https://pixi-silk.schmooky.dev/llms.txt)
9
+ [Studio](https://pixi-silk.schmooky.dev/studio/) |
10
+ [FAQ](https://pixi-silk.schmooky.dev/faq/)
12
11
 
13
12
  ```bash
14
13
  npm install pixi-silk pixi.js
15
14
  ```
16
15
 
17
16
  ```ts
18
- import { createSilkApp, SilkGraphics, conic, vertical } from 'pixi-silk';
17
+ import { conic, createSilkApp, SilkGraphics, vertical } from 'pixi-silk';
19
18
 
20
19
  const { app } = await createSilkApp({ parent: document.getElementById('stage')!, background: 0x000000 });
20
+ const g = new SilkGraphics();
21
21
 
22
- const g = new SilkGraphics()
23
- .roundRect(10, 10, 340, 140, 22, 0.6).fill(0x1c1c1e) // squircle card
24
- .arcSweep(80, 80, 44, -Math.PI / 2, Math.PI * 1.5)
22
+ g.roundRect(10, 10, 340, 140, 22, 0.6).fill(0x1c1c1e); // radius 22, squircle smoothing 0.6
23
+ g.arcSweep(80, 80, 44, -Math.PI / 2, Math.PI * 1.5)
25
24
  .stroke({ width: 12, cap: 'round', gradient: conic([0x30d158, 0xffd60a, 0xff453a]) });
26
-
27
25
  g.area([120, 100, 170, 80, 220, 92, 270, 60, 320, 70], 130, { smooth: 'monotone' })
28
26
  .fill(vertical([[0, 0xff9f0a, 0.8], [1, 0xff9f0a, 0]]))
29
- .stroke({ width: 2, color: 0xff9f0a, cap: 'round' }); // stroke right after fill = top line
27
+ .stroke({ width: 2, color: 0xff9f0a, cap: 'round' });
30
28
 
31
29
  app.stage.addChild(g);
32
30
  ```
33
31
 
34
- ## Why
35
-
36
- PixiJS v8 turns `Graphics` into triangles when you draw. Scaled curves show facets. Thin lines
37
- crawl between pixels. Anti-aliasing is MSAA on the main canvas only, so filters and render textures
38
- stay aliased unless you opt each one in. Filters render at resolution 1, and 8-bit gradients band.
39
-
40
- | | Pixi `Graphics` | `SilkGraphics` |
41
- |---|---|---|
42
- | Edges | triangles + optional MSAA | exact distance per pixel, 1-device-pixel filter |
43
- | Zoom | facets appear | exact at any scale |
44
- | Thin lines | break up below 1 px | keep 1 px and fade |
45
- | Inside filters / render textures | aliased unless each target opts into MSAA | same quality everywhere |
46
- | Gradients | sRGB, 8-bit | OKLab, half-float ramps, dithered |
47
- | Draw calls | batched geometry | one instanced draw call per object |
48
-
49
- ## Features
50
-
51
- - **Shapes.** `rect`, `roundRect` with per-corner radii and squircle smoothing, `pill`, `circle`,
52
- `ellipse`, `arc`, `arcSweep`, `sector` (donuts, gauges), `line` and `polyline`. Polylines can be
53
- smoothed (monotone or Catmull-Rom), closed and tapered.
54
- - **Paths and more.** `moveTo`, `lineTo`, `quadraticCurveTo`, `bezierCurveTo`, `area` for charts,
55
- `heart`, `star`, `regularPoly` and rounded `triangle`.
56
- - **Gradients.** `linear`, `vertical`, `horizontal`, `radial`, `conic` and `along`. They mix in OKLab
57
- (or linear or sRGB), with easing and extend modes.
58
- - **Paint.** A gaussian `blur` on any fill or stroke gives glows and soft shadows. Dashes and dots
59
- are drawn in the shader. Strokes align inside, center or outside. Hairlines keep 1 pixel and fade.
60
- - **Transforms.** `save`, `restore`, `translateTransform`, `rotateTransform`, `scaleTransform` and
61
- `setTransform`. Rotated shapes stay exact.
62
- - **Events.** `containsPoint` tests the real shapes. Rings are hollow and a line only reacts on its
63
- stroke.
64
- - **`createSilkApp`.** Maps canvas pixels 1:1 to device pixels, even at fractional ratios, and follows
65
- DPR changes. No MSAA, filters at screen resolution, and pages still scroll on touch screens.
66
- - **Motion.** Frame-rate independent `damp`, `dampAngle`, `Spring` and `ease`.
67
- - **Performance.** 40 floats per primitive and one draw call per object. Rebuilding 50,000 primitives
68
- takes about 12 ms of CPU per frame.
69
-
70
- Requirements: `pixi.js` ^8.6 (peer dependency) and WebGL2. WebGPU is not supported yet.
71
- Free-form paths are stroke-only, and joins are always round.
72
-
73
- ## Documentation
74
-
75
- - [Introduction](https://pixi-silk.schmooky.dev/docs/introduction/), [installation](https://pixi-silk.schmooky.dev/docs/installation/) and [quick start](https://pixi-silk.schmooky.dev/docs/quick-start/)
76
- - Smooth graphics: [anti-aliasing in PixiJS v8 (MSAA vs SDF)](https://pixi-silk.schmooky.dev/docs/antialiasing-in-pixijs/), [fix jagged or blurry PixiJS graphics](https://pixi-silk.schmooky.dev/docs/smooth-graphics-pixijs/), [@pixi/graphics-smooth and PixiJS v8](https://pixi-silk.schmooky.dev/docs/graphics-smooth-v8/), [glossary](https://pixi-silk.schmooky.dev/docs/glossary/)
77
- - Guides with live demos: [shapes](https://pixi-silk.schmooky.dev/docs/shapes/), [arcs & rings](https://pixi-silk.schmooky.dev/docs/arcs-and-rings/), [lines & paths](https://pixi-silk.schmooky.dev/docs/lines-and-paths/), [fills & strokes](https://pixi-silk.schmooky.dev/docs/fills-and-strokes/), [dashes](https://pixi-silk.schmooky.dev/docs/dashes/), [gradients](https://pixi-silk.schmooky.dev/docs/gradients/), [blur & shadows](https://pixi-silk.schmooky.dev/docs/blur-and-shadows/), [charts](https://pixi-silk.schmooky.dev/docs/charts/), [transforms](https://pixi-silk.schmooky.dev/docs/transforms/), [hit testing](https://pixi-silk.schmooky.dev/docs/hit-testing/), [animation](https://pixi-silk.schmooky.dev/docs/animation/), [resolution & DPR](https://pixi-silk.schmooky.dev/docs/resolution/), [performance](https://pixi-silk.schmooky.dev/docs/performance/)
78
- - [How it works](https://pixi-silk.schmooky.dev/docs/how-it-works/), [Migrating from Graphics](https://pixi-silk.schmooky.dev/docs/migrating-from-graphics/) and the [FAQ](https://pixi-silk.schmooky.dev/faq/)
79
- - [API reference](https://pixi-silk.schmooky.dev/api/), generated from the source JSDoc
32
+ That draws a squircle card, a gauge with a conic gradient and a smoothed area chart.
33
+ `createSilkApp` turns MSAA off and maps one canvas pixel to one device pixel.
80
34
 
81
- ## Repository
35
+ ## What is in the package
82
36
 
83
- A pnpm workspace:
37
+ The root import holds `SilkGraphics`, gradients, `createSilkApp`, motion helpers and
38
+ `enableSilkBatching()`. Everything else is its own entry point, so an app bundles only what it
39
+ imports.
84
40
 
85
- | path | |
41
+ | Import | What it holds |
86
42
  |---|---|
87
- | `packages/pixi-silk` | the library, built by tsdown into ES modules (one file per module), tested with vitest |
88
- | `apps/site` | docs site: Astro, React islands, MDX guides with live demos, TypeDoc API pages, lab, llms.txt |
89
- | `scripts` | release helpers, page checks, screenshot and measurement tools |
43
+ | `pixi-silk` | Shapes, lines, free paths, shape operations, gradients, blur and shadows |
44
+ | `pixi-silk/text` | `SilkText`, distance field text |
45
+ | `pixi-silk/layout`, `pixi-silk/ui/layout` | A flex layout engine and the Pixi containers built on it |
46
+ | `pixi-silk/glass`, `pixi-silk/glow` | Glass and glow filters |
47
+ | `pixi-silk/webgpu` | The WGSL shader, for WebGPU in your own Pixi app |
48
+ | `pixi-silk/ui/*` | Buttons, radial menus, counters and the editor kit |
49
+
50
+ [Choose an entry point](https://pixi-silk.schmooky.dev/docs/choose-an-entry-point/) lists every
51
+ subpath. The editor kit (camera, rulers, gizmos, pickers, panels) is experimental in 1.0: its API
52
+ may change in a minor release.
53
+
54
+ ## Requirements
55
+
56
+ - `pixi.js` 8.6 or newer, as a peer dependency
57
+ - WebGL2 or WebGPU. WebGL2 is the default. For WebGPU, pass `preference: 'webgpu'` to
58
+ `createSilkApp`, or call `enableWebGPU()` from `pixi-silk/webgpu` before the first
59
+ `SilkGraphics` in your own Pixi app
60
+
61
+ It does not do texture fills or SVG documents, and `SilkText` has no shaping for right-to-left
62
+ scripts. The [FAQ](https://pixi-silk.schmooky.dev/faq/) lists the other limits.
63
+
64
+ ## For AI agents
65
+
66
+ - [AGENTS.md](https://github.com/schmooky/pixi-silk/blob/main/AGENTS.md) explains how to work in this repository.
67
+ - [llms.txt](https://pixi-silk.schmooky.dev/llms.txt) indexes the docs in plain text.
68
+
69
+ ## Repository
70
+
71
+ A pnpm workspace. `packages/pixi-silk` is the library and `apps/site` is the docs site.
90
72
 
91
73
  ```bash
92
74
  pnpm install
93
- pnpm site:dev # docs + lab at http://localhost:5178
75
+ pnpm site:dev # docs at http://localhost:5178
94
76
  pnpm --filter pixi-silk test # unit tests
95
77
  pnpm build # library build
96
- pnpm site:build # static site + search index
97
78
  ```
98
79
 
99
- Releases use [changesets](.changeset/README.md) and npm trusted publishing. See
100
- [CONTRIBUTING.md](CONTRIBUTING.md).
80
+ [CONTRIBUTING.md](https://github.com/schmooky/pixi-silk/blob/main/CONTRIBUTING.md) covers checks, changesets and releases.
101
81
 
102
82
  ## License
103
83