@pixerate/editor 0.249.0 → 0.251.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.
- package/dist/agent/index.cjs +40 -41
- package/dist/agent/index.js +9 -10
- package/dist/animation/index.cjs +6 -7
- package/dist/animation/index.js +5 -6
- package/dist/animation-editor/index.cjs +124 -123
- package/dist/animation-editor/index.js +15 -14
- package/dist/brushes/index.cjs +1406 -0
- package/dist/brushes/index.d.cts +12 -0
- package/dist/brushes/index.d.ts +12 -0
- package/dist/brushes/index.js +1406 -0
- package/dist/brushes/migrate.d.cts +17 -0
- package/dist/brushes/migrate.d.ts +17 -0
- package/dist/brushes/normalize.d.cts +15 -0
- package/dist/brushes/normalize.d.ts +15 -0
- package/dist/brushes/presets.d.cts +12 -0
- package/dist/brushes/presets.d.ts +12 -0
- package/dist/brushes/resolve.d.cts +56 -0
- package/dist/brushes/resolve.d.ts +56 -0
- package/dist/brushes/schema.d.cts +29 -0
- package/dist/brushes/schema.d.ts +29 -0
- package/dist/brushes/types.d.cts +323 -0
- package/dist/brushes/types.d.ts +323 -0
- package/dist/{brushstrokeRender-T3JZST44.js → brushstrokeRender-5PYSKZIJ.js} +9 -8
- package/dist/{brushstrokeRender-GCKK7V2I.cjs → brushstrokeRender-7FLLSQEC.cjs} +15 -14
- package/dist/canvas/index.cjs +120 -65
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +88 -33
- package/dist/canvas/stickers.d.cts +35 -0
- package/dist/canvas/stickers.d.ts +35 -0
- package/dist/chart/index.cjs +159 -160
- package/dist/chart/index.js +9 -10
- package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
- package/dist/{chunk-DOIU7VJG.js → chunk-2ZJ4DT3M.js} +1 -1
- package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
- package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
- package/dist/{chunk-6BIDVPED.js → chunk-5JNA6LLY.js} +1 -1
- package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
- package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
- package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
- package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
- package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
- package/dist/{chunk-O75V4ZS3.js → chunk-7P6VF3FG.js} +2 -2
- package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
- package/dist/{chunk-5RH3VXAK.js → chunk-APX63ILU.js} +4 -100
- package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
- package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
- package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
- package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
- package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
- package/dist/{chunk-PZP2SZIZ.js → chunk-GYMMNCFT.js} +3 -3
- package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
- package/dist/chunk-HS6QDWDF.cjs +1029 -0
- package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
- package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
- package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
- package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
- package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
- package/dist/{chunk-LP2MCSBE.cjs → chunk-JFHBXNR2.cjs} +88 -88
- package/dist/{chunk-IOFVM3L3.cjs → chunk-JPEHXIB5.cjs} +10 -10
- package/dist/chunk-JSDND7DF.cjs +173 -0
- package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
- package/dist/{chunk-KYX7NZ5V.cjs → chunk-LFMKWGFL.cjs} +1 -1
- package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
- package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
- package/dist/chunk-MTKY6K3Q.js +1029 -0
- package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
- package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
- package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
- package/dist/chunk-PXDIAYB6.cjs +594 -0
- package/dist/{chunk-UBRJOIR5.js → chunk-QC3OXRE4.js} +9 -9
- package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
- package/dist/{chunk-WLJZZHUZ.cjs → chunk-QLSGTCYT.cjs} +23 -23
- package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
- package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
- package/dist/{chunk-LJRCU3BJ.cjs → chunk-SABJMH6M.cjs} +150 -15
- package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
- package/dist/chunk-SZTI6EER.js +13 -0
- package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
- package/dist/{chunk-2SMMZDMG.cjs → chunk-TLOGFIIV.cjs} +37 -37
- package/dist/chunk-TXFWZ5ZJ.js +594 -0
- package/dist/chunk-U67EN7GG.cjs +13 -0
- package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
- package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
- package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
- package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
- package/dist/{chunk-EJLRBS5Q.js → chunk-WZOGDKCQ.js} +137 -2
- package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
- package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
- package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
- package/dist/color/index.cjs +4 -6
- package/dist/color/index.js +7 -9
- package/dist/effects/helpers.d.cts +6 -0
- package/dist/effects/helpers.d.ts +6 -0
- package/dist/effects/index.cjs +62 -60
- package/dist/effects/index.js +5 -3
- package/dist/effects/tools.d.cts +6 -0
- package/dist/effects/tools.d.ts +6 -0
- package/dist/export/index.cjs +7 -8
- package/dist/export/index.js +6 -7
- package/dist/extensions/index.cjs +10 -11
- package/dist/extensions/index.js +9 -10
- package/dist/gradient/index.cjs +33 -34
- package/dist/gradient/index.js +4 -5
- package/dist/image-editor/effects.d.cts +1 -1
- package/dist/image-editor/effects.d.ts +1 -1
- package/dist/image-editor/index.cjs +887 -863
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +69 -45
- package/dist/image-editor/stickers.d.cts +9 -0
- package/dist/image-editor/stickers.d.ts +9 -0
- package/dist/index.cjs +16 -17
- package/dist/index.js +10 -11
- package/dist/paint/index.cjs +6 -4
- package/dist/paint/index.js +21 -19
- package/dist/paint-editor/brushes.d.cts +1 -2
- package/dist/paint-editor/brushes.d.ts +1 -2
- package/dist/paint-editor/index.cjs +2199 -699
- package/dist/paint-editor/index.js +1577 -77
- package/dist/paint-editor/mark-settings.d.cts +104 -0
- package/dist/paint-editor/mark-settings.d.ts +104 -0
- package/dist/paint-editor/procedural.d.cts +2 -75
- package/dist/paint-editor/procedural.d.ts +2 -75
- package/dist/paint-editor/stickers.d.cts +1 -22
- package/dist/paint-editor/stickers.d.ts +1 -22
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.js +9 -9
- package/dist/stickers/index.cjs +22 -16
- package/dist/stickers/index.d.cts +1 -1
- package/dist/stickers/index.d.ts +1 -1
- package/dist/stickers/index.js +14 -8
- package/dist/stickers/tools.d.cts +57 -1
- package/dist/stickers/tools.d.ts +57 -1
- package/dist/tokens/index.cjs +3 -4
- package/dist/tokens/index.js +2 -3
- package/dist/typography/index.cjs +7 -8
- package/dist/typography/index.js +2 -3
- package/dist/vector/index.cjs +1011 -977
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +47 -13
- package/dist/vector/stickers.d.cts +11 -0
- package/dist/vector/stickers.d.ts +11 -0
- package/dist/video-editor/index.cjs +349 -350
- package/dist/video-editor/index.js +9 -10
- package/package.json +11 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-stickers/SKILL.md +13 -1
- package/dist/chunk-7AHBW2CQ.cjs +0 -200
- package/dist/chunk-F67XMVDI.js +0 -200
- package/dist/chunk-H4AOUUBE.cjs +0 -2635
- package/dist/chunk-J7T5QZ45.js +0 -2635
- package/dist/chunk-ZEYMKDYS.cjs +0 -269
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings of the sticker, particle and bristle engines: types, defaults and normalisers, with
|
|
3
|
+
* no rendering code (sticker refs and the stamp list come from the renderer-free `stickers/`), so
|
|
4
|
+
* the brush model (`@pixerate/editor/brushes`) can read and check them without bundling the
|
|
5
|
+
* renderers. `stickers.ts` and `procedural.ts` re-export them.
|
|
6
|
+
*/
|
|
7
|
+
import { type StampKind } from '../stickers/stamps.cjs';
|
|
8
|
+
import type { StickerRef } from '../stickers/types.cjs';
|
|
9
|
+
export { STAMP_KINDS, type StampKind } from '../stickers/stamps.cjs';
|
|
10
|
+
/** Sticker spray settings (each 0..1 unless noted). */
|
|
11
|
+
export interface StickerSettings {
|
|
12
|
+
/**
|
|
13
|
+
* The stickers to spray (one picked at random per sticker): refs `provider:id`. A bare editor
|
|
14
|
+
* stamp (`"star"`) is read as `editor:star`.
|
|
15
|
+
*/
|
|
16
|
+
stamps: StickerRef[];
|
|
17
|
+
/** How closely stickers follow each other: about `density × 4` per tip diameter of travel (0.25 ≈ one per diameter). */
|
|
18
|
+
density: number;
|
|
19
|
+
/** Random size change. */
|
|
20
|
+
sizeJitter: number;
|
|
21
|
+
/** Random turn, as a fraction of ±180°. */
|
|
22
|
+
rotationJitter: number;
|
|
23
|
+
/** How far from the path stickers land, in tip diameters (0..2). */
|
|
24
|
+
scatter: number;
|
|
25
|
+
/** Random colour change (hue and lightness). */
|
|
26
|
+
colorJitter: number;
|
|
27
|
+
}
|
|
28
|
+
/** At most this many stickers in a sticker brush. */
|
|
29
|
+
export declare const MAX_STICKER_STAMPS = 16;
|
|
30
|
+
export declare const DEFAULT_STICKER: Readonly<StickerSettings>;
|
|
31
|
+
export declare function normalizeStickerSettings(raw?: Partial<StickerSettings>, base?: StickerSettings): StickerSettings;
|
|
32
|
+
export type ParticleKind = 'string' | 'spring' | 'orbit' | 'flow' | 'elastic' | 'fuzzy';
|
|
33
|
+
export declare const PARTICLE_KINDS: readonly ParticleKind[];
|
|
34
|
+
export type ParticleRender = 'dot' | 'line' | 'sequence' | 'ribbon';
|
|
35
|
+
export declare const PARTICLE_RENDERS: readonly ParticleRender[];
|
|
36
|
+
/** Ribbon: which particles' paths are joined (`adjacent`: each to its neighbour; `first-last`: one band between the outermost two). */
|
|
37
|
+
export type RibbonPairs = 'adjacent' | 'first-last';
|
|
38
|
+
export declare const RIBBON_PAIRS: readonly RibbonPairs[];
|
|
39
|
+
/** Textured dots: the stamps in turn, or one picked at random (seeded) per dot. */
|
|
40
|
+
export type DotTextureOrder = 'sequence' | 'random';
|
|
41
|
+
export declare const DOT_TEXTURE_ORDERS: readonly DotTextureOrder[];
|
|
42
|
+
/** Textured dots: turned with the particle's motion, at random, or at the tip angle. */
|
|
43
|
+
export type DotRotation = 'follow' | 'random' | 'fixed';
|
|
44
|
+
export declare const DOT_ROTATIONS: readonly DotRotation[];
|
|
45
|
+
/** Textured dots: at most this many stamps. */
|
|
46
|
+
export declare const MAX_DOT_TEXTURES = 4;
|
|
47
|
+
/** Particle engine settings (each 0..1 unless noted). */
|
|
48
|
+
export interface ParticleSettings {
|
|
49
|
+
kind: ParticleKind;
|
|
50
|
+
render: ParticleRender;
|
|
51
|
+
/** Particles, 1..64. */
|
|
52
|
+
count: number;
|
|
53
|
+
/** Mark size as a fraction of the tip size. */
|
|
54
|
+
size: number;
|
|
55
|
+
/** How far apart the particles start, as a fraction of the tip size. */
|
|
56
|
+
spread: number;
|
|
57
|
+
/** Spring and string stiffness (stiff follows closely; soft swings wide). */
|
|
58
|
+
stiffness: number;
|
|
59
|
+
/** How quickly motion dies down. */
|
|
60
|
+
damping: number;
|
|
61
|
+
/** Orbit and flow speed. */
|
|
62
|
+
speed: number;
|
|
63
|
+
/** Pull downwards (−1 up .. 1 down). */
|
|
64
|
+
gravity: number;
|
|
65
|
+
/** Flow particles' lifetime. */
|
|
66
|
+
life: number;
|
|
67
|
+
/** Sequence: spacing of the beads along each path. */
|
|
68
|
+
interval: number;
|
|
69
|
+
/** Ribbon: opacity of the fill between the paths, relative to their edges. */
|
|
70
|
+
ribbonFill: number;
|
|
71
|
+
/** Ribbon: which paths are joined. */
|
|
72
|
+
ribbonPairs: RibbonPairs;
|
|
73
|
+
/** Wave: how far each particle's drawn place swings sideways, as a fraction of the tip size (0: no wave). */
|
|
74
|
+
waveAmplitude: number;
|
|
75
|
+
/** Wave: wavelength in px of pen travel, 4..2000. */
|
|
76
|
+
waveLength: number;
|
|
77
|
+
/** Wave: how fast the waves run (0: they stand still on the path; 1: about four a second while the pen moves). */
|
|
78
|
+
waveSpeed: number;
|
|
79
|
+
/** Wave: how far out of step the particles' waves are (0: all in step; 1: random phases). */
|
|
80
|
+
wavePhaseJitter: number;
|
|
81
|
+
/** Dots and beads: up to four sticker stamps drawn instead of round marks (empty: round). */
|
|
82
|
+
dotTextures: StampKind[];
|
|
83
|
+
dotTextureOrder: DotTextureOrder;
|
|
84
|
+
dotRotation: DotRotation;
|
|
85
|
+
}
|
|
86
|
+
export declare const DEFAULT_PARTICLE: Readonly<ParticleSettings>;
|
|
87
|
+
export declare function normalizeParticle(raw?: Partial<ParticleSettings>, base?: ParticleSettings): ParticleSettings;
|
|
88
|
+
/** Bristle engine settings (each 0..1 unless noted). */
|
|
89
|
+
export interface BristleSettings {
|
|
90
|
+
/** Bristles in the tuft, 3..128. */
|
|
91
|
+
count: number;
|
|
92
|
+
/** Stiff bristles follow the tip; soft ones lag and bend into curves at turns. */
|
|
93
|
+
stiffness: number;
|
|
94
|
+
/** How far pressure spreads the tuft. */
|
|
95
|
+
splay: number;
|
|
96
|
+
/** Width of each bristle's line as a fraction of the tip size. */
|
|
97
|
+
thickness: number;
|
|
98
|
+
/** Paint per bristle: 1 never runs dry; lower, bristles run out along the stroke (dry brush). */
|
|
99
|
+
load: number;
|
|
100
|
+
/** Random variation between bristles (length, paint, position). */
|
|
101
|
+
jitter: number;
|
|
102
|
+
}
|
|
103
|
+
export declare const DEFAULT_BRISTLE: Readonly<BristleSettings>;
|
|
104
|
+
export declare function normalizeBristle(raw?: Partial<BristleSettings>, base?: BristleSettings): BristleSettings;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings of the sticker, particle and bristle engines: types, defaults and normalisers, with
|
|
3
|
+
* no rendering code (sticker refs and the stamp list come from the renderer-free `stickers/`), so
|
|
4
|
+
* the brush model (`@pixerate/editor/brushes`) can read and check them without bundling the
|
|
5
|
+
* renderers. `stickers.ts` and `procedural.ts` re-export them.
|
|
6
|
+
*/
|
|
7
|
+
import { type StampKind } from '../stickers/stamps.js';
|
|
8
|
+
import type { StickerRef } from '../stickers/types.js';
|
|
9
|
+
export { STAMP_KINDS, type StampKind } from '../stickers/stamps.js';
|
|
10
|
+
/** Sticker spray settings (each 0..1 unless noted). */
|
|
11
|
+
export interface StickerSettings {
|
|
12
|
+
/**
|
|
13
|
+
* The stickers to spray (one picked at random per sticker): refs `provider:id`. A bare editor
|
|
14
|
+
* stamp (`"star"`) is read as `editor:star`.
|
|
15
|
+
*/
|
|
16
|
+
stamps: StickerRef[];
|
|
17
|
+
/** How closely stickers follow each other: about `density × 4` per tip diameter of travel (0.25 ≈ one per diameter). */
|
|
18
|
+
density: number;
|
|
19
|
+
/** Random size change. */
|
|
20
|
+
sizeJitter: number;
|
|
21
|
+
/** Random turn, as a fraction of ±180°. */
|
|
22
|
+
rotationJitter: number;
|
|
23
|
+
/** How far from the path stickers land, in tip diameters (0..2). */
|
|
24
|
+
scatter: number;
|
|
25
|
+
/** Random colour change (hue and lightness). */
|
|
26
|
+
colorJitter: number;
|
|
27
|
+
}
|
|
28
|
+
/** At most this many stickers in a sticker brush. */
|
|
29
|
+
export declare const MAX_STICKER_STAMPS = 16;
|
|
30
|
+
export declare const DEFAULT_STICKER: Readonly<StickerSettings>;
|
|
31
|
+
export declare function normalizeStickerSettings(raw?: Partial<StickerSettings>, base?: StickerSettings): StickerSettings;
|
|
32
|
+
export type ParticleKind = 'string' | 'spring' | 'orbit' | 'flow' | 'elastic' | 'fuzzy';
|
|
33
|
+
export declare const PARTICLE_KINDS: readonly ParticleKind[];
|
|
34
|
+
export type ParticleRender = 'dot' | 'line' | 'sequence' | 'ribbon';
|
|
35
|
+
export declare const PARTICLE_RENDERS: readonly ParticleRender[];
|
|
36
|
+
/** Ribbon: which particles' paths are joined (`adjacent`: each to its neighbour; `first-last`: one band between the outermost two). */
|
|
37
|
+
export type RibbonPairs = 'adjacent' | 'first-last';
|
|
38
|
+
export declare const RIBBON_PAIRS: readonly RibbonPairs[];
|
|
39
|
+
/** Textured dots: the stamps in turn, or one picked at random (seeded) per dot. */
|
|
40
|
+
export type DotTextureOrder = 'sequence' | 'random';
|
|
41
|
+
export declare const DOT_TEXTURE_ORDERS: readonly DotTextureOrder[];
|
|
42
|
+
/** Textured dots: turned with the particle's motion, at random, or at the tip angle. */
|
|
43
|
+
export type DotRotation = 'follow' | 'random' | 'fixed';
|
|
44
|
+
export declare const DOT_ROTATIONS: readonly DotRotation[];
|
|
45
|
+
/** Textured dots: at most this many stamps. */
|
|
46
|
+
export declare const MAX_DOT_TEXTURES = 4;
|
|
47
|
+
/** Particle engine settings (each 0..1 unless noted). */
|
|
48
|
+
export interface ParticleSettings {
|
|
49
|
+
kind: ParticleKind;
|
|
50
|
+
render: ParticleRender;
|
|
51
|
+
/** Particles, 1..64. */
|
|
52
|
+
count: number;
|
|
53
|
+
/** Mark size as a fraction of the tip size. */
|
|
54
|
+
size: number;
|
|
55
|
+
/** How far apart the particles start, as a fraction of the tip size. */
|
|
56
|
+
spread: number;
|
|
57
|
+
/** Spring and string stiffness (stiff follows closely; soft swings wide). */
|
|
58
|
+
stiffness: number;
|
|
59
|
+
/** How quickly motion dies down. */
|
|
60
|
+
damping: number;
|
|
61
|
+
/** Orbit and flow speed. */
|
|
62
|
+
speed: number;
|
|
63
|
+
/** Pull downwards (−1 up .. 1 down). */
|
|
64
|
+
gravity: number;
|
|
65
|
+
/** Flow particles' lifetime. */
|
|
66
|
+
life: number;
|
|
67
|
+
/** Sequence: spacing of the beads along each path. */
|
|
68
|
+
interval: number;
|
|
69
|
+
/** Ribbon: opacity of the fill between the paths, relative to their edges. */
|
|
70
|
+
ribbonFill: number;
|
|
71
|
+
/** Ribbon: which paths are joined. */
|
|
72
|
+
ribbonPairs: RibbonPairs;
|
|
73
|
+
/** Wave: how far each particle's drawn place swings sideways, as a fraction of the tip size (0: no wave). */
|
|
74
|
+
waveAmplitude: number;
|
|
75
|
+
/** Wave: wavelength in px of pen travel, 4..2000. */
|
|
76
|
+
waveLength: number;
|
|
77
|
+
/** Wave: how fast the waves run (0: they stand still on the path; 1: about four a second while the pen moves). */
|
|
78
|
+
waveSpeed: number;
|
|
79
|
+
/** Wave: how far out of step the particles' waves are (0: all in step; 1: random phases). */
|
|
80
|
+
wavePhaseJitter: number;
|
|
81
|
+
/** Dots and beads: up to four sticker stamps drawn instead of round marks (empty: round). */
|
|
82
|
+
dotTextures: StampKind[];
|
|
83
|
+
dotTextureOrder: DotTextureOrder;
|
|
84
|
+
dotRotation: DotRotation;
|
|
85
|
+
}
|
|
86
|
+
export declare const DEFAULT_PARTICLE: Readonly<ParticleSettings>;
|
|
87
|
+
export declare function normalizeParticle(raw?: Partial<ParticleSettings>, base?: ParticleSettings): ParticleSettings;
|
|
88
|
+
/** Bristle engine settings (each 0..1 unless noted). */
|
|
89
|
+
export interface BristleSettings {
|
|
90
|
+
/** Bristles in the tuft, 3..128. */
|
|
91
|
+
count: number;
|
|
92
|
+
/** Stiff bristles follow the tip; soft ones lag and bend into curves at turns. */
|
|
93
|
+
stiffness: number;
|
|
94
|
+
/** How far pressure spreads the tuft. */
|
|
95
|
+
splay: number;
|
|
96
|
+
/** Width of each bristle's line as a fraction of the tip size. */
|
|
97
|
+
thickness: number;
|
|
98
|
+
/** Paint per bristle: 1 never runs dry; lower, bristles run out along the stroke (dry brush). */
|
|
99
|
+
load: number;
|
|
100
|
+
/** Random variation between bristles (length, paint, position). */
|
|
101
|
+
jitter: number;
|
|
102
|
+
}
|
|
103
|
+
export declare const DEFAULT_BRISTLE: Readonly<BristleSettings>;
|
|
104
|
+
export declare function normalizeBristle(raw?: Partial<BristleSettings>, base?: BristleSettings): BristleSettings;
|
|
@@ -28,7 +28,8 @@ import type { PaintBrush } from './brushes.cjs';
|
|
|
28
28
|
import { type EffectPaintPixels } from './effect-paint.cjs';
|
|
29
29
|
import { PenDabWalker, PenSmoother, type PenDab, type PenPoint, type StrokeCopy } from './engine.cjs';
|
|
30
30
|
import { type PaperGrain } from './paper.cjs';
|
|
31
|
-
import {
|
|
31
|
+
import type { StampKind } from './mark-settings.cjs';
|
|
32
|
+
export { DEFAULT_BRISTLE, DEFAULT_PARTICLE, DOT_ROTATIONS, DOT_TEXTURE_ORDERS, MAX_DOT_TEXTURES, normalizeBristle, normalizeParticle, PARTICLE_KINDS, PARTICLE_RENDERS, RIBBON_PAIRS, type BristleSettings, type DotRotation, type DotTextureOrder, type ParticleKind, type ParticleRender, type ParticleSettings, type RibbonPairs, } from './mark-settings.cjs';
|
|
32
33
|
export interface ProceduralStrokeOptions {
|
|
33
34
|
grain: PaperGrain | null;
|
|
34
35
|
paperDepth: number;
|
|
@@ -91,62 +92,6 @@ declare abstract class MarkStroke implements CoverageStroke {
|
|
|
91
92
|
/** Marks along a segment, spaced by a fraction of the radius. */
|
|
92
93
|
protected segment(x0: number, y0: number, x1: number, y1: number, r: number, alpha: number, opacity: number, pressure: number, rects: RasterRect[]): void;
|
|
93
94
|
}
|
|
94
|
-
export type ParticleKind = 'string' | 'spring' | 'orbit' | 'flow' | 'elastic' | 'fuzzy';
|
|
95
|
-
export declare const PARTICLE_KINDS: readonly ParticleKind[];
|
|
96
|
-
export type ParticleRender = 'dot' | 'line' | 'sequence' | 'ribbon';
|
|
97
|
-
export declare const PARTICLE_RENDERS: readonly ParticleRender[];
|
|
98
|
-
/** Ribbon: which particles' paths are joined (`adjacent`: each to its neighbour; `first-last`: one band between the outermost two). */
|
|
99
|
-
export type RibbonPairs = 'adjacent' | 'first-last';
|
|
100
|
-
export declare const RIBBON_PAIRS: readonly RibbonPairs[];
|
|
101
|
-
/** Textured dots: the stamps in turn, or one picked at random (seeded) per dot. */
|
|
102
|
-
export type DotTextureOrder = 'sequence' | 'random';
|
|
103
|
-
export declare const DOT_TEXTURE_ORDERS: readonly DotTextureOrder[];
|
|
104
|
-
/** Textured dots: turned with the particle's motion, at random, or at the tip angle. */
|
|
105
|
-
export type DotRotation = 'follow' | 'random' | 'fixed';
|
|
106
|
-
export declare const DOT_ROTATIONS: readonly DotRotation[];
|
|
107
|
-
/** Textured dots: at most this many stamps. */
|
|
108
|
-
export declare const MAX_DOT_TEXTURES = 4;
|
|
109
|
-
/** Particle engine settings (each 0..1 unless noted). */
|
|
110
|
-
export interface ParticleSettings {
|
|
111
|
-
kind: ParticleKind;
|
|
112
|
-
render: ParticleRender;
|
|
113
|
-
/** Particles, 1..64. */
|
|
114
|
-
count: number;
|
|
115
|
-
/** Mark size as a fraction of the tip size. */
|
|
116
|
-
size: number;
|
|
117
|
-
/** How far apart the particles start, as a fraction of the tip size. */
|
|
118
|
-
spread: number;
|
|
119
|
-
/** Spring and string stiffness (stiff follows closely; soft swings wide). */
|
|
120
|
-
stiffness: number;
|
|
121
|
-
/** How quickly motion dies down. */
|
|
122
|
-
damping: number;
|
|
123
|
-
/** Orbit and flow speed. */
|
|
124
|
-
speed: number;
|
|
125
|
-
/** Pull downwards (−1 up .. 1 down). */
|
|
126
|
-
gravity: number;
|
|
127
|
-
/** Flow particles' lifetime. */
|
|
128
|
-
life: number;
|
|
129
|
-
/** Sequence: spacing of the beads along each path. */
|
|
130
|
-
interval: number;
|
|
131
|
-
/** Ribbon: opacity of the fill between the paths, relative to their edges. */
|
|
132
|
-
ribbonFill: number;
|
|
133
|
-
/** Ribbon: which paths are joined. */
|
|
134
|
-
ribbonPairs: RibbonPairs;
|
|
135
|
-
/** Wave: how far each particle's drawn place swings sideways, as a fraction of the tip size (0: no wave). */
|
|
136
|
-
waveAmplitude: number;
|
|
137
|
-
/** Wave: wavelength in px of pen travel, 4..2000. */
|
|
138
|
-
waveLength: number;
|
|
139
|
-
/** Wave: how fast the waves run (0: they stand still on the path; 1: about four a second while the pen moves). */
|
|
140
|
-
waveSpeed: number;
|
|
141
|
-
/** Wave: how far out of step the particles' waves are (0: all in step; 1: random phases). */
|
|
142
|
-
wavePhaseJitter: number;
|
|
143
|
-
/** Dots and beads: up to four sticker stamps drawn instead of round marks (empty: round). */
|
|
144
|
-
dotTextures: StampKind[];
|
|
145
|
-
dotTextureOrder: DotTextureOrder;
|
|
146
|
-
dotRotation: DotRotation;
|
|
147
|
-
}
|
|
148
|
-
export declare const DEFAULT_PARTICLE: Readonly<ParticleSettings>;
|
|
149
|
-
export declare function normalizeParticle(raw?: Partial<ParticleSettings>, base?: ParticleSettings): ParticleSettings;
|
|
150
95
|
/**
|
|
151
96
|
* Adds the area polygon `pts` (x, y pairs, even-odd) covers in each pixel of `rect`, times `weight`, to `out`,
|
|
152
97
|
* exactly across each of `RIBBON_SUB` sub-rows per row. Points on an edge two polygons share
|
|
@@ -189,23 +134,6 @@ export declare class ParticleStroke extends MarkStroke {
|
|
|
189
134
|
*/
|
|
190
135
|
private telescope;
|
|
191
136
|
}
|
|
192
|
-
/** Bristle engine settings (each 0..1 unless noted). */
|
|
193
|
-
export interface BristleSettings {
|
|
194
|
-
/** Bristles in the tuft, 3..128. */
|
|
195
|
-
count: number;
|
|
196
|
-
/** Stiff bristles follow the tip; soft ones lag and bend into curves at turns. */
|
|
197
|
-
stiffness: number;
|
|
198
|
-
/** How far pressure spreads the tuft. */
|
|
199
|
-
splay: number;
|
|
200
|
-
/** Width of each bristle's line as a fraction of the tip size. */
|
|
201
|
-
thickness: number;
|
|
202
|
-
/** Paint per bristle: 1 never runs dry; lower, bristles run out along the stroke (dry brush). */
|
|
203
|
-
load: number;
|
|
204
|
-
/** Random variation between bristles (length, paint, position). */
|
|
205
|
-
jitter: number;
|
|
206
|
-
}
|
|
207
|
-
export declare const DEFAULT_BRISTLE: Readonly<BristleSettings>;
|
|
208
|
-
export declare function normalizeBristle(raw?: Partial<BristleSettings>, base?: BristleSettings): BristleSettings;
|
|
209
137
|
/** A bristle-brush stroke: every bristle draws its own line. */
|
|
210
138
|
export declare class BristleStroke extends MarkStroke {
|
|
211
139
|
private readonly tufts;
|
|
@@ -213,4 +141,3 @@ export declare class BristleStroke extends MarkStroke {
|
|
|
213
141
|
constructor(brush: PaintBrush, options: ProceduralStrokeOptions);
|
|
214
142
|
protected advance(copy: number, d: PenDab, rects: RasterRect[]): void;
|
|
215
143
|
}
|
|
216
|
-
export {};
|
|
@@ -28,7 +28,8 @@ import type { PaintBrush } from './brushes.js';
|
|
|
28
28
|
import { type EffectPaintPixels } from './effect-paint.js';
|
|
29
29
|
import { PenDabWalker, PenSmoother, type PenDab, type PenPoint, type StrokeCopy } from './engine.js';
|
|
30
30
|
import { type PaperGrain } from './paper.js';
|
|
31
|
-
import {
|
|
31
|
+
import type { StampKind } from './mark-settings.js';
|
|
32
|
+
export { DEFAULT_BRISTLE, DEFAULT_PARTICLE, DOT_ROTATIONS, DOT_TEXTURE_ORDERS, MAX_DOT_TEXTURES, normalizeBristle, normalizeParticle, PARTICLE_KINDS, PARTICLE_RENDERS, RIBBON_PAIRS, type BristleSettings, type DotRotation, type DotTextureOrder, type ParticleKind, type ParticleRender, type ParticleSettings, type RibbonPairs, } from './mark-settings.js';
|
|
32
33
|
export interface ProceduralStrokeOptions {
|
|
33
34
|
grain: PaperGrain | null;
|
|
34
35
|
paperDepth: number;
|
|
@@ -91,62 +92,6 @@ declare abstract class MarkStroke implements CoverageStroke {
|
|
|
91
92
|
/** Marks along a segment, spaced by a fraction of the radius. */
|
|
92
93
|
protected segment(x0: number, y0: number, x1: number, y1: number, r: number, alpha: number, opacity: number, pressure: number, rects: RasterRect[]): void;
|
|
93
94
|
}
|
|
94
|
-
export type ParticleKind = 'string' | 'spring' | 'orbit' | 'flow' | 'elastic' | 'fuzzy';
|
|
95
|
-
export declare const PARTICLE_KINDS: readonly ParticleKind[];
|
|
96
|
-
export type ParticleRender = 'dot' | 'line' | 'sequence' | 'ribbon';
|
|
97
|
-
export declare const PARTICLE_RENDERS: readonly ParticleRender[];
|
|
98
|
-
/** Ribbon: which particles' paths are joined (`adjacent`: each to its neighbour; `first-last`: one band between the outermost two). */
|
|
99
|
-
export type RibbonPairs = 'adjacent' | 'first-last';
|
|
100
|
-
export declare const RIBBON_PAIRS: readonly RibbonPairs[];
|
|
101
|
-
/** Textured dots: the stamps in turn, or one picked at random (seeded) per dot. */
|
|
102
|
-
export type DotTextureOrder = 'sequence' | 'random';
|
|
103
|
-
export declare const DOT_TEXTURE_ORDERS: readonly DotTextureOrder[];
|
|
104
|
-
/** Textured dots: turned with the particle's motion, at random, or at the tip angle. */
|
|
105
|
-
export type DotRotation = 'follow' | 'random' | 'fixed';
|
|
106
|
-
export declare const DOT_ROTATIONS: readonly DotRotation[];
|
|
107
|
-
/** Textured dots: at most this many stamps. */
|
|
108
|
-
export declare const MAX_DOT_TEXTURES = 4;
|
|
109
|
-
/** Particle engine settings (each 0..1 unless noted). */
|
|
110
|
-
export interface ParticleSettings {
|
|
111
|
-
kind: ParticleKind;
|
|
112
|
-
render: ParticleRender;
|
|
113
|
-
/** Particles, 1..64. */
|
|
114
|
-
count: number;
|
|
115
|
-
/** Mark size as a fraction of the tip size. */
|
|
116
|
-
size: number;
|
|
117
|
-
/** How far apart the particles start, as a fraction of the tip size. */
|
|
118
|
-
spread: number;
|
|
119
|
-
/** Spring and string stiffness (stiff follows closely; soft swings wide). */
|
|
120
|
-
stiffness: number;
|
|
121
|
-
/** How quickly motion dies down. */
|
|
122
|
-
damping: number;
|
|
123
|
-
/** Orbit and flow speed. */
|
|
124
|
-
speed: number;
|
|
125
|
-
/** Pull downwards (−1 up .. 1 down). */
|
|
126
|
-
gravity: number;
|
|
127
|
-
/** Flow particles' lifetime. */
|
|
128
|
-
life: number;
|
|
129
|
-
/** Sequence: spacing of the beads along each path. */
|
|
130
|
-
interval: number;
|
|
131
|
-
/** Ribbon: opacity of the fill between the paths, relative to their edges. */
|
|
132
|
-
ribbonFill: number;
|
|
133
|
-
/** Ribbon: which paths are joined. */
|
|
134
|
-
ribbonPairs: RibbonPairs;
|
|
135
|
-
/** Wave: how far each particle's drawn place swings sideways, as a fraction of the tip size (0: no wave). */
|
|
136
|
-
waveAmplitude: number;
|
|
137
|
-
/** Wave: wavelength in px of pen travel, 4..2000. */
|
|
138
|
-
waveLength: number;
|
|
139
|
-
/** Wave: how fast the waves run (0: they stand still on the path; 1: about four a second while the pen moves). */
|
|
140
|
-
waveSpeed: number;
|
|
141
|
-
/** Wave: how far out of step the particles' waves are (0: all in step; 1: random phases). */
|
|
142
|
-
wavePhaseJitter: number;
|
|
143
|
-
/** Dots and beads: up to four sticker stamps drawn instead of round marks (empty: round). */
|
|
144
|
-
dotTextures: StampKind[];
|
|
145
|
-
dotTextureOrder: DotTextureOrder;
|
|
146
|
-
dotRotation: DotRotation;
|
|
147
|
-
}
|
|
148
|
-
export declare const DEFAULT_PARTICLE: Readonly<ParticleSettings>;
|
|
149
|
-
export declare function normalizeParticle(raw?: Partial<ParticleSettings>, base?: ParticleSettings): ParticleSettings;
|
|
150
95
|
/**
|
|
151
96
|
* Adds the area polygon `pts` (x, y pairs, even-odd) covers in each pixel of `rect`, times `weight`, to `out`,
|
|
152
97
|
* exactly across each of `RIBBON_SUB` sub-rows per row. Points on an edge two polygons share
|
|
@@ -189,23 +134,6 @@ export declare class ParticleStroke extends MarkStroke {
|
|
|
189
134
|
*/
|
|
190
135
|
private telescope;
|
|
191
136
|
}
|
|
192
|
-
/** Bristle engine settings (each 0..1 unless noted). */
|
|
193
|
-
export interface BristleSettings {
|
|
194
|
-
/** Bristles in the tuft, 3..128. */
|
|
195
|
-
count: number;
|
|
196
|
-
/** Stiff bristles follow the tip; soft ones lag and bend into curves at turns. */
|
|
197
|
-
stiffness: number;
|
|
198
|
-
/** How far pressure spreads the tuft. */
|
|
199
|
-
splay: number;
|
|
200
|
-
/** Width of each bristle's line as a fraction of the tip size. */
|
|
201
|
-
thickness: number;
|
|
202
|
-
/** Paint per bristle: 1 never runs dry; lower, bristles run out along the stroke (dry brush). */
|
|
203
|
-
load: number;
|
|
204
|
-
/** Random variation between bristles (length, paint, position). */
|
|
205
|
-
jitter: number;
|
|
206
|
-
}
|
|
207
|
-
export declare const DEFAULT_BRISTLE: Readonly<BristleSettings>;
|
|
208
|
-
export declare function normalizeBristle(raw?: Partial<BristleSettings>, base?: BristleSettings): BristleSettings;
|
|
209
137
|
/** A bristle-brush stroke: every bristle draws its own line. */
|
|
210
138
|
export declare class BristleStroke extends MarkStroke {
|
|
211
139
|
private readonly tufts;
|
|
@@ -213,4 +141,3 @@ export declare class BristleStroke extends MarkStroke {
|
|
|
213
141
|
constructor(brush: PaintBrush, options: ProceduralStrokeOptions);
|
|
214
142
|
protected advance(copy: number, d: PenDab, rects: RasterRect[]): void;
|
|
215
143
|
}
|
|
216
|
-
export {};
|
|
@@ -18,6 +18,7 @@ import { type StampKind } from '../stickers/stamps.cjs';
|
|
|
18
18
|
import type { StickerRef } from '../stickers/types.cjs';
|
|
19
19
|
import { type StickerArtLookup } from './sticker-art.cjs';
|
|
20
20
|
export { STAMP_KINDS, stampCoverage, type StampKind } from '../stickers/stamps.cjs';
|
|
21
|
+
export { DEFAULT_STICKER, MAX_STICKER_STAMPS, normalizeStickerSettings, type StickerSettings } from './mark-settings.cjs';
|
|
21
22
|
import { type EffectPaintPixels } from './effect-paint.cjs';
|
|
22
23
|
/** One sticker (document pixels). */
|
|
23
24
|
export interface Sticker {
|
|
@@ -39,28 +40,6 @@ export interface Sticker {
|
|
|
39
40
|
/** Texture seed. */
|
|
40
41
|
seed: number;
|
|
41
42
|
}
|
|
42
|
-
/** Sticker spray settings (each 0..1 unless noted). */
|
|
43
|
-
export interface StickerSettings {
|
|
44
|
-
/**
|
|
45
|
-
* The stickers to spray (one picked at random per sticker): refs `provider:id`. A bare editor
|
|
46
|
-
* stamp (`"star"`) is read as `editor:star`.
|
|
47
|
-
*/
|
|
48
|
-
stamps: StickerRef[];
|
|
49
|
-
/** How closely stickers follow each other: about `density × 4` per tip diameter of travel (0.25 ≈ one per diameter). */
|
|
50
|
-
density: number;
|
|
51
|
-
/** Random size change. */
|
|
52
|
-
sizeJitter: number;
|
|
53
|
-
/** Random turn, as a fraction of ±180°. */
|
|
54
|
-
rotationJitter: number;
|
|
55
|
-
/** How far from the path stickers land, in tip diameters (0..2). */
|
|
56
|
-
scatter: number;
|
|
57
|
-
/** Random colour change (hue and lightness). */
|
|
58
|
-
colorJitter: number;
|
|
59
|
-
}
|
|
60
|
-
/** At most this many stickers in a sticker brush. */
|
|
61
|
-
export declare const MAX_STICKER_STAMPS = 16;
|
|
62
|
-
export declare const DEFAULT_STICKER: Readonly<StickerSettings>;
|
|
63
|
-
export declare function normalizeStickerSettings(raw?: Partial<StickerSettings>, base?: StickerSettings): StickerSettings;
|
|
64
43
|
/** The pixel rectangle a sticker covers. */
|
|
65
44
|
export declare function stickerRect(s: Sticker): RasterRect;
|
|
66
45
|
/** The editor stamp a sticker shows, or `null` for a provider's sticker. */
|
|
@@ -18,6 +18,7 @@ import { type StampKind } from '../stickers/stamps.js';
|
|
|
18
18
|
import type { StickerRef } from '../stickers/types.js';
|
|
19
19
|
import { type StickerArtLookup } from './sticker-art.js';
|
|
20
20
|
export { STAMP_KINDS, stampCoverage, type StampKind } from '../stickers/stamps.js';
|
|
21
|
+
export { DEFAULT_STICKER, MAX_STICKER_STAMPS, normalizeStickerSettings, type StickerSettings } from './mark-settings.js';
|
|
21
22
|
import { type EffectPaintPixels } from './effect-paint.js';
|
|
22
23
|
/** One sticker (document pixels). */
|
|
23
24
|
export interface Sticker {
|
|
@@ -39,28 +40,6 @@ export interface Sticker {
|
|
|
39
40
|
/** Texture seed. */
|
|
40
41
|
seed: number;
|
|
41
42
|
}
|
|
42
|
-
/** Sticker spray settings (each 0..1 unless noted). */
|
|
43
|
-
export interface StickerSettings {
|
|
44
|
-
/**
|
|
45
|
-
* The stickers to spray (one picked at random per sticker): refs `provider:id`. A bare editor
|
|
46
|
-
* stamp (`"star"`) is read as `editor:star`.
|
|
47
|
-
*/
|
|
48
|
-
stamps: StickerRef[];
|
|
49
|
-
/** How closely stickers follow each other: about `density × 4` per tip diameter of travel (0.25 ≈ one per diameter). */
|
|
50
|
-
density: number;
|
|
51
|
-
/** Random size change. */
|
|
52
|
-
sizeJitter: number;
|
|
53
|
-
/** Random turn, as a fraction of ±180°. */
|
|
54
|
-
rotationJitter: number;
|
|
55
|
-
/** How far from the path stickers land, in tip diameters (0..2). */
|
|
56
|
-
scatter: number;
|
|
57
|
-
/** Random colour change (hue and lightness). */
|
|
58
|
-
colorJitter: number;
|
|
59
|
-
}
|
|
60
|
-
/** At most this many stickers in a sticker brush. */
|
|
61
|
-
export declare const MAX_STICKER_STAMPS = 16;
|
|
62
|
-
export declare const DEFAULT_STICKER: Readonly<StickerSettings>;
|
|
63
|
-
export declare function normalizeStickerSettings(raw?: Partial<StickerSettings>, base?: StickerSettings): StickerSettings;
|
|
64
43
|
/** The pixel rectangle a sticker covers. */
|
|
65
44
|
export declare function stickerRect(s: Sticker): RasterRect;
|
|
66
45
|
/** The editor stamp a sticker shows, or `null` for a provider's sticker. */
|
package/dist/raster/index.cjs
CHANGED
|
@@ -81,6 +81,7 @@ var _chunkK6PXS6DOcjs = require('../chunk-K6PXS6DO.cjs');
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
var _chunkW5M3J7PVcjs = require('../chunk-W5M3J7PV.cjs');
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
|
|
@@ -115,7 +116,6 @@ var _chunkK6PXS6DOcjs = require('../chunk-K6PXS6DO.cjs');
|
|
|
115
116
|
|
|
116
117
|
|
|
117
118
|
|
|
118
|
-
var _chunk2VX55NFMcjs = require('../chunk-2VX55NFM.cjs');
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
|
|
@@ -124,7 +124,7 @@ var _chunk2VX55NFMcjs = require('../chunk-2VX55NFM.cjs');
|
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
var
|
|
127
|
+
var _chunk2VX55NFMcjs = require('../chunk-2VX55NFM.cjs');
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
|
package/dist/raster/index.js
CHANGED
|
@@ -73,6 +73,15 @@ import {
|
|
|
73
73
|
DIRECT_GAUSSIAN_MAX_SIGMA,
|
|
74
74
|
gaussianBlur
|
|
75
75
|
} from "../chunk-ZIF4UJJ6.js";
|
|
76
|
+
import {
|
|
77
|
+
base64ToBytes,
|
|
78
|
+
bytesToBase64,
|
|
79
|
+
decodePng,
|
|
80
|
+
encodePng,
|
|
81
|
+
isPng,
|
|
82
|
+
parseDataUrl,
|
|
83
|
+
pngDataUrl
|
|
84
|
+
} from "../chunk-OTTT5N3K.js";
|
|
76
85
|
import {
|
|
77
86
|
BIT_DEPTHS,
|
|
78
87
|
BLEND_MODES,
|
|
@@ -116,15 +125,6 @@ import {
|
|
|
116
125
|
to8From32,
|
|
117
126
|
writeDeepRegion
|
|
118
127
|
} from "../chunk-IRSTHLQQ.js";
|
|
119
|
-
import {
|
|
120
|
-
base64ToBytes,
|
|
121
|
-
bytesToBase64,
|
|
122
|
-
decodePng,
|
|
123
|
-
encodePng,
|
|
124
|
-
isPng,
|
|
125
|
-
parseDataUrl,
|
|
126
|
-
pngDataUrl
|
|
127
|
-
} from "../chunk-OTTT5N3K.js";
|
|
128
128
|
import {
|
|
129
129
|
SurfaceDraft,
|
|
130
130
|
TILE,
|
package/dist/stickers/index.cjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkLJRCU3BJcjs = require('../chunk-LJRCU3BJ.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
12
|
+
var _chunkSABJMH6Mcjs = require('../chunk-SABJMH6M.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -24,7 +24,11 @@ var _chunkLJRCU3BJcjs = require('../chunk-LJRCU3BJ.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
var _chunkJSDND7DFcjs = require('../chunk-JSDND7DF.cjs');
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var _chunkU67EN7GGcjs = require('../chunk-U67EN7GG.cjs');
|
|
28
32
|
require('../chunk-3K6HWEXZ.cjs');
|
|
29
33
|
|
|
30
34
|
|
|
@@ -91,8 +95,8 @@ function createFakeStickerProvider(options = {}) {
|
|
|
91
95
|
name: "Fake stickers",
|
|
92
96
|
version: "1",
|
|
93
97
|
capabilities: { supportsSearch: true, supportsSvg: true, supportsRaster: true, maxSize: 512 },
|
|
94
|
-
list: (o) =>
|
|
95
|
-
search: (q, o) =>
|
|
98
|
+
list: (o) => _chunkJSDND7DFcjs.stickerPage.call(void 0, summaries, o),
|
|
99
|
+
search: (q, o) => _chunkJSDND7DFcjs.stickerPage.call(void 0, summaries, o, q),
|
|
96
100
|
describe(id) {
|
|
97
101
|
const s = find(id);
|
|
98
102
|
if (!s) return void 0;
|
|
@@ -102,12 +106,12 @@ function createFakeStickerProvider(options = {}) {
|
|
|
102
106
|
async load(id, o = {}) {
|
|
103
107
|
if (options.loadDelayMs) await new Promise((r) => setTimeout(r, options.loadDelayMs));
|
|
104
108
|
const s = find(id);
|
|
105
|
-
if (!s) throw new (0,
|
|
106
|
-
if (_optionalChain([options, 'access', _ => _.failIds, 'optionalAccess', _2 => _2.includes, 'call', _3 => _3(id)])) throw new (0,
|
|
109
|
+
if (!s) throw new (0, _chunkU67EN7GGcjs.StickerError)("unknown_sticker", `No fake sticker "${id}".`);
|
|
110
|
+
if (_optionalChain([options, 'access', _ => _.failIds, 'optionalAccess', _2 => _2.includes, 'call', _3 => _3(id)])) throw new (0, _chunkU67EN7GGcjs.StickerError)("load_failed", `The fake sticker "${id}" failed to load (failIds).`);
|
|
107
111
|
const fill = s.shape === "badge" && o.colour ? o.colour.toLowerCase() : s.colours[0];
|
|
108
112
|
if (o.format === "png") {
|
|
109
113
|
const size = _nullishCoalesce(o.size, () => ( 128));
|
|
110
|
-
if (!(Number.isInteger(size) && size >= 8 && size <= 512)) throw new (0,
|
|
114
|
+
if (!(Number.isInteger(size) && size >= 8 && size <= 512)) throw new (0, _chunkU67EN7GGcjs.StickerError)("invalid_argument", `size must be 8..512 px, got ${size}.`);
|
|
111
115
|
return { kind: "image", url: _chunkW5M3J7PVcjs.pngDataUrl.call(void 0, size, size, pixelsOf(s, size, fill)), width: size, height: size };
|
|
112
116
|
}
|
|
113
117
|
return { kind: "svg", svg: svgOf(s, fill) };
|
|
@@ -119,23 +123,23 @@ function createFakeStickerProvider(options = {}) {
|
|
|
119
123
|
function combineStickerProviders(providers, options = {}) {
|
|
120
124
|
const ids = providers.map((p) => p.id);
|
|
121
125
|
const dup = ids.find((id, i) => ids.indexOf(id) !== i);
|
|
122
|
-
if (dup) throw new (0,
|
|
126
|
+
if (dup) throw new (0, _chunkU67EN7GGcjs.StickerError)("invalid_argument", `Two sticker providers have the id "${dup}"; give each a unique id.`);
|
|
123
127
|
const byId = new Map(providers.map((p) => [p.id, p]));
|
|
124
128
|
const owner = (ref) => {
|
|
125
|
-
const { provider, id } =
|
|
129
|
+
const { provider, id } = _chunkJSDND7DFcjs.parseStickerRef.call(void 0, ref);
|
|
126
130
|
const p = byId.get(provider);
|
|
127
|
-
if (!p) throw new (0,
|
|
131
|
+
if (!p) throw new (0, _chunkU67EN7GGcjs.StickerError)("unknown_provider", `No sticker provider "${provider}"; the providers are ${ids.join(", ") || "none"}.`);
|
|
128
132
|
return { p, id };
|
|
129
133
|
};
|
|
130
|
-
const prefix = (p, s) => ({ ...s, id:
|
|
134
|
+
const prefix = (p, s) => ({ ...s, id: _chunkJSDND7DFcjs.stickerRefOf.call(void 0, p, s.id) });
|
|
131
135
|
const page = async (query, o = {}) => {
|
|
132
|
-
const { after, limit =
|
|
133
|
-
|
|
136
|
+
const { after, limit = _chunkJSDND7DFcjs.DEFAULT_STICKER_PAGE, ...filters } = o;
|
|
137
|
+
_chunkJSDND7DFcjs.checkStickerSearchOptions.call(void 0, { limit });
|
|
134
138
|
let i = 0;
|
|
135
139
|
let inner;
|
|
136
140
|
if (after !== void 0) {
|
|
137
141
|
const m = /^(\d+)\|(.*)$/.exec(after);
|
|
138
|
-
if (!m || Number(m[1]) >= providers.length) throw new (0,
|
|
142
|
+
if (!m || Number(m[1]) >= providers.length) throw new (0, _chunkU67EN7GGcjs.StickerError)("invalid_argument", `after "${after}" is not a cursor from this provider; pass the next value of the previous page.`);
|
|
139
143
|
i = Number(m[1]);
|
|
140
144
|
inner = m[2] || void 0;
|
|
141
145
|
}
|
|
@@ -179,7 +183,7 @@ function combineStickerProviders(providers, options = {}) {
|
|
|
179
183
|
return void 0;
|
|
180
184
|
}
|
|
181
185
|
const d = await o.p.describe(o.id);
|
|
182
|
-
return d ? { ...d, id:
|
|
186
|
+
return d ? { ...d, id: _chunkJSDND7DFcjs.stickerRefOf.call(void 0, o.p, d.id) } : void 0;
|
|
183
187
|
},
|
|
184
188
|
async load(ref, o) {
|
|
185
189
|
const { p, id } = owner(ref);
|
|
@@ -328,4 +332,6 @@ async function checkStickerProvider(provider, options = {}) {
|
|
|
328
332
|
|
|
329
333
|
|
|
330
334
|
|
|
331
|
-
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
exports.DEFAULT_STICKER_PAGE = _chunkJSDND7DFcjs.DEFAULT_STICKER_PAGE; exports.EDITOR_STICKERS_ID = _chunkJSDND7DFcjs.EDITOR_STICKERS_ID; exports.MAX_STICKER_PAGE = _chunkJSDND7DFcjs.MAX_STICKER_PAGE; exports.STAMP_KINDS = _chunkJSDND7DFcjs.STAMP_KINDS; exports.StickerBrowser = _chunkSABJMH6Mcjs.StickerBrowser; exports.StickerError = _chunkU67EN7GGcjs.StickerError; exports.StickersSlot = _chunkJSDND7DFcjs.StickersSlot; exports.checkStickerProvider = checkStickerProvider; exports.checkStickerSearchOptions = _chunkJSDND7DFcjs.checkStickerSearchOptions; exports.closestStickerRefs = _chunkJSDND7DFcjs.closestStickerRefs; exports.combineStickerProviders = combineStickerProviders; exports.createFakeStickerProvider = createFakeStickerProvider; exports.createInsertStickerTool = _chunkSABJMH6Mcjs.createInsertStickerTool; exports.createStickerToolProvider = _chunkSABJMH6Mcjs.createStickerToolProvider; exports.createStickerTools = _chunkSABJMH6Mcjs.createStickerTools; exports.describeStickerRef = _chunkSABJMH6Mcjs.describeStickerRef; exports.editorStampOf = _chunkJSDND7DFcjs.editorStampOf; exports.editorStickers = _chunkSABJMH6Mcjs.editorStickers; exports.insertSticker = _chunkSABJMH6Mcjs.insertSticker; exports.normalizeStickerRef = _chunkJSDND7DFcjs.normalizeStickerRef; exports.parseStickerRef = _chunkJSDND7DFcjs.parseStickerRef; exports.stampCoverage = _chunkJSDND7DFcjs.stampCoverage; exports.stampOutline = _chunkSABJMH6Mcjs.stampOutline; exports.stampPixels = _chunkSABJMH6Mcjs.stampPixels; exports.stickerForAgent = _chunkSABJMH6Mcjs.stickerForAgent; exports.stickerIdFor = _chunkJSDND7DFcjs.stickerIdFor; exports.stickerPage = _chunkJSDND7DFcjs.stickerPage; exports.stickerRefOf = _chunkJSDND7DFcjs.stickerRefOf;
|
|
@@ -12,5 +12,5 @@ export { editorStickers, stampOutline, stampPixels } from './editor.cjs';
|
|
|
12
12
|
export { createFakeStickerProvider, type FakeStickerProviderOptions } from './fake.cjs';
|
|
13
13
|
export { combineStickerProviders } from './combine.cjs';
|
|
14
14
|
export { checkStickerProvider, type StickerConformanceIssue, type StickerConformanceOptions } from './conformance.cjs';
|
|
15
|
-
export { createStickerTools, createStickerToolProvider, describeStickerRef, stickerForAgent, type StickerToolsOptions } from './tools.cjs';
|
|
15
|
+
export { createInsertStickerTool, insertSticker, createStickerTools, createStickerToolProvider, describeStickerRef, stickerForAgent, type StickerInsertHost, type StickerPlacement, type StickerToolsOptions } from './tools.cjs';
|
|
16
16
|
export { StickerBrowser, type StickerBrowserItem, type StickerBrowserState } from './browser.cjs';
|