@pixerate/editor 0.248.0 → 0.250.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/README.md +1 -0
- package/dist/animation-editor/index.cjs +118 -114
- package/dist/animation-editor/index.js +11 -7
- package/dist/{brushstrokeRender-QLCXROJK.js → brushstrokeRender-2FHFLSEG.js} +8 -4
- package/dist/{brushstrokeRender-DTDPFBLC.cjs → brushstrokeRender-QGRXOKDA.cjs} +15 -11
- package/dist/canvas/index.cjs +71 -15
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +58 -2
- package/dist/canvas/stickers.d.cts +35 -0
- package/dist/canvas/stickers.d.ts +35 -0
- package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
- package/dist/{chunk-SC2RZ5EF.js → chunk-2VJAVXLI.js} +2 -2
- package/dist/{chunk-OLNIPTB3.cjs → chunk-2VX55NFM.cjs} +1 -320
- package/dist/chunk-3K6HWEXZ.cjs +92 -0
- package/dist/{chunk-UOOK7HTX.js → chunk-3PPJRMIG.js} +1 -1
- package/dist/{chunk-ZFSLEOSQ.js → chunk-3TWOCSCY.js} +11 -9
- package/dist/chunk-4D6KP5BV.js +92 -0
- package/dist/chunk-4JNWA3VT.cjs +302 -0
- package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
- package/dist/{chunk-2ONK3ERD.cjs → chunk-75K3W4D6.cjs} +20 -20
- package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
- package/dist/chunk-ATK6ABN3.cjs +303 -0
- package/dist/{chunk-7T7JWTVE.cjs → chunk-BOHDJJ2O.cjs} +8 -8
- package/dist/{chunk-2PBZBRP5.js → chunk-D5KGAO4Z.js} +10 -92
- package/dist/{chunk-HB4ICNNA.cjs → chunk-DPYAO5U6.cjs} +42 -42
- package/dist/{chunk-6G6ZDDDB.cjs → chunk-GT77U7QG.cjs} +303 -149
- package/dist/{chunk-PQ3H2AAN.cjs → chunk-I7NJPHWV.cjs} +122 -204
- package/dist/{chunk-42TWUPNJ.js → chunk-IRSTHLQQ.js} +1 -320
- package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
- package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
- package/dist/{chunk-VMROIWLL.cjs → chunk-KBYB7OWB.cjs} +3 -3
- package/dist/{chunk-Q2HA52V4.js → chunk-KDLBJ6QR.js} +2 -2
- package/dist/{chunk-WVS5KQDH.cjs → chunk-M2VKFE5L.cjs} +246 -244
- package/dist/{chunk-5GLYUSNT.js → chunk-NOHJP5TK.js} +1 -1
- package/dist/{chunk-XNRBMYNB.js → chunk-NTRAVM2I.js} +1 -1
- package/dist/{chunk-VNBUDVD4.js → chunk-OTEPAQJX.js} +228 -74
- package/dist/chunk-OTTT5N3K.js +322 -0
- package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
- package/dist/{chunk-NZ3O3A5C.js → chunk-SMSGP2HQ.js} +1 -1
- package/dist/chunk-SZTI6EER.js +13 -0
- package/dist/chunk-U4NUOKBT.js +303 -0
- package/dist/chunk-U67EN7GG.cjs +13 -0
- package/dist/chunk-W5M3J7PV.cjs +322 -0
- package/dist/{chunk-4P6H35HU.js → chunk-WA44NKPF.js} +2 -2
- package/dist/chunk-WKH5ZAUA.js +302 -0
- package/dist/{chunk-L6REDLNB.cjs → chunk-WPUXGDH4.cjs} +7 -7
- package/dist/{chunk-P3NIPIKS.js → chunk-WQCNC4DK.js} +1 -1
- package/dist/{chunk-IBDU6EGZ.cjs → chunk-X7WRL5ZZ.cjs} +35 -35
- package/dist/{chunk-XWTRATIM.cjs → chunk-YM6ZBTXG.cjs} +23 -23
- package/dist/{chunk-TPWB4Y6L.cjs → chunk-YW43M56C.cjs} +1 -1
- package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
- package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
- 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/image-editor/effects.d.cts +1 -1
- package/dist/image-editor/effects.d.ts +1 -1
- package/dist/image-editor/index.cjs +1097 -1069
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +58 -30
- package/dist/image-editor/stickers.d.cts +9 -0
- package/dist/image-editor/stickers.d.ts +9 -0
- package/dist/paint/index.cjs +8 -5
- package/dist/paint/index.js +13 -10
- package/dist/paint-editor/controller.d.cts +37 -1
- package/dist/paint-editor/controller.d.ts +37 -1
- package/dist/paint-editor/index.cjs +753 -609
- package/dist/paint-editor/index.d.cts +3 -0
- package/dist/paint-editor/index.d.ts +3 -0
- package/dist/paint-editor/index.js +187 -43
- package/dist/paint-editor/sticker-art.d.cts +55 -0
- package/dist/paint-editor/sticker-art.d.ts +55 -0
- package/dist/paint-editor/stickers.d.cts +30 -17
- package/dist/paint-editor/stickers.d.ts +30 -17
- package/dist/paint-editor/stroke.d.cts +4 -0
- package/dist/paint-editor/stroke.d.ts +4 -0
- package/dist/paint-editor/ui.d.cts +10 -2
- package/dist/paint-editor/ui.d.ts +10 -2
- package/dist/raster/index.cjs +6 -4
- package/dist/raster/index.js +12 -10
- package/dist/stickers/browser.d.cts +48 -0
- package/dist/stickers/browser.d.ts +48 -0
- package/dist/stickers/combine.d.cts +10 -0
- package/dist/stickers/combine.d.ts +10 -0
- package/dist/stickers/conformance.d.cts +18 -0
- package/dist/stickers/conformance.d.ts +18 -0
- package/dist/stickers/editor.d.cts +14 -0
- package/dist/stickers/editor.d.ts +14 -0
- package/dist/stickers/errors.d.cts +6 -0
- package/dist/stickers/errors.d.ts +6 -0
- package/dist/stickers/fake.d.cts +16 -0
- package/dist/stickers/fake.d.ts +16 -0
- package/dist/stickers/helpers.d.cts +51 -0
- package/dist/stickers/helpers.d.ts +51 -0
- package/dist/stickers/index.cjs +337 -0
- package/dist/stickers/index.d.cts +16 -0
- package/dist/stickers/index.d.ts +16 -0
- package/dist/stickers/index.js +337 -0
- package/dist/stickers/stamps.d.cts +13 -0
- package/dist/stickers/stamps.d.ts +13 -0
- package/dist/stickers/tools.d.cts +81 -0
- package/dist/stickers/tools.d.ts +81 -0
- package/dist/stickers/types.d.cts +123 -0
- package/dist/stickers/types.d.ts +123 -0
- package/dist/vector/index.cjs +1018 -981
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +44 -7
- package/dist/vector/stickers.d.cts +11 -0
- package/dist/vector/stickers.d.ts +11 -0
- package/dist/video-editor/index.cjs +344 -344
- package/dist/video-editor/index.js +4 -4
- package/package.json +11 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +8 -5
- package/skills/pixerate-stickers/SKILL.md +57 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sticker provider contract: how an editor finds, describes and loads stickers from a library
|
|
3
|
+
* it knows nothing about (the editor's own stamps, a brand pack, user uploads, a third-party API).
|
|
4
|
+
* Libraries implement it structurally, like `EffectProvider` and `FontProvider`.
|
|
5
|
+
*
|
|
6
|
+
* Ids are the provider's own; a `StickerRef` (`provider:id`) names a sticker across providers
|
|
7
|
+
* (`combineStickerProviders` lists them that way).
|
|
8
|
+
*/
|
|
9
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
10
|
+
/** How a sticker's art may be used. Every sticker says. */
|
|
11
|
+
export interface StickerLicence {
|
|
12
|
+
/** SPDX id when there is one (`MIT`, `CC-BY-4.0`). */
|
|
13
|
+
spdx?: string;
|
|
14
|
+
/** Human-readable name. */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Credit line the licence asks for. */
|
|
17
|
+
attribution?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
/** May be used commercially. */
|
|
20
|
+
commercial: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type StickerFormat = 'svg' | 'png';
|
|
23
|
+
/** A sticker in a list or search result. */
|
|
24
|
+
export interface StickerSummary {
|
|
25
|
+
/** The provider's id (no `:` needed; `combineStickerProviders` prefixes its own). */
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
category: string;
|
|
29
|
+
tags?: string[];
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Natural size in px, for layout before the art is loaded. */
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
/** A small `data:` or `https:` image. */
|
|
35
|
+
thumbnail?: string;
|
|
36
|
+
/** The formats `load` can return. */
|
|
37
|
+
formats: StickerFormat[];
|
|
38
|
+
licence: StickerLicence;
|
|
39
|
+
/** Flat, single-colour art: `load(id, { colour })` recolours it (the paint editor's spray colours it). */
|
|
40
|
+
tintable: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Everything about one sticker. */
|
|
43
|
+
export interface StickerDescription extends StickerSummary {
|
|
44
|
+
/** SVG path data of its outline, in its natural box (for die-cut treatments). */
|
|
45
|
+
silhouette?: string;
|
|
46
|
+
/** Dominant colours #rrggbb, for matching and recolouring. */
|
|
47
|
+
colours?: string[];
|
|
48
|
+
variants?: {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
}[];
|
|
52
|
+
}
|
|
53
|
+
/** A sticker's art. */
|
|
54
|
+
export type StickerAsset = {
|
|
55
|
+
kind: 'svg';
|
|
56
|
+
svg: string;
|
|
57
|
+
silhouette?: string;
|
|
58
|
+
}
|
|
59
|
+
/** `url`: a `data:` or `https:` image. */
|
|
60
|
+
| {
|
|
61
|
+
kind: 'image';
|
|
62
|
+
url: string;
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
66
|
+
/** One page of results. Pages stay small; follow `next` (pass it as `after`). */
|
|
67
|
+
export interface StickerPage {
|
|
68
|
+
items: StickerSummary[];
|
|
69
|
+
/** How many match in all. */
|
|
70
|
+
total: number;
|
|
71
|
+
next?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface StickerSearchOptions {
|
|
74
|
+
category?: string;
|
|
75
|
+
/** Every tag must match. */
|
|
76
|
+
tags?: string[];
|
|
77
|
+
/** Page size (providers cap it; 1..100, default 24). */
|
|
78
|
+
limit?: number;
|
|
79
|
+
/** `next` from the previous page. */
|
|
80
|
+
after?: string;
|
|
81
|
+
licence?: {
|
|
82
|
+
commercial?: boolean;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface StickerLoadOptions {
|
|
86
|
+
format?: StickerFormat;
|
|
87
|
+
/** Longest side in px for raster art. */
|
|
88
|
+
size?: number;
|
|
89
|
+
/** #rrggbb: recolour a tintable sticker. */
|
|
90
|
+
colour?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface StickerProviderCapabilities {
|
|
93
|
+
supportsSearch: boolean;
|
|
94
|
+
supportsSvg: boolean;
|
|
95
|
+
supportsRaster: boolean;
|
|
96
|
+
/** The largest raster `size` it loads. */
|
|
97
|
+
maxSize?: number;
|
|
98
|
+
}
|
|
99
|
+
export interface StickerProvider {
|
|
100
|
+
/** Short and unique among the providers an editor uses: `editor`, `acme-brand`, `uploads`. */
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly name: string;
|
|
103
|
+
readonly version?: string;
|
|
104
|
+
readonly capabilities: StickerProviderCapabilities;
|
|
105
|
+
/** Its ids are already refs (`provider:id`): a combination of providers (`combineStickerProviders`). */
|
|
106
|
+
readonly namespaced?: boolean;
|
|
107
|
+
/** The stickers, a page at a time; `category` and `tags` filter. */
|
|
108
|
+
list(options?: StickerSearchOptions): MaybePromise<StickerPage>;
|
|
109
|
+
/** Stickers matching words in their name, tags, category or description; `""` is `list`. */
|
|
110
|
+
search(query: string, options?: StickerSearchOptions): MaybePromise<StickerPage>;
|
|
111
|
+
/** A sticker by id, or `undefined`. */
|
|
112
|
+
describe(id: string): MaybePromise<StickerDescription | undefined>;
|
|
113
|
+
/** The art; rejects with a `StickerError` (`unknown_sticker`, `unsupported_format`) when it can't. */
|
|
114
|
+
load(id: string, options?: StickerLoadOptions): MaybePromise<StickerAsset>;
|
|
115
|
+
/** Categories with counts, when the provider knows them. */
|
|
116
|
+
categories?(): MaybePromise<Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
count: number;
|
|
120
|
+
}>>;
|
|
121
|
+
}
|
|
122
|
+
/** `provider:id`, the name of a sticker across providers. A bare editor stamp (`"star"`) means `editor:star`. */
|
|
123
|
+
export type StickerRef = string;
|