@codingfactory/mediables-vue 2.19.0 → 2.19.2
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/{PixiFrameExporter-CL1sPbnw.js → PixiFrameExporter-CRe8z6ua.js} +2 -2
- package/dist/{PixiFrameExporter-CL1sPbnw.js.map → PixiFrameExporter-CRe8z6ua.js.map} +1 -1
- package/dist/{PixiFrameExporter-nFehBjPQ.cjs → PixiFrameExporter-R6iQjzVw.cjs} +2 -2
- package/dist/{PixiFrameExporter-nFehBjPQ.cjs.map → PixiFrameExporter-R6iQjzVw.cjs.map} +1 -1
- package/dist/components/MediaFilterChips.vue.d.ts +10 -0
- package/dist/components/MediaInspectorPanel.vue.d.ts +13 -0
- package/dist/components/MediaLibraryShell.vue.d.ts +21 -0
- package/dist/components/MediaManagementView.vue.d.ts +1 -0
- package/dist/components/MediaTrashWorkspace.vue.d.ts +5 -0
- package/dist/composables/useMediaDeletion.d.ts +20 -0
- package/dist/composables/useMediaLibraryVisibility.d.ts +37 -0
- package/dist/composables/useMediaMetadata.d.ts +24 -0
- package/dist/editor-BQ_nY4P6.js +4302 -0
- package/dist/editor-BQ_nY4P6.js.map +1 -0
- package/dist/editor-CUV1pIsV.cjs +2 -0
- package/dist/editor-CUV1pIsV.cjs.map +1 -0
- package/dist/imageEditorState-BNQEZoCF.js +81 -0
- package/dist/imageEditorState-BNQEZoCF.js.map +1 -0
- package/dist/imageEditorState-PrcqbsfM.cjs +2 -0
- package/dist/imageEditorState-PrcqbsfM.cjs.map +1 -0
- package/dist/{index-BR0szJau.js → index-B8LxZ37n.js} +16860 -15559
- package/dist/index-B8LxZ37n.js.map +1 -0
- package/dist/index-Dae8SHT7.js +6557 -0
- package/dist/index-Dae8SHT7.js.map +1 -0
- package/dist/index-DutUeSES.cjs +357 -0
- package/dist/index-DutUeSES.cjs.map +1 -0
- package/dist/index-QOKC8XA_.cjs +2 -0
- package/dist/index-QOKC8XA_.cjs.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/mediables-primitives.cjs +2 -0
- package/dist/mediables-primitives.cjs.map +1 -0
- package/dist/mediables-primitives.mjs +21 -0
- package/dist/mediables-primitives.mjs.map +1 -0
- package/dist/mediables-vanilla.cjs +1 -1
- package/dist/mediables-vanilla.mjs +8 -7
- package/dist/mediables-vanilla.mjs.map +1 -1
- package/dist/mediables-vue.cjs +1 -1
- package/dist/mediables-vue.mjs +74 -70
- package/dist/mediables-vue.mjs.map +1 -1
- package/dist/primitives-exports.d.ts +37 -0
- package/dist/style.css +1 -1
- package/dist/types/media.d.ts +2 -0
- package/dist/types/mediaLibraryPicker.d.ts +5 -0
- package/dist/utils/focus.d.ts +4 -0
- package/dist/vanilla-editor/core/EventEmitter.d.ts +8 -8
- package/dist/vanilla-editor/core/State.d.ts +441 -95
- package/package.json +8 -2
- package/dist/editor-D85y_zTO.cjs +0 -2
- package/dist/editor-D85y_zTO.cjs.map +0 -1
- package/dist/editor-DAJxTvzM.js +0 -10873
- package/dist/editor-DAJxTvzM.js.map +0 -1
- package/dist/index-BR0szJau.js.map +0 -1
- package/dist/index-CKYVSPfs.cjs +0 -357
- package/dist/index-CKYVSPfs.cjs.map +0 -1
package/dist/types/media.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Media } from './media';
|
|
|
4
4
|
export type MediaKind = 'image' | 'video' | 'audio' | 'document' | (string & {});
|
|
5
5
|
export type MediaSort = 'newest' | 'oldest' | 'name' | 'largest' | (string & {});
|
|
6
6
|
export type MediaUsageStatus = 'used' | 'not_used';
|
|
7
|
+
export type MediaMetadataStatus = 'missing_alt' | 'has_alt' | 'missing_caption' | 'has_caption' | 'has_tags' | 'decorative';
|
|
7
8
|
export type MediaSelectionMode = 'single' | 'multiple';
|
|
8
9
|
export type MediaLibraryPickerMode = 'picker-single' | 'picker-multi' | 'management';
|
|
9
10
|
export type MediaLibraryUploadBehavior = 'adapter' | 'delegate';
|
|
@@ -27,6 +28,7 @@ export interface MediaLibraryFilters {
|
|
|
27
28
|
created_after?: string;
|
|
28
29
|
created_before?: string;
|
|
29
30
|
usage_status?: MediaUsageStatus | null;
|
|
31
|
+
metadata_status?: MediaMetadataStatus | null;
|
|
30
32
|
unfiled_only?: boolean;
|
|
31
33
|
selected_uuids?: string[];
|
|
32
34
|
}
|
|
@@ -208,9 +210,12 @@ export interface MediaLibraryCapabilities {
|
|
|
208
210
|
allowCreatePost?: boolean;
|
|
209
211
|
allowImageEdit?: boolean;
|
|
210
212
|
allowPreview?: boolean;
|
|
213
|
+
allowReplaceMedia?: boolean;
|
|
214
|
+
allowDownloadOriginal?: boolean;
|
|
211
215
|
allowVideoEdit?: boolean;
|
|
212
216
|
allowVisibilityChange?: boolean;
|
|
213
217
|
allowDownloadZip?: boolean;
|
|
218
|
+
allowMetadataEdit?: boolean;
|
|
214
219
|
showRawFileName?: boolean;
|
|
215
220
|
}
|
|
216
221
|
export interface MediaItemFilterResult {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getFocusableElements(root: HTMLElement): HTMLElement[];
|
|
2
|
+
export declare function focusElement(element: HTMLElement | null | undefined): void;
|
|
3
|
+
export declare function trapTabKey(event: KeyboardEvent, root: HTMLElement | null | undefined): void;
|
|
4
|
+
export declare function focusMenuItemByKey(event: KeyboardEvent, root: HTMLElement | null | undefined): boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* EventEmitter
|
|
2
|
+
* Simple EventEmitter for vanilla JS
|
|
3
|
+
* Provides pub/sub functionality without external dependencies
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
5
|
export class EventEmitter {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
_events: Map<any, any>;
|
|
7
|
+
on(event: any, callback: any): () => void;
|
|
8
|
+
off(event: any, callback: any): void;
|
|
9
|
+
emit(event: any, ...args: any[]): void;
|
|
10
|
+
once(event: any, callback: any): () => void;
|
|
11
|
+
removeAllListeners(event: any): void;
|
|
12
12
|
}
|
|
@@ -1,98 +1,444 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { EventEmitter } from './EventEmitter';
|
|
6
|
-
|
|
1
|
+
export function getState(): any;
|
|
2
|
+
export function createState(): State;
|
|
7
3
|
export const TEXT_LAYER_FONT_FAMILIES: readonly string[];
|
|
8
|
-
|
|
9
|
-
export interface EditorState {
|
|
10
|
-
hasImage: boolean;
|
|
11
|
-
imageUrl: string | null;
|
|
12
|
-
mode: 'filters' | 'crop';
|
|
13
|
-
zoom: number;
|
|
14
|
-
fitScale: number;
|
|
15
|
-
activeFilters: Set<string>;
|
|
16
|
-
filterValues: Record<string, Record<string, unknown>>;
|
|
17
|
-
selectedFilter: string | null;
|
|
18
|
-
selectedCategory: string;
|
|
19
|
-
crop: {
|
|
20
|
-
shape: 'free' | 'square' | 'circle';
|
|
21
|
-
aspect: string;
|
|
22
|
-
rect: { x: number; y: number; width: number; height: number } | null;
|
|
23
|
-
dirty: boolean;
|
|
24
|
-
};
|
|
25
|
-
transform?: {
|
|
26
|
-
rotation: number;
|
|
27
|
-
};
|
|
28
|
-
editorDocument: Record<string, unknown> | null;
|
|
29
|
-
editorDocumentId: string | null;
|
|
30
|
-
editorDocumentRevisionId: string | null;
|
|
31
|
-
editorDocumentRevisionNumber: number | null;
|
|
32
|
-
layers: Array<Record<string, unknown>>;
|
|
33
|
-
activeLayerId: string | null;
|
|
34
|
-
theme: 'light' | 'dark' | 'auto';
|
|
35
|
-
isDarkMode: boolean;
|
|
36
|
-
backgroundRemovalAvailable: boolean;
|
|
37
|
-
isProcessing: boolean;
|
|
38
|
-
isSaving: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Canonical serializable editor session state (v3.0.0+) */
|
|
42
|
-
export interface SerializableEditorState {
|
|
43
|
-
version: 1;
|
|
44
|
-
crop: {
|
|
45
|
-
rect: { x: number; y: number; width: number; height: number } | null;
|
|
46
|
-
aspectRatio: string;
|
|
47
|
-
shape: 'free' | 'square' | 'circle';
|
|
48
|
-
};
|
|
49
|
-
transform: {
|
|
50
|
-
rotation: number;
|
|
51
|
-
};
|
|
52
|
-
filters: Array<{
|
|
53
|
-
id: string;
|
|
54
|
-
enabled: boolean;
|
|
55
|
-
values: Record<string, string | number | boolean>;
|
|
56
|
-
}>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
4
|
export class State extends EventEmitter {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
5
|
+
_state: {
|
|
6
|
+
hasImage: boolean;
|
|
7
|
+
imageUrl: null;
|
|
8
|
+
mode: string;
|
|
9
|
+
zoom: number;
|
|
10
|
+
fitScale: number;
|
|
11
|
+
activeFilters: Set<any>;
|
|
12
|
+
filterValues: {};
|
|
13
|
+
selectedFilter: null;
|
|
14
|
+
selectedCategory: string;
|
|
15
|
+
crop: {
|
|
16
|
+
shape: string;
|
|
17
|
+
aspect: string;
|
|
18
|
+
rect: null;
|
|
19
|
+
dirty: boolean;
|
|
20
|
+
};
|
|
21
|
+
transform: {
|
|
22
|
+
rotation: number;
|
|
23
|
+
};
|
|
24
|
+
editorDocument: null;
|
|
25
|
+
editorDocumentId: null;
|
|
26
|
+
editorDocumentRevisionId: null;
|
|
27
|
+
editorDocumentRevisionNumber: null;
|
|
28
|
+
layers: never[];
|
|
29
|
+
activeLayerId: null;
|
|
30
|
+
theme: string;
|
|
31
|
+
isDarkMode: boolean;
|
|
32
|
+
backgroundRemovalAvailable: boolean;
|
|
33
|
+
isProcessing: boolean;
|
|
34
|
+
isSaving: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get a state value
|
|
38
|
+
* @param {string} key - State key (supports dot notation: 'crop.shape')
|
|
39
|
+
* @returns {*} The state value
|
|
40
|
+
*/
|
|
41
|
+
get(key: string): any;
|
|
42
|
+
/**
|
|
43
|
+
* Set a state value and emit change event
|
|
44
|
+
* @param {string} key - State key (supports dot notation: 'crop.shape')
|
|
45
|
+
* @param {*} value - New value
|
|
46
|
+
*/
|
|
47
|
+
set(key: string, value: any): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get the entire state object (for debugging).
|
|
50
|
+
* WARNING: Shallow copy only — nested objects are live references.
|
|
51
|
+
* For persistence, use getSerializableState() instead.
|
|
52
|
+
*/
|
|
53
|
+
getAll(): {
|
|
54
|
+
hasImage: boolean;
|
|
55
|
+
imageUrl: null;
|
|
56
|
+
mode: string;
|
|
57
|
+
zoom: number;
|
|
58
|
+
fitScale: number;
|
|
59
|
+
activeFilters: Set<any>;
|
|
60
|
+
filterValues: {};
|
|
61
|
+
selectedFilter: null;
|
|
62
|
+
selectedCategory: string;
|
|
63
|
+
crop: {
|
|
64
|
+
shape: string;
|
|
65
|
+
aspect: string;
|
|
66
|
+
rect: null;
|
|
67
|
+
dirty: boolean;
|
|
68
|
+
};
|
|
69
|
+
transform: {
|
|
70
|
+
rotation: number;
|
|
71
|
+
};
|
|
72
|
+
editorDocument: null;
|
|
73
|
+
editorDocumentId: null;
|
|
74
|
+
editorDocumentRevisionId: null;
|
|
75
|
+
editorDocumentRevisionNumber: null;
|
|
76
|
+
layers: never[];
|
|
77
|
+
activeLayerId: null;
|
|
78
|
+
theme: string;
|
|
79
|
+
isDarkMode: boolean;
|
|
80
|
+
backgroundRemovalAvailable: boolean;
|
|
81
|
+
isProcessing: boolean;
|
|
82
|
+
isSaving: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Deep clone a JSON-compatible editor payload.
|
|
86
|
+
* @param {*} value
|
|
87
|
+
* @returns {*}
|
|
88
|
+
*/
|
|
89
|
+
_clonePlain(value: any): any;
|
|
90
|
+
/**
|
|
91
|
+
* Get a deep, serializable snapshot of the editor state.
|
|
92
|
+
* Safe for persistence — no mutable references leak out.
|
|
93
|
+
* @returns {Object} ImageEditorSessionState-compatible object
|
|
94
|
+
*/
|
|
95
|
+
getSerializableState(): Object;
|
|
96
|
+
/**
|
|
97
|
+
* Store the active immutable v2 editor document snapshot.
|
|
98
|
+
* @param {Object|null} document
|
|
99
|
+
* @param {{ documentId?: string|null, documentRevisionId?: string|null, documentRevisionNumber?: number|null }} binding
|
|
100
|
+
*/
|
|
101
|
+
setEditorDocument(document: Object | null, binding?: {
|
|
102
|
+
documentId?: string | null;
|
|
103
|
+
documentRevisionId?: string | null;
|
|
104
|
+
documentRevisionNumber?: number | null;
|
|
105
|
+
}): void;
|
|
106
|
+
clearEditorDocument(): void;
|
|
107
|
+
/**
|
|
108
|
+
* @returns {Object|null}
|
|
109
|
+
*/
|
|
110
|
+
getSerializableDocument(): Object | null;
|
|
111
|
+
/**
|
|
112
|
+
* @returns {{ documentId: string|null, documentRevisionId: string|null, documentRevisionNumber: number|null }|null}
|
|
113
|
+
*/
|
|
114
|
+
getEditorDocumentBinding(): {
|
|
115
|
+
documentId: string | null;
|
|
116
|
+
documentRevisionId: string | null;
|
|
117
|
+
documentRevisionNumber: number | null;
|
|
118
|
+
} | null;
|
|
119
|
+
/**
|
|
120
|
+
* @param {string} layerId
|
|
121
|
+
* @returns {number}
|
|
122
|
+
*/
|
|
123
|
+
_findLayerIndex(layerId: string): number;
|
|
124
|
+
/**
|
|
125
|
+
* @param {Object|null|undefined} layer
|
|
126
|
+
* @returns {boolean}
|
|
127
|
+
*/
|
|
128
|
+
_layerLocked(layer: Object | null | undefined): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* @param {Object[]|null|undefined} layers
|
|
131
|
+
* @returns {boolean}
|
|
132
|
+
*/
|
|
133
|
+
_backgroundLayerLocked(layers?: Object[] | null | undefined): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* @returns {boolean}
|
|
136
|
+
*/
|
|
137
|
+
isBackgroundLayerLocked(): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* @param {string} baseId
|
|
140
|
+
* @returns {string}
|
|
141
|
+
*/
|
|
142
|
+
_uniqueLayerId(baseId: string): string;
|
|
143
|
+
/**
|
|
144
|
+
* @param {Object|null|undefined} layer
|
|
145
|
+
* @returns {Object|null|undefined}
|
|
146
|
+
*/
|
|
147
|
+
_normalizeLayerForState(layer: Object | null | undefined): Object | null | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* @param {Array|null|undefined} filters
|
|
150
|
+
* @returns {Array}
|
|
151
|
+
*/
|
|
152
|
+
_normalizeLayerFilters(filters: any[] | null | undefined): any[];
|
|
153
|
+
/**
|
|
154
|
+
* @param {Object|null|undefined} layer
|
|
155
|
+
* @returns {boolean}
|
|
156
|
+
*/
|
|
157
|
+
_layerSupportsFilters(layer: Object | null | undefined): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* @returns {number}
|
|
160
|
+
*/
|
|
161
|
+
_activeFilterLayerIndex(): number;
|
|
162
|
+
/**
|
|
163
|
+
* @returns {string|null}
|
|
164
|
+
*/
|
|
165
|
+
getActiveFilterLayerId(): string | null;
|
|
166
|
+
/**
|
|
167
|
+
* @param {string|null|undefined} expectedLayerId
|
|
168
|
+
* @returns {boolean}
|
|
169
|
+
*/
|
|
170
|
+
_matchesExpectedFilterLayer(expectedLayerId: string | null | undefined): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Project the active filterable layer into the legacy filter UI state.
|
|
173
|
+
*/
|
|
174
|
+
_syncFilterStateFromActiveLayer(): void;
|
|
175
|
+
/**
|
|
176
|
+
* @param {*} value
|
|
177
|
+
* @param {number} min
|
|
178
|
+
* @param {number} max
|
|
179
|
+
* @param {number} fallback
|
|
180
|
+
* @returns {number}
|
|
181
|
+
*/
|
|
182
|
+
_clampNumber(value: any, min: number, max: number, fallback: number): number;
|
|
183
|
+
/**
|
|
184
|
+
* @param {*} value
|
|
185
|
+
* @returns {number}
|
|
186
|
+
*/
|
|
187
|
+
_normalizeDegrees(value: any): number;
|
|
188
|
+
/**
|
|
189
|
+
* @param {*} value
|
|
190
|
+
* @returns {boolean}
|
|
191
|
+
*/
|
|
192
|
+
_isSupportedTextColor(value: any): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* @param {*} value
|
|
195
|
+
* @param {string} fallback
|
|
196
|
+
* @returns {string}
|
|
197
|
+
*/
|
|
198
|
+
_normalizeTextColor(value: any, fallback: string): string;
|
|
199
|
+
/**
|
|
200
|
+
* @param {*} value
|
|
201
|
+
* @param {boolean} fallback
|
|
202
|
+
* @returns {boolean}
|
|
203
|
+
*/
|
|
204
|
+
_normalizeBoolean(value: any, fallback?: boolean): boolean;
|
|
205
|
+
/**
|
|
206
|
+
* @param {*} value
|
|
207
|
+
* @param {string} fallback
|
|
208
|
+
* @returns {string}
|
|
209
|
+
*/
|
|
210
|
+
_normalizeBlendMode(value: any, fallback?: string): string;
|
|
211
|
+
/**
|
|
212
|
+
* @param {*} value
|
|
213
|
+
* @returns {string}
|
|
214
|
+
*/
|
|
215
|
+
_normalizeTextFontFamily(value: any): string;
|
|
216
|
+
/**
|
|
217
|
+
* @param {*} value
|
|
218
|
+
* @param {number} fallback
|
|
219
|
+
* @returns {number}
|
|
220
|
+
*/
|
|
221
|
+
_normalizeTextFontWeight(value: any, fallback?: number): number;
|
|
222
|
+
/**
|
|
223
|
+
* @param {Object|null|undefined} box
|
|
224
|
+
* @param {Object|null|undefined} base
|
|
225
|
+
* @returns {{ x: number, y: number, width: number, height: number }}
|
|
226
|
+
*/
|
|
227
|
+
_normalizeTextBox(box: Object | null | undefined, base?: Object | null | undefined): {
|
|
228
|
+
x: number;
|
|
229
|
+
y: number;
|
|
230
|
+
width: number;
|
|
231
|
+
height: number;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* @param {Object|null|undefined} style
|
|
235
|
+
* @param {Object|null|undefined} base
|
|
236
|
+
* @returns {Object}
|
|
237
|
+
*/
|
|
238
|
+
_normalizeTextStyle(style: Object | null | undefined, base?: Object | null | undefined): Object;
|
|
239
|
+
/**
|
|
240
|
+
* @param {Object|null|undefined} effects
|
|
241
|
+
* @param {Object|null|undefined} base
|
|
242
|
+
* @returns {Object}
|
|
243
|
+
*/
|
|
244
|
+
_normalizeTextEffects(effects: Object | null | undefined, base?: Object | null | undefined): Object;
|
|
245
|
+
/**
|
|
246
|
+
* @param {Object|null|undefined} transform
|
|
247
|
+
* @param {Object|null|undefined} base
|
|
248
|
+
* @returns {{ x: number, y: number, scaleX: number, scaleY: number, rotation: number }}
|
|
249
|
+
*/
|
|
250
|
+
_normalizeLayerTransform(transform: Object | null | undefined, base?: Object | null | undefined): {
|
|
251
|
+
x: number;
|
|
252
|
+
y: number;
|
|
253
|
+
scaleX: number;
|
|
254
|
+
scaleY: number;
|
|
255
|
+
rotation: number;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* @param {Object|null|undefined} input
|
|
259
|
+
* @param {Object|null|undefined} base
|
|
260
|
+
* @returns {Object}
|
|
261
|
+
*/
|
|
262
|
+
_normalizeTextPayload(input?: Object | null | undefined, base?: Object | null | undefined): Object;
|
|
263
|
+
/**
|
|
264
|
+
* @param {Object} input
|
|
265
|
+
* @param {Object|null|undefined} base
|
|
266
|
+
* @returns {Object}
|
|
267
|
+
*/
|
|
268
|
+
_normalizeTextLayer(input?: Object, base?: Object | null | undefined): Object;
|
|
269
|
+
/**
|
|
270
|
+
* @param {Object[]} layers
|
|
271
|
+
* @param {number} removedIndex
|
|
272
|
+
* @returns {string|null}
|
|
273
|
+
*/
|
|
274
|
+
_nearestEditableLayerId(layers: Object[], removedIndex: number): string | null;
|
|
275
|
+
/**
|
|
276
|
+
* @param {Object[]} layers
|
|
277
|
+
* @param {number} fromIndex
|
|
278
|
+
* @param {number} toIndex
|
|
279
|
+
* @returns {boolean}
|
|
280
|
+
*/
|
|
281
|
+
_moveCrossesLockedLayer(layers: Object[], fromIndex: number, toIndex: number): boolean;
|
|
282
|
+
/**
|
|
283
|
+
* @param {string} layerId
|
|
284
|
+
* @returns {Object|null}
|
|
285
|
+
*/
|
|
286
|
+
getLayer(layerId: string): Object | null;
|
|
287
|
+
/**
|
|
288
|
+
* @param {string|null} layerId
|
|
289
|
+
* @returns {boolean}
|
|
290
|
+
*/
|
|
291
|
+
setActiveLayer(layerId: string | null): boolean;
|
|
292
|
+
/**
|
|
293
|
+
* @returns {boolean}
|
|
294
|
+
*/
|
|
295
|
+
isActiveLayerLocked(): boolean;
|
|
296
|
+
/**
|
|
297
|
+
* @param {string} layerId
|
|
298
|
+
* @param {boolean} visible
|
|
299
|
+
* @returns {boolean}
|
|
300
|
+
*/
|
|
301
|
+
setLayerVisibility(layerId: string, visible: boolean): boolean;
|
|
302
|
+
/**
|
|
303
|
+
* @param {string} layerId
|
|
304
|
+
* @param {string} name
|
|
305
|
+
* @returns {boolean}
|
|
306
|
+
*/
|
|
307
|
+
renameLayer(layerId: string, name: string): boolean;
|
|
308
|
+
/**
|
|
309
|
+
* @param {string} layerId
|
|
310
|
+
* @returns {string|null}
|
|
311
|
+
*/
|
|
312
|
+
duplicateLayer(layerId: string): string | null;
|
|
313
|
+
/**
|
|
314
|
+
* @param {string} layerId
|
|
315
|
+
* @returns {boolean}
|
|
316
|
+
*/
|
|
317
|
+
deleteLayer(layerId: string): boolean;
|
|
318
|
+
/**
|
|
319
|
+
* @param {string} layerId
|
|
320
|
+
* @param {'up'|'down'|'front'|'back'|'bring-forward'|'send-backward'|'bring-to-front'|'send-to-back'} direction
|
|
321
|
+
* @returns {boolean}
|
|
322
|
+
*/
|
|
323
|
+
moveLayer(layerId: string, direction: "up" | "down" | "front" | "back" | "bring-forward" | "send-backward" | "bring-to-front" | "send-to-back"): boolean;
|
|
324
|
+
/**
|
|
325
|
+
* @param {string} layerId
|
|
326
|
+
* @param {boolean} locked
|
|
327
|
+
* @returns {boolean}
|
|
328
|
+
*/
|
|
329
|
+
setLayerLocked(layerId: string, locked: boolean): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* @param {string} layerId
|
|
332
|
+
* @param {Object} source
|
|
333
|
+
* @returns {boolean}
|
|
334
|
+
*/
|
|
335
|
+
replaceLayerSource(layerId: string, source: Object): boolean;
|
|
336
|
+
/**
|
|
337
|
+
* @param {Object} payload
|
|
338
|
+
* @returns {string|null}
|
|
339
|
+
*/
|
|
340
|
+
addTextLayer(payload?: Object): string | null;
|
|
341
|
+
/**
|
|
342
|
+
* @param {string} layerId
|
|
343
|
+
* @param {Object} patch
|
|
344
|
+
* @returns {boolean}
|
|
345
|
+
*/
|
|
346
|
+
updateTextLayer(layerId: string, patch?: Object): boolean;
|
|
347
|
+
_commitLayers(layers: any, eventName?: null, eventPayload?: {}): void;
|
|
348
|
+
_backgroundLayerIndex(layers?: any[]): number;
|
|
349
|
+
_defaultBackgroundLayer(fill?: {
|
|
350
|
+
kind: string;
|
|
351
|
+
}): {
|
|
352
|
+
id: string;
|
|
353
|
+
type: string;
|
|
354
|
+
role: string;
|
|
355
|
+
name: string;
|
|
356
|
+
visible: boolean;
|
|
357
|
+
locked: boolean;
|
|
358
|
+
opacity: number;
|
|
359
|
+
blendMode: string;
|
|
360
|
+
transform: {
|
|
361
|
+
x: number;
|
|
362
|
+
y: number;
|
|
363
|
+
scaleX: number;
|
|
364
|
+
scaleY: number;
|
|
365
|
+
rotation: number;
|
|
366
|
+
};
|
|
367
|
+
effects: never[];
|
|
368
|
+
metadata: {};
|
|
369
|
+
fill: any;
|
|
370
|
+
crop: null;
|
|
371
|
+
filters: never[];
|
|
372
|
+
};
|
|
373
|
+
_normalizeBackgroundFill(fill: any): {
|
|
374
|
+
kind: string;
|
|
375
|
+
gradientType?: undefined;
|
|
376
|
+
angle?: undefined;
|
|
377
|
+
stops?: undefined;
|
|
378
|
+
fit?: undefined;
|
|
379
|
+
source?: undefined;
|
|
380
|
+
} | {
|
|
381
|
+
fit?: any;
|
|
382
|
+
kind: string;
|
|
383
|
+
value: any;
|
|
384
|
+
gradientType?: undefined;
|
|
385
|
+
angle?: undefined;
|
|
386
|
+
stops?: undefined;
|
|
387
|
+
source?: undefined;
|
|
388
|
+
} | {
|
|
389
|
+
kind: string;
|
|
390
|
+
gradientType: any;
|
|
391
|
+
angle: number;
|
|
392
|
+
stops: any;
|
|
393
|
+
fit: any;
|
|
394
|
+
source?: undefined;
|
|
395
|
+
} | {
|
|
396
|
+
kind: string;
|
|
397
|
+
source: any;
|
|
398
|
+
fit: any;
|
|
399
|
+
gradientType?: undefined;
|
|
400
|
+
angle?: undefined;
|
|
401
|
+
stops?: undefined;
|
|
402
|
+
};
|
|
403
|
+
ensureBackgroundLayer(fill?: {
|
|
404
|
+
kind: string;
|
|
405
|
+
}): any;
|
|
406
|
+
setBackgroundFill(fill: any): any;
|
|
407
|
+
setBackgroundFit(fit: any): boolean;
|
|
408
|
+
setBackgroundBlur(amount: any): boolean;
|
|
409
|
+
removeBackgroundLayer(): boolean;
|
|
410
|
+
/**
|
|
411
|
+
* Toggle a filter in the active filters set
|
|
412
|
+
* @param {string} filterId
|
|
413
|
+
* @param {boolean} enabled
|
|
414
|
+
*/
|
|
415
|
+
toggleFilter(filterId: string, enabled: boolean, expectedLayerId?: undefined): boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Update a filter's control value
|
|
418
|
+
* @param {string} filterId
|
|
419
|
+
* @param {string} controlId
|
|
420
|
+
* @param {*} value
|
|
421
|
+
*/
|
|
422
|
+
setFilterValue(filterId: string, controlId: string, value: any, expectedLayerId?: undefined): boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Get a filter's control values
|
|
425
|
+
* @param {string} filterId
|
|
426
|
+
* @returns {Object} Filter values
|
|
427
|
+
*/
|
|
428
|
+
getFilterValues(filterId: string): Object;
|
|
429
|
+
/**
|
|
430
|
+
* Initialize filter values from definition defaults
|
|
431
|
+
* @param {string} filterId
|
|
432
|
+
* @param {Array} controls - Control definitions with defaults
|
|
433
|
+
*/
|
|
434
|
+
initFilterValues(filterId: string, controls: any[], expectedLayerId?: undefined): boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Reset all filters
|
|
437
|
+
*/
|
|
438
|
+
resetFilters(expectedLayerId?: undefined): boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Detect and set dark mode based on preference
|
|
441
|
+
*/
|
|
442
|
+
detectTheme(): void;
|
|
95
443
|
}
|
|
96
|
-
|
|
97
|
-
export function createState(): State;
|
|
98
|
-
export function getState(): State;
|
|
444
|
+
import { EventEmitter } from './EventEmitter.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingfactory/mediables-vue",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "restricted"
|
|
6
6
|
},
|
|
@@ -30,14 +30,20 @@
|
|
|
30
30
|
"import": "./dist/mediables-vanilla.mjs",
|
|
31
31
|
"require": "./dist/mediables-vanilla.cjs"
|
|
32
32
|
},
|
|
33
|
+
"./primitives": {
|
|
34
|
+
"types": "./dist/primitives-exports.d.ts",
|
|
35
|
+
"import": "./dist/mediables-primitives.mjs",
|
|
36
|
+
"require": "./dist/mediables-primitives.cjs"
|
|
37
|
+
},
|
|
33
38
|
"./style.css": "./dist/style.css"
|
|
34
39
|
},
|
|
35
40
|
"packageManager": "pnpm@10.24.0",
|
|
36
41
|
"scripts": {
|
|
37
42
|
"preinstall": "npx only-allow pnpm",
|
|
38
43
|
"clean": "rimraf dist",
|
|
39
|
-
"build": "vite build --config vite.lib.config.ts && vue-tsc -p tsconfig.build.json --emitDeclarationOnly && pnpm build:vanilla-types && pnpm build:render",
|
|
44
|
+
"build": "vite build --config vite.lib.config.ts && vue-tsc -p tsconfig.build.json --emitDeclarationOnly && pnpm build:vanilla-types && pnpm build:primitives-types && pnpm build:render",
|
|
40
45
|
"build:vanilla-types": "tsc -p tsconfig.vanilla-declarations.json && node scripts/build-vanilla-declarations.mjs",
|
|
46
|
+
"build:primitives-types": "tsc -p tsconfig.primitives-declarations.json && node scripts/build-primitives-declarations.mjs",
|
|
41
47
|
"build:render": "vite build --config vite.render.config.ts",
|
|
42
48
|
"dev": "vite build --config vite.lib.config.ts --watch",
|
|
43
49
|
"type-check": "vue-tsc --noEmit",
|