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/index.d.ts
CHANGED
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* This is the main entry point for all Panel type definitions.
|
|
7
7
|
* Types are organized into modules for better maintainability:
|
|
8
8
|
*
|
|
9
|
-
* - `
|
|
10
|
-
* - `
|
|
11
|
-
* - `
|
|
12
|
-
* - `
|
|
13
|
-
* - `
|
|
9
|
+
* - `base.d.ts` - State, Feature, Modal, History, Event Listeners
|
|
10
|
+
* - `features.d.ts` - View, Dialog, Drawer, Dropdown, Notification, etc.
|
|
11
|
+
* - `helpers.d.ts` - $helper.* utilities
|
|
12
|
+
* - `libraries.d.ts` - $library.* (colors, dayjs, autosize)
|
|
13
|
+
* - `api.d.ts` - API client methods
|
|
14
|
+
* - `writer.d.ts` - Writer (ProseMirror) editor and extensions
|
|
15
|
+
* - `textarea.d.ts` - Textarea toolbar buttons
|
|
14
16
|
*
|
|
15
17
|
* @see https://github.com/getkirby/kirby/tree/main/panel/src/panel
|
|
16
18
|
* @since 4.0.0
|
|
@@ -26,56 +28,43 @@ import type {
|
|
|
26
28
|
import type * as PanelFeatures from "./features";
|
|
27
29
|
import type { PanelHelpers } from "./helpers";
|
|
28
30
|
import type { PanelLibrary } from "./libraries";
|
|
31
|
+
import type { TextareaButton } from "./textarea";
|
|
32
|
+
import type { WriterMarkExtension, WriterNodeExtension } from "./writer";
|
|
29
33
|
|
|
30
34
|
// =============================================================================
|
|
31
|
-
// Re-exports from
|
|
35
|
+
// Re-exports from api.d.ts
|
|
32
36
|
// =============================================================================
|
|
33
37
|
|
|
34
38
|
export type {
|
|
35
|
-
// Request Types
|
|
36
|
-
PanelApiRequestOptions,
|
|
37
|
-
PanelApiPagination,
|
|
38
|
-
PanelApiSearchQuery,
|
|
39
39
|
// Auth
|
|
40
|
-
PanelApiLoginData,
|
|
41
40
|
PanelApiAuth,
|
|
42
41
|
// Files
|
|
43
42
|
PanelApiFiles,
|
|
44
43
|
// Languages
|
|
45
|
-
PanelApiLanguageData,
|
|
46
44
|
PanelApiLanguages,
|
|
47
45
|
// Pages
|
|
48
|
-
PanelApiPageCreateData,
|
|
49
|
-
PanelApiPageDuplicateOptions,
|
|
50
46
|
PanelApiPages,
|
|
51
47
|
// Roles
|
|
52
48
|
PanelApiRoles,
|
|
53
49
|
// Site
|
|
54
50
|
PanelApiSite,
|
|
55
51
|
// System
|
|
56
|
-
PanelApiSystemInstallData,
|
|
57
|
-
PanelApiSystemRegisterData,
|
|
58
52
|
PanelApiSystem,
|
|
59
53
|
// Translations
|
|
60
54
|
PanelApiTranslations,
|
|
61
55
|
// Users
|
|
62
|
-
PanelApiUserCreateData,
|
|
63
56
|
PanelApiUsers,
|
|
64
57
|
// Main API Interface
|
|
65
58
|
PanelApi,
|
|
66
59
|
} from "./api";
|
|
67
60
|
|
|
68
61
|
// =============================================================================
|
|
69
|
-
// Re-exports from
|
|
62
|
+
// Re-exports from base.d.ts
|
|
70
63
|
// =============================================================================
|
|
71
64
|
|
|
72
65
|
export type {
|
|
73
66
|
// State Management
|
|
74
67
|
PanelState,
|
|
75
|
-
PanelStateBase,
|
|
76
|
-
PanelFeatureBase,
|
|
77
|
-
PanelModalBase,
|
|
78
|
-
PanelHistoryBase,
|
|
79
68
|
// Event Listeners
|
|
80
69
|
PanelEventCallback,
|
|
81
70
|
PanelEventListenerMap,
|
|
@@ -102,55 +91,43 @@ export type {
|
|
|
102
91
|
} from "./base";
|
|
103
92
|
|
|
104
93
|
// =============================================================================
|
|
105
|
-
// Re-exports from
|
|
94
|
+
// Re-exports from features.d.ts
|
|
106
95
|
// =============================================================================
|
|
107
96
|
|
|
108
97
|
export type {
|
|
109
98
|
// Timer
|
|
110
99
|
PanelTimer,
|
|
111
100
|
// Activation
|
|
112
|
-
PanelActivationDefaults,
|
|
113
101
|
PanelActivation,
|
|
114
102
|
// Drag
|
|
115
|
-
PanelDragDefaults,
|
|
116
103
|
PanelDrag,
|
|
117
104
|
// Theme
|
|
118
|
-
PanelThemeDefaults,
|
|
119
105
|
PanelThemeValue,
|
|
120
106
|
PanelTheme,
|
|
121
107
|
// Language
|
|
122
|
-
PanelLanguageDefaults,
|
|
123
108
|
PanelLanguage,
|
|
124
109
|
// Menu
|
|
125
110
|
PanelMenuEntry,
|
|
126
|
-
PanelMenuDefaults,
|
|
127
111
|
PanelMenu,
|
|
128
112
|
// Notification
|
|
129
|
-
PanelNotificationDefaults,
|
|
130
113
|
PanelNotificationOptions,
|
|
131
114
|
PanelErrorObject,
|
|
132
115
|
PanelNotification,
|
|
133
116
|
// System
|
|
134
|
-
PanelSystemDefaults,
|
|
135
117
|
PanelSystem,
|
|
136
118
|
// Translation
|
|
137
|
-
PanelTranslationDefaults,
|
|
138
119
|
PanelTranslation,
|
|
139
120
|
// User
|
|
140
|
-
PanelUserDefaults,
|
|
141
121
|
PanelUser,
|
|
142
122
|
// View
|
|
143
123
|
PanelBreadcrumbItem,
|
|
144
|
-
PanelViewDefaults,
|
|
145
124
|
PanelView,
|
|
146
125
|
// Dropdown
|
|
147
126
|
PanelDropdownOption,
|
|
148
127
|
PanelDropdown,
|
|
149
128
|
// Dialog
|
|
150
|
-
PanelDialogDefaults,
|
|
151
129
|
PanelDialog,
|
|
152
130
|
// Drawer
|
|
153
|
-
PanelDrawerDefaults,
|
|
154
131
|
PanelDrawer,
|
|
155
132
|
// Content
|
|
156
133
|
PanelContentVersion,
|
|
@@ -165,100 +142,61 @@ export type {
|
|
|
165
142
|
PanelSearcher,
|
|
166
143
|
// Upload
|
|
167
144
|
PanelUploadFile,
|
|
168
|
-
PanelUploadDefaults,
|
|
169
145
|
PanelUpload,
|
|
170
146
|
// Events
|
|
171
|
-
PanelKeychain,
|
|
172
147
|
PanelEventEmitter,
|
|
173
148
|
PanelEvents,
|
|
174
149
|
} from "./features";
|
|
175
150
|
|
|
176
151
|
// =============================================================================
|
|
177
|
-
// Re-exports from
|
|
152
|
+
// Re-exports from helpers.d.ts
|
|
178
153
|
// =============================================================================
|
|
179
154
|
|
|
180
155
|
export type {
|
|
181
|
-
// Array
|
|
182
|
-
PanelArraySearchOptions,
|
|
183
|
-
PanelHelpersArray,
|
|
184
|
-
// String
|
|
185
|
-
PanelSlugRules,
|
|
186
|
-
PanelHelpersString,
|
|
187
|
-
// Object
|
|
188
|
-
PanelHelpersObject,
|
|
189
|
-
// URL
|
|
190
|
-
PanelHelpersUrl,
|
|
191
|
-
// Clipboard
|
|
192
|
-
PanelHelpersClipboard,
|
|
193
|
-
// Embed
|
|
194
|
-
PanelHelpersEmbed,
|
|
195
|
-
// Field
|
|
196
|
-
PanelFieldDefinition,
|
|
197
|
-
PanelHelpersField,
|
|
198
|
-
// File
|
|
199
|
-
PanelHelpersFile,
|
|
200
|
-
// Keyboard
|
|
201
|
-
PanelHelpersKeyboard,
|
|
202
|
-
// Link
|
|
203
|
-
PanelLinkType,
|
|
204
|
-
PanelLinkDetection,
|
|
205
|
-
PanelLinkPreview,
|
|
206
|
-
PanelHelpersLink,
|
|
207
|
-
// Page
|
|
208
|
-
PanelPageStatusProps,
|
|
209
|
-
PanelHelpersPage,
|
|
210
|
-
// Upload
|
|
211
|
-
PanelUploadProgressCallback,
|
|
212
|
-
PanelUploadCompleteCallback,
|
|
213
|
-
PanelUploadParams,
|
|
214
|
-
// Utility Types
|
|
215
|
-
PanelDebounceOptions,
|
|
216
|
-
PanelThrottleOptions,
|
|
217
|
-
PanelDebouncedFunction,
|
|
218
|
-
PanelSortOptions,
|
|
219
|
-
PanelComparator,
|
|
220
156
|
// Main Helpers Interface
|
|
221
157
|
PanelHelpers,
|
|
222
158
|
} from "./helpers";
|
|
223
159
|
|
|
224
160
|
// =============================================================================
|
|
225
|
-
// Re-exports from
|
|
161
|
+
// Re-exports from libraries.d.ts
|
|
226
162
|
// =============================================================================
|
|
227
163
|
|
|
228
164
|
export type {
|
|
229
|
-
// Color Types
|
|
230
|
-
PanelColorFormat,
|
|
231
|
-
PanelColorRGB,
|
|
232
|
-
PanelColorHSL,
|
|
233
|
-
PanelColorHSV,
|
|
234
|
-
PanelColorObject,
|
|
235
|
-
PanelColorInput,
|
|
236
|
-
PanelLibraryColors,
|
|
237
|
-
// Dayjs Types
|
|
238
|
-
PanelDayjsISOFormat,
|
|
239
|
-
PanelDayjsPatternPart,
|
|
240
|
-
PanelDayjsPattern,
|
|
241
|
-
PanelDayjsInstance,
|
|
242
|
-
PanelDayjsInput,
|
|
243
|
-
PanelDayjsUnit,
|
|
244
|
-
PanelLibraryDayjs,
|
|
245
|
-
// Autosize
|
|
246
|
-
PanelLibraryAutosize,
|
|
247
165
|
// Main Library Interface
|
|
248
166
|
PanelLibrary,
|
|
249
167
|
} from "./libraries";
|
|
250
168
|
|
|
251
169
|
// =============================================================================
|
|
252
|
-
// Re-exports from
|
|
170
|
+
// Re-exports from textarea.d.ts
|
|
253
171
|
// =============================================================================
|
|
254
172
|
|
|
255
173
|
export type {
|
|
174
|
+
// Textarea Toolbar
|
|
175
|
+
TextareaButton,
|
|
176
|
+
TextareaToolbarContext,
|
|
177
|
+
} from "./textarea";
|
|
178
|
+
|
|
179
|
+
// =============================================================================
|
|
180
|
+
// Re-exports from writer.d.ts
|
|
181
|
+
// =============================================================================
|
|
182
|
+
|
|
183
|
+
export type {
|
|
184
|
+
// Writer Editor
|
|
185
|
+
WriterEditor,
|
|
186
|
+
// Writer Toolbar
|
|
187
|
+
WriterToolbarButton,
|
|
256
188
|
// Writer Utilities
|
|
257
189
|
WriterUtils,
|
|
258
190
|
// Writer Contexts
|
|
259
191
|
WriterMarkContext,
|
|
260
192
|
WriterNodeContext,
|
|
261
193
|
WriterExtensionContext,
|
|
194
|
+
// Writer Schemas
|
|
195
|
+
WriterMarkSchema,
|
|
196
|
+
WriterNodeSchema,
|
|
197
|
+
// Writer Extensions
|
|
198
|
+
WriterMarkExtension,
|
|
199
|
+
WriterNodeExtension,
|
|
262
200
|
} from "./writer";
|
|
263
201
|
|
|
264
202
|
// =============================================================================
|
|
@@ -275,27 +213,21 @@ export type {
|
|
|
275
213
|
* @example
|
|
276
214
|
* ```ts
|
|
277
215
|
* // In a Vue component
|
|
278
|
-
* const slug = this.$helper.slug(
|
|
279
|
-
* const date = this.$library.dayjs(
|
|
216
|
+
* const slug = this.$helper.slug("My Page Title");
|
|
217
|
+
* const date = this.$library.dayjs("2024-01-15").format("DD.MM.YYYY");
|
|
280
218
|
* ```
|
|
281
219
|
*/
|
|
282
220
|
export type PanelApp = InstanceType<VueConstructor> & {
|
|
283
221
|
$library: PanelLibrary;
|
|
284
222
|
$helper: PanelHelpers;
|
|
223
|
+
/** Shortcut for escaping HTML (alias for `$helper.string.escapeHTML`) */
|
|
224
|
+
$esc: (string: string) => string;
|
|
285
225
|
};
|
|
286
226
|
|
|
287
227
|
// =============================================================================
|
|
288
228
|
// Panel Configuration
|
|
289
229
|
// =============================================================================
|
|
290
230
|
|
|
291
|
-
/**
|
|
292
|
-
* Panel API configuration.
|
|
293
|
-
*/
|
|
294
|
-
export interface PanelConfigApi {
|
|
295
|
-
/** Whether to use method override for PUT/PATCH/DELETE */
|
|
296
|
-
methodOverride: boolean;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
231
|
/**
|
|
300
232
|
* Global Panel configuration.
|
|
301
233
|
*
|
|
@@ -303,7 +235,10 @@ export interface PanelConfigApi {
|
|
|
303
235
|
*/
|
|
304
236
|
export interface PanelConfig {
|
|
305
237
|
/** API configuration */
|
|
306
|
-
api:
|
|
238
|
+
api: {
|
|
239
|
+
/** Whether to use method override for PUT/PATCH/DELETE */
|
|
240
|
+
methodOverride: boolean;
|
|
241
|
+
};
|
|
307
242
|
/** Whether debug mode is enabled */
|
|
308
243
|
debug: boolean;
|
|
309
244
|
/** Whether KirbyText is enabled */
|
|
@@ -323,7 +258,7 @@ export interface PanelConfig {
|
|
|
323
258
|
/**
|
|
324
259
|
* Access permissions for Panel areas.
|
|
325
260
|
*/
|
|
326
|
-
|
|
261
|
+
interface PanelPermissionsAccess {
|
|
327
262
|
account: boolean;
|
|
328
263
|
languages: boolean;
|
|
329
264
|
panel: boolean;
|
|
@@ -335,7 +270,7 @@ export interface PanelPermissionsAccess {
|
|
|
335
270
|
/**
|
|
336
271
|
* File operation permissions.
|
|
337
272
|
*/
|
|
338
|
-
|
|
273
|
+
interface PanelPermissionsFiles {
|
|
339
274
|
access: boolean;
|
|
340
275
|
changeName: boolean;
|
|
341
276
|
changeTemplate: boolean;
|
|
@@ -351,7 +286,7 @@ export interface PanelPermissionsFiles {
|
|
|
351
286
|
/**
|
|
352
287
|
* Language operation permissions.
|
|
353
288
|
*/
|
|
354
|
-
|
|
289
|
+
interface PanelPermissionsLanguages {
|
|
355
290
|
create: boolean;
|
|
356
291
|
delete: boolean;
|
|
357
292
|
update: boolean;
|
|
@@ -360,7 +295,7 @@ export interface PanelPermissionsLanguages {
|
|
|
360
295
|
/**
|
|
361
296
|
* Page operation permissions.
|
|
362
297
|
*/
|
|
363
|
-
|
|
298
|
+
interface PanelPermissionsPages {
|
|
364
299
|
access: boolean;
|
|
365
300
|
changeSlug: boolean;
|
|
366
301
|
changeStatus: boolean;
|
|
@@ -380,7 +315,7 @@ export interface PanelPermissionsPages {
|
|
|
380
315
|
/**
|
|
381
316
|
* Site operation permissions.
|
|
382
317
|
*/
|
|
383
|
-
|
|
318
|
+
interface PanelPermissionsSite {
|
|
384
319
|
changeTitle: boolean;
|
|
385
320
|
update: boolean;
|
|
386
321
|
}
|
|
@@ -388,7 +323,7 @@ export interface PanelPermissionsSite {
|
|
|
388
323
|
/**
|
|
389
324
|
* User management permissions (for other users).
|
|
390
325
|
*/
|
|
391
|
-
|
|
326
|
+
interface PanelPermissionsUsers {
|
|
392
327
|
changeEmail: boolean;
|
|
393
328
|
changeLanguage: boolean;
|
|
394
329
|
changeName: boolean;
|
|
@@ -402,7 +337,7 @@ export interface PanelPermissionsUsers {
|
|
|
402
337
|
/**
|
|
403
338
|
* Current user permissions (for own account).
|
|
404
339
|
*/
|
|
405
|
-
|
|
340
|
+
interface PanelPermissionsUser {
|
|
406
341
|
changeEmail: boolean;
|
|
407
342
|
changeLanguage: boolean;
|
|
408
343
|
changeName: boolean;
|
|
@@ -468,96 +403,117 @@ export interface PanelUrls {
|
|
|
468
403
|
}
|
|
469
404
|
|
|
470
405
|
// =============================================================================
|
|
471
|
-
// Panel
|
|
406
|
+
// Panel Request Response
|
|
472
407
|
// =============================================================================
|
|
473
408
|
|
|
474
409
|
/**
|
|
475
|
-
*
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
export type PanelPluginsWriterNodes = Record<string, Record<string, any>>;
|
|
410
|
+
* Response object from Panel requests.
|
|
411
|
+
*
|
|
412
|
+
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/request.js
|
|
413
|
+
*/
|
|
414
|
+
export interface PanelRequestResponse {
|
|
415
|
+
/** The original Request object */
|
|
416
|
+
request: Request;
|
|
417
|
+
/** The parsed response */
|
|
418
|
+
response: {
|
|
419
|
+
/** Parsed JSON data */
|
|
420
|
+
json: any;
|
|
421
|
+
/** Raw response text */
|
|
422
|
+
text: string;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
491
425
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
export type PanelPluginsViews = Record<string, Record<string, any>>;
|
|
426
|
+
// =============================================================================
|
|
427
|
+
// Panel Plugins
|
|
428
|
+
// =============================================================================
|
|
496
429
|
|
|
497
430
|
/**
|
|
498
431
|
* Panel plugin system.
|
|
499
432
|
*
|
|
500
433
|
* Manages Vue components, icons, and extensions registered by plugins.
|
|
434
|
+
* Properties are ordered to match `panel/public/js/plugins.js`.
|
|
501
435
|
*
|
|
502
436
|
* @see https://getkirby.com/docs/reference/plugins/extensions
|
|
503
437
|
*/
|
|
504
438
|
export interface PanelPlugins {
|
|
439
|
+
// ---------------------------------------------------------------------------
|
|
440
|
+
// Helper Functions (from panel/src/panel/plugins.js)
|
|
441
|
+
// ---------------------------------------------------------------------------
|
|
442
|
+
|
|
505
443
|
/**
|
|
506
|
-
* Resolves component
|
|
444
|
+
* Resolves a component extension if defined as component name.
|
|
445
|
+
*
|
|
446
|
+
* @param app - Vue application instance
|
|
447
|
+
* @param name - Component name being registered
|
|
448
|
+
* @param component - Component options object
|
|
449
|
+
* @returns Updated/extended component options
|
|
507
450
|
*/
|
|
508
|
-
resolveComponentExtension: (
|
|
509
|
-
name: string,
|
|
510
|
-
extension: string,
|
|
511
|
-
fallback?: any,
|
|
512
|
-
) => any;
|
|
451
|
+
resolveComponentExtension: (app: any, name: string, component: any) => any;
|
|
513
452
|
|
|
514
453
|
/**
|
|
515
|
-
* Resolves
|
|
454
|
+
* Resolves available mixins if they are defined.
|
|
455
|
+
*
|
|
456
|
+
* @param component - Component options object
|
|
457
|
+
* @returns Updated component options with resolved mixins
|
|
516
458
|
*/
|
|
517
|
-
resolveComponentMixins: (
|
|
459
|
+
resolveComponentMixins: (component: any) => any;
|
|
518
460
|
|
|
519
461
|
/**
|
|
520
|
-
* Resolves
|
|
462
|
+
* Resolves a component's competing template/render options.
|
|
463
|
+
*
|
|
464
|
+
* @param component - Component options object
|
|
465
|
+
* @returns Updated component options
|
|
521
466
|
*/
|
|
522
|
-
resolveComponentRender: (
|
|
467
|
+
resolveComponentRender: (component: any) => any;
|
|
468
|
+
|
|
469
|
+
// ---------------------------------------------------------------------------
|
|
470
|
+
// Plugin Data (ordered as in panel/public/js/plugins.js)
|
|
471
|
+
// ---------------------------------------------------------------------------
|
|
523
472
|
|
|
524
473
|
/** Registered Vue components */
|
|
525
474
|
components: Record<string, ComponentPublicInstance>;
|
|
526
475
|
|
|
527
|
-
/**
|
|
528
|
-
created:
|
|
476
|
+
/** Callbacks to run after Panel creation */
|
|
477
|
+
created: (() => void)[];
|
|
529
478
|
|
|
530
479
|
/** Registered SVG icons */
|
|
531
480
|
icons: Record<string, string>;
|
|
532
481
|
|
|
533
|
-
/** Custom login component */
|
|
482
|
+
/** Custom login component (set dynamically by plugins) */
|
|
534
483
|
login: ComponentPublicInstance | null;
|
|
535
484
|
|
|
536
|
-
/**
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
/** Third-party plugin data */
|
|
540
|
-
thirdParty: PanelPluginsThirdParty;
|
|
485
|
+
/** Registered Panel routes */
|
|
486
|
+
routes: Record<string, any>[];
|
|
541
487
|
|
|
542
488
|
/**
|
|
543
|
-
*
|
|
489
|
+
* Registered textarea toolbar buttons.
|
|
490
|
+
* @see https://getkirby.com/docs/reference/plugins/extensions/textarea-buttons
|
|
544
491
|
*/
|
|
545
|
-
|
|
492
|
+
textareaButtons: Record<string, TextareaButton>;
|
|
546
493
|
|
|
547
|
-
/**
|
|
548
|
-
|
|
494
|
+
/** Registered third-party plugin data */
|
|
495
|
+
thirdParty: Record<string, any>;
|
|
549
496
|
|
|
550
|
-
/**
|
|
551
|
-
|
|
497
|
+
/** Installed Vue plugins via `Vue.use()` */
|
|
498
|
+
use: any[];
|
|
552
499
|
|
|
553
|
-
/**
|
|
554
|
-
|
|
500
|
+
/** Registered view buttons */
|
|
501
|
+
viewButtons: Record<string, ComponentPublicInstance | Record<string, any>>;
|
|
555
502
|
|
|
556
|
-
/**
|
|
557
|
-
|
|
503
|
+
/** Registered Panel views */
|
|
504
|
+
views: Record<string, Record<string, any>>;
|
|
558
505
|
|
|
559
|
-
/**
|
|
560
|
-
|
|
506
|
+
/**
|
|
507
|
+
* Registered writer marks.
|
|
508
|
+
* @see https://getkirby.com/docs/reference/plugins/extensions/writer-marks
|
|
509
|
+
*/
|
|
510
|
+
writerMarks: Record<string, WriterMarkExtension>;
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Registered writer nodes.
|
|
514
|
+
* @see https://getkirby.com/docs/reference/plugins/extensions/writer-nodes
|
|
515
|
+
*/
|
|
516
|
+
writerNodes: Record<string, WriterNodeExtension>;
|
|
561
517
|
}
|
|
562
518
|
|
|
563
519
|
// =============================================================================
|
|
@@ -568,7 +524,7 @@ export interface PanelPlugins {
|
|
|
568
524
|
* Language information for multi-language sites.
|
|
569
525
|
*/
|
|
570
526
|
export interface PanelLanguageInfo {
|
|
571
|
-
/** Language code (e.g., `
|
|
527
|
+
/** Language code (e.g., `"en"`, `"de"`) */
|
|
572
528
|
code: string;
|
|
573
529
|
/** Whether this is the default language */
|
|
574
530
|
default: boolean;
|
|
@@ -589,7 +545,6 @@ export interface PanelLanguageInfo {
|
|
|
589
545
|
*/
|
|
590
546
|
export interface PanelGlobalState {
|
|
591
547
|
activation: PanelFeatures.PanelActivationDefaults;
|
|
592
|
-
content: Record<string, any>;
|
|
593
548
|
dialog: PanelFeatures.PanelDialogDefaults;
|
|
594
549
|
drag: PanelFeatures.PanelDragDefaults;
|
|
595
550
|
drawer: PanelFeatures.PanelDrawerDefaults;
|
|
@@ -620,13 +575,13 @@ export interface PanelGlobalState {
|
|
|
620
575
|
* const panel = window.$panel;
|
|
621
576
|
*
|
|
622
577
|
* // Navigate to a page
|
|
623
|
-
* await panel.view.open(
|
|
578
|
+
* await panel.view.open("/pages/home");
|
|
624
579
|
*
|
|
625
580
|
* // Open a dialog
|
|
626
|
-
* await panel.dialog.open(
|
|
581
|
+
* await panel.dialog.open("/dialogs/pages/create");
|
|
627
582
|
*
|
|
628
583
|
* // Make an API request
|
|
629
|
-
* const data = await panel.get(
|
|
584
|
+
* const data = await panel.get("/api/pages/home");
|
|
630
585
|
* ```
|
|
631
586
|
*
|
|
632
587
|
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/panel.js
|
|
@@ -775,8 +730,12 @@ export interface Panel {
|
|
|
775
730
|
*
|
|
776
731
|
* @param error - Error or message
|
|
777
732
|
* @param openNotification - Whether to show notification (default: true)
|
|
733
|
+
* @returns Notification state if opened, void otherwise
|
|
778
734
|
*/
|
|
779
|
-
error: (
|
|
735
|
+
error: (
|
|
736
|
+
error: Error | string,
|
|
737
|
+
openNotification?: boolean,
|
|
738
|
+
) => void | PanelFeatures.PanelNotificationDefaults;
|
|
780
739
|
|
|
781
740
|
/**
|
|
782
741
|
* Sends a GET request through the Panel router.
|
|
@@ -788,26 +747,29 @@ export interface Panel {
|
|
|
788
747
|
get: (url: string | URL, options?: PanelRequestOptions) => Promise<any>;
|
|
789
748
|
|
|
790
749
|
/**
|
|
791
|
-
* Opens a URL through the Panel router.
|
|
750
|
+
* Opens a URL through the Panel router and sets the state.
|
|
751
|
+
*
|
|
752
|
+
* Unlike `get()`, this method also updates the Panel state
|
|
753
|
+
* based on the response.
|
|
792
754
|
*
|
|
793
|
-
* @param url - URL to open
|
|
755
|
+
* @param url - URL to open or state object
|
|
794
756
|
* @param options - Request options
|
|
757
|
+
* @returns The new Panel state
|
|
795
758
|
*/
|
|
796
|
-
open: (
|
|
759
|
+
open: (
|
|
760
|
+
url: string | URL | Partial<PanelGlobalState>,
|
|
761
|
+
options?: PanelRequestOptions,
|
|
762
|
+
) => Promise<PanelGlobalState>;
|
|
797
763
|
|
|
798
764
|
/**
|
|
799
|
-
* Returns all open overlay
|
|
765
|
+
* Returns all open overlay types.
|
|
800
766
|
*
|
|
801
|
-
*
|
|
802
|
-
|
|
803
|
-
overlays: () => PanelContext[];
|
|
804
|
-
|
|
805
|
-
/**
|
|
806
|
-
* Registers a plugin or plugin module.
|
|
767
|
+
* Returns an array of currently open overlays in order.
|
|
768
|
+
* Only includes "drawer" and "dialog" - the view is not an overlay.
|
|
807
769
|
*
|
|
808
|
-
* @
|
|
770
|
+
* @returns Array of open overlay types
|
|
809
771
|
*/
|
|
810
|
-
|
|
772
|
+
overlays: () => ("drawer" | "dialog")[];
|
|
811
773
|
|
|
812
774
|
/**
|
|
813
775
|
* Sends a POST request through the Panel router.
|
|
@@ -840,28 +802,39 @@ export interface Panel {
|
|
|
840
802
|
/**
|
|
841
803
|
* Sends a request through the Panel router.
|
|
842
804
|
*
|
|
805
|
+
* Returns an object with both the request and parsed response,
|
|
806
|
+
* or `false` if the request was redirected externally.
|
|
807
|
+
*
|
|
843
808
|
* @param url - URL to request
|
|
844
809
|
* @param options - Request options including method
|
|
845
|
-
* @returns
|
|
810
|
+
* @returns Request/response object or false on redirect
|
|
846
811
|
*/
|
|
847
812
|
request: (
|
|
848
813
|
url: string | URL,
|
|
849
814
|
options?: PanelRequestOptions,
|
|
850
|
-
) => Promise<
|
|
815
|
+
) => Promise<PanelRequestResponse | false>;
|
|
851
816
|
|
|
852
817
|
/**
|
|
853
|
-
*
|
|
818
|
+
* Opens the search dialog or performs a search query.
|
|
854
819
|
*
|
|
855
|
-
*
|
|
856
|
-
*
|
|
857
|
-
*
|
|
858
|
-
*
|
|
820
|
+
* When called without a query, opens the search dialog
|
|
821
|
+
* with the specified search type pre-selected.
|
|
822
|
+
*
|
|
823
|
+
* When called with a query, performs the search and returns results.
|
|
824
|
+
*
|
|
825
|
+
* @param type - Search type (`"pages"`, `"files"`, `"users"`)
|
|
826
|
+
* @param query - Search query string
|
|
827
|
+
* @param options - Search options (page, limit)
|
|
828
|
+
* @returns Search results when query provided, void otherwise
|
|
859
829
|
*/
|
|
860
|
-
search:
|
|
861
|
-
type: string
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
830
|
+
search: {
|
|
831
|
+
(type: string): void;
|
|
832
|
+
(
|
|
833
|
+
type: string,
|
|
834
|
+
query: string,
|
|
835
|
+
options?: PanelFeatures.PanelSearchOptions,
|
|
836
|
+
): Promise<PanelFeatures.PanelSearchResult>;
|
|
837
|
+
};
|
|
865
838
|
|
|
866
839
|
/**
|
|
867
840
|
* Sets global Panel state.
|
|
@@ -904,7 +877,7 @@ export interface Panel {
|
|
|
904
877
|
/**
|
|
905
878
|
* Lock information for content.
|
|
906
879
|
*/
|
|
907
|
-
|
|
880
|
+
interface PanelViewPropsLockUser {
|
|
908
881
|
id: string;
|
|
909
882
|
email: string;
|
|
910
883
|
}
|
|
@@ -912,7 +885,7 @@ export interface PanelViewPropsLockUser {
|
|
|
912
885
|
/**
|
|
913
886
|
* Content lock state.
|
|
914
887
|
*/
|
|
915
|
-
|
|
888
|
+
interface PanelViewPropsLock {
|
|
916
889
|
isLegacy: boolean;
|
|
917
890
|
isLocked: boolean;
|
|
918
891
|
modified: string | null;
|
|
@@ -922,7 +895,7 @@ export interface PanelViewPropsLock {
|
|
|
922
895
|
/**
|
|
923
896
|
* Content permissions for a view.
|
|
924
897
|
*/
|
|
925
|
-
|
|
898
|
+
interface PanelViewPropsPermissions {
|
|
926
899
|
access: boolean;
|
|
927
900
|
changeSlug: boolean;
|
|
928
901
|
changeStatus: boolean;
|
|
@@ -942,7 +915,7 @@ export interface PanelViewPropsPermissions {
|
|
|
942
915
|
/**
|
|
943
916
|
* Version information.
|
|
944
917
|
*/
|
|
945
|
-
|
|
918
|
+
interface PanelViewPropsVersions {
|
|
946
919
|
latest: Record<string, any>;
|
|
947
920
|
changes: Record<string, any>;
|
|
948
921
|
}
|
|
@@ -950,10 +923,10 @@ export interface PanelViewPropsVersions {
|
|
|
950
923
|
/**
|
|
951
924
|
* Tab definition.
|
|
952
925
|
*/
|
|
953
|
-
|
|
926
|
+
interface PanelViewPropsTab {
|
|
954
927
|
label: string;
|
|
955
928
|
icon: string;
|
|
956
|
-
columns:
|
|
929
|
+
columns: Record<string, any>[];
|
|
957
930
|
link: string;
|
|
958
931
|
name: string;
|
|
959
932
|
}
|
|
@@ -961,7 +934,7 @@ export interface PanelViewPropsTab {
|
|
|
961
934
|
/**
|
|
962
935
|
* Navigation link (next/prev).
|
|
963
936
|
*/
|
|
964
|
-
|
|
937
|
+
interface PanelViewPropsNavigation {
|
|
965
938
|
link: string;
|
|
966
939
|
title: string;
|
|
967
940
|
}
|
|
@@ -969,7 +942,7 @@ export interface PanelViewPropsNavigation {
|
|
|
969
942
|
/**
|
|
970
943
|
* Model information.
|
|
971
944
|
*/
|
|
972
|
-
|
|
945
|
+
interface PanelViewPropsModel {
|
|
973
946
|
id: string;
|
|
974
947
|
link: string;
|
|
975
948
|
parent: string;
|
|
@@ -982,7 +955,7 @@ export interface PanelViewPropsModel {
|
|
|
982
955
|
/**
|
|
983
956
|
* Button definition.
|
|
984
957
|
*/
|
|
985
|
-
|
|
958
|
+
interface PanelViewPropsButton {
|
|
986
959
|
component: string;
|
|
987
960
|
key: string;
|
|
988
961
|
props: {
|
|
@@ -1009,7 +982,7 @@ export interface PanelViewProps {
|
|
|
1009
982
|
link: string;
|
|
1010
983
|
lock: PanelViewPropsLock;
|
|
1011
984
|
permissions: PanelViewPropsPermissions;
|
|
1012
|
-
tabs:
|
|
985
|
+
tabs: Record<string, any>[];
|
|
1013
986
|
uuid: string;
|
|
1014
987
|
versions: PanelViewPropsVersions;
|
|
1015
988
|
tab: PanelViewPropsTab;
|