kirby-types 1.4.7 → 1.4.9

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.
@@ -224,6 +224,8 @@ export type {
224
224
  * const slug = this.$helper.slug("My Page Title");
225
225
  * const date = this.$library.dayjs("2024-01-15").format("DD.MM.YYYY");
226
226
  * ```
227
+ * @source panel/src/panel/app.js
228
+ * @source panel/src/index.js
227
229
  */
228
230
  export type PanelApp = InstanceType<VueConstructor> & {
229
231
  $library: PanelLibrary;
@@ -242,6 +244,7 @@ export type PanelApp = InstanceType<VueConstructor> & {
242
244
  * Components can be defined as:
243
245
  * - Vue component options object with template or render function
244
246
  * - Component that extends another component by name
247
+ * @source panel/src/panel/plugins.js
245
248
  */
246
249
  export type PanelComponentExtension =
247
250
  | DefineComponent<any, any, any, any, any, any, any, any, any, any, any>
@@ -280,6 +283,8 @@ export type PanelComponentExtension =
280
283
  * Global Panel configuration.
281
284
  *
282
285
  * @see https://github.com/getkirby/kirby/blob/main/panel/src/config/config.js
286
+ * @source panel/src/panel/panel.js
287
+ * @source src/Panel/View.php
283
288
  */
284
289
  export interface PanelConfig {
285
290
  /** API configuration */
@@ -305,6 +310,8 @@ export interface PanelConfig {
305
310
 
306
311
  /**
307
312
  * Access permissions for Panel areas.
313
+ * @source src/Cms/Permissions.php
314
+ * @source src/Cms/UserPermissions.php
308
315
  */
309
316
  interface PanelPermissionsAccess {
310
317
  account: boolean;
@@ -317,6 +324,8 @@ interface PanelPermissionsAccess {
317
324
 
318
325
  /**
319
326
  * File operation permissions.
327
+ * @source src/Cms/Permissions.php
328
+ * @source src/Cms/FilePermissions.php
320
329
  */
321
330
  interface PanelPermissionsFiles {
322
331
  access: boolean;
@@ -333,6 +342,8 @@ interface PanelPermissionsFiles {
333
342
 
334
343
  /**
335
344
  * Language operation permissions.
345
+ * @source src/Cms/Permissions.php
346
+ * @source src/Cms/LanguagePermissions.php
336
347
  */
337
348
  interface PanelPermissionsLanguages {
338
349
  create: boolean;
@@ -342,6 +353,8 @@ interface PanelPermissionsLanguages {
342
353
 
343
354
  /**
344
355
  * Page operation permissions.
356
+ * @source src/Cms/Permissions.php
357
+ * @source src/Cms/PagePermissions.php
345
358
  */
346
359
  interface PanelPermissionsPages {
347
360
  access: boolean;
@@ -362,16 +375,22 @@ interface PanelPermissionsPages {
362
375
 
363
376
  /**
364
377
  * Site operation permissions.
378
+ * @source src/Cms/Permissions.php
379
+ * @source src/Cms/SitePermissions.php
365
380
  */
366
381
  interface PanelPermissionsSite {
382
+ access: boolean;
367
383
  changeTitle: boolean;
368
384
  update: boolean;
369
385
  }
370
386
 
371
387
  /**
372
388
  * User management permissions (for other users).
389
+ * @source src/Cms/Permissions.php
390
+ * @source src/Cms/UserPermissions.php
373
391
  */
374
392
  interface PanelPermissionsUsers {
393
+ access: boolean;
375
394
  changeEmail: boolean;
376
395
  changeLanguage: boolean;
377
396
  changeName: boolean;
@@ -379,19 +398,24 @@ interface PanelPermissionsUsers {
379
398
  changeRole: boolean;
380
399
  create: boolean;
381
400
  delete: boolean;
401
+ list: boolean;
382
402
  update: boolean;
383
403
  }
384
404
 
385
405
  /**
386
406
  * Current user permissions (for own account).
407
+ * @source src/Cms/Permissions.php
408
+ * @source src/Cms/UserPermissions.php
387
409
  */
388
410
  interface PanelPermissionsUser {
411
+ access: boolean;
389
412
  changeEmail: boolean;
390
413
  changeLanguage: boolean;
391
414
  changeName: boolean;
392
415
  changePassword: boolean;
393
416
  changeRole: boolean;
394
417
  delete: boolean;
418
+ list: boolean;
395
419
  update: boolean;
396
420
  }
397
421
 
@@ -399,6 +423,8 @@ interface PanelPermissionsUser {
399
423
  * Complete permission set for the current user.
400
424
  *
401
425
  * @see https://getkirby.com/docs/reference/plugins/extensions/permissions
426
+ * @source src/Cms/Permissions.php
427
+ * @source src/Cms/Role.php
402
428
  */
403
429
  export interface PanelPermissions {
404
430
  access: PanelPermissionsAccess;
@@ -416,18 +442,18 @@ export interface PanelPermissions {
416
442
 
417
443
  /**
418
444
  * Search type definition.
445
+ * @source src/Panel/View.php
419
446
  */
420
447
  export interface PanelSearchType {
421
- /** Icon for the search type */
422
448
  icon: string;
423
- /** Display label */
424
449
  label: string;
425
- /** Unique identifier */
426
450
  id: string;
427
451
  }
428
452
 
429
453
  /**
430
454
  * Available search types in the Panel.
455
+ * @source panel/src/panel/panel.js
456
+ * @source src/Panel/View.php
431
457
  */
432
458
  export interface PanelSearches {
433
459
  pages: PanelSearchType;
@@ -442,11 +468,10 @@ export interface PanelSearches {
442
468
 
443
469
  /**
444
470
  * Base URLs for Panel operations.
471
+ * @source panel/src/panel/panel.js
445
472
  */
446
473
  export interface PanelUrls {
447
- /** API endpoint URL */
448
474
  api: string;
449
- /** Site URL */
450
475
  site: string;
451
476
  }
452
477
 
@@ -458,12 +483,13 @@ export interface PanelUrls {
458
483
  * Response object from Panel requests.
459
484
  *
460
485
  * @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/request.js
486
+ * @source panel/src/panel/request.js
461
487
  */
462
488
  export interface PanelRequestResponse {
463
489
  /** The original Request object */
464
490
  request: Request;
465
- /** The parsed response */
466
- response: {
491
+ /** Native `Response` mutated so that `text` and `json` are pre-resolved properties (not callable methods). */
492
+ response: Response & {
467
493
  /** Parsed JSON data */
468
494
  json: any;
469
495
  /** Raw response text */
@@ -526,6 +552,7 @@ export interface PanelRequestResponse {
526
552
  * ```
527
553
  *
528
554
  * @see https://getkirby.com/docs/reference/plugins/extensions
555
+ * @source panel/public/js/plugins.js
529
556
  */
530
557
  export interface PanelPluginExtensions {
531
558
  /**
@@ -651,6 +678,8 @@ export interface PanelPluginExtensions {
651
678
  * Properties are ordered to match `panel/public/js/plugins.js`.
652
679
  *
653
680
  * @see https://getkirby.com/docs/reference/plugins/extensions
681
+ * @source panel/src/panel/plugins.js
682
+ * @source panel/public/js/plugins.js
654
683
  */
655
684
  export interface PanelPlugins {
656
685
  // ---------------------------------------------------------------------------
@@ -714,7 +743,7 @@ export interface PanelPlugins {
714
743
  any
715
744
  > | null;
716
745
 
717
- /** Registered Panel routes */
746
+ /** Reserved bucket for plugin-registered routes (initialized empty; not currently written to by `panel.plugin()`). */
718
747
  routes: Record<string, any>[];
719
748
 
720
749
  /**
@@ -729,14 +758,14 @@ export interface PanelPlugins {
729
758
  /** Installed Vue plugins via `Vue.use()` */
730
759
  use: (PluginObject<any> | PluginFunction<any>)[];
731
760
 
732
- /** Registered view buttons */
761
+ /** Reserved bucket for view-button plugins (initialized empty; entries are actually stored under `components` as `k-${name}-view-button`). */
733
762
  viewButtons: Record<
734
763
  string,
735
764
  | DefineComponent<any, any, any, any, any, any, any, any, any, any, any>
736
765
  | Record<string, any>
737
766
  >;
738
767
 
739
- /** Registered Panel views */
768
+ /** Reserved bucket for plugin-registered views (initialized empty; not currently written to by `panel.plugin()`). */
740
769
  views: Record<string, Record<string, any>>;
741
770
 
742
771
  /**
@@ -758,18 +787,21 @@ export interface PanelPlugins {
758
787
 
759
788
  /**
760
789
  * Language information for multi-language sites.
790
+ * @source src/Cms/Language.php
791
+ * @source src/Panel/View.php
761
792
  */
762
793
  export interface PanelLanguageInfo {
763
794
  /** Language code (e.g., `"en"`, `"de"`) */
764
795
  code: string;
765
796
  /** Whether this is the default language */
766
797
  default: boolean;
767
- /** Text direction */
768
798
  direction: "ltr" | "rtl";
769
- /** Display name */
799
+ /** Whether the configured language `url` is an absolute URL (i.e., starts with `http://` or `https://`). */
800
+ hasCustomDomain: boolean;
770
801
  name: string;
771
- /** Slug conversion rules */
772
802
  rules: Record<string, string>;
803
+ /** Absolute URL for this language (always resolved against the site URL via `Url::makeAbsolute`). */
804
+ url: string;
773
805
  }
774
806
 
775
807
  // -----------------------------------------------------------------------------
@@ -778,6 +810,7 @@ export interface PanelLanguageInfo {
778
810
 
779
811
  /**
780
812
  * Global Panel state for `panel.state()`.
813
+ * @source panel/src/panel/panel.js
781
814
  */
782
815
  export interface PanelGlobalState {
783
816
  activation: PanelFeatures.PanelActivationDefaults;
@@ -821,6 +854,9 @@ export interface PanelGlobalState {
821
854
  * ```
822
855
  *
823
856
  * @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/panel.js
857
+ * @source panel/src/panel/panel.js
858
+ * @source panel/src/index.js
859
+ * @source panel/public/js/plugins.js
824
860
  */
825
861
  export interface Panel {
826
862
  // ---------------------------------------------------------------------------
@@ -839,10 +875,10 @@ export interface Panel {
839
875
  /** Text direction */
840
876
  readonly direction: "ltr" | "rtl";
841
877
 
842
- /** Document title */
878
+ /** Document title getter/setter; on set, the system title is appended as a suffix when present. */
843
879
  title: string;
844
880
 
845
- /** Whether any feature is loading */
881
+ /** Whether the Panel is currently loading a new view via `open()`. */
846
882
  isLoading: boolean;
847
883
 
848
884
  /** Whether the browser is offline */
@@ -962,7 +998,7 @@ export interface Panel {
962
998
  deprecated: (message: string) => void;
963
999
 
964
1000
  /**
965
- * Handles an error, optionally opening a notification.
1001
+ * Centralized error handler: ignores `AbortError`, marks the Panel offline on `OfflineError`, logs in debug mode, and optionally opens an error notification.
966
1002
  *
967
1003
  * @param error - Error or message
968
1004
  * @param openNotification - Whether to show notification (default: true)
@@ -1104,7 +1140,7 @@ export interface Panel {
1104
1140
  };
1105
1141
 
1106
1142
  /**
1107
- * Sets global Panel state.
1143
+ * Applies a new Panel state: updates globals, dispatches per-feature `set()` calls, opens/closes modals and the dropdown, and opens the view when present.
1108
1144
  *
1109
1145
  * @param state - State to merge
1110
1146
  */
@@ -1129,7 +1165,7 @@ export interface Panel {
1129
1165
  /**
1130
1166
  * Creates a URL object for a Panel path.
1131
1167
  *
1132
- * @param path - Path (default: current path)
1168
+ * @param path - Path or URL to build (default: empty string)
1133
1169
  * @param query - Query parameters
1134
1170
  * @param origin - Base origin
1135
1171
  * @returns URL object
@@ -1143,6 +1179,7 @@ export interface Panel {
1143
1179
 
1144
1180
  /**
1145
1181
  * Lock information for content.
1182
+ * @source src/Content/Lock.php
1146
1183
  */
1147
1184
  interface PanelViewPropsLockUser {
1148
1185
  id: string;
@@ -1151,6 +1188,8 @@ interface PanelViewPropsLockUser {
1151
1188
 
1152
1189
  /**
1153
1190
  * Content lock state.
1191
+ * @source src/Content/Lock.php
1192
+ * @source src/Panel/Model.php
1154
1193
  */
1155
1194
  interface PanelViewPropsLock {
1156
1195
  isLegacy: boolean;
@@ -1161,9 +1200,25 @@ interface PanelViewPropsLock {
1161
1200
 
1162
1201
  /**
1163
1202
  * Content permissions for a view.
1203
+ * @source src/Cms/ModelPermissions.php
1204
+ * @source src/Cms/PageBlueprint.php
1205
+ * @source src/Cms/FileBlueprint.php
1206
+ * @source src/Cms/UserBlueprint.php
1207
+ * @source src/Cms/SiteBlueprint.php
1208
+ * @source src/Panel/Site.php
1164
1209
  */
1165
1210
  interface PanelViewPropsPermissions {
1166
1211
  access: boolean;
1212
+ /** User permission. Present on User views. */
1213
+ changeEmail?: boolean;
1214
+ /** User permission. Present on User views. */
1215
+ changeLanguage?: boolean;
1216
+ /** File / User permission. Present on File and User views. */
1217
+ changeName?: boolean;
1218
+ /** User permission. Present on User views. */
1219
+ changePassword?: boolean;
1220
+ /** User permission. Present on User views. */
1221
+ changeRole?: boolean;
1167
1222
  changeSlug: boolean;
1168
1223
  changeStatus: boolean;
1169
1224
  changeTemplate: boolean;
@@ -1175,12 +1230,15 @@ interface PanelViewPropsPermissions {
1175
1230
  move: boolean;
1176
1231
  preview: boolean;
1177
1232
  read: boolean;
1233
+ /** File permission. Present on File views. */
1234
+ replace?: boolean;
1178
1235
  sort: boolean;
1179
1236
  update: boolean;
1180
1237
  }
1181
1238
 
1182
1239
  /**
1183
1240
  * Version information.
1241
+ * @source src/Panel/Model.php
1184
1242
  */
1185
1243
  interface PanelViewPropsVersions {
1186
1244
  latest: Record<string, any>;
@@ -1189,6 +1247,7 @@ interface PanelViewPropsVersions {
1189
1247
 
1190
1248
  /**
1191
1249
  * Tab definition.
1250
+ * @source src/Cms/Blueprint.php
1192
1251
  */
1193
1252
  interface PanelViewPropsTab {
1194
1253
  label: string;
@@ -1200,6 +1259,10 @@ interface PanelViewPropsTab {
1200
1259
 
1201
1260
  /**
1202
1261
  * Navigation link (next/prev).
1262
+ * @source src/Panel/Model.php
1263
+ * @source src/Panel/Page.php
1264
+ * @source src/Panel/File.php
1265
+ * @source src/Panel/User.php
1203
1266
  */
1204
1267
  interface PanelViewPropsNavigation {
1205
1268
  link: string;
@@ -1207,7 +1270,11 @@ interface PanelViewPropsNavigation {
1207
1270
  }
1208
1271
 
1209
1272
  /**
1210
- * Model information.
1273
+ * Legacy model information (deprecated; use the top-level view props instead).
1274
+ * @source src/Panel/Page.php
1275
+ * @source src/Panel/File.php
1276
+ * @source src/Panel/User.php
1277
+ * @source src/Panel/Site.php
1211
1278
  */
1212
1279
  interface PanelViewPropsModel {
1213
1280
  id: string;
@@ -1221,18 +1288,39 @@ interface PanelViewPropsModel {
1221
1288
 
1222
1289
  /**
1223
1290
  * Button definition.
1291
+ * @source src/Panel/Ui/Buttons/ViewButton.php
1292
+ * @source src/Panel/Ui/Buttons/ViewButtons.php
1293
+ * @source src/Panel/Ui/Component.php
1224
1294
  */
1225
1295
  interface PanelViewPropsButton {
1226
1296
  component: string;
1227
1297
  key: string;
1228
1298
  props: {
1299
+ /** Optional badge label rendered next to the button. */
1300
+ badge?: string;
1229
1301
  class?: string;
1302
+ /** Whether the button represents the current view/route. */
1303
+ current?: boolean;
1304
+ /** Dialog endpoint or config to open on click. */
1305
+ dialog?: string | Record<string, any>;
1230
1306
  disabled?: boolean;
1307
+ /** Drawer endpoint or config to open on click. */
1308
+ drawer?: string | Record<string, any>;
1309
+ /** Dropdown endpoint or config to open on click. */
1310
+ dropdown?: string | Record<string, any>;
1231
1311
  icon?: string;
1232
1312
  link?: string;
1313
+ /** Inline dropdown options. */
1314
+ options?: Record<string, any>[];
1233
1315
  responsive?: boolean;
1234
1316
  size?: string;
1317
+ /** Inline CSS style string. */
1318
+ style?: string;
1235
1319
  target?: string;
1320
+ /** Visible button label. */
1321
+ text?: string;
1322
+ /** Visual theme variant (e.g., `"positive"`, `"negative"`). */
1323
+ theme?: string;
1236
1324
  title?: string;
1237
1325
  type?: string;
1238
1326
  variant?: string;
@@ -1241,10 +1329,19 @@ interface PanelViewPropsButton {
1241
1329
 
1242
1330
  /**
1243
1331
  * Common view props passed from backend.
1332
+ * @source src/Panel/Model.php
1333
+ * @source src/Panel/Page.php
1334
+ * @source src/Panel/File.php
1335
+ * @source src/Panel/User.php
1336
+ * @source src/Panel/Site.php
1244
1337
  */
1245
1338
  export interface PanelViewProps {
1246
1339
  api: string;
1247
- buttons: PanelViewPropsButton[];
1340
+ /**
1341
+ * View buttons. May contain `'-'` string separators between groups.
1342
+ * @source src/Panel/Ui/Buttons/ViewButtons.php
1343
+ */
1344
+ buttons: (PanelViewPropsButton | "-")[];
1248
1345
  id: string;
1249
1346
  link: string;
1250
1347
  lock: PanelViewPropsLock;
@@ -1252,9 +1349,20 @@ export interface PanelViewProps {
1252
1349
  tabs: Record<string, any>[];
1253
1350
  uuid: string;
1254
1351
  versions: PanelViewPropsVersions;
1255
- tab: PanelViewPropsTab;
1256
- next: PanelViewPropsNavigation;
1257
- prev: PanelViewPropsNavigation;
1352
+ /** Active blueprint tab. Only present when the blueprint defines tabs. */
1353
+ tab?: PanelViewPropsTab;
1354
+ /**
1355
+ * Sibling navigation link to the next model. Present on Page, File and
1356
+ * User views (may be `null` when there is no next sibling); not emitted
1357
+ * for Site.
1358
+ */
1359
+ next?: PanelViewPropsNavigation | null;
1360
+ /**
1361
+ * Sibling navigation link to the previous model. Present on Page, File
1362
+ * and User views (may be `null` when there is no previous sibling); not
1363
+ * emitted for Site.
1364
+ */
1365
+ prev?: PanelViewPropsNavigation | null;
1258
1366
  blueprint: string;
1259
1367
  model: PanelViewPropsModel;
1260
1368
  title: string;