kirby-types 1.4.8 → 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.
- package/package.json +1 -1
- package/src/panel/features.d.ts +30 -11
- package/src/panel/index.d.ts +6 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kirby-types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.9",
|
|
5
5
|
"packageManager": "pnpm@10.33.2",
|
|
6
6
|
"description": "TypeScript types for Kirby Panel plugins and headless CMS usage",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
package/src/panel/features.d.ts
CHANGED
|
@@ -662,12 +662,8 @@ export interface PanelViewDefaults extends PanelFeatureDefaults {
|
|
|
662
662
|
id: string | null;
|
|
663
663
|
/** View link */
|
|
664
664
|
link: string | null;
|
|
665
|
-
/**
|
|
666
|
-
|
|
667
|
-
* Inherits the `string | null` shape from `PanelFeatureDefaults.path`;
|
|
668
|
-
* View does not override the runtime default of `null`.
|
|
669
|
-
*/
|
|
670
|
-
path: string | null;
|
|
665
|
+
/** Relative path to this view */
|
|
666
|
+
path: string;
|
|
671
667
|
/** Default search type */
|
|
672
668
|
search: string;
|
|
673
669
|
/** View title */
|
|
@@ -699,8 +695,8 @@ export interface PanelView extends Omit<
|
|
|
699
695
|
id: string | null;
|
|
700
696
|
/** View link */
|
|
701
697
|
link: string | null;
|
|
702
|
-
/** Relative path to this view
|
|
703
|
-
path: string
|
|
698
|
+
/** Relative path to this view */
|
|
699
|
+
path: string;
|
|
704
700
|
/** Default search type */
|
|
705
701
|
search: string;
|
|
706
702
|
/** View title */
|
|
@@ -1193,6 +1189,26 @@ export interface PanelSearcher {
|
|
|
1193
1189
|
// Upload
|
|
1194
1190
|
// -----------------------------------------------------------------------------
|
|
1195
1191
|
|
|
1192
|
+
/**
|
|
1193
|
+
* Server-side file model passed to `PanelUpload.replace()` and stored in
|
|
1194
|
+
* `PanelUploadDefaults.replacing`. Distinct from `PanelUploadFile` (the
|
|
1195
|
+
* client-side queued upload). Carries the fields read by `replace()` to
|
|
1196
|
+
* configure the upload picker (`url`, `accept`).
|
|
1197
|
+
*
|
|
1198
|
+
* @see https://github.com/getkirby/kirby/blob/main/panel/src/panel/upload.js
|
|
1199
|
+
* @source panel/src/panel/upload.js
|
|
1200
|
+
*/
|
|
1201
|
+
export interface PanelUploadReplaceFile {
|
|
1202
|
+
/** API path segment used to build the upload URL */
|
|
1203
|
+
link: string;
|
|
1204
|
+
/** File extension without dot, used for the picker `accept` filter */
|
|
1205
|
+
extension: string;
|
|
1206
|
+
/** MIME type, used for the picker `accept` filter */
|
|
1207
|
+
mime: string;
|
|
1208
|
+
/** Additional server-side fields */
|
|
1209
|
+
[key: string]: any;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1196
1212
|
/**
|
|
1197
1213
|
* Upload file state representing a file in the upload queue.
|
|
1198
1214
|
*
|
|
@@ -1248,7 +1264,7 @@ export interface PanelUploadDefaults {
|
|
|
1248
1264
|
/** File preview data */
|
|
1249
1265
|
preview: Record<string, any>;
|
|
1250
1266
|
/** Server file model being replaced (carries `link`, `extension`, `mime`). */
|
|
1251
|
-
replacing:
|
|
1267
|
+
replacing: PanelUploadReplaceFile | null;
|
|
1252
1268
|
/** Upload endpoint URL */
|
|
1253
1269
|
url: string | null;
|
|
1254
1270
|
}
|
|
@@ -1280,7 +1296,7 @@ export interface PanelUpload
|
|
|
1280
1296
|
/** File preview data */
|
|
1281
1297
|
preview: Record<string, any>;
|
|
1282
1298
|
/** Server file model being replaced (see `PanelUploadDefaults.replacing`) */
|
|
1283
|
-
replacing:
|
|
1299
|
+
replacing: PanelUploadReplaceFile | null;
|
|
1284
1300
|
/** Upload endpoint URL */
|
|
1285
1301
|
url: string | null;
|
|
1286
1302
|
|
|
@@ -1355,7 +1371,10 @@ export interface PanelUpload
|
|
|
1355
1371
|
* @param file - Server file model being replaced
|
|
1356
1372
|
* @param options - Upload options
|
|
1357
1373
|
*/
|
|
1358
|
-
replace: (
|
|
1374
|
+
replace: (
|
|
1375
|
+
file: PanelUploadReplaceFile,
|
|
1376
|
+
options?: Partial<PanelUploadDefaults>,
|
|
1377
|
+
) => void;
|
|
1359
1378
|
|
|
1360
1379
|
/**
|
|
1361
1380
|
* Adds files to upload list with deduplication.
|
package/src/panel/index.d.ts
CHANGED
|
@@ -1353,14 +1353,16 @@ export interface PanelViewProps {
|
|
|
1353
1353
|
tab?: PanelViewPropsTab;
|
|
1354
1354
|
/**
|
|
1355
1355
|
* Sibling navigation link to the next model. Present on Page, File and
|
|
1356
|
-
* User views; not emitted
|
|
1356
|
+
* User views (may be `null` when there is no next sibling); not emitted
|
|
1357
|
+
* for Site.
|
|
1357
1358
|
*/
|
|
1358
|
-
next?: PanelViewPropsNavigation;
|
|
1359
|
+
next?: PanelViewPropsNavigation | null;
|
|
1359
1360
|
/**
|
|
1360
1361
|
* Sibling navigation link to the previous model. Present on Page, File
|
|
1361
|
-
* and User views
|
|
1362
|
+
* and User views (may be `null` when there is no previous sibling); not
|
|
1363
|
+
* emitted for Site.
|
|
1362
1364
|
*/
|
|
1363
|
-
prev?: PanelViewPropsNavigation;
|
|
1365
|
+
prev?: PanelViewPropsNavigation | null;
|
|
1364
1366
|
blueprint: string;
|
|
1365
1367
|
model: PanelViewPropsModel;
|
|
1366
1368
|
title: string;
|