svelte-p5 0.2.0 → 0.3.0

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.
@@ -2,7 +2,7 @@
2
2
  * Bridge reactive Svelte state into a p5 sketch closure.
3
3
  *
4
4
  * Mutations from either side are seen by the other. Because p5's draw loop
5
- * reads fields on every frame, you don't need effects or subscriptions
5
+ * reads fields on every frame, you don't need effects or subscriptions -
6
6
  * just read `bridge.state.foo` inside your sketch and write to it from
7
7
  * Svelte UI.
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * Bridge reactive Svelte state into a p5 sketch closure.
3
3
  *
4
4
  * Mutations from either side are seen by the other. Because p5's draw loop
5
- * reads fields on every frame, you don't need effects or subscriptions
5
+ * reads fields on every frame, you don't need effects or subscriptions -
6
6
  * just read `bridge.state.foo` inside your sketch and write to it from
7
7
  * Svelte UI.
8
8
  *
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { default as P5Canvas } from './P5Canvas.svelte';
2
2
  export { createP5Bridge } from './createP5Bridge.svelte.js';
3
- // Re-export utils from the main entry for convenience users doing
3
+ // Re-export utils from the main entry for convenience - users doing
4
4
  // `import { disableFES } from 'svelte-p5'` get the same
5
5
  // helpers they'd get from `.../utils`. Tree-shakeable via `sideEffects: false`.
6
6
  export * from './utils/index.js';
package/dist/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export type SketchFn = (p: p5) => void;
8
8
  * Props accepted by the `<P5Canvas>` component.
9
9
  */
10
10
  export interface P5CanvasProps {
11
- /** Your sketch function assigns p.setup, p.draw, etc. */
11
+ /** Your sketch function - assigns p.setup, p.draw, etc. */
12
12
  sketch: SketchFn;
13
13
  /** Bindable: the p5 instance, available after mount. `null` before mount or after unmount. */
14
14
  instance?: p5 | null;
@@ -2,8 +2,8 @@
2
2
  * Lazy cache for CSS color strings.
3
3
  *
4
4
  * p5.color() allocates a p5.Color instance on every call (object + typed
5
- * arrays + regex parse). Calling it in a draw loop e.g. to colorize per
6
- * speaker or per data-point leaks a lot of garbage. Use a ColorCache to
5
+ * arrays + regex parse). Calling it in a draw loop - e.g. to colorize per
6
+ * speaker or per data-point - leaks a lot of garbage. Use a ColorCache to
7
7
  * compute each color once and reuse the CSS string.
8
8
  *
9
9
  * @example
@@ -19,11 +19,11 @@ export interface FontAtlas {
19
19
  * Pre-render a fixed set of strings to an offscreen buffer **once**, then
20
20
  * composite them each frame with `p5.image()`. This bypasses the OpenType.js
21
21
  * path-rendering slow path that fires for every `p5.text()` call when you've
22
- * `loadFont()`'d an OTF/TTF file typically a 10-100× speedup for text-heavy
22
+ * `loadFont()`'d an OTF/TTF file - typically a 10-100× speedup for text-heavy
23
23
  * sketches (word clouds, axis labels, small-multiples titles).
24
24
  *
25
25
  * Use for a fixed vocabulary (speaker names, category labels, axis ticks).
26
- * Don't use for per-frame dynamic text that defeats the point.
26
+ * Don't use for per-frame dynamic text - that defeats the point.
27
27
  *
28
28
  * @see https://github.com/processing/p5.js/blob/main/src/core/p5.Renderer2D.js
29
29
  */
@@ -2,11 +2,11 @@
2
2
  * Pre-render a fixed set of strings to an offscreen buffer **once**, then
3
3
  * composite them each frame with `p5.image()`. This bypasses the OpenType.js
4
4
  * path-rendering slow path that fires for every `p5.text()` call when you've
5
- * `loadFont()`'d an OTF/TTF file typically a 10-100× speedup for text-heavy
5
+ * `loadFont()`'d an OTF/TTF file - typically a 10-100× speedup for text-heavy
6
6
  * sketches (word clouds, axis labels, small-multiples titles).
7
7
  *
8
8
  * Use for a fixed vocabulary (speaker names, category labels, axis ticks).
9
- * Don't use for per-frame dynamic text that defeats the point.
9
+ * Don't use for per-frame dynamic text - that defeats the point.
10
10
  *
11
11
  * @see https://github.com/processing/p5.js/blob/main/src/core/p5.Renderer2D.js
12
12
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-p5",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Svelte 5 + p5.js integration primitives — <P5Canvas> wrapper, rune bridge, and performance utilities",
5
5
  "keywords": [
6
6
  "svelte",
@@ -14,12 +14,12 @@
14
14
  ],
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "git+https://github.com/edwinzhao/svelte-p5.git",
17
+ "url": "git+https://github.com/edw1nzhao/svelte-p5.git",
18
18
  "directory": "packages/core"
19
19
  },
20
- "homepage": "https://github.com/edwinzhao/svelte-p5/tree/main/packages/core#readme",
20
+ "homepage": "https://github.com/edw1nzhao/svelte-p5/tree/main/packages/core#readme",
21
21
  "bugs": {
22
- "url": "https://github.com/edwinzhao/svelte-p5/issues"
22
+ "url": "https://github.com/edw1nzhao/svelte-p5/issues"
23
23
  },
24
24
  "author": "Edwin Zhao",
25
25
  "license": "MIT",
@@ -44,6 +44,9 @@
44
44
  "README.md",
45
45
  "LICENSE"
46
46
  ],
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
47
50
  "sideEffects": false,
48
51
  "scripts": {
49
52
  "build": "svelte-package -o dist && publint",