@yoobic/yobi 8.7.51 → 8.7.52
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/cjs/yoo-grid-calendar.cjs.entry.js +1 -1
- package/dist/collection/components/grid/grid-calendar/grid-calendar.js +1 -1
- package/dist/design-system/yoo-grid-calendar.entry.js +1 -1
- package/dist/esm/yoo-grid-calendar.entry.js +1 -1
- package/dist/types/components/form/image-cropper-dialog/pintura/pintura.d.ts +1294 -0
- package/package.json +1 -1
@@ -242,7 +242,7 @@ const YooGridCalendarComponent = class {
|
|
242
242
|
}
|
243
243
|
scrollToClosesDateInListMonth() {
|
244
244
|
if (this.leftSelectedDate) {
|
245
|
-
const scroller = this.host.querySelector('.swiper-slide-active .fc-scroller');
|
245
|
+
const scroller = this.host.shadowRoot.querySelector('.swiper-slide-active .fc-scroller');
|
246
246
|
const date = index$1.dateFormat(this.leftSelectedDate, 'YYYY-MM-DD');
|
247
247
|
const daysEl = Array.from(scroller.querySelectorAll('.fc-list-day'));
|
248
248
|
let dayEl = daysEl.find((d) => d.getAttribute('data-date') === date);
|
@@ -225,7 +225,7 @@ export class YooGridCalendarComponent {
|
|
225
225
|
}
|
226
226
|
scrollToClosesDateInListMonth() {
|
227
227
|
if (this.leftSelectedDate) {
|
228
|
-
const scroller = this.host.querySelector('.swiper-slide-active .fc-scroller');
|
228
|
+
const scroller = this.host.shadowRoot.querySelector('.swiper-slide-active .fc-scroller');
|
229
229
|
const date = dateFormat(this.leftSelectedDate, 'YYYY-MM-DD');
|
230
230
|
const daysEl = Array.from(scroller.querySelectorAll('.fc-list-day'));
|
231
231
|
let dayEl = daysEl.find((d) => d.getAttribute('data-date') === date);
|
@@ -238,7 +238,7 @@ const YooGridCalendarComponent = class {
|
|
238
238
|
}
|
239
239
|
scrollToClosesDateInListMonth() {
|
240
240
|
if (this.leftSelectedDate) {
|
241
|
-
const scroller = this.host.querySelector('.swiper-slide-active .fc-scroller');
|
241
|
+
const scroller = this.host.shadowRoot.querySelector('.swiper-slide-active .fc-scroller');
|
242
242
|
const date = dateFormat(this.leftSelectedDate, 'YYYY-MM-DD');
|
243
243
|
const daysEl = Array.from(scroller.querySelectorAll('.fc-list-day'));
|
244
244
|
let dayEl = daysEl.find((d) => d.getAttribute('data-date') === date);
|
@@ -238,7 +238,7 @@ const YooGridCalendarComponent = class {
|
|
238
238
|
}
|
239
239
|
scrollToClosesDateInListMonth() {
|
240
240
|
if (this.leftSelectedDate) {
|
241
|
-
const scroller = this.host.querySelector('.swiper-slide-active .fc-scroller');
|
241
|
+
const scroller = this.host.shadowRoot.querySelector('.swiper-slide-active .fc-scroller');
|
242
242
|
const date = dateFormat(this.leftSelectedDate, 'YYYY-MM-DD');
|
243
243
|
const daysEl = Array.from(scroller.querySelectorAll('.fc-list-day'));
|
244
244
|
let dayEl = daysEl.find((d) => d.getAttribute('data-date') === date);
|
@@ -0,0 +1,1294 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2
|
+
export type ProgressCallback = (event: ProgressEvent) => void;
|
3
|
+
|
4
|
+
export type Percentage = string;
|
5
|
+
|
6
|
+
export interface PinturaMetadata {
|
7
|
+
[key: string]: any;
|
8
|
+
}
|
9
|
+
|
10
|
+
// prettier-ignore
|
11
|
+
/**
|
12
|
+
* A matrix of 20 digits based on the SVG <feColorMatrix> filter
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* ```
|
16
|
+
* R G B A W
|
17
|
+
* R | 1 0 0 0 0
|
18
|
+
* G | 0 1 0 0 0
|
19
|
+
* B | 0 0 1 0 0
|
20
|
+
* A | 0 0 0 1 0
|
21
|
+
* ```
|
22
|
+
* @link Utility to generate a color matrix: https://fecolormatrix.com
|
23
|
+
* @link More information on color matrices: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feColorMatrix
|
24
|
+
*/
|
25
|
+
export type ColorMatrix = [
|
26
|
+
number, number, number, number, number,
|
27
|
+
number, number, number, number, number,
|
28
|
+
number, number, number, number, number,
|
29
|
+
number, number, number, number, number
|
30
|
+
];
|
31
|
+
|
32
|
+
// prettier-ignore
|
33
|
+
/**
|
34
|
+
* A matrix of 9 digits based on the SVG <feConvolveMatrix> filter
|
35
|
+
*
|
36
|
+
* @example
|
37
|
+
* ```
|
38
|
+
* 1 0 0
|
39
|
+
* 0 1 0
|
40
|
+
* 0 0 1
|
41
|
+
* ```
|
42
|
+
* @link More information on convolution matrices: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feConvolveMatrix
|
43
|
+
*/
|
44
|
+
export type ConvolutionMatrix = [
|
45
|
+
number, number, number,
|
46
|
+
number, number, number,
|
47
|
+
number, number, number
|
48
|
+
];
|
49
|
+
|
50
|
+
export type Color = number[];
|
51
|
+
|
52
|
+
export type TextAlign = 'left' | 'center' | 'right';
|
53
|
+
|
54
|
+
export type TextLayout = 'auto-width' | 'auto-height' | 'fixed-size';
|
55
|
+
|
56
|
+
export type SizeCategory =
|
57
|
+
| 'extraSmall'
|
58
|
+
| 'small'
|
59
|
+
| 'mediumSmall'
|
60
|
+
| 'medium'
|
61
|
+
| 'mediumLarge'
|
62
|
+
| 'large'
|
63
|
+
| 'extraLarge';
|
64
|
+
|
65
|
+
export type LineEndStyle =
|
66
|
+
| 'bar'
|
67
|
+
| 'arrow'
|
68
|
+
| 'arrowSolid'
|
69
|
+
| 'circle'
|
70
|
+
| 'circleSolid'
|
71
|
+
| 'square'
|
72
|
+
| 'squareSolid';
|
73
|
+
|
74
|
+
export interface ColorPalette {
|
75
|
+
transparent?: Color;
|
76
|
+
white?: Color;
|
77
|
+
silver?: Color;
|
78
|
+
gray?: Color;
|
79
|
+
black?: Color;
|
80
|
+
navy?: Color;
|
81
|
+
blue?: Color;
|
82
|
+
aqua?: Color;
|
83
|
+
teal?: Color;
|
84
|
+
olive?: Color;
|
85
|
+
green?: Color;
|
86
|
+
yellow?: Color;
|
87
|
+
orange?: Color;
|
88
|
+
red?: Color;
|
89
|
+
maroon?: Color;
|
90
|
+
fuchsia?: Color;
|
91
|
+
purple?: Color;
|
92
|
+
}
|
93
|
+
|
94
|
+
export type SizeCategories = Record<SizeCategory, Percentage | number>;
|
95
|
+
|
96
|
+
export interface LocaleCollection {
|
97
|
+
[shapeProperty: string]: string;
|
98
|
+
}
|
99
|
+
|
100
|
+
export type LocaleString = string | ((locale: LocaleCollection) => string);
|
101
|
+
|
102
|
+
export interface Vector {
|
103
|
+
x: number;
|
104
|
+
y: number;
|
105
|
+
}
|
106
|
+
|
107
|
+
export interface Size {
|
108
|
+
width: number;
|
109
|
+
height: number;
|
110
|
+
}
|
111
|
+
|
112
|
+
export interface Rect {
|
113
|
+
x: number;
|
114
|
+
y: number;
|
115
|
+
width: number;
|
116
|
+
height: number;
|
117
|
+
}
|
118
|
+
|
119
|
+
export interface ShapeToolOptions {
|
120
|
+
position?: string;
|
121
|
+
inputMode?: string;
|
122
|
+
}
|
123
|
+
|
124
|
+
export interface ShapeRectangle {
|
125
|
+
x?: number | Percentage;
|
126
|
+
y?: number | Percentage;
|
127
|
+
width?: number | Percentage;
|
128
|
+
height?: number | Percentage;
|
129
|
+
}
|
130
|
+
|
131
|
+
export interface Shape {
|
132
|
+
x?: number | Percentage;
|
133
|
+
y?: number | Percentage;
|
134
|
+
width?: number | Percentage;
|
135
|
+
height?: number | Percentage;
|
136
|
+
left?: number | Percentage;
|
137
|
+
top?: number | Percentage;
|
138
|
+
right?: number | Percentage;
|
139
|
+
bottom?: number | Percentage;
|
140
|
+
rx?: number | Percentage;
|
141
|
+
ry?: number | Percentage;
|
142
|
+
x1?: number | Percentage;
|
143
|
+
y1?: number | Percentage;
|
144
|
+
x2?: number | Percentage;
|
145
|
+
y2?: number | Percentage;
|
146
|
+
strokeColor?: Color;
|
147
|
+
strokeWidth?: number | Percentage;
|
148
|
+
cornerRadius?: number | Percentage;
|
149
|
+
fontSize?: number | Percentage;
|
150
|
+
fontFamily?: string;
|
151
|
+
lineHeight?: number | Percentage;
|
152
|
+
textAlign?: undefined | 'left' | 'center' | 'right';
|
153
|
+
text?: string;
|
154
|
+
aspectRatio?: number;
|
155
|
+
rotation?: number;
|
156
|
+
points?: Vector[];
|
157
|
+
color?: Color;
|
158
|
+
backgroundColor?: Color;
|
159
|
+
eraseRadius?: number;
|
160
|
+
lineStart?:
|
161
|
+
| undefined
|
162
|
+
| 'bar'
|
163
|
+
| 'arrow'
|
164
|
+
| 'arrow-solid'
|
165
|
+
| 'square'
|
166
|
+
| 'square-solid'
|
167
|
+
| 'circle'
|
168
|
+
| 'circle-solid';
|
169
|
+
lineEnd?:
|
170
|
+
| undefined
|
171
|
+
| 'bar'
|
172
|
+
| 'arrow'
|
173
|
+
| 'arrow-solid'
|
174
|
+
| 'square'
|
175
|
+
| 'square-solid'
|
176
|
+
| 'circle'
|
177
|
+
| 'circle-solid';
|
178
|
+
isSelected?: boolean;
|
179
|
+
isEditing?: boolean;
|
180
|
+
disableStyle?: boolean | string[];
|
181
|
+
disableErase?: boolean;
|
182
|
+
disableSelect?: boolean;
|
183
|
+
disableRemove?: boolean;
|
184
|
+
disableDuplicate?: boolean;
|
185
|
+
disableReorder?: boolean;
|
186
|
+
disableFlip?: boolean;
|
187
|
+
disableInput?: boolean | ((text: string) => string);
|
188
|
+
disableManipulate?: boolean;
|
189
|
+
disableMove?: boolean;
|
190
|
+
disableResize?: boolean;
|
191
|
+
disableRotate?: boolean;
|
192
|
+
disableTextLayout?: boolean | TextLayout[];
|
193
|
+
|
194
|
+
// private
|
195
|
+
readonly _context?: Rect | Size;
|
196
|
+
readonly _isDraft?: boolean;
|
197
|
+
readonly _isComplete?: boolean;
|
198
|
+
readonly _isError?: boolean;
|
199
|
+
readonly _isLoading?: boolean;
|
200
|
+
readonly _isFormatted?: boolean;
|
201
|
+
}
|
202
|
+
|
203
|
+
export type SvelteComponent = any;
|
204
|
+
export type SvelteComponentProps = any;
|
205
|
+
|
206
|
+
export type ShapeControl = [
|
207
|
+
// Component to use
|
208
|
+
SvelteComponent,
|
209
|
+
|
210
|
+
// Component properties to map
|
211
|
+
{
|
212
|
+
title?: LocaleString;
|
213
|
+
label?: LocaleString;
|
214
|
+
options?: SvelteComponentProps;
|
215
|
+
optionIconStyle?: LocaleString;
|
216
|
+
optionLabelStyle?: LocaleString;
|
217
|
+
}
|
218
|
+
];
|
219
|
+
|
220
|
+
export type ShapeColorOption = [Color, string] | [Color, string, any];
|
221
|
+
export type ShapeSizeOption = [number | Percentage, string] | [number | Percentage, string, any];
|
222
|
+
|
223
|
+
export type ShapeLineEndOption = [LineEndStyle, string] | [LineEndStyle, string, any];
|
224
|
+
export type ShapeFontFamilyOption = [string, string] | [string, string, any];
|
225
|
+
export type ShapeFontStyleOption = [string, string] | [string, string, any];
|
226
|
+
|
227
|
+
export interface ShapeControlOptions {
|
228
|
+
colorOptions?: false | ShapeColorOption[];
|
229
|
+
lineEndStyleOptions?: false | ShapeLineEndOption[];
|
230
|
+
fontFamilyOptions?: false | ShapeFontFamilyOption[];
|
231
|
+
fontStyleOptions?: false | ShapeFontStyleOption[];
|
232
|
+
textAlignOptions?: false | [TextAlign, string][];
|
233
|
+
strokeWidthOptions?: false | ShapeSizeOption[] | number[];
|
234
|
+
fontSizeOptions?: false | ShapeSizeOption[] | number[];
|
235
|
+
lineHeightOptions?: false | ShapeSizeOption[] | number[];
|
236
|
+
}
|
237
|
+
|
238
|
+
export interface ShapeControlConfiguration {
|
239
|
+
// A mapping of a shapeProperty to a Component
|
240
|
+
[shapeProperty: string]: ShapeControl;
|
241
|
+
}
|
242
|
+
|
243
|
+
export type StickerSource = string; // emoji or URL
|
244
|
+
|
245
|
+
export interface StickerTemplate {
|
246
|
+
thumb?: StickerSource;
|
247
|
+
src?: StickerSource;
|
248
|
+
width?: number;
|
249
|
+
height?: number;
|
250
|
+
alt?: string;
|
251
|
+
disabled?: boolean;
|
252
|
+
shape?: Shape;
|
253
|
+
mount?: (
|
254
|
+
element: HTMLElement,
|
255
|
+
sticker: StickerTemplate
|
256
|
+
) => { update?: (sticker: StickerTemplate) => void; destroy?: () => void };
|
257
|
+
}
|
258
|
+
|
259
|
+
export type Sticker = StickerSource | StickerTemplate;
|
260
|
+
|
261
|
+
export interface StickerGroupOptions {
|
262
|
+
icon?: string;
|
263
|
+
hideLabel?: boolean;
|
264
|
+
disabled?: boolean;
|
265
|
+
}
|
266
|
+
|
267
|
+
export type StickerGroup = [string, Sticker[]] | [string, Sticker[], StickerGroupOptions];
|
268
|
+
|
269
|
+
export type ImageSource = File | Blob | string | HTMLImageElement | HTMLCanvasElement;
|
270
|
+
|
271
|
+
export interface Store {
|
272
|
+
subscribe: (value: (value: any) => void) => () => void;
|
273
|
+
set?: (value: any) => void;
|
274
|
+
update?: (fn: (value: any) => any) => void;
|
275
|
+
}
|
276
|
+
|
277
|
+
export interface StoreCollection {
|
278
|
+
[shapeProperty: string]: Store;
|
279
|
+
}
|
280
|
+
|
281
|
+
export type Filter = () => ColorMatrix;
|
282
|
+
|
283
|
+
export interface Frame {
|
284
|
+
shape: any;
|
285
|
+
thumb: string; // HTML or SVG
|
286
|
+
}
|
287
|
+
|
288
|
+
export interface Effect {
|
289
|
+
base: number;
|
290
|
+
min: number;
|
291
|
+
max: number;
|
292
|
+
getLabel?: (value: number) => number;
|
293
|
+
getStore: (stores: StoreCollection) => Store;
|
294
|
+
getValue: (store: Store) => number;
|
295
|
+
setValue: (store: Store, value: number) => void;
|
296
|
+
}
|
297
|
+
|
298
|
+
export interface PinturaEditorHistoryAPI {
|
299
|
+
undo: () => number;
|
300
|
+
redo: () => number;
|
301
|
+
revert: () => void;
|
302
|
+
write: (imageState?: any) => void;
|
303
|
+
get: () => any[];
|
304
|
+
getCollapsed: () => any[];
|
305
|
+
set: (imageStates: any[]) => void;
|
306
|
+
readonly length: number;
|
307
|
+
readonly index: number;
|
308
|
+
}
|
309
|
+
|
310
|
+
export interface PinturaEditorMethods {
|
311
|
+
on: (event: string, cb: (detail?: any) => void) => void;
|
312
|
+
loadImage: (
|
313
|
+
src: ImageSource,
|
314
|
+
options?: PinturaEditorOptions
|
315
|
+
) => Promise<PinturaDefaultImageReaderResult>;
|
316
|
+
editImage: (
|
317
|
+
src: ImageSource,
|
318
|
+
options?: PinturaEditorOptions
|
319
|
+
) => Promise<PinturaDefaultImageWriterResult>;
|
320
|
+
processImage: (
|
321
|
+
src?: ImageSource,
|
322
|
+
options?: PinturaEditorOptions
|
323
|
+
) => Promise<PinturaDefaultImageWriterResult>;
|
324
|
+
abortLoadImage: () => void;
|
325
|
+
abortProcessImage: () => void;
|
326
|
+
updateImage: (src: ImageSource) => Promise<PinturaDefaultImageReaderResult>;
|
327
|
+
updateImagePreview: (src: ImageSource) => void;
|
328
|
+
removeImage: () => void;
|
329
|
+
close: () => void;
|
330
|
+
destroy: () => void;
|
331
|
+
readonly history: PinturaEditorHistoryAPI;
|
332
|
+
}
|
333
|
+
|
334
|
+
export type CropOption = [number | undefined, string];
|
335
|
+
|
336
|
+
export type SizeOption = [[number, number], string];
|
337
|
+
|
338
|
+
export type CropPresetOption = CropOption | SizeOption;
|
339
|
+
|
340
|
+
export type OptionGroup = [string, any[]] | [string, any[], any];
|
341
|
+
|
342
|
+
export interface CropPluginOptions {
|
343
|
+
cropAutoCenterImageSelectionTimeout?: undefined | number;
|
344
|
+
cropWillRenderImageSelectionGuides?:
|
345
|
+
| undefined
|
346
|
+
| ((
|
347
|
+
interaction: string,
|
348
|
+
interactionFraction: number
|
349
|
+
) => { rows: number; cols: number; opacity: number });
|
350
|
+
cropEnableButtonFlipHorizontal?: boolean;
|
351
|
+
cropEnableButtonFlipVertical?: boolean;
|
352
|
+
cropEnableButtonRotateLeft?: boolean;
|
353
|
+
cropEnableButtonRotateRight?: boolean;
|
354
|
+
cropEnableButtonToggleCropLimit?: boolean;
|
355
|
+
cropEnableCenterImageSelection?: boolean;
|
356
|
+
cropEnableImageSelection?: boolean;
|
357
|
+
cropEnableInfoIndicator?: boolean;
|
358
|
+
cropEnableLimitWheelInputToCropSelection?: boolean;
|
359
|
+
|
360
|
+
/**
|
361
|
+
* Range in radians, defaults to Math.PI / 4
|
362
|
+
*/
|
363
|
+
cropEnableRotationInput?: boolean;
|
364
|
+
cropRotationRange?: number;
|
365
|
+
cropEnableSelectPreset?: boolean;
|
366
|
+
cropEnableZoomInput?: boolean;
|
367
|
+
cropEnableZoomMatchImageAspectRatio?: boolean;
|
368
|
+
cropEnableZoomTowardsWheelPosition?: boolean;
|
369
|
+
cropEnableZoomAutoHide?: boolean;
|
370
|
+
cropImageSelectionCornerStyle?: undefined | 'hook' | 'round' | 'invisible';
|
371
|
+
cropSelectPresetOptions?: OptionGroup[] | CropPresetOption[];
|
372
|
+
cropSelectPresetFilter?: 'landscape' | 'portrait' | false;
|
373
|
+
cropEnableRotateMatchImageAspectRatio?: 'never' | 'custom' | 'always';
|
374
|
+
cropWillRenderTools?: (nodes: PinturaNode[], env: any, redraw: () => void) => PinturaNode[];
|
375
|
+
cropInteractionFocus?: 'image' | 'selection';
|
376
|
+
cropMinimizeToolbar?: 'never' | 'auto' | 'always';
|
377
|
+
}
|
378
|
+
|
379
|
+
export interface ShapeToolButtonOptions {
|
380
|
+
icon?: string;
|
381
|
+
}
|
382
|
+
|
383
|
+
export type ShapeTool = [string, LocaleString] | [string, LocaleString, ShapeToolButtonOptions];
|
384
|
+
|
385
|
+
export interface PinturaMarkupEditorProperties {
|
386
|
+
markupEditorToolbar?: [string, LocaleString, any][];
|
387
|
+
markupEditorToolStyles?: MarkupEditorToolStyleDefaults;
|
388
|
+
markupEditorToolRetainStyles?: boolean;
|
389
|
+
markupEditorShapeStyleControls?: MarkupEditorShapeStyleControlDefaults;
|
390
|
+
markupEditorToolSelectRadius?: number;
|
391
|
+
|
392
|
+
/**
|
393
|
+
* Set to `'modal'` to show a text input popup, set to `'inline'` to enable inline text editing.
|
394
|
+
*/
|
395
|
+
markupEditorTextInputMode?: 'modal' | 'inline';
|
396
|
+
|
397
|
+
/**
|
398
|
+
* Enable to automatically add a shape when a tool is selected
|
399
|
+
*/
|
400
|
+
enableSelectToolToAddShape?: boolean;
|
401
|
+
|
402
|
+
/**
|
403
|
+
* Enable to tap canvas to add text box instead of dragging
|
404
|
+
*/
|
405
|
+
enableTapToAddText?: boolean;
|
406
|
+
|
407
|
+
/**
|
408
|
+
* Enable to show the move/arrow, used to select and manipulate shapes
|
409
|
+
*/
|
410
|
+
enableMoveTool?: boolean;
|
411
|
+
|
412
|
+
/**
|
413
|
+
* Enable to show the hand/view tool, used to pan the canvas
|
414
|
+
*/
|
415
|
+
enableViewTool?: boolean;
|
416
|
+
|
417
|
+
/**
|
418
|
+
* Wether to automatically select move tool when enabled, set to `true` to select for all tools, set to `false` to don't select, set to array of tool names to enable for specific tools only.
|
419
|
+
*/
|
420
|
+
enableAutoSelectMoveTool?: boolean | string[];
|
421
|
+
|
422
|
+
/**
|
423
|
+
* @deprecated Use `enablePanInput` instead
|
424
|
+
*/
|
425
|
+
markupEditorInteractionMode?: 'auto' | 'pan';
|
426
|
+
|
427
|
+
/**
|
428
|
+
* @deprecated Use `zoomLevel` instead
|
429
|
+
*/
|
430
|
+
markupEditorZoomLevel?: number | undefined | null;
|
431
|
+
|
432
|
+
/**
|
433
|
+
* @deprecated Use `zoomPresetOptions` instead
|
434
|
+
*/
|
435
|
+
markupEditorZoomLevels?: number[];
|
436
|
+
|
437
|
+
/**
|
438
|
+
* @deprecated Use `zoomAdjustStep` instead
|
439
|
+
*/
|
440
|
+
markupEditorZoomAdjustStep?: number;
|
441
|
+
|
442
|
+
/**
|
443
|
+
* @deprecated Use `zoomAdjustFactor` instead
|
444
|
+
*/
|
445
|
+
markupEditorZoomAdjustFactor?: number;
|
446
|
+
|
447
|
+
/**
|
448
|
+
* @deprecated Use `zoomAdjustWheelFactor` instead
|
449
|
+
*/
|
450
|
+
markupEditorZoomAdjustWheelFactor?: number;
|
451
|
+
|
452
|
+
markupEditorWillStartInteraction?: (point: Vector, image: Rect) => boolean;
|
453
|
+
}
|
454
|
+
|
455
|
+
export interface AnnotatePluginOptions extends PinturaMarkupEditorProperties {
|
456
|
+
annotateActiveTool?: string;
|
457
|
+
annotateEnableButtonFlipVertical?: boolean;
|
458
|
+
annotatePresets?: Sticker[] | StickerGroup[];
|
459
|
+
annotateEnableDropImagePreset?: boolean;
|
460
|
+
annotateEnableSelectImagePreset?: boolean;
|
461
|
+
}
|
462
|
+
|
463
|
+
export interface DecoratePluginOptions extends PinturaMarkupEditorProperties {
|
464
|
+
decorateActiveTool?: string;
|
465
|
+
decorateEnableButtonFlipVertical?: boolean;
|
466
|
+
decoratePresets?: Sticker[] | StickerGroup[];
|
467
|
+
decorateEnableDropImagePreset?: boolean;
|
468
|
+
decorateEnableSelectImagePreset?: boolean;
|
469
|
+
}
|
470
|
+
|
471
|
+
export interface FilterPluginOptions {
|
472
|
+
filterFunctions?: { [key: string]: Filter };
|
473
|
+
filterOptions?: any;
|
474
|
+
}
|
475
|
+
|
476
|
+
export interface FinetunePluginOptions {
|
477
|
+
finetuneControlConfiguration?: { [key: string]: Effect };
|
478
|
+
finetuneOptions?: [string | undefined, LocaleString][];
|
479
|
+
}
|
480
|
+
|
481
|
+
export interface ResizePluginOptions {
|
482
|
+
resizeMaxSize?: Size;
|
483
|
+
resizeMinSize?: Size;
|
484
|
+
resizeSizePresetOptions?: OptionGroup[] | SizeOption[];
|
485
|
+
resizeWidthPresetOptions?: OptionGroup[] | SizeOption[];
|
486
|
+
resizeHeightPresetOptions?: OptionGroup[] | SizeOption[];
|
487
|
+
resizeWillRenderFooter?: (nodes: PinturaNode[], env: any, redraw: () => void) => PinturaNode[];
|
488
|
+
}
|
489
|
+
|
490
|
+
export interface FramePluginOptions {
|
491
|
+
frameStyles?: {
|
492
|
+
[key: string]: {
|
493
|
+
shape: {
|
494
|
+
frameStyle: string;
|
495
|
+
[key: string]: any;
|
496
|
+
};
|
497
|
+
thumb: string;
|
498
|
+
};
|
499
|
+
};
|
500
|
+
frameOptions?: [string | undefined, LocaleString][];
|
501
|
+
}
|
502
|
+
|
503
|
+
export interface StickerPluginOptions {
|
504
|
+
stickers?: Sticker[] | StickerGroup[];
|
505
|
+
stickerStickToImage?: boolean;
|
506
|
+
stickerEnableDropImagePreset?: boolean;
|
507
|
+
stickerEnableSelectImagePreset?: boolean;
|
508
|
+
stickerEnableButtonFlipVertical?: boolean;
|
509
|
+
stickerWillRenderShapePresetToolbar?: (
|
510
|
+
nodes: PinturaNode[],
|
511
|
+
addPreset: (sticker: Sticker) => void,
|
512
|
+
env: any,
|
513
|
+
redraw: () => void
|
514
|
+
) => PinturaNode[];
|
515
|
+
|
516
|
+
/**
|
517
|
+
* @deprecated Use `stickerEnableSelectImagePreset` instead
|
518
|
+
*/
|
519
|
+
stickerEnableSelectImage?: boolean;
|
520
|
+
|
521
|
+
/**
|
522
|
+
* @deprecated Use `stickerEnableButtonFlipVerticalt instead
|
523
|
+
*/
|
524
|
+
stickersEnableButtonFlipVertical?: boolean;
|
525
|
+
|
526
|
+
/**
|
527
|
+
* @deprecated Use `stickerWillRenderShapePresetToolbar` instead
|
528
|
+
*/
|
529
|
+
stickersWillRenderShapePresetToolbar?: (
|
530
|
+
nodes: PinturaNode[],
|
531
|
+
addPreset: (sticker: Sticker) => void,
|
532
|
+
env: any,
|
533
|
+
redraw: () => void
|
534
|
+
) => PinturaNode[];
|
535
|
+
}
|
536
|
+
|
537
|
+
export interface PinturaImageState {
|
538
|
+
backgroundColor?: Color;
|
539
|
+
colorMatrix?: ColorMatrix;
|
540
|
+
convolutionMatrix?: ConvolutionMatrix;
|
541
|
+
crop?: Rect;
|
542
|
+
cropAspectRatio?: number | undefined;
|
543
|
+
cropLimitToImage?: boolean;
|
544
|
+
cropMaxSize?: Size;
|
545
|
+
cropMinSize?: Size;
|
546
|
+
redaction?: ShapeRectangle[];
|
547
|
+
annotation?: Shape[];
|
548
|
+
decoration?: Shape[];
|
549
|
+
flipX?: boolean;
|
550
|
+
flipY?: boolean;
|
551
|
+
frame?: string;
|
552
|
+
gamma?: number;
|
553
|
+
rotation?: number;
|
554
|
+
vignette?: number;
|
555
|
+
targetSize?: Size;
|
556
|
+
metadata?: PinturaMetadata;
|
557
|
+
duration?: number;
|
558
|
+
trim?: [number, number][];
|
559
|
+
}
|
560
|
+
|
561
|
+
export interface PinturaImageOptions extends PinturaImageState {
|
562
|
+
readonly size: Size;
|
563
|
+
readonly aspectRatio: number;
|
564
|
+
readonly cropSize: Size;
|
565
|
+
readonly cropRectAspectRatio: number;
|
566
|
+
readonly file: File;
|
567
|
+
readonly loadState: any;
|
568
|
+
readonly processState: any;
|
569
|
+
readonly rotationRange: [number, number];
|
570
|
+
state?: any;
|
571
|
+
}
|
572
|
+
|
573
|
+
export interface PinturaEditorImageOptionsReadonly {
|
574
|
+
readonly imageSize: Size;
|
575
|
+
readonly imageAspectRatio: number;
|
576
|
+
readonly imageCropSize: Size;
|
577
|
+
readonly imageCropRectAspectRatio: number;
|
578
|
+
readonly imageFile: File;
|
579
|
+
readonly imageLoadState: any;
|
580
|
+
readonly imageProcessState: any;
|
581
|
+
readonly imageRotationRange: [number, number];
|
582
|
+
}
|
583
|
+
|
584
|
+
export interface PinturaEditorImageOptions {
|
585
|
+
imageBackgroundColor?: Color;
|
586
|
+
imageBackgroundImage?: ImageSource;
|
587
|
+
imageColorMatrix?: ColorMatrix;
|
588
|
+
imageConvolutionMatrix?: ConvolutionMatrix;
|
589
|
+
imageCrop?: Rect;
|
590
|
+
imageCropAspectRatio?: number | undefined;
|
591
|
+
imageCropLimitToImage?: boolean;
|
592
|
+
imageCropMaxSize?: Size;
|
593
|
+
imageCropMinSize?: Size;
|
594
|
+
imageRedaction?: ShapeRectangle[];
|
595
|
+
imageAnnotation?: Shape[];
|
596
|
+
imageDecoration?: Shape[];
|
597
|
+
imageFlipX?: boolean;
|
598
|
+
imageFlipY?: boolean;
|
599
|
+
imageGamma?: number;
|
600
|
+
imageNoise?: number;
|
601
|
+
imageRotation?: number;
|
602
|
+
imageVignette?: number;
|
603
|
+
imageTargetSize?: Size;
|
604
|
+
imageFrame?:
|
605
|
+
| string
|
606
|
+
| {
|
607
|
+
[key: string]: any;
|
608
|
+
frameStyle: string;
|
609
|
+
};
|
610
|
+
imageMetadata?: PinturaMetadata;
|
611
|
+
imageState?: any;
|
612
|
+
}
|
613
|
+
|
614
|
+
export interface PinturaEditorOptionsReadonly {
|
615
|
+
readonly element?: HTMLElement;
|
616
|
+
readonly stores?: any[];
|
617
|
+
readonly images?: any;
|
618
|
+
}
|
619
|
+
|
620
|
+
export interface PinturaNodeOptions {
|
621
|
+
[key: string]: any;
|
622
|
+
}
|
623
|
+
|
624
|
+
export type PinturaComponent = 'Button' | 'Dropdown';
|
625
|
+
|
626
|
+
export type PinturaNodeType = string | SvelteComponent | PinturaComponent;
|
627
|
+
|
628
|
+
// ignore for TypeScript 3.x
|
629
|
+
export type PinturaNode =
|
630
|
+
| [PinturaNodeType, string]
|
631
|
+
| [PinturaNodeType, string, PinturaNodeOptions]
|
632
|
+
| [PinturaNodeType, string, PinturaNode[]]
|
633
|
+
| [PinturaNodeType, string, PinturaNodeOptions, PinturaNode[]];
|
634
|
+
|
635
|
+
export type PinturaEditorStatus =
|
636
|
+
| string
|
637
|
+
| [string]
|
638
|
+
| [string, number]
|
639
|
+
| [string, false]
|
640
|
+
| undefined;
|
641
|
+
|
642
|
+
export interface PinturaEditorBaseOptions {
|
643
|
+
id?: string;
|
644
|
+
class?: string;
|
645
|
+
animations?: boolean;
|
646
|
+
src?: ImageSource;
|
647
|
+
util?: string;
|
648
|
+
utils?: string[];
|
649
|
+
disabled?: boolean;
|
650
|
+
status?: PinturaEditorStatus;
|
651
|
+
elasticityMultiplier?: number;
|
652
|
+
layoutDirectionPreference?: 'auto' | 'horizontal' | 'vertical';
|
653
|
+
layoutVerticalUtilsPreference?: 'left' | 'right';
|
654
|
+
layoutHorizontalUtilsPreference?: 'bottom' | 'top';
|
655
|
+
layoutVerticalControlGroupsPreference?: 'bottom' | 'top';
|
656
|
+
layoutVerticalControlTabsPreference?: 'bottom' | 'top';
|
657
|
+
layoutVerticalToolbarPreference?: 'bottom' | 'top';
|
658
|
+
imageSourceToImageData?: (src: any) => Promise<ImageData>;
|
659
|
+
previewImageData?: ImageBitmap | ImageData | HTMLCanvasElement;
|
660
|
+
previewImageDataMaxSize?: Size;
|
661
|
+
previewUpscale?: boolean;
|
662
|
+
previewPad?: boolean;
|
663
|
+
previewMaskOpacity?: number;
|
664
|
+
shapePreprocessor?: any;
|
665
|
+
enableButtonClose?: boolean;
|
666
|
+
enableButtonExport?: boolean;
|
667
|
+
enableButtonResetHistory?: boolean;
|
668
|
+
enableButtonRevert?: boolean;
|
669
|
+
enableNavigateHistory?: boolean;
|
670
|
+
enableToolbar?: boolean;
|
671
|
+
enableUtils?: boolean;
|
672
|
+
enableDropImage?: boolean;
|
673
|
+
enablePasteImage?: boolean;
|
674
|
+
|
675
|
+
/**
|
676
|
+
* Enable to toggle zooming the canvas with multi-touch input and mouse wheel
|
677
|
+
*/
|
678
|
+
enableZoom?: boolean;
|
679
|
+
|
680
|
+
/**
|
681
|
+
* Enable to show zoom controls
|
682
|
+
*/
|
683
|
+
enableZoomControls?: boolean;
|
684
|
+
|
685
|
+
/**
|
686
|
+
* Enable to toggle panning the canvas, pan with two fingers or by holding spacebar
|
687
|
+
*/
|
688
|
+
enablePan?: boolean;
|
689
|
+
|
690
|
+
/**
|
691
|
+
* Set to false to disable limiting pan input to the centered image bounds
|
692
|
+
*/
|
693
|
+
enablePanLimit?: boolean;
|
694
|
+
|
695
|
+
/**
|
696
|
+
* Gutter scalar to add around the pan limit bounds, value between 0 and 1, 0 no gutter, 1 gutter size of centered image
|
697
|
+
*/
|
698
|
+
panLimitGutterScalar?: number;
|
699
|
+
|
700
|
+
/**
|
701
|
+
* Set current zoom level or set undefined to fit to view, set null to let editor handle zoom level
|
702
|
+
*/
|
703
|
+
zoomLevel?: number | undefined | null;
|
704
|
+
zoomPresetOptions?: number[];
|
705
|
+
zoomAdjustStep?: number;
|
706
|
+
zoomAdjustFactor?: number;
|
707
|
+
zoomAdjustWheelFactor?: number;
|
708
|
+
|
709
|
+
/**
|
710
|
+
* Set to `true` to enable pan mode programatically
|
711
|
+
*/
|
712
|
+
enablePanInput?: boolean;
|
713
|
+
|
714
|
+
/**
|
715
|
+
* Enable zoom input mode
|
716
|
+
*/
|
717
|
+
enableZoomInput?: boolean;
|
718
|
+
|
719
|
+
handleEvent?: (type: string, detail: any) => void;
|
720
|
+
|
721
|
+
willRequest?: (
|
722
|
+
url: string,
|
723
|
+
requestInfo: { resourceType: string }
|
724
|
+
) => void | false | RequestInit;
|
725
|
+
willClose?: () => Promise<boolean>;
|
726
|
+
willRevert?: () => Promise<boolean>;
|
727
|
+
willProcessImage?: () => Promise<boolean>;
|
728
|
+
willRenderCanvas?: (
|
729
|
+
shapes: {
|
730
|
+
decorationShapes: Shape[];
|
731
|
+
annotationShapes: Shape[];
|
732
|
+
interfaceShapes: Shape[];
|
733
|
+
frameShapes: Shape;
|
734
|
+
},
|
735
|
+
state: {
|
736
|
+
annotationShapesDirty: boolean;
|
737
|
+
backgroundColor: number[];
|
738
|
+
blendShapesDirty: boolean;
|
739
|
+
decorationShapesDirty: boolean;
|
740
|
+
foregroundColor: number[];
|
741
|
+
frameShapesDirty: boolean;
|
742
|
+
images: {
|
743
|
+
backgroundColor: number[];
|
744
|
+
colorMatrix: number[];
|
745
|
+
convolutionMatrix: number[];
|
746
|
+
data: ImageBitmap | ImageData;
|
747
|
+
gamma: number;
|
748
|
+
opacity: number;
|
749
|
+
origin: Vector;
|
750
|
+
resize: number;
|
751
|
+
rotation: { x: number; y: number; z: number };
|
752
|
+
scale: number;
|
753
|
+
size: Size;
|
754
|
+
translation: Vector;
|
755
|
+
vignette: number;
|
756
|
+
};
|
757
|
+
isInteracting: boolean;
|
758
|
+
isInteractingFraction: number;
|
759
|
+
lineColor: number[];
|
760
|
+
opacity: number;
|
761
|
+
rootRect: Rect;
|
762
|
+
rotation: { x: number; y: number; z: number };
|
763
|
+
scale: number;
|
764
|
+
selectionRect: Rect;
|
765
|
+
size: Size;
|
766
|
+
stageRect: Rect;
|
767
|
+
utilVisibility: {
|
768
|
+
annotate: number;
|
769
|
+
crop: number;
|
770
|
+
decorate: number;
|
771
|
+
filter: number;
|
772
|
+
finetune: number;
|
773
|
+
frame: number;
|
774
|
+
redact: number;
|
775
|
+
resize: number;
|
776
|
+
};
|
777
|
+
}
|
778
|
+
) => {
|
779
|
+
decorationShapes: Shape[];
|
780
|
+
annotationShapes: Shape[];
|
781
|
+
interfaceShapes: Shape[];
|
782
|
+
};
|
783
|
+
willSetHistoryInitialState?: (initialState: any) => any;
|
784
|
+
willRenderToolbar?: (nodes: PinturaNode[], env: any, redraw: () => void) => PinturaNode[];
|
785
|
+
beforeSelectShape?: (current: Shape | undefined, target: Shape) => boolean;
|
786
|
+
beforeDeselectShape?: (current: Shape, target: Shape | undefined) => boolean;
|
787
|
+
beforeAddShape?: (shape: Shape) => boolean;
|
788
|
+
beforeRemoveShape?: (shape: Shape) => boolean;
|
789
|
+
beforeUpdateShape?: (shape: Shape, props: any, context: Rect) => Shape;
|
790
|
+
willRenderShapeControls?: (nodes: PinturaNode[], shapeId: string) => PinturaNode[];
|
791
|
+
willRenderShapePresetToolbar?: (
|
792
|
+
nodes: PinturaNode[],
|
793
|
+
addPreset: (sticker: Sticker) => void,
|
794
|
+
env: any,
|
795
|
+
redraw: () => void
|
796
|
+
) => PinturaNode[];
|
797
|
+
|
798
|
+
/**
|
799
|
+
* @deprecated Use `willRequest` instead
|
800
|
+
*/
|
801
|
+
willRequestResource?: (url: string) => boolean;
|
802
|
+
}
|
803
|
+
|
804
|
+
export interface PinturaEditorOptions
|
805
|
+
extends PinturaEditorBaseOptions,
|
806
|
+
PinturaEditorImageOptions,
|
807
|
+
AnnotatePluginOptions,
|
808
|
+
CropPluginOptions,
|
809
|
+
DecoratePluginOptions,
|
810
|
+
FilterPluginOptions,
|
811
|
+
FinetunePluginOptions,
|
812
|
+
StickerPluginOptions {
|
813
|
+
locale: any;
|
814
|
+
imageReader: any;
|
815
|
+
imageWriter?: any;
|
816
|
+
imageOrienter?: any;
|
817
|
+
imageScrambler?: any;
|
818
|
+
}
|
819
|
+
|
820
|
+
export interface PinturaEditorDefaultOptions
|
821
|
+
extends PinturaEditorBaseOptions,
|
822
|
+
PinturaEditorImageOptions,
|
823
|
+
AnnotatePluginOptions,
|
824
|
+
CropPluginOptions,
|
825
|
+
DecoratePluginOptions,
|
826
|
+
FilterPluginOptions,
|
827
|
+
FinetunePluginOptions,
|
828
|
+
StickerPluginOptions {
|
829
|
+
locale?: any;
|
830
|
+
imageReader?: any;
|
831
|
+
imageWriter?: any;
|
832
|
+
imageOrienter?: any;
|
833
|
+
}
|
834
|
+
|
835
|
+
export interface PinturaEditorHeadlessOptions extends PinturaEditorImageOptions {
|
836
|
+
imageReader?: any;
|
837
|
+
imageWriter?: any;
|
838
|
+
imageScrambler?: any;
|
839
|
+
shapePreprocessor?: any;
|
840
|
+
}
|
841
|
+
|
842
|
+
export interface PinturaEditor
|
843
|
+
extends PinturaEditorMethods,
|
844
|
+
PinturaEditorOptions,
|
845
|
+
PinturaEditorOptionsReadonly,
|
846
|
+
PinturaEditorImageOptionsReadonly {}
|
847
|
+
|
848
|
+
export interface PinturaEditorModalOptions {
|
849
|
+
preventZoomViewport?: boolean;
|
850
|
+
preventScrollBodyIfNeeded?: boolean;
|
851
|
+
preventFooterOverlapIfNeeded?: boolean;
|
852
|
+
enableAutoHide?: boolean;
|
853
|
+
enableAutoDestroy?: boolean;
|
854
|
+
readonly modal?: HTMLElement;
|
855
|
+
}
|
856
|
+
|
857
|
+
export interface PinturaEditorModal extends PinturaEditor, PinturaEditorModalOptions {
|
858
|
+
show: () => void;
|
859
|
+
hide: () => void;
|
860
|
+
}
|
861
|
+
|
862
|
+
export interface PinturaReadState {
|
863
|
+
index: number;
|
864
|
+
task: string;
|
865
|
+
taskLengthComputable: boolean;
|
866
|
+
taskProgress: number;
|
867
|
+
timeStamp: number;
|
868
|
+
error?: unknown;
|
869
|
+
}
|
870
|
+
|
871
|
+
export interface PinturaWriteState {
|
872
|
+
index: number;
|
873
|
+
task: string;
|
874
|
+
taskLengthComputable: boolean;
|
875
|
+
taskProgress: number;
|
876
|
+
timeStamp: number;
|
877
|
+
error?: unknown;
|
878
|
+
}
|
879
|
+
|
880
|
+
// Default image reader and writer
|
881
|
+
export interface PinturaDefaultImageReaderResult {
|
882
|
+
readonly src: ImageSource;
|
883
|
+
readonly dest: File;
|
884
|
+
readonly size: Size;
|
885
|
+
}
|
886
|
+
|
887
|
+
export interface PinturaDefaultImageWriterResult {
|
888
|
+
readonly src: ImageSource;
|
889
|
+
readonly dest: File;
|
890
|
+
readonly imageState: any;
|
891
|
+
readonly store: any;
|
892
|
+
}
|
893
|
+
|
894
|
+
export interface PinturaTargetSize {
|
895
|
+
width?: number;
|
896
|
+
height?: number;
|
897
|
+
fit?: 'contain' | 'cover' | 'force';
|
898
|
+
upscale?: boolean;
|
899
|
+
}
|
900
|
+
|
901
|
+
export interface PinturaDefaultImageReaderOptions {
|
902
|
+
orientImage?: boolean;
|
903
|
+
outputProps?: string[];
|
904
|
+
request?: {
|
905
|
+
headers?: { [key: string]: string };
|
906
|
+
credentials?: string;
|
907
|
+
};
|
908
|
+
preprocessImageFile?: (file: File, options: any, onprogress: ProgressCallback) => Promise<File>;
|
909
|
+
}
|
910
|
+
|
911
|
+
export type PinturaStoreField = [string, string] | [string, Blob | File, string];
|
912
|
+
|
913
|
+
export interface PinturaDefaultImageWriterOptions {
|
914
|
+
canvasMemoryLimit?: number;
|
915
|
+
orientImage?: boolean;
|
916
|
+
copyImageHead?: boolean;
|
917
|
+
mimeType?: string;
|
918
|
+
quality?: number;
|
919
|
+
format?: 'file' | 'imageData' | 'canvas';
|
920
|
+
renameFile?: (file: File) => string;
|
921
|
+
targetSize?: PinturaTargetSize;
|
922
|
+
imageDataResizer?: (imageData: ImageData, width: number, height: number) => Promise<ImageData>;
|
923
|
+
store?:
|
924
|
+
| string
|
925
|
+
| {
|
926
|
+
url: string;
|
927
|
+
dataset?: (imageState: any) => PinturaStoreField[];
|
928
|
+
credentials?: string;
|
929
|
+
headers?: { [key: string]: string };
|
930
|
+
}
|
931
|
+
| ((imageState: any, options: any, onprogress: ProgressCallback) => Promise<any>);
|
932
|
+
outputProps?: string[];
|
933
|
+
preprocessImageSource?: (
|
934
|
+
imageSource: Blob | File,
|
935
|
+
options: any,
|
936
|
+
onprogress: ProgressCallback
|
937
|
+
) => Promise<Blob | File>;
|
938
|
+
preprocessImageState?: (
|
939
|
+
imageState: any,
|
940
|
+
options: any,
|
941
|
+
onprogress: ProgressCallback
|
942
|
+
) => Promise<any>;
|
943
|
+
postprocessImageData?: (
|
944
|
+
imageData: any,
|
945
|
+
options: any,
|
946
|
+
onprogress: ProgressCallback
|
947
|
+
) => Promise<ImageData>;
|
948
|
+
|
949
|
+
postprocessImageBlob?: (
|
950
|
+
output: {
|
951
|
+
blob: Blob;
|
952
|
+
imageData: ImageData;
|
953
|
+
src: File;
|
954
|
+
},
|
955
|
+
options: any,
|
956
|
+
onprogress: ProgressCallback
|
957
|
+
) => Promise<ImageData>;
|
958
|
+
}
|
959
|
+
|
960
|
+
export interface PinturaDefaultImageScramblerOptions {
|
961
|
+
dataSizeScalar?: number;
|
962
|
+
blurAmount?: number;
|
963
|
+
scrambleAmount?: number;
|
964
|
+
backgroundColor?: number[];
|
965
|
+
}
|
966
|
+
|
967
|
+
export interface PinturaImageOrienter {
|
968
|
+
read: (file: Blob | File, onprogress?: ProgressCallback) => Promise<number>;
|
969
|
+
apply: (imageData: ImageData, orientation: number) => ImageData;
|
970
|
+
}
|
971
|
+
|
972
|
+
// exports
|
973
|
+
export const setPlugins: (...plugins: any[]) => void;
|
974
|
+
|
975
|
+
export const getEditorDefaults: (
|
976
|
+
options?: PinturaEditorDefaultOptions
|
977
|
+
) => PinturaEditorDefaultOptions;
|
978
|
+
|
979
|
+
export const appendEditor: (
|
980
|
+
target: HTMLElement | string,
|
981
|
+
options?: PinturaEditorOptions
|
982
|
+
) => PinturaEditor;
|
983
|
+
|
984
|
+
export const appendDefaultEditor: (
|
985
|
+
target: HTMLElement | string,
|
986
|
+
options?: PinturaEditorDefaultOptions
|
987
|
+
) => PinturaEditor;
|
988
|
+
|
989
|
+
export const appendEditors: (
|
990
|
+
target: HTMLElement | string,
|
991
|
+
options?: PinturaEditorOptions
|
992
|
+
) => PinturaEditor[];
|
993
|
+
|
994
|
+
export const appendDefaultEditors: (
|
995
|
+
target: HTMLElement | string,
|
996
|
+
options?: PinturaEditorDefaultOptions
|
997
|
+
) => PinturaEditor[];
|
998
|
+
|
999
|
+
export const overlayEditor: (
|
1000
|
+
target: HTMLElement | string,
|
1001
|
+
options?: PinturaEditorOptions
|
1002
|
+
) => PinturaEditor;
|
1003
|
+
|
1004
|
+
export const overlayDefaultEditor: (
|
1005
|
+
target: HTMLElement | string,
|
1006
|
+
options?: PinturaEditorDefaultOptions
|
1007
|
+
) => PinturaEditor;
|
1008
|
+
|
1009
|
+
export const openEditor: (options: PinturaEditorOptions) => PinturaEditorModal;
|
1010
|
+
|
1011
|
+
export const openDefaultEditor: (options: PinturaEditorDefaultOptions) => PinturaEditorModal;
|
1012
|
+
|
1013
|
+
export const defineCustomElements: (options?: PinturaEditorOptions) => Promise<PinturaEditor>;
|
1014
|
+
|
1015
|
+
export const defineDefaultCustomElements: (
|
1016
|
+
options?: PinturaEditorDefaultOptions
|
1017
|
+
) => Promise<PinturaEditor>;
|
1018
|
+
|
1019
|
+
export const processImage: (
|
1020
|
+
src: ImageSource,
|
1021
|
+
options: PinturaEditorHeadlessOptions
|
1022
|
+
) => Promise<PinturaDefaultImageWriterResult>;
|
1023
|
+
|
1024
|
+
export const processDefaultImage: (
|
1025
|
+
src: ImageSource,
|
1026
|
+
options: PinturaEditorHeadlessOptions
|
1027
|
+
) => Promise<PinturaDefaultImageWriterResult>;
|
1028
|
+
|
1029
|
+
export const createDefaultImageReader: (options?: PinturaDefaultImageReaderOptions) => any[];
|
1030
|
+
|
1031
|
+
export const createDefaultImageWriter: (options?: PinturaDefaultImageWriterOptions) => any[];
|
1032
|
+
|
1033
|
+
export const createDefaultImageOrienter: () => PinturaImageOrienter;
|
1034
|
+
|
1035
|
+
export const createDefaultImageScrambler: (
|
1036
|
+
options?: PinturaDefaultImageScramblerOptions
|
1037
|
+
) => (imageData: ImageData | ImageBitmap) => HTMLCanvasElement;
|
1038
|
+
|
1039
|
+
export const createDefaultShapePreprocessor: () => any;
|
1040
|
+
|
1041
|
+
export const createDefaultFrameStyles: () => {
|
1042
|
+
[key: string]: (shape: Shape, options?: { isPreview: boolean }) => Shape[];
|
1043
|
+
};
|
1044
|
+
|
1045
|
+
export const createDefaultLineEndStyles: () => {
|
1046
|
+
[key: string]: (shape: Shape, options?: { isPreview: boolean }) => Shape[];
|
1047
|
+
};
|
1048
|
+
|
1049
|
+
export const createFrameStyleProcessor: (styles: any) => any;
|
1050
|
+
|
1051
|
+
export const createLineEndProcessor: (styles: any) => any;
|
1052
|
+
|
1053
|
+
// node tree helpers
|
1054
|
+
export function createNode(
|
1055
|
+
name: PinturaNodeType,
|
1056
|
+
id: string,
|
1057
|
+
props: PinturaNodeOptions | undefined,
|
1058
|
+
children: PinturaNode[]
|
1059
|
+
): PinturaNode;
|
1060
|
+
|
1061
|
+
export function createNode(name: PinturaNodeType, id: string): PinturaNode;
|
1062
|
+
|
1063
|
+
export function createNode(name: PinturaNodeType, id: string, children: PinturaNode[]): PinturaNode;
|
1064
|
+
|
1065
|
+
export function createNode(
|
1066
|
+
name: PinturaNodeType,
|
1067
|
+
id: string,
|
1068
|
+
props: PinturaNodeOptions
|
1069
|
+
): PinturaNode;
|
1070
|
+
|
1071
|
+
export function findNode(id: string, haystack: PinturaNode | PinturaNode[]): void;
|
1072
|
+
export function appendNode(node: PinturaNode, haystack: PinturaNode | PinturaNode[]): void;
|
1073
|
+
export function removeNode(id: string): void;
|
1074
|
+
export function insertNodeBefore(
|
1075
|
+
node: PinturaNode,
|
1076
|
+
targetId: string,
|
1077
|
+
haystack: PinturaNode | PinturaNode[]
|
1078
|
+
): void;
|
1079
|
+
export function insertNodeAfter(
|
1080
|
+
node: PinturaNode,
|
1081
|
+
targetId: string,
|
1082
|
+
haystack: PinturaNode | PinturaNode[]
|
1083
|
+
): void;
|
1084
|
+
|
1085
|
+
// utils
|
1086
|
+
export const supportsWebGL: () => boolean;
|
1087
|
+
export const degToRad: (deg: number) => number;
|
1088
|
+
export const naturalAspectRatioToNumber: (
|
1089
|
+
aspectRatio: string | number | undefined
|
1090
|
+
) => number | false | undefined;
|
1091
|
+
export const colorStringToColorArray: (Color: string) => Color;
|
1092
|
+
export const legacyDataToImageState: (data: any) => PinturaImageOptions;
|
1093
|
+
export const dispatchEditorEvents: (
|
1094
|
+
editor: PinturaEditor,
|
1095
|
+
element: HTMLElement,
|
1096
|
+
options?: { prefix?: string }
|
1097
|
+
) => any[];
|
1098
|
+
export const blobToFile: (blob: Blob | File, filename: string, mimetype?: string) => File;
|
1099
|
+
export const isSupported: () => boolean;
|
1100
|
+
|
1101
|
+
// shape helpers
|
1102
|
+
export const shapeGetLevel: (
|
1103
|
+
shapeState: { flipX: undefined | boolean; flipY: undefined | boolean; rotation: number },
|
1104
|
+
imageState: { flipX: boolean; flipY: boolean; rotation: number }
|
1105
|
+
) => { flipX: boolean; flipY: boolean; rotation: number };
|
1106
|
+
export const shapeGetLength: (shape: Shape) => undefined | number;
|
1107
|
+
export const shapeGetCenter: (shape: Shape) => Vector;
|
1108
|
+
|
1109
|
+
// locale
|
1110
|
+
export const locale_en_gb: LocaleCollection;
|
1111
|
+
|
1112
|
+
//
|
1113
|
+
// markup editor
|
1114
|
+
//
|
1115
|
+
export interface MarkupEditorToolStyleDefaults {
|
1116
|
+
sharpie: [Shape, ShapeToolOptions];
|
1117
|
+
line: [Shape, ShapeToolOptions];
|
1118
|
+
arrow: [Shape, ShapeToolOptions];
|
1119
|
+
rectangle: [Shape, ShapeToolOptions];
|
1120
|
+
ellipse: [Shape, ShapeToolOptions];
|
1121
|
+
text: [Shape, ShapeToolOptions];
|
1122
|
+
[custom: string]: [Shape, ShapeToolOptions];
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
export interface MarkupEditorShapeStyleControlDefaults {
|
1126
|
+
backgroundColor: undefined | ShapeControl;
|
1127
|
+
strokeColor: undefined | ShapeControl;
|
1128
|
+
strokeWidth: undefined | ShapeControl;
|
1129
|
+
lineStart: undefined | ShapeControl;
|
1130
|
+
lineEnd: undefined | ShapeControl;
|
1131
|
+
color: undefined | ShapeControl;
|
1132
|
+
fontFamily: undefined | ShapeControl;
|
1133
|
+
fontStyleFontWeight: undefined | ShapeControl;
|
1134
|
+
fontSize: undefined | ShapeControl;
|
1135
|
+
textAlign: undefined | ShapeControl;
|
1136
|
+
lineHeight: undefined | ShapeControl;
|
1137
|
+
}
|
1138
|
+
|
1139
|
+
export type ToolbarItem =
|
1140
|
+
| string
|
1141
|
+
| [string, { disabled?: boolean; icon: string }]
|
1142
|
+
| [string, LocaleString, { disabled?: boolean; icon: string }];
|
1143
|
+
|
1144
|
+
/**
|
1145
|
+
* Create tools available in the markup editor
|
1146
|
+
*/
|
1147
|
+
export const createMarkupEditorToolbar: (tools?: ToolbarItem[]) => [string, LocaleString, any][];
|
1148
|
+
|
1149
|
+
/**
|
1150
|
+
* Create default shape styles for each tool, optionally add custom shape styles
|
1151
|
+
*/
|
1152
|
+
export const createMarkupEditorToolStyles: (toolStyles?: {
|
1153
|
+
[key: string]: [Shape, ShapeToolOptions];
|
1154
|
+
}) => MarkupEditorToolStyleDefaults;
|
1155
|
+
|
1156
|
+
/**
|
1157
|
+
* Create a custom tool style based on one of the existing types
|
1158
|
+
*/
|
1159
|
+
export const createMarkupEditorToolStyle: (
|
1160
|
+
type: 'path' | 'rectangle' | 'ellipse' | 'line' | 'text',
|
1161
|
+
shape?: Shape,
|
1162
|
+
options?: ShapeToolOptions
|
1163
|
+
) => [Shape, ShapeToolOptions];
|
1164
|
+
|
1165
|
+
/**
|
1166
|
+
* Create default shape style controls
|
1167
|
+
*/
|
1168
|
+
export const createMarkupEditorShapeStyleControls: (
|
1169
|
+
shapeControlOptions?: ShapeControlOptions
|
1170
|
+
) => MarkupEditorShapeStyleControlDefaults;
|
1171
|
+
|
1172
|
+
export const createDefaultColorOptions: () => ColorPalette;
|
1173
|
+
export const createDefaultFontSizeOptions: () => number[];
|
1174
|
+
export const createDefaultFontScaleOptions: () => SizeCategories;
|
1175
|
+
export const createDefaultLineHeightOptions: () => number[];
|
1176
|
+
export const createDefaultLineHeightScaleOptions: () => SizeCategories;
|
1177
|
+
export const createDefaultStrokeWidthOptions: () => number[];
|
1178
|
+
export const createDefaultStrokeScaleOptions: () => SizeCategories;
|
1179
|
+
export const createDefaultLineEndStyleOptions: () => LineEndStyle[];
|
1180
|
+
export const createDefaultFontFamilyOptions: () => [string, string][];
|
1181
|
+
export const createDefaultFontStyleOptions: () => [string, string][];
|
1182
|
+
export const createDefaultTextAlignOptions: () => TextAlign[];
|
1183
|
+
|
1184
|
+
export const createMarkupEditorColorOptions: (colors: ColorPalette) => ShapeColorOption[];
|
1185
|
+
export const createMarkupEditorFontSizeOptions: (sizes: number[]) => ShapeSizeOption[];
|
1186
|
+
export const createMarkupEditorFontScaleOptions: (sizes: SizeCategories) => ShapeSizeOption[];
|
1187
|
+
export const createMarkupEditorLineHeightOptions: (sizes: number[]) => ShapeSizeOption[];
|
1188
|
+
export const createMarkupEditorLineHeightScaleOptions: (sizes: SizeCategories) => ShapeSizeOption[];
|
1189
|
+
export const createMarkupEditorStrokeWidthOptions: (widths: number[]) => ShapeSizeOption[];
|
1190
|
+
export const createMarkupEditorStrokeScaleOptions: (sizes: SizeCategories) => ShapeSizeOption[];
|
1191
|
+
export const createMarkupEditorFontFamilyOptions: (
|
1192
|
+
families: [string, string][]
|
1193
|
+
) => ShapeFontFamilyOption[];
|
1194
|
+
export const createMarkupEditorFontStyleOptions: (
|
1195
|
+
styles: [string, string][]
|
1196
|
+
) => ShapeFontStyleOption[];
|
1197
|
+
export const createMarkupEditorLineEndStyleOptions: (
|
1198
|
+
styles: LineEndStyle[]
|
1199
|
+
) => [LineEndStyle, string][];
|
1200
|
+
|
1201
|
+
export const createMarkupEditorBackgroundColorControl: (colors: ShapeColorOption[]) => ShapeControl;
|
1202
|
+
export const createMarkupEditorStrokeColorControl: (
|
1203
|
+
colors: ShapeColorOption[],
|
1204
|
+
options?: { defaultStrokeWidth: number | string }
|
1205
|
+
) => ShapeControl;
|
1206
|
+
export const createMarkupEditorStrokeWidthControl: (widths: ShapeSizeOption[]) => ShapeControl;
|
1207
|
+
export const createMarkupEditorLineStartStyleControl: (
|
1208
|
+
styles: [LineEndStyle, string][]
|
1209
|
+
) => ShapeControl;
|
1210
|
+
export const createMarkupEditorLineEndStyleControl: (
|
1211
|
+
styles: [LineEndStyle, string][]
|
1212
|
+
) => ShapeControl;
|
1213
|
+
export const createMarkupEditorFontColorControl: (colors: ShapeColorOption[]) => ShapeControl;
|
1214
|
+
export const createMarkupEditorFontFamilyControl: (
|
1215
|
+
fontFamilies: [string, string][],
|
1216
|
+
options?: { defaultKey: string | undefined }
|
1217
|
+
) => ShapeControl;
|
1218
|
+
export const createMarkupEditorFontStyleControl: (fontStyles: [string, string][]) => ShapeControl;
|
1219
|
+
export const createMarkupEditorFontSizeControl: (sizes: ShapeSizeOption[]) => ShapeControl;
|
1220
|
+
export const createMarkupEditorTextAlignControl: (textAlignments: TextAlign[]) => ShapeControl;
|
1221
|
+
export const createMarkupEditorLineHeightControl: (lineHeights: [number, string][]) => ShapeControl;
|
1222
|
+
|
1223
|
+
export const markup_editor_defaults: {
|
1224
|
+
markupEditorToolbar: [string, LocaleString, any][];
|
1225
|
+
markupEditorToolStyles: MarkupEditorToolStyleDefaults;
|
1226
|
+
markupEditorShapeStyleControls: MarkupEditorShapeStyleControlDefaults;
|
1227
|
+
};
|
1228
|
+
|
1229
|
+
export const markup_editor_locale_en_gb: LocaleCollection;
|
1230
|
+
|
1231
|
+
//
|
1232
|
+
// plugins
|
1233
|
+
//
|
1234
|
+
export interface PinturaUtilPlugin {
|
1235
|
+
util: [string, any];
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
export const plugin_annotate: PinturaUtilPlugin;
|
1239
|
+
export const plugin_crop: PinturaUtilPlugin;
|
1240
|
+
export const plugin_decorate: PinturaUtilPlugin;
|
1241
|
+
export const plugin_filter: PinturaUtilPlugin;
|
1242
|
+
export const plugin_finetune: PinturaUtilPlugin;
|
1243
|
+
export const plugin_resize: PinturaUtilPlugin;
|
1244
|
+
export const plugin_sticker: PinturaUtilPlugin;
|
1245
|
+
export const plugin_redact: PinturaUtilPlugin;
|
1246
|
+
export const plugin_frame: PinturaUtilPlugin;
|
1247
|
+
|
1248
|
+
export const plugin_annotate_locale_en_gb: LocaleCollection;
|
1249
|
+
export const plugin_crop_locale_en_gb: LocaleCollection;
|
1250
|
+
export const plugin_decorate_locale_en_gb: LocaleCollection;
|
1251
|
+
export const plugin_filter_locale_en_gb: LocaleCollection;
|
1252
|
+
export const plugin_finetune_locale_en_gb: LocaleCollection;
|
1253
|
+
export const plugin_resize_locale_en_gb: LocaleCollection;
|
1254
|
+
export const plugin_sticker_locale_en_gb: LocaleCollection;
|
1255
|
+
export const plugin_redact_locale_en_gb: LocaleCollection;
|
1256
|
+
export const plugin_frame_locale_en_gb: LocaleCollection;
|
1257
|
+
|
1258
|
+
export const plugin_frame_defaults: FramePluginOptions;
|
1259
|
+
export const plugin_filter_defaults: FilterPluginOptions;
|
1260
|
+
export const plugin_finetune_defaults: FinetunePluginOptions;
|
1261
|
+
|
1262
|
+
export const effectBrightness: Effect;
|
1263
|
+
export const effectContrast: Effect;
|
1264
|
+
export const effectSaturation: Effect;
|
1265
|
+
export const effectExposure: Effect;
|
1266
|
+
export const effectGamma: Effect;
|
1267
|
+
export const effectVignette: Effect;
|
1268
|
+
export const effectClarity: Effect;
|
1269
|
+
export const effectTemperature: Effect;
|
1270
|
+
|
1271
|
+
export const filterPastel: Filter;
|
1272
|
+
export const filterChrome: Filter;
|
1273
|
+
export const filterFade: Filter;
|
1274
|
+
export const filterWarm: Filter;
|
1275
|
+
export const filterCold: Filter;
|
1276
|
+
export const filterInvert: Filter;
|
1277
|
+
export const filterMonoDefault: Filter;
|
1278
|
+
export const filterMonoNoir: Filter;
|
1279
|
+
export const filterMonoWash: Filter;
|
1280
|
+
export const filterMonoStark: Filter;
|
1281
|
+
export const filterSepiaDefault: Filter;
|
1282
|
+
export const filterSepiaBlues: Filter;
|
1283
|
+
export const filterSepiaRust: Filter;
|
1284
|
+
export const filterSepiaColor: Filter;
|
1285
|
+
|
1286
|
+
export const frameSolidSharp: Frame;
|
1287
|
+
export const frameSolidRound: Frame;
|
1288
|
+
export const frameLineSingle: Frame;
|
1289
|
+
export const frameLineMultiple: Frame;
|
1290
|
+
export const frameEdgeSeparate: Frame;
|
1291
|
+
export const frameEdgeCross: Frame;
|
1292
|
+
export const frameEdgeOverlap: Frame;
|
1293
|
+
export const frameHook: Frame;
|
1294
|
+
export const framePolaroid: Frame;
|