@nullplatform/ui-plugin-sdk 0.20.0-beta.0 → 0.21.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/dist/bridge.d.ts +1 -37
- package/dist/bridge.js +0 -44
- package/dist/calendar.d.ts +58 -0
- package/dist/calendar.js +1 -0
- package/dist/catalog.d.ts +4 -3
- package/dist/catalog.js +2 -1
- package/dist/components.d.ts +17 -4
- package/dist/components.generated.d.ts +157 -8
- package/dist/components.generated.js +12 -1
- package/dist/context.d.ts +0 -6
- package/dist/contract/allowlist.d.ts +6 -8
- package/dist/contract/allowlist.js +78 -26
- package/dist/contract/index.d.ts +2 -2
- package/dist/contract/index.js +2 -2
- package/dist/contract/manifest.d.ts +9 -13
- package/dist/contract/manifest.js +24 -15
- package/dist/contract/when.d.ts +1 -1
- package/dist/contract/when.js +1 -1
- package/dist/contract-cjs/allowlist.js +79 -27
- package/dist/contract-cjs/index.js +3 -2
- package/dist/contract-cjs/manifest.js +25 -15
- package/dist/contract-cjs/when.js +1 -1
- package/dist/contractProps.d.ts +39 -1
- package/dist/contracts.generated.d.ts +165 -0
- package/dist/contracts.generated.js +82 -4
- package/dist/dataTable.d.ts +49 -2
- package/dist/filterSingleDate.d.ts +21 -0
- package/dist/filterSingleDate.js +5 -0
- package/dist/host.d.ts +0 -8
- package/dist/host.js +0 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/protocol.d.ts +1 -108
- package/dist/protocol.js +0 -14
- package/dist/worker.js +1 -2
- package/package.json +2 -2
package/dist/bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Plugin-side client of the host bridge. The only way out of the sandbox.
|
|
3
3
|
*/
|
|
4
|
-
import { type ConfirmOptions, type
|
|
4
|
+
import { type ConfirmOptions, type ApiRequest, type BridgeMethodName, type BridgeMethods, type HostMessage, type HttpRequest, type HttpResponse, type NavigationTarget, type PluginContext, type SnackbarOptions, type WorkerMessage } from './protocol.js';
|
|
5
5
|
import { topics as topicsApi } from './topics.js';
|
|
6
6
|
export declare class BridgeClient {
|
|
7
7
|
private readonly timeoutMs;
|
|
@@ -42,42 +42,6 @@ export declare const nullplatform: {
|
|
|
42
42
|
* time per plugin (a second one rejects with `BUSY`). A host older than the call rejects with `UNKNOWN_METHOD`.
|
|
43
43
|
*/
|
|
44
44
|
confirm(options: ConfirmOptions): Promise<boolean>;
|
|
45
|
-
/**
|
|
46
|
-
* Shows work that takes a while in the host's progress panel, in a corner of the page: a title and one line per
|
|
47
|
-
* item, each `waiting`, `running`, `done` or `failed`. Every call replaces the plugin's panel; `null` removes
|
|
48
|
-
* it. The person can fold it, and close it once nothing is waiting or running; it goes when the plugin stops.
|
|
49
|
-
* A host older than the call rejects with `UNKNOWN_METHOD`.
|
|
50
|
-
*/
|
|
51
|
-
progress(panel: ProgressPanel | null): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Shows an approval request in the host's own modal, with its checklist when it has one: the person reads it and
|
|
54
|
-
* acts on it there, without leaving the page. Resolves once they close it. It says nothing about what they did,
|
|
55
|
-
* so read again whatever the approval decides. `approvalId` is the request's id, its digits as a string
|
|
56
|
-
* (`BAD_REQUEST` otherwise). Waits up to 30 minutes; one at a time per plugin (a second one rejects with `BUSY`).
|
|
57
|
-
* Offer it only when `hostSupports('ui.approval')`: a host older than the call rejects with `UNKNOWN_METHOD`, one
|
|
58
|
-
* that shows no approvals with `APPROVALS_NOT_SUPPORTED`.
|
|
59
|
-
*/
|
|
60
|
-
approval(approvalId: string): Promise<void>;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Files from the person's computer. A plugin cannot open a file picker or read a file: the host does both, and
|
|
64
|
-
* hands back only the file's name, size and type. A host older than these calls rejects with `UNKNOWN_METHOD`;
|
|
65
|
-
* one that offers no file picker or upload, with `FILES_NOT_SUPPORTED`.
|
|
66
|
-
*/
|
|
67
|
-
files: {
|
|
68
|
-
/**
|
|
69
|
-
* Opens the host's file picker. Resolves the picked files: none when the person cancels, one unless `multiple`.
|
|
70
|
-
* Call it from a press: browsers only open a file picker shortly after one. Waits up to 10 minutes; one picker
|
|
71
|
-
* at a time per plugin (a second one rejects with `BUSY`). More files than `FILE_LIMITS.picked` in one pick
|
|
72
|
-
* rejects with `TOO_MANY_FILES`.
|
|
73
|
-
*/
|
|
74
|
-
pick(options?: FilePickOptions): Promise<PickedFile[]>;
|
|
75
|
-
/**
|
|
76
|
-
* Sends a picked file as a form POST to a host declared in `permissions.upload` (an S3 presigned POST, for
|
|
77
|
-
* example). Resolves when the form was sent; the host cannot read the answer, so check that the file arrived.
|
|
78
|
-
* Rejects with `PERMISSION_DENIED` for an undeclared host and `UNKNOWN_FILE` for an id it does not hold.
|
|
79
|
-
*/
|
|
80
|
-
upload(upload: FileUpload): Promise<void>;
|
|
81
45
|
};
|
|
82
46
|
context: {
|
|
83
47
|
get(): Promise<PluginContext>;
|
package/dist/bridge.js
CHANGED
|
@@ -111,50 +111,6 @@ export const nullplatform = {
|
|
|
111
111
|
confirm(options) {
|
|
112
112
|
return bridge.call('ui.confirm', options);
|
|
113
113
|
},
|
|
114
|
-
/**
|
|
115
|
-
* Shows work that takes a while in the host's progress panel, in a corner of the page: a title and one line per
|
|
116
|
-
* item, each `waiting`, `running`, `done` or `failed`. Every call replaces the plugin's panel; `null` removes
|
|
117
|
-
* it. The person can fold it, and close it once nothing is waiting or running; it goes when the plugin stops.
|
|
118
|
-
* A host older than the call rejects with `UNKNOWN_METHOD`.
|
|
119
|
-
*/
|
|
120
|
-
progress(panel) {
|
|
121
|
-
return bridge.call('ui.progress', panel);
|
|
122
|
-
},
|
|
123
|
-
/**
|
|
124
|
-
* Shows an approval request in the host's own modal, with its checklist when it has one: the person reads it and
|
|
125
|
-
* acts on it there, without leaving the page. Resolves once they close it. It says nothing about what they did,
|
|
126
|
-
* so read again whatever the approval decides. `approvalId` is the request's id, its digits as a string
|
|
127
|
-
* (`BAD_REQUEST` otherwise). Waits up to 30 minutes; one at a time per plugin (a second one rejects with `BUSY`).
|
|
128
|
-
* Offer it only when `hostSupports('ui.approval')`: a host older than the call rejects with `UNKNOWN_METHOD`, one
|
|
129
|
-
* that shows no approvals with `APPROVALS_NOT_SUPPORTED`.
|
|
130
|
-
*/
|
|
131
|
-
approval(approvalId) {
|
|
132
|
-
return bridge.call('ui.approval', approvalId);
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
/**
|
|
136
|
-
* Files from the person's computer. A plugin cannot open a file picker or read a file: the host does both, and
|
|
137
|
-
* hands back only the file's name, size and type. A host older than these calls rejects with `UNKNOWN_METHOD`;
|
|
138
|
-
* one that offers no file picker or upload, with `FILES_NOT_SUPPORTED`.
|
|
139
|
-
*/
|
|
140
|
-
files: {
|
|
141
|
-
/**
|
|
142
|
-
* Opens the host's file picker. Resolves the picked files: none when the person cancels, one unless `multiple`.
|
|
143
|
-
* Call it from a press: browsers only open a file picker shortly after one. Waits up to 10 minutes; one picker
|
|
144
|
-
* at a time per plugin (a second one rejects with `BUSY`). More files than `FILE_LIMITS.picked` in one pick
|
|
145
|
-
* rejects with `TOO_MANY_FILES`.
|
|
146
|
-
*/
|
|
147
|
-
pick(options) {
|
|
148
|
-
return bridge.call('files.pick', options);
|
|
149
|
-
},
|
|
150
|
-
/**
|
|
151
|
-
* Sends a picked file as a form POST to a host declared in `permissions.upload` (an S3 presigned POST, for
|
|
152
|
-
* example). Resolves when the form was sent; the host cannot read the answer, so check that the file arrived.
|
|
153
|
-
* Rejects with `PERMISSION_DENIED` for an undeclared host and `UNKNOWN_FILE` for an id it does not hold.
|
|
154
|
-
*/
|
|
155
|
-
upload(upload) {
|
|
156
|
-
return bridge.call('files.upload', upload);
|
|
157
|
-
},
|
|
158
114
|
},
|
|
159
115
|
context: {
|
|
160
116
|
get() {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { UI_COMPONENTS_CONTRACTS } from "./contracts.generated.js";
|
|
2
|
+
/**
|
|
3
|
+
* The items the design system's calendars take from a plugin, which their contracts can only type as arrays. Dates
|
|
4
|
+
* are ISO-8601 strings: an instant `end` is exclusive, a date-only `end` includes its day.
|
|
5
|
+
*/
|
|
6
|
+
type ContractValues<Tag> = Extract<(typeof UI_COMPONENTS_CONTRACTS)[number], {
|
|
7
|
+
tag: Tag;
|
|
8
|
+
}> extends {
|
|
9
|
+
values: infer V;
|
|
10
|
+
} ? V : never;
|
|
11
|
+
type TimelineValues = ContractValues<"np-calendar-timeline">;
|
|
12
|
+
/** A deploy freeze or a deploy window. */
|
|
13
|
+
export type CalendarEventKind = ContractValues<"np-calendar-month">["events[].kind"][number];
|
|
14
|
+
/** Where an item stands against now. Left out, the calendar derives it from the times. */
|
|
15
|
+
export type CalendarEventState = ContractValues<"np-calendar-month">["events[].state"][number];
|
|
16
|
+
export type CalendarTimelineRowKind = TimelineValues["rows[].kind"][number];
|
|
17
|
+
/** An event on `CalendarMonth` or `CalendarWeek`. */
|
|
18
|
+
export interface CalendarEvent {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
start: string;
|
|
22
|
+
end: string;
|
|
23
|
+
/** Drawn in the week's "all day" row, whatever its times. */
|
|
24
|
+
allDay?: boolean;
|
|
25
|
+
kind: CalendarEventKind;
|
|
26
|
+
state?: CalendarEventState;
|
|
27
|
+
/** A short line after the title: the hours, a scope. */
|
|
28
|
+
meta?: string;
|
|
29
|
+
/** Drawn with a repeat mark. */
|
|
30
|
+
recurring?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** A resource on `CalendarTimeline`, indented by `depth` under its parent. */
|
|
33
|
+
export interface CalendarTimelineRow {
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
kind: CalendarTimelineRowKind;
|
|
37
|
+
depth: number;
|
|
38
|
+
}
|
|
39
|
+
/** A bar on a `CalendarTimeline` row. */
|
|
40
|
+
export interface CalendarTimelineBar {
|
|
41
|
+
id: string;
|
|
42
|
+
rowId: string;
|
|
43
|
+
title: string;
|
|
44
|
+
start: string;
|
|
45
|
+
end: string;
|
|
46
|
+
kind: CalendarEventKind;
|
|
47
|
+
/** Set on a resource from one above it: drawn hatched, with a dashed border. */
|
|
48
|
+
inherited?: boolean;
|
|
49
|
+
state?: CalendarEventState;
|
|
50
|
+
meta?: string;
|
|
51
|
+
recurring?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** An empty hour of `CalendarWeek`, as instants. */
|
|
54
|
+
export interface CalendarSlot {
|
|
55
|
+
start: string;
|
|
56
|
+
end: string;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
package/dist/calendar.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/catalog.d.ts
CHANGED
|
@@ -23,17 +23,18 @@ export interface CatalogElementSpec {
|
|
|
23
23
|
/**
|
|
24
24
|
* Closed lists for string props. The host drops any other value, so the element draws its default. `prop[].key`
|
|
25
25
|
* names a key of each item in an array prop, which the host drops from an item whose value isn't in the list.
|
|
26
|
-
* `prop[]` names the items of an array of plain values: the host drops each item that isn't in the list.
|
|
26
|
+
* `prop[]` names the items of an array of plain values: the host drops each item that isn't in the list. `prop.key`
|
|
27
|
+
* names a key of an object prop, which the host drops from the object when its value isn't in the list.
|
|
27
28
|
*/
|
|
28
29
|
values?: Readonly<Record<string, readonly string[]>>;
|
|
29
30
|
/**
|
|
30
31
|
* Props that end up in CSS, which the host only passes as plain values. `prop[].key` names a key of each item
|
|
31
|
-
* in an array prop.
|
|
32
|
+
* in an array prop, `prop.key` a key of an object prop.
|
|
32
33
|
*/
|
|
33
34
|
cssValues?: readonly string[];
|
|
34
35
|
/**
|
|
35
36
|
* Props that load an image, which the host only passes when they point to plugin bundle storage, as np-image's
|
|
36
|
-
* `src` does. `prop[].key` names a key of each item in an array prop.
|
|
37
|
+
* `src` does. `prop[].key` names a key of each item in an array prop, `prop.key` a key of an object prop.
|
|
37
38
|
*/
|
|
38
39
|
imageValues?: readonly string[];
|
|
39
40
|
/** Whether the element draws nested elements. The host drops children otherwise. */
|
package/dist/catalog.js
CHANGED
|
@@ -199,7 +199,6 @@ const OWN_CATALOG = [
|
|
|
199
199
|
href: "string",
|
|
200
200
|
color: "string",
|
|
201
201
|
underline: "string",
|
|
202
|
-
newTab: "boolean",
|
|
203
202
|
},
|
|
204
203
|
events: { press: "onPress" },
|
|
205
204
|
values: CATALOG_PROP_VALUES.Link,
|
|
@@ -399,6 +398,8 @@ const OWN_CATALOG = [
|
|
|
399
398
|
xScale: "string",
|
|
400
399
|
xFormat: "string",
|
|
401
400
|
yFormat: "string",
|
|
401
|
+
xTicks: "array",
|
|
402
|
+
yTicks: "array",
|
|
402
403
|
xMax: "number",
|
|
403
404
|
yMax: "number",
|
|
404
405
|
selected: "string",
|
package/dist/components.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ import { type AlertSeverity, type ButtonColor, type ButtonSize, type ButtonVaria
|
|
|
8
8
|
export type { AlertSeverity, ButtonColor, ButtonSize, ButtonVariant, CardTone, ChipColor, ChipSize, ChipVariant, LinkColor, LinkUnderline, ScatterScale, SkeletonVariant, StackDirection, TextAlign, TextVariant, } from "./catalog.js";
|
|
9
9
|
export * from "./components.generated.js";
|
|
10
10
|
export type { ContractProps, UiComponentsTag } from "./contractProps.js";
|
|
11
|
-
export type {
|
|
11
|
+
export type { CalendarEvent, CalendarEventKind, CalendarEventState, CalendarSlot, CalendarTimelineBar, CalendarTimelineRow, CalendarTimelineRowKind, } from "./calendar.js";
|
|
12
|
+
export type { FilterSingleDateChange, FilterSingleDatePreset } from "./filterSingleDate.js";
|
|
13
|
+
export type { DataTableAvatar, DataTableColor, DataTableColumn, DataTableEmptyState, DataTableFormatter, DataTableGrouping, DataTableLabelVariant, DataTableLink, DataTablePagination, DataTableRow, DataTableRowAction, DataTableState, DataTableTypography, } from "./dataTable.js";
|
|
12
14
|
export declare const TextField: import("react").ComponentType<{
|
|
13
15
|
label: string;
|
|
14
16
|
value: string;
|
|
@@ -137,8 +139,6 @@ export declare const Link: import("react").ComponentType<{
|
|
|
137
139
|
color?: LinkColor;
|
|
138
140
|
/** Unset, the theme's: underlined on hover. */
|
|
139
141
|
underline?: LinkUnderline;
|
|
140
|
-
/** Opens a `to` page in a new tab and leaves this one where it is. An `href` always opens in a new tab. */
|
|
141
|
-
newTab?: boolean;
|
|
142
142
|
onPress?: () => void;
|
|
143
143
|
} & {
|
|
144
144
|
children?: ReactNode;
|
|
@@ -350,12 +350,21 @@ export interface ScatterPoint {
|
|
|
350
350
|
label: string;
|
|
351
351
|
x: number;
|
|
352
352
|
y: number;
|
|
353
|
+
/** Text for this point's x value in its tooltip; the axis formatter when left out. */
|
|
354
|
+
xLabel?: string;
|
|
355
|
+
/** Text for this point's y value in its tooltip; the axis formatter when left out. */
|
|
356
|
+
yLabel?: string;
|
|
353
357
|
/** Relative area: the largest point gets the largest dot. Every dot is the same size when left out. */
|
|
354
358
|
size?: number;
|
|
355
359
|
color?: ThemeColor | string;
|
|
356
360
|
/** Outline with a faint fill, for points that matter less. */
|
|
357
361
|
hollow?: boolean;
|
|
358
362
|
}
|
|
363
|
+
/** A numeric position with the text the axis and tooltip should show for it. */
|
|
364
|
+
export interface ScatterAxisTick {
|
|
365
|
+
value: number;
|
|
366
|
+
label: string;
|
|
367
|
+
}
|
|
359
368
|
/**
|
|
360
369
|
* Splits the plane at `x` and `y`. `labels` names the corners and `colors` tints them, both in reading order
|
|
361
370
|
* (top left, top right, bottom left, bottom right); `null` leaves a corner untinted.
|
|
@@ -382,7 +391,11 @@ export declare const Scatter: import("react").ComponentType<{
|
|
|
382
391
|
xScale?: ScatterScale;
|
|
383
392
|
xFormat?: ValueFormat;
|
|
384
393
|
yFormat?: ValueFormat;
|
|
385
|
-
/**
|
|
394
|
+
/** Replaces generated numeric ticks and formats matching tooltip values. Useful for elapsed-time landmarks. */
|
|
395
|
+
xTicks?: ScatterAxisTick[];
|
|
396
|
+
/** Replaces generated numeric ticks and formats matching tooltip values. Useful for ordered categories. */
|
|
397
|
+
yTicks?: ScatterAxisTick[];
|
|
398
|
+
/** Axis maxima; custom ticks may extend either end. Otherwise, log x starts at the data minimum and linear axes at 0. */
|
|
386
399
|
xMax?: number;
|
|
387
400
|
yMax?: number;
|
|
388
401
|
/** The `id` of the point drawn as chosen. */
|
|
@@ -362,17 +362,23 @@ export declare const DataTable: import("react").ComponentType<Omit<{
|
|
|
362
362
|
initialState?: Readonly<Record<string, unknown>> | undefined;
|
|
363
363
|
paginationProps?: Readonly<Record<string, unknown>> | undefined;
|
|
364
364
|
variant?: "default" | "embedded" | "plain" | undefined;
|
|
365
|
+
isRowClickable?: string | undefined;
|
|
366
|
+
emptyStateProps?: Readonly<Record<string, unknown>> | undefined;
|
|
367
|
+
grouping?: Readonly<Record<string, unknown>> | undefined;
|
|
365
368
|
} & {
|
|
366
369
|
readonly onChangeTableState?: ((payload: unknown) => void) | undefined;
|
|
367
370
|
readonly onRowClick?: ((payload: unknown) => void) | undefined;
|
|
368
|
-
} & {}, "data" | "onChangeTableState" | "onRowClick" | "columns" | "initialState" | "paginationProps"> & Pick<{
|
|
371
|
+
} & {}, "data" | "onChangeTableState" | "onRowClick" | "columns" | "initialState" | "paginationProps" | "isRowClickable" | "emptyStateProps" | "grouping"> & Pick<{
|
|
369
372
|
columns?: readonly import("./dataTable").DataTableColumn[];
|
|
370
373
|
data?: readonly import("./dataTable").DataTableRow[];
|
|
371
374
|
initialState?: import("./dataTable").DataTableState;
|
|
372
375
|
paginationProps?: import("./dataTable").DataTablePagination;
|
|
376
|
+
isRowClickable?: string;
|
|
377
|
+
emptyStateProps?: import("./dataTable").DataTableEmptyState;
|
|
378
|
+
grouping?: import("./dataTable").DataTableGrouping;
|
|
373
379
|
onChangeTableState?: (state: import("./dataTable").DataTableState) => void;
|
|
374
380
|
onRowClick?: (row: import("./dataTable").DataTableRow) => void;
|
|
375
|
-
}, "data" | "onChangeTableState" | "onRowClick" | "columns" | "initialState" | "paginationProps"> & {
|
|
381
|
+
}, "data" | "onChangeTableState" | "onRowClick" | "columns" | "initialState" | "paginationProps" | "isRowClickable" | "emptyStateProps" | "grouping"> & {
|
|
376
382
|
children?: import("react").ReactNode;
|
|
377
383
|
}>;
|
|
378
384
|
export declare const Gauge: import("react").ComponentType<{
|
|
@@ -446,7 +452,7 @@ export declare const Markdown: import("react").ComponentType<{
|
|
|
446
452
|
} & {} & {} & {
|
|
447
453
|
children?: import("react").ReactNode;
|
|
448
454
|
}>;
|
|
449
|
-
export declare const CalendarMonth: import("react").ComponentType<{
|
|
455
|
+
export declare const CalendarMonth: import("react").ComponentType<Omit<{
|
|
450
456
|
month?: string | undefined;
|
|
451
457
|
timeZone?: string | undefined;
|
|
452
458
|
weekStartsOn?: number | undefined;
|
|
@@ -459,10 +465,15 @@ export declare const CalendarMonth: import("react").ComponentType<{
|
|
|
459
465
|
readonly onEventPress?: ((payload: unknown) => void) | undefined;
|
|
460
466
|
readonly onDayPress?: ((payload: unknown) => void) | undefined;
|
|
461
467
|
readonly onMorePress?: ((payload: unknown) => void) | undefined;
|
|
462
|
-
} & {} & {
|
|
468
|
+
} & {}, "onEventPress" | "onDayPress" | "onMorePress" | "events"> & Pick<{
|
|
469
|
+
events?: readonly import("./calendar").CalendarEvent[];
|
|
470
|
+
onEventPress?: (id: string) => void;
|
|
471
|
+
onDayPress?: (day: string) => void;
|
|
472
|
+
onMorePress?: (day: string) => void;
|
|
473
|
+
}, "onEventPress" | "onDayPress" | "onMorePress" | "events"> & {
|
|
463
474
|
children?: import("react").ReactNode;
|
|
464
475
|
}>;
|
|
465
|
-
export declare const CalendarWeek: import("react").ComponentType<{
|
|
476
|
+
export declare const CalendarWeek: import("react").ComponentType<Omit<{
|
|
466
477
|
weekStart?: string | undefined;
|
|
467
478
|
timeZone?: string | undefined;
|
|
468
479
|
startHour?: number | undefined;
|
|
@@ -475,10 +486,14 @@ export declare const CalendarWeek: import("react").ComponentType<{
|
|
|
475
486
|
} & {
|
|
476
487
|
readonly onEventPress?: ((payload: unknown) => void) | undefined;
|
|
477
488
|
readonly onSlotPress?: ((payload: unknown) => void) | undefined;
|
|
478
|
-
} & {} & {
|
|
489
|
+
} & {}, "onEventPress" | "onSlotPress" | "events"> & Pick<{
|
|
490
|
+
events?: readonly import("./calendar").CalendarEvent[];
|
|
491
|
+
onEventPress?: (id: string) => void;
|
|
492
|
+
onSlotPress?: (slot: import("./calendar").CalendarSlot) => void;
|
|
493
|
+
}, "onEventPress" | "onSlotPress" | "events"> & {
|
|
479
494
|
children?: import("react").ReactNode;
|
|
480
495
|
}>;
|
|
481
|
-
export declare const CalendarTimeline: import("react").ComponentType<{
|
|
496
|
+
export declare const CalendarTimeline: import("react").ComponentType<Omit<{
|
|
482
497
|
from?: string | undefined;
|
|
483
498
|
to?: string | undefined;
|
|
484
499
|
timeZone?: string | undefined;
|
|
@@ -488,9 +503,20 @@ export declare const CalendarTimeline: import("react").ComponentType<{
|
|
|
488
503
|
now?: string | undefined;
|
|
489
504
|
locale?: string | undefined;
|
|
490
505
|
resourceLabel?: string | undefined;
|
|
506
|
+
loading?: boolean | undefined;
|
|
507
|
+
emptyStateProps?: Readonly<Record<string, unknown>> | undefined;
|
|
508
|
+
maxRows?: number | undefined;
|
|
491
509
|
} & {
|
|
492
510
|
readonly onBarPress?: ((payload: unknown) => void) | undefined;
|
|
493
|
-
} & {} & {
|
|
511
|
+
} & {}, "rows" | "onBarPress" | "emptyStateProps" | "bars"> & Pick<{
|
|
512
|
+
rows?: readonly import("./calendar").CalendarTimelineRow[];
|
|
513
|
+
bars?: readonly import("./calendar").CalendarTimelineBar[];
|
|
514
|
+
emptyStateProps?: {
|
|
515
|
+
title?: string;
|
|
516
|
+
description?: string;
|
|
517
|
+
};
|
|
518
|
+
onBarPress?: (id: string) => void;
|
|
519
|
+
}, "rows" | "onBarPress" | "emptyStateProps" | "bars"> & {
|
|
494
520
|
children?: import("react").ReactNode;
|
|
495
521
|
}>;
|
|
496
522
|
export declare const ToggleButtonBar: import("react").ComponentType<{
|
|
@@ -541,3 +567,126 @@ export declare const DateTimeRangeField: import("react").ComponentType<{
|
|
|
541
567
|
} & {} & {
|
|
542
568
|
children?: import("react").ReactNode;
|
|
543
569
|
}>;
|
|
570
|
+
export declare const Checkbox: import("react").ComponentType<{
|
|
571
|
+
checked?: boolean | undefined;
|
|
572
|
+
disabled?: boolean | undefined;
|
|
573
|
+
} & {
|
|
574
|
+
readonly onChange?: ((payload: unknown) => void) | undefined;
|
|
575
|
+
} & {} & {
|
|
576
|
+
children?: import("react").ReactNode;
|
|
577
|
+
}>;
|
|
578
|
+
export declare const CheckboxCard: import("react").ComponentType<{
|
|
579
|
+
label?: string | undefined;
|
|
580
|
+
description?: string | undefined;
|
|
581
|
+
icon?: string | undefined;
|
|
582
|
+
checked?: boolean | undefined;
|
|
583
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
584
|
+
variant?: "outline" | "surface" | "subtle" | "solid" | undefined;
|
|
585
|
+
align?: "center" | "start" | "end" | undefined;
|
|
586
|
+
justify?: "center" | "start" | "end" | undefined;
|
|
587
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
588
|
+
indicator?: boolean | undefined;
|
|
589
|
+
disabled?: boolean | undefined;
|
|
590
|
+
readOnly?: boolean | undefined;
|
|
591
|
+
error?: boolean | undefined;
|
|
592
|
+
} & {
|
|
593
|
+
readonly onChange?: ((payload: unknown) => void) | undefined;
|
|
594
|
+
} & {} & {
|
|
595
|
+
children?: import("react").ReactNode;
|
|
596
|
+
}>;
|
|
597
|
+
export declare const Slider: import("react").ComponentType<{
|
|
598
|
+
value?: number | undefined;
|
|
599
|
+
min?: number | undefined;
|
|
600
|
+
max?: number | undefined;
|
|
601
|
+
step?: number | undefined;
|
|
602
|
+
disabled?: boolean | undefined;
|
|
603
|
+
"aria-label"?: string | undefined;
|
|
604
|
+
} & {
|
|
605
|
+
readonly onChange?: ((payload: unknown) => void) | undefined;
|
|
606
|
+
readonly onChangeCommitted?: ((payload: unknown) => void) | undefined;
|
|
607
|
+
} & {} & {
|
|
608
|
+
children?: import("react").ReactNode;
|
|
609
|
+
}>;
|
|
610
|
+
export declare const Accordion: import("react").ComponentType<{
|
|
611
|
+
expanded?: boolean | undefined;
|
|
612
|
+
defaultExpanded?: boolean | undefined;
|
|
613
|
+
disabled?: boolean | undefined;
|
|
614
|
+
disableGutters?: boolean | undefined;
|
|
615
|
+
} & {
|
|
616
|
+
readonly onChange?: ((payload: unknown) => void) | undefined;
|
|
617
|
+
} & {} & {
|
|
618
|
+
children?: import("react").ReactNode;
|
|
619
|
+
}>;
|
|
620
|
+
export declare const AccordionSummary: import("react").ComponentType<{} & {} & {
|
|
621
|
+
expandIcon?: import("react").ReactNode;
|
|
622
|
+
} & {
|
|
623
|
+
children?: import("react").ReactNode;
|
|
624
|
+
}>;
|
|
625
|
+
export declare const AccordionDetails: import("react").ComponentType<{} & {} & {} & {
|
|
626
|
+
children?: import("react").ReactNode;
|
|
627
|
+
}>;
|
|
628
|
+
export declare const DatePickerField: import("react").ComponentType<{
|
|
629
|
+
value?: string | undefined;
|
|
630
|
+
minDate?: string | undefined;
|
|
631
|
+
maxDate?: string | undefined;
|
|
632
|
+
timeZone?: string | undefined;
|
|
633
|
+
label?: string | undefined;
|
|
634
|
+
helperText?: string | undefined;
|
|
635
|
+
error?: boolean | undefined;
|
|
636
|
+
disabled?: boolean | undefined;
|
|
637
|
+
} & {
|
|
638
|
+
readonly onChange?: ((payload: unknown) => void) | undefined;
|
|
639
|
+
} & {} & {
|
|
640
|
+
children?: import("react").ReactNode;
|
|
641
|
+
}>;
|
|
642
|
+
export declare const FilterSingleDateField: import("react").ComponentType<Omit<{
|
|
643
|
+
value?: string | undefined;
|
|
644
|
+
preset?: string | undefined;
|
|
645
|
+
presets?: readonly unknown[] | undefined;
|
|
646
|
+
timeZone?: string | undefined;
|
|
647
|
+
label?: string | undefined;
|
|
648
|
+
placeholder?: string | undefined;
|
|
649
|
+
customLabel?: string | undefined;
|
|
650
|
+
helperText?: string | undefined;
|
|
651
|
+
error?: boolean | undefined;
|
|
652
|
+
required?: boolean | undefined;
|
|
653
|
+
disabled?: boolean | undefined;
|
|
654
|
+
minDate?: string | undefined;
|
|
655
|
+
maxDate?: string | undefined;
|
|
656
|
+
disablePast?: boolean | undefined;
|
|
657
|
+
disableFuture?: boolean | undefined;
|
|
658
|
+
hideActionButtons?: boolean | undefined;
|
|
659
|
+
} & {
|
|
660
|
+
readonly onChange?: ((payload: unknown) => void) | undefined;
|
|
661
|
+
} & {}, "onChange" | "value" | "preset" | "presets"> & Pick<{
|
|
662
|
+
value?: string | null;
|
|
663
|
+
preset?: string | null;
|
|
664
|
+
presets?: readonly import("./filterSingleDate").FilterSingleDatePreset[];
|
|
665
|
+
onChange?: (change: import("./filterSingleDate").FilterSingleDateChange) => void;
|
|
666
|
+
}, "onChange" | "value" | "preset" | "presets"> & {
|
|
667
|
+
children?: import("react").ReactNode;
|
|
668
|
+
}>;
|
|
669
|
+
export declare const Stepper: import("react").ComponentType<{
|
|
670
|
+
activeStep?: number | undefined;
|
|
671
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
672
|
+
alternativeLabel?: boolean | undefined;
|
|
673
|
+
nonLinear?: boolean | undefined;
|
|
674
|
+
} & {} & {} & {
|
|
675
|
+
children?: import("react").ReactNode;
|
|
676
|
+
}>;
|
|
677
|
+
export declare const Step: import("react").ComponentType<{
|
|
678
|
+
index?: number | undefined;
|
|
679
|
+
last?: boolean | undefined;
|
|
680
|
+
active?: boolean | undefined;
|
|
681
|
+
completed?: boolean | undefined;
|
|
682
|
+
disabled?: boolean | undefined;
|
|
683
|
+
} & {} & {} & {
|
|
684
|
+
children?: import("react").ReactNode;
|
|
685
|
+
}>;
|
|
686
|
+
export declare const StepLabel: import("react").ComponentType<{
|
|
687
|
+
error?: boolean | undefined;
|
|
688
|
+
} & {} & {
|
|
689
|
+
optional?: import("react").ReactNode;
|
|
690
|
+
} & {
|
|
691
|
+
children?: import("react").ReactNode;
|
|
692
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by scripts/sync-contracts.mjs from @nullplatform/react-ui-components@0.
|
|
1
|
+
// Generated by scripts/sync-contracts.mjs from @nullplatform/react-ui-components@0.17.1. Don't edit: change the contract in
|
|
2
2
|
// react-ui-components, bump `uiComponentsContracts` in package.json and run `pnpm sync:contracts`.
|
|
3
3
|
import { component } from "./component.js";
|
|
4
4
|
export const Badge = component("np-badge");
|
|
@@ -54,3 +54,14 @@ export const ToggleButtonBar = component("np-toggle-button-group");
|
|
|
54
54
|
export const IconActionButton = component("np-icon-button");
|
|
55
55
|
export const AutocompleteSelect = component("np-autocomplete");
|
|
56
56
|
export const DateTimeRangeField = component("np-date-time-range-picker");
|
|
57
|
+
export const Checkbox = component("np-checkbox");
|
|
58
|
+
export const CheckboxCard = component("np-checkbox-card");
|
|
59
|
+
export const Slider = component("np-slider");
|
|
60
|
+
export const Accordion = component("np-accordion");
|
|
61
|
+
export const AccordionSummary = component("np-accordion-summary");
|
|
62
|
+
export const AccordionDetails = component("np-accordion-details");
|
|
63
|
+
export const DatePickerField = component("np-date-picker");
|
|
64
|
+
export const FilterSingleDateField = component("np-filter-single-date");
|
|
65
|
+
export const Stepper = component("np-stepper");
|
|
66
|
+
export const Step = component("np-step");
|
|
67
|
+
export const StepLabel = component("np-step-label");
|
package/dist/context.d.ts
CHANGED
|
@@ -33,12 +33,6 @@ export declare function useNullplatform(): {
|
|
|
33
33
|
ui: {
|
|
34
34
|
snackbar(options: import("./protocol").SnackbarOptions): Promise<void>;
|
|
35
35
|
confirm(options: import("./protocol").ConfirmOptions): Promise<boolean>;
|
|
36
|
-
progress(panel: import("./protocol").ProgressPanel | null): Promise<void>;
|
|
37
|
-
approval(approvalId: string): Promise<void>;
|
|
38
|
-
};
|
|
39
|
-
files: {
|
|
40
|
-
pick(options?: import("./protocol").FilePickOptions): Promise<import("./protocol").PickedFile[]>;
|
|
41
|
-
upload(upload: import("./protocol").FileUpload): Promise<void>;
|
|
42
36
|
};
|
|
43
37
|
context: {
|
|
44
38
|
get(): Promise<PluginContext>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiPermission, HttpPermission
|
|
1
|
+
import type { ApiPermission, HttpPermission } from './manifest.js';
|
|
2
2
|
/** Splits a path into segments; rejects traversal, empty segments and query/hash fragments. */
|
|
3
3
|
export declare function normalizePath(path: string): string[] | null;
|
|
4
4
|
/**
|
|
@@ -9,6 +9,11 @@ export declare function normalizePath(path: string): string[] | null;
|
|
|
9
9
|
export declare function canonicalizePath(path: string): string | null;
|
|
10
10
|
/** `{param}` placeholders match exactly one non-empty segment. */
|
|
11
11
|
export declare function pathMatches(pattern: string, requestSegments: string[]): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* True when no plugin may call `method` on `path`, whatever its manifest declares. A path that
|
|
14
|
+
* does not normalize is not reserved: `isApiRequestAllowed` already refuses it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isReservedApiRequest(method: string, path: string): boolean;
|
|
12
17
|
/**
|
|
13
18
|
* Decides whether a plugin API request (a nullplatform public API path) is covered
|
|
14
19
|
* by its declared `permissions.api`. Query strings are never part of the decision.
|
|
@@ -22,10 +27,3 @@ export declare const isRequestAllowed: typeof isApiRequestAllowed;
|
|
|
22
27
|
* declared method and path pattern.
|
|
23
28
|
*/
|
|
24
29
|
export declare function isHttpRequestAllowed(permissions: HttpPermission[] | undefined, method: string, url: string): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Decides whether a file may be uploaded to `url` under `permissions.upload`: https only, no credentials in the URL,
|
|
27
|
-
* and a declared host. An exact host matches itself (port included when declared); `*.example.com` matches every
|
|
28
|
-
* host under `example.com` on the default port, never `example.com` itself. The path and the query are the
|
|
29
|
-
* upload's own business: a presigned POST goes to `/`.
|
|
30
|
-
*/
|
|
31
|
-
export declare function isUploadAllowed(permissions: UploadPermission[] | undefined, url: string): boolean;
|