kirby-types 1.1.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -0
- package/index.d.ts +22 -0
- package/package.json +16 -7
- package/src/blueprint.d.ts +660 -0
- package/src/panel/api.d.ts +30 -54
- package/src/panel/base.d.ts +14 -12
- package/src/panel/features.d.ts +47 -40
- package/src/panel/helpers.d.ts +45 -32
- package/src/panel/index.d.ts +179 -206
- package/src/panel/libraries.d.ts +126 -139
- package/src/panel/textarea.d.ts +192 -0
- package/src/panel/writer.d.ts +570 -13
package/src/panel/api.d.ts
CHANGED
|
@@ -76,33 +76,28 @@ export interface PanelApiAuth {
|
|
|
76
76
|
/**
|
|
77
77
|
* Logs out the current user.
|
|
78
78
|
*/
|
|
79
|
-
logout: () => Promise<
|
|
79
|
+
logout: () => Promise<any>;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Pings the server to keep session alive.
|
|
83
83
|
*/
|
|
84
|
-
ping: () => Promise<
|
|
84
|
+
ping: () => Promise<any>;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* Gets the current user.
|
|
88
88
|
*
|
|
89
89
|
* @param query - Query parameters
|
|
90
|
-
* @param options - Request options
|
|
91
90
|
* @returns User data
|
|
92
91
|
*/
|
|
93
|
-
user: (
|
|
94
|
-
query?: Record<string, any>,
|
|
95
|
-
options?: PanelApiRequestOptions,
|
|
96
|
-
) => Promise<any>;
|
|
92
|
+
user: (query?: Record<string, any>) => Promise<any>;
|
|
97
93
|
|
|
98
94
|
/**
|
|
99
95
|
* Verifies a 2FA code.
|
|
100
96
|
*
|
|
101
97
|
* @param code - Verification code
|
|
102
|
-
* @param data - Additional data
|
|
103
98
|
* @returns Verification result
|
|
104
99
|
*/
|
|
105
|
-
verifyCode: (code: string
|
|
100
|
+
verifyCode: (code: string) => Promise<any>;
|
|
106
101
|
}
|
|
107
102
|
|
|
108
103
|
// -----------------------------------------------------------------------------
|
|
@@ -135,7 +130,7 @@ export interface PanelApiFiles {
|
|
|
135
130
|
* @param parent - Parent page/site path
|
|
136
131
|
* @param filename - Filename to delete
|
|
137
132
|
*/
|
|
138
|
-
delete: (parent: string | null, filename: string) => Promise<
|
|
133
|
+
delete: (parent: string | null, filename: string) => Promise<any>;
|
|
139
134
|
|
|
140
135
|
/**
|
|
141
136
|
* Gets a file.
|
|
@@ -225,18 +220,17 @@ export interface PanelApiLanguages {
|
|
|
225
220
|
/**
|
|
226
221
|
* Creates a new language.
|
|
227
222
|
*
|
|
228
|
-
* @param
|
|
229
|
-
* @param data - Language data
|
|
223
|
+
* @param data - Language data (including code)
|
|
230
224
|
* @returns Created language
|
|
231
225
|
*/
|
|
232
|
-
create: (
|
|
226
|
+
create: (data: PanelApiLanguageData) => Promise<any>;
|
|
233
227
|
|
|
234
228
|
/**
|
|
235
229
|
* Deletes a language.
|
|
236
230
|
*
|
|
237
231
|
* @param code - Language code
|
|
238
232
|
*/
|
|
239
|
-
delete: (code: string) => Promise<
|
|
233
|
+
delete: (code: string) => Promise<any>;
|
|
240
234
|
|
|
241
235
|
/**
|
|
242
236
|
* Gets a language.
|
|
@@ -381,7 +375,7 @@ export interface PanelApiPages {
|
|
|
381
375
|
* @param id - Page ID
|
|
382
376
|
* @param data - Delete options
|
|
383
377
|
*/
|
|
384
|
-
delete: (id: string, data?: { force?: boolean }) => Promise<
|
|
378
|
+
delete: (id: string, data?: { force?: boolean }) => Promise<any>;
|
|
385
379
|
|
|
386
380
|
/**
|
|
387
381
|
* Duplicates a page.
|
|
@@ -488,11 +482,10 @@ export interface PanelApiRoles {
|
|
|
488
482
|
/**
|
|
489
483
|
* Lists available roles.
|
|
490
484
|
*
|
|
491
|
-
* @param
|
|
492
|
-
* @param query - Query parameters
|
|
485
|
+
* @param params - Query parameters
|
|
493
486
|
* @returns Array of roles
|
|
494
487
|
*/
|
|
495
|
-
list: (
|
|
488
|
+
list: (params?: Record<string, any>) => Promise<any[]>;
|
|
496
489
|
}
|
|
497
490
|
|
|
498
491
|
// -----------------------------------------------------------------------------
|
|
@@ -523,22 +516,17 @@ export interface PanelApiSite {
|
|
|
523
516
|
* Changes the site title.
|
|
524
517
|
*
|
|
525
518
|
* @param title - New title
|
|
526
|
-
* @param language - Language code
|
|
527
519
|
* @returns Updated site
|
|
528
520
|
*/
|
|
529
|
-
changeTitle: (title: string
|
|
521
|
+
changeTitle: (title: string) => Promise<any>;
|
|
530
522
|
|
|
531
523
|
/**
|
|
532
524
|
* Searches site children.
|
|
533
525
|
*
|
|
534
526
|
* @param query - Search query
|
|
535
|
-
* @param options - Query options
|
|
536
527
|
* @returns Search results
|
|
537
528
|
*/
|
|
538
|
-
children: (
|
|
539
|
-
query?: PanelApiSearchQuery,
|
|
540
|
-
options?: Record<string, any>,
|
|
541
|
-
) => Promise<any>;
|
|
529
|
+
children: (query?: PanelApiSearchQuery) => Promise<any>;
|
|
542
530
|
|
|
543
531
|
/**
|
|
544
532
|
* Gets the site.
|
|
@@ -552,10 +540,9 @@ export interface PanelApiSite {
|
|
|
552
540
|
* Updates the site content.
|
|
553
541
|
*
|
|
554
542
|
* @param data - Content data
|
|
555
|
-
* @param language - Language code
|
|
556
543
|
* @returns Updated site
|
|
557
544
|
*/
|
|
558
|
-
update: (data: Record<string, any
|
|
545
|
+
update: (data: Record<string, any>) => Promise<any>;
|
|
559
546
|
}
|
|
560
547
|
|
|
561
548
|
// -----------------------------------------------------------------------------
|
|
@@ -602,25 +589,17 @@ export interface PanelApiSystem {
|
|
|
602
589
|
* Installs Kirby with initial user.
|
|
603
590
|
*
|
|
604
591
|
* @param data - Installation data
|
|
605
|
-
* @param query - Query parameters
|
|
606
592
|
* @returns Installation result
|
|
607
593
|
*/
|
|
608
|
-
install: (
|
|
609
|
-
data: PanelApiSystemInstallData,
|
|
610
|
-
query?: Record<string, any>,
|
|
611
|
-
) => Promise<any>;
|
|
594
|
+
install: (data: PanelApiSystemInstallData) => Promise<any>;
|
|
612
595
|
|
|
613
596
|
/**
|
|
614
597
|
* Registers a license.
|
|
615
598
|
*
|
|
616
599
|
* @param data - Registration data
|
|
617
|
-
* @param query - Query parameters
|
|
618
600
|
* @returns Registration result
|
|
619
601
|
*/
|
|
620
|
-
register: (
|
|
621
|
-
data: PanelApiSystemRegisterData,
|
|
622
|
-
query?: Record<string, any>,
|
|
623
|
-
) => Promise<any>;
|
|
602
|
+
register: (data: PanelApiSystemRegisterData) => Promise<any>;
|
|
624
603
|
}
|
|
625
604
|
|
|
626
605
|
// -----------------------------------------------------------------------------
|
|
@@ -686,11 +665,11 @@ export interface PanelApiUsers {
|
|
|
686
665
|
/**
|
|
687
666
|
* Gets available blueprints for users.
|
|
688
667
|
*
|
|
689
|
-
* @param
|
|
690
|
-
* @param
|
|
668
|
+
* @param id - User ID for context
|
|
669
|
+
* @param section - Section name to filter by
|
|
691
670
|
* @returns Array of blueprints
|
|
692
671
|
*/
|
|
693
|
-
blueprints: (
|
|
672
|
+
blueprints: (id: string, section?: string) => Promise<any[]>;
|
|
694
673
|
|
|
695
674
|
/**
|
|
696
675
|
* Changes a user's email.
|
|
@@ -724,13 +703,13 @@ export interface PanelApiUsers {
|
|
|
724
703
|
*
|
|
725
704
|
* @param id - User ID
|
|
726
705
|
* @param password - New password
|
|
727
|
-
* @param
|
|
706
|
+
* @param currentPassword - Current password for verification
|
|
728
707
|
* @returns Updated user
|
|
729
708
|
*/
|
|
730
709
|
changePassword: (
|
|
731
710
|
id: string,
|
|
732
711
|
password: string,
|
|
733
|
-
|
|
712
|
+
currentPassword: string,
|
|
734
713
|
) => Promise<any>;
|
|
735
714
|
|
|
736
715
|
/**
|
|
@@ -745,25 +724,24 @@ export interface PanelApiUsers {
|
|
|
745
724
|
/**
|
|
746
725
|
* Creates a new user.
|
|
747
726
|
*
|
|
748
|
-
* @param
|
|
749
|
-
* @param data - User data
|
|
727
|
+
* @param data - User data (including email as identifier)
|
|
750
728
|
* @returns Created user
|
|
751
729
|
*/
|
|
752
|
-
create: (
|
|
730
|
+
create: (data: PanelApiUserCreateData) => Promise<any>;
|
|
753
731
|
|
|
754
732
|
/**
|
|
755
733
|
* Deletes a user.
|
|
756
734
|
*
|
|
757
735
|
* @param id - User ID
|
|
758
736
|
*/
|
|
759
|
-
delete: (id: string) => Promise<
|
|
737
|
+
delete: (id: string) => Promise<any>;
|
|
760
738
|
|
|
761
739
|
/**
|
|
762
740
|
* Deletes a user's avatar.
|
|
763
741
|
*
|
|
764
742
|
* @param id - User ID
|
|
765
743
|
*/
|
|
766
|
-
deleteAvatar: (id: string) => Promise<
|
|
744
|
+
deleteAvatar: (id: string) => Promise<any>;
|
|
767
745
|
|
|
768
746
|
/**
|
|
769
747
|
* Gets a user.
|
|
@@ -842,13 +820,13 @@ export interface PanelApiUsers {
|
|
|
842
820
|
* @example
|
|
843
821
|
* ```ts
|
|
844
822
|
* // Get a page
|
|
845
|
-
* const page = await panel.api.pages.get(
|
|
823
|
+
* const page = await panel.api.pages.get("home");
|
|
846
824
|
*
|
|
847
825
|
* // Create a new page
|
|
848
|
-
* await panel.api.pages.create(
|
|
849
|
-
* slug:
|
|
850
|
-
* title:
|
|
851
|
-
* template:
|
|
826
|
+
* await panel.api.pages.create("blog", {
|
|
827
|
+
* slug: "new-post",
|
|
828
|
+
* title: "New Post",
|
|
829
|
+
* template: "article"
|
|
852
830
|
* });
|
|
853
831
|
* ```
|
|
854
832
|
*
|
|
@@ -913,7 +891,6 @@ export interface PanelApi {
|
|
|
913
891
|
* @param data - Request body
|
|
914
892
|
* @param options - Request options
|
|
915
893
|
* @param silent - Skip loading indicator
|
|
916
|
-
* @param upload - Whether uploading file
|
|
917
894
|
* @returns Response data
|
|
918
895
|
*/
|
|
919
896
|
post: (
|
|
@@ -921,7 +898,6 @@ export interface PanelApi {
|
|
|
921
898
|
data?: any,
|
|
922
899
|
options?: PanelApiRequestOptions,
|
|
923
900
|
silent?: boolean,
|
|
924
|
-
upload?: boolean,
|
|
925
901
|
) => Promise<any>;
|
|
926
902
|
|
|
927
903
|
/**
|
package/src/panel/base.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* ```ts
|
|
26
26
|
* // State is used by: language, menu, notification, system, translation, user, drag, theme
|
|
27
27
|
* const notification: PanelState<PanelNotificationDefaults> = panel.notification;
|
|
28
|
-
* notification.set({ message:
|
|
28
|
+
* notification.set({ message: "Saved!" });
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/state.js
|
|
@@ -149,11 +149,11 @@ export type PanelEventListenerMap<TEvents extends string = string> = Partial<
|
|
|
149
149
|
*
|
|
150
150
|
* @example
|
|
151
151
|
* ```ts
|
|
152
|
-
* panel.dialog.addEventListener(
|
|
153
|
-
* console.log(
|
|
152
|
+
* panel.dialog.addEventListener("submit", (value) => {
|
|
153
|
+
* console.log("Dialog submitted:", value);
|
|
154
154
|
* });
|
|
155
155
|
*
|
|
156
|
-
* panel.dialog.emit(
|
|
156
|
+
* panel.dialog.emit("submit", formData);
|
|
157
157
|
* ```
|
|
158
158
|
*
|
|
159
159
|
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/listeners.js
|
|
@@ -241,10 +241,10 @@ export interface PanelFeatureDefaults {
|
|
|
241
241
|
* @example
|
|
242
242
|
* ```ts
|
|
243
243
|
* // Load a view
|
|
244
|
-
* await panel.view.load(
|
|
244
|
+
* await panel.view.load("/pages/home");
|
|
245
245
|
*
|
|
246
246
|
* // Open a dropdown with options
|
|
247
|
-
* await panel.dropdown.open(
|
|
247
|
+
* await panel.dropdown.open("/dropdowns/pages/home/options");
|
|
248
248
|
* ```
|
|
249
249
|
*
|
|
250
250
|
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/feature.js
|
|
@@ -359,8 +359,9 @@ export interface PanelFeature<TDefaults extends object = PanelFeatureDefaults>
|
|
|
359
359
|
* Reloads the feature by re-opening its current URL.
|
|
360
360
|
*
|
|
361
361
|
* @param options - Request options
|
|
362
|
+
* @returns False if no path exists, otherwise void
|
|
362
363
|
*/
|
|
363
|
-
reload: (options?: PanelRequestOptions) => Promise<void>;
|
|
364
|
+
reload: (options?: PanelRequestOptions) => Promise<void | false>;
|
|
364
365
|
|
|
365
366
|
/**
|
|
366
367
|
* Creates a full URL object for the current path and query.
|
|
@@ -405,7 +406,7 @@ export interface PanelSuccessResponse {
|
|
|
405
406
|
message?: string;
|
|
406
407
|
/** Events to emit (string or array of strings) */
|
|
407
408
|
event?: string | string[];
|
|
408
|
-
/** Whether to emit the global
|
|
409
|
+
/** Whether to emit the global `"success"` event (default: true) */
|
|
409
410
|
emit?: boolean;
|
|
410
411
|
/** URL to navigate to */
|
|
411
412
|
route?: string | { url: string; options?: PanelRequestOptions };
|
|
@@ -431,14 +432,14 @@ export interface PanelSuccessResponse {
|
|
|
431
432
|
* @example
|
|
432
433
|
* ```ts
|
|
433
434
|
* // Open a dialog
|
|
434
|
-
* await panel.dialog.open(
|
|
435
|
+
* await panel.dialog.open("/dialogs/pages/create", {
|
|
435
436
|
* on: {
|
|
436
|
-
* submit: (value) => console.log(
|
|
437
|
+
* submit: (value) => console.log("Created:", value)
|
|
437
438
|
* }
|
|
438
439
|
* });
|
|
439
440
|
*
|
|
440
441
|
* // Close with history navigation
|
|
441
|
-
* panel.drawer.goTo(
|
|
442
|
+
* panel.drawer.goTo("previous-drawer-id");
|
|
442
443
|
* ```
|
|
443
444
|
*
|
|
444
445
|
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/modal.js
|
|
@@ -527,8 +528,9 @@ export interface PanelModal<
|
|
|
527
528
|
* Reloads the modal by closing and reopening at the same URL.
|
|
528
529
|
*
|
|
529
530
|
* @param options - Request options
|
|
531
|
+
* @returns False if no path exists, otherwise void
|
|
530
532
|
*/
|
|
531
|
-
reload: (options?: PanelRequestOptions) => Promise<void>;
|
|
533
|
+
reload: (options?: PanelRequestOptions) => Promise<void | false>;
|
|
532
534
|
|
|
533
535
|
/**
|
|
534
536
|
* Sets modal state, auto-generating an ID if not provided.
|
package/src/panel/features.d.ts
CHANGED
|
@@ -13,12 +13,12 @@ import type {
|
|
|
13
13
|
NotificationTheme,
|
|
14
14
|
NotificationType,
|
|
15
15
|
PanelEventCallback,
|
|
16
|
-
PanelEventListenerMap,
|
|
17
16
|
PanelEventListeners,
|
|
18
17
|
PanelFeature,
|
|
19
18
|
PanelFeatureDefaults,
|
|
20
19
|
PanelHistory,
|
|
21
20
|
PanelModal,
|
|
21
|
+
PanelModalListeners,
|
|
22
22
|
PanelRequestOptions,
|
|
23
23
|
PanelState,
|
|
24
24
|
} from "./base";
|
|
@@ -120,10 +120,10 @@ export interface PanelDrag extends PanelState<PanelDragDefaults> {
|
|
|
120
120
|
/**
|
|
121
121
|
* Starts a drag operation with type and data.
|
|
122
122
|
*
|
|
123
|
-
* @param type - Drag item type (e.g., `
|
|
124
|
-
* @param data - Associated data
|
|
123
|
+
* @param type - Drag item type (e.g., `"page"`, `"file"`)
|
|
124
|
+
* @param data - Associated data (string or object)
|
|
125
125
|
*/
|
|
126
|
-
start: (type: string, data: Record<string, any>) => void;
|
|
126
|
+
start: (type: string, data: string | Record<string, any>) => void;
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Stops the current drag operation and resets state.
|
|
@@ -197,7 +197,7 @@ export interface PanelTheme extends Omit<
|
|
|
197
197
|
* Default state for content language.
|
|
198
198
|
*/
|
|
199
199
|
export interface PanelLanguageDefaults {
|
|
200
|
-
/** Language code (e.g., `
|
|
200
|
+
/** Language code (e.g., `"en"`, `"de"`) */
|
|
201
201
|
code: string | null;
|
|
202
202
|
/** Whether this is the default language */
|
|
203
203
|
default: boolean;
|
|
@@ -218,7 +218,7 @@ export interface PanelLanguageDefaults {
|
|
|
218
218
|
* @since 4.0.0
|
|
219
219
|
*/
|
|
220
220
|
export interface PanelLanguage extends PanelState<PanelLanguageDefaults> {
|
|
221
|
-
/** Language code (e.g., `
|
|
221
|
+
/** Language code (e.g., `"en"`, `"de"`) */
|
|
222
222
|
code: string | null;
|
|
223
223
|
/** Whether this is the default language */
|
|
224
224
|
default: boolean;
|
|
@@ -284,9 +284,10 @@ export interface PanelMenu extends Omit<PanelState<PanelMenuDefaults>, "set"> {
|
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
286
|
* Handles outside clicks to close mobile menu.
|
|
287
|
+
* Returns false if not mobile/open, void otherwise.
|
|
287
288
|
* @internal
|
|
288
289
|
*/
|
|
289
|
-
blur: (event: Event) => void;
|
|
290
|
+
blur: (event: Event) => false | void;
|
|
290
291
|
|
|
291
292
|
/**
|
|
292
293
|
* Collapses the sidebar menu.
|
|
@@ -296,9 +297,10 @@ export interface PanelMenu extends Omit<PanelState<PanelMenuDefaults>, "set"> {
|
|
|
296
297
|
|
|
297
298
|
/**
|
|
298
299
|
* Handles escape key to close mobile menu.
|
|
300
|
+
* Returns false if not mobile/open, void otherwise.
|
|
299
301
|
* @internal
|
|
300
302
|
*/
|
|
301
|
-
escape: () => void;
|
|
303
|
+
escape: () => false | void;
|
|
302
304
|
|
|
303
305
|
/**
|
|
304
306
|
* Expands the sidebar menu.
|
|
@@ -429,12 +431,14 @@ export interface PanelNotification extends PanelState<PanelNotificationDefaults>
|
|
|
429
431
|
/**
|
|
430
432
|
* Creates an error notification.
|
|
431
433
|
* Opens error dialog in view context.
|
|
434
|
+
* May redirect to logout for auth errors.
|
|
432
435
|
*
|
|
433
436
|
* @param error - Error object, string, or Error instance
|
|
437
|
+
* @returns Notification state, or void if redirected
|
|
434
438
|
*/
|
|
435
439
|
error: (
|
|
436
440
|
error: Error | string | PanelErrorObject,
|
|
437
|
-
) => PanelNotificationDefaults;
|
|
441
|
+
) => PanelNotificationDefaults | void;
|
|
438
442
|
|
|
439
443
|
/**
|
|
440
444
|
* Creates a fatal error notification.
|
|
@@ -523,7 +527,7 @@ export interface PanelSystem extends PanelState<PanelSystemDefaults> {
|
|
|
523
527
|
* Default state for interface translation.
|
|
524
528
|
*/
|
|
525
529
|
export interface PanelTranslationDefaults {
|
|
526
|
-
/** Translation code (e.g., `
|
|
530
|
+
/** Translation code (e.g., `"en"`, `"de"`) */
|
|
527
531
|
code: string;
|
|
528
532
|
/** Translation strings by key */
|
|
529
533
|
data: Record<string, string>;
|
|
@@ -545,7 +549,7 @@ export interface PanelTranslationDefaults {
|
|
|
545
549
|
* @since 4.0.0
|
|
546
550
|
*/
|
|
547
551
|
export interface PanelTranslation extends PanelState<PanelTranslationDefaults> {
|
|
548
|
-
/** Translation code (e.g., `
|
|
552
|
+
/** Translation code (e.g., `"en"`, `"de"`) */
|
|
549
553
|
code: string;
|
|
550
554
|
/** Translation strings by key */
|
|
551
555
|
data: Record<string, string>;
|
|
@@ -645,6 +649,8 @@ export interface PanelViewDefaults extends PanelFeatureDefaults {
|
|
|
645
649
|
id: string | null;
|
|
646
650
|
/** View link */
|
|
647
651
|
link: string | null;
|
|
652
|
+
/** Relative path to this view */
|
|
653
|
+
path: string;
|
|
648
654
|
/** Default search type */
|
|
649
655
|
search: string;
|
|
650
656
|
/** View title */
|
|
@@ -674,6 +680,8 @@ export interface PanelView extends Omit<
|
|
|
674
680
|
id: string | null;
|
|
675
681
|
/** View link */
|
|
676
682
|
link: string | null;
|
|
683
|
+
/** Relative path to this view */
|
|
684
|
+
path: string;
|
|
677
685
|
/** Default search type */
|
|
678
686
|
search: string;
|
|
679
687
|
/** View title */
|
|
@@ -745,12 +753,13 @@ export interface PanelDropdown extends PanelFeature<PanelFeatureDefaults> {
|
|
|
745
753
|
|
|
746
754
|
/**
|
|
747
755
|
* Opens a dropdown asynchronously.
|
|
748
|
-
*
|
|
756
|
+
*
|
|
757
|
+
* @deprecated Since 4.0.0 - Use `open()` instead
|
|
749
758
|
*/
|
|
750
759
|
openAsync: (
|
|
751
760
|
dropdown: string | URL | Partial<PanelFeatureDefaults>,
|
|
752
761
|
options?: PanelRequestOptions | PanelEventCallback,
|
|
753
|
-
) => () => Promise<PanelFeatureDefaults>;
|
|
762
|
+
) => (ready?: () => void) => Promise<PanelFeatureDefaults>;
|
|
754
763
|
|
|
755
764
|
/**
|
|
756
765
|
* Returns dropdown options array from props.
|
|
@@ -812,13 +821,11 @@ export interface PanelDialog extends PanelModal<PanelDialogDefaults> {
|
|
|
812
821
|
|
|
813
822
|
/**
|
|
814
823
|
* Opens a legacy Vue component dialog.
|
|
815
|
-
*
|
|
824
|
+
*
|
|
825
|
+
* @param dialog - Vue component instance
|
|
826
|
+
* @deprecated Since 4.0.0 - Use `open()` with component object instead
|
|
816
827
|
*/
|
|
817
|
-
openComponent: (dialog:
|
|
818
|
-
component: string;
|
|
819
|
-
props?: Record<string, any>;
|
|
820
|
-
on?: PanelEventListenerMap;
|
|
821
|
-
}) => Promise<void>;
|
|
828
|
+
openComponent: (dialog: any) => Promise<PanelDialogDefaults>;
|
|
822
829
|
}
|
|
823
830
|
|
|
824
831
|
// -----------------------------------------------------------------------------
|
|
@@ -845,7 +852,7 @@ export interface PanelDrawer extends PanelModal<PanelDrawerDefaults> {
|
|
|
845
852
|
/** Breadcrumb from history milestones */
|
|
846
853
|
readonly breadcrumb: PanelHistory["milestones"];
|
|
847
854
|
|
|
848
|
-
/** Drawer icon, defaults to
|
|
855
|
+
/** Drawer icon, defaults to `"box"` */
|
|
849
856
|
readonly icon: string;
|
|
850
857
|
|
|
851
858
|
/**
|
|
@@ -860,8 +867,14 @@ export interface PanelDrawer extends PanelModal<PanelDrawerDefaults> {
|
|
|
860
867
|
* Switches drawer tabs.
|
|
861
868
|
*
|
|
862
869
|
* @param tab - Tab name to switch to
|
|
870
|
+
* @returns False if no tabs exist, void otherwise
|
|
871
|
+
*/
|
|
872
|
+
tab: (tab: string) => void | false;
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Returns drawer event listeners for Vue component binding.
|
|
863
876
|
*/
|
|
864
|
-
|
|
877
|
+
listeners: () => PanelModalListeners;
|
|
865
878
|
}
|
|
866
879
|
|
|
867
880
|
// -----------------------------------------------------------------------------
|
|
@@ -958,7 +971,7 @@ export interface PanelContent {
|
|
|
958
971
|
/**
|
|
959
972
|
* Emits a content event with environment context.
|
|
960
973
|
*
|
|
961
|
-
* @param event - Event name (prefixed with
|
|
974
|
+
* @param event - Event name (prefixed with `"content."`)
|
|
962
975
|
* @param options - Additional event data
|
|
963
976
|
* @param env - Environment context
|
|
964
977
|
*/
|
|
@@ -1142,7 +1155,7 @@ export interface PanelSearcher {
|
|
|
1142
1155
|
/**
|
|
1143
1156
|
* Opens the search dialog.
|
|
1144
1157
|
*
|
|
1145
|
-
* @param type - Search type (e.g., `
|
|
1158
|
+
* @param type - Search type (e.g., `"pages"`, `"files"`, `"users"`)
|
|
1146
1159
|
*/
|
|
1147
1160
|
open: (type?: string) => void;
|
|
1148
1161
|
|
|
@@ -1183,7 +1196,7 @@ export interface PanelUploadFile {
|
|
|
1183
1196
|
filename: string;
|
|
1184
1197
|
/** File size in bytes */
|
|
1185
1198
|
size: number;
|
|
1186
|
-
/** Formatted file size (e.g., `
|
|
1199
|
+
/** Formatted file size (e.g., `"1.2 MB"`) */
|
|
1187
1200
|
niceSize: string;
|
|
1188
1201
|
/** MIME type */
|
|
1189
1202
|
type: string;
|
|
@@ -1203,8 +1216,8 @@ export interface PanelUploadFile {
|
|
|
1203
1216
|
* Default state for upload feature.
|
|
1204
1217
|
*/
|
|
1205
1218
|
export interface PanelUploadDefaults {
|
|
1206
|
-
/**
|
|
1207
|
-
abort:
|
|
1219
|
+
/** AbortController for current upload */
|
|
1220
|
+
abort: AbortController | null;
|
|
1208
1221
|
/** Accepted file types */
|
|
1209
1222
|
accept: string;
|
|
1210
1223
|
/** Additional file attributes */
|
|
@@ -1234,8 +1247,8 @@ export interface PanelUploadDefaults {
|
|
|
1234
1247
|
*/
|
|
1235
1248
|
export interface PanelUpload
|
|
1236
1249
|
extends PanelState<PanelUploadDefaults>, PanelEventListeners {
|
|
1237
|
-
/**
|
|
1238
|
-
abort:
|
|
1250
|
+
/** AbortController for current upload */
|
|
1251
|
+
abort: AbortController | null;
|
|
1239
1252
|
/** Accepted file types */
|
|
1240
1253
|
accept: string;
|
|
1241
1254
|
/** Additional file attributes */
|
|
@@ -1276,10 +1289,12 @@ export interface PanelUpload
|
|
|
1276
1289
|
|
|
1277
1290
|
/**
|
|
1278
1291
|
* Finds duplicate file by comparing properties.
|
|
1292
|
+
* Returns the index of the duplicate file, or false if not found.
|
|
1279
1293
|
*
|
|
1280
1294
|
* @param file - File to check
|
|
1295
|
+
* @returns Index of duplicate file or false
|
|
1281
1296
|
*/
|
|
1282
|
-
findDuplicate: (file: File) =>
|
|
1297
|
+
findDuplicate: (file: File) => number | false;
|
|
1283
1298
|
|
|
1284
1299
|
/**
|
|
1285
1300
|
* Checks if file has a unique name.
|
|
@@ -1368,11 +1383,6 @@ export interface PanelUpload
|
|
|
1368
1383
|
// Events
|
|
1369
1384
|
// -----------------------------------------------------------------------------
|
|
1370
1385
|
|
|
1371
|
-
/**
|
|
1372
|
-
* Keychain modifier string (e.g., `'cmd.shift.s'`).
|
|
1373
|
-
*/
|
|
1374
|
-
export type PanelKeychain = string;
|
|
1375
|
-
|
|
1376
1386
|
/**
|
|
1377
1387
|
* Event emitter interface (mitt-compatible).
|
|
1378
1388
|
*/
|
|
@@ -1392,9 +1402,6 @@ export interface PanelEventEmitter {
|
|
|
1392
1402
|
* @since 4.0.0
|
|
1393
1403
|
*/
|
|
1394
1404
|
export interface PanelEvents extends PanelEventEmitter {
|
|
1395
|
-
/** Internal mitt emitter instance */
|
|
1396
|
-
emitter: PanelEventEmitter;
|
|
1397
|
-
|
|
1398
1405
|
/** Element that was entered during drag */
|
|
1399
1406
|
entered: Element | null;
|
|
1400
1407
|
|
|
@@ -1471,13 +1478,13 @@ export interface PanelEvents extends PanelEventEmitter {
|
|
|
1471
1478
|
focus: (event: FocusEvent) => void;
|
|
1472
1479
|
|
|
1473
1480
|
/**
|
|
1474
|
-
* Creates keychain modifier string.
|
|
1481
|
+
* Creates keychain modifier string (e.g., `"keydown.cmd.shift.s"`).
|
|
1475
1482
|
*
|
|
1476
1483
|
* @param type - Event type
|
|
1477
1484
|
* @param event - KeyboardEvent
|
|
1478
|
-
* @returns Keychain string
|
|
1485
|
+
* @returns Keychain string
|
|
1479
1486
|
*/
|
|
1480
|
-
keychain: (type: "keydown" | "keyup", event: KeyboardEvent) =>
|
|
1487
|
+
keychain: (type: "keydown" | "keyup", event: KeyboardEvent) => string;
|
|
1481
1488
|
|
|
1482
1489
|
/**
|
|
1483
1490
|
* Handles window keydown event.
|