@nullplatform/ui-plugin-sdk 0.20.0-beta.0 → 0.20.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.js +2 -1
- package/dist/components.d.ts +16 -3
- package/dist/components.generated.d.ts +149 -6
- 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 +31 -0
- package/dist/contracts.generated.d.ts +157 -0
- package/dist/contracts.generated.js +78 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by scripts/sync-contracts.mjs from @nullplatform/react-ui-components@0.16.
|
|
1
|
+
// Generated by scripts/sync-contracts.mjs from @nullplatform/react-ui-components@0.16.15. Don't edit: change the contract in
|
|
2
2
|
// react-ui-components, bump `uiComponentsContracts` in package.json and run `pnpm sync:contracts`.
|
|
3
3
|
export const UI_COMPONENTS_CONTRACTS = [
|
|
4
4
|
{
|
|
@@ -348,7 +348,7 @@ export const UI_COMPONENTS_CONTRACTS = [
|
|
|
348
348
|
{
|
|
349
349
|
tag: "np-calendar-timeline",
|
|
350
350
|
component: "CalendarTimeline",
|
|
351
|
-
properties: { "from": "string", "to": "string", "timeZone": "string", "rows": "array", "bars": "array", "selectedId": "string", "now": "string", "locale": "string", "resourceLabel": "string" },
|
|
351
|
+
properties: { "from": "string", "to": "string", "timeZone": "string", "rows": "array", "bars": "array", "selectedId": "string", "now": "string", "locale": "string", "resourceLabel": "string", "loading": "boolean", "emptyStateProps": "object", "maxRows": "number" },
|
|
352
352
|
events: { "barPress": "onBarPress" },
|
|
353
353
|
values: { "rows[].kind": ["organization", "account", "namespace", "application"], "bars[].kind": ["freeze", "window"], "bars[].state": ["active", "upcoming", "past"] },
|
|
354
354
|
},
|
|
@@ -378,4 +378,80 @@ export const UI_COMPONENTS_CONTRACTS = [
|
|
|
378
378
|
properties: { "start": "string", "end": "string", "allDay": "boolean", "timeZone": "string", "locale": "string", "label": "string", "error": "string", "disabled": "boolean" },
|
|
379
379
|
events: { "change": "onChange" },
|
|
380
380
|
},
|
|
381
|
+
{
|
|
382
|
+
tag: "np-checkbox",
|
|
383
|
+
component: "Checkbox",
|
|
384
|
+
properties: { "checked": "boolean", "disabled": "boolean" },
|
|
385
|
+
events: { "change": "onChange" },
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
tag: "np-checkbox-card",
|
|
389
|
+
component: "CheckboxCard",
|
|
390
|
+
properties: { "label": "string", "description": "string", "icon": "string", "checked": "boolean", "size": "string", "variant": "string", "align": "string", "justify": "string", "orientation": "string", "indicator": "boolean", "disabled": "boolean", "readOnly": "boolean", "error": "boolean" },
|
|
391
|
+
events: { "change": "onChange" },
|
|
392
|
+
values: { "size": ["sm", "md", "lg"], "variant": ["outline", "surface", "subtle", "solid"], "align": ["start", "end", "center"], "justify": ["start", "end", "center"], "orientation": ["horizontal", "vertical"] },
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
tag: "np-slider",
|
|
396
|
+
component: "Slider",
|
|
397
|
+
properties: { "value": "number", "min": "number", "max": "number", "step": "number", "disabled": "boolean", "aria-label": "string" },
|
|
398
|
+
events: { "change": "onChange", "changeCommitted": "onChangeCommitted" },
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
tag: "np-accordion",
|
|
402
|
+
component: "Accordion",
|
|
403
|
+
properties: { "expanded": "boolean", "defaultExpanded": "boolean", "disabled": "boolean", "disableGutters": "boolean" },
|
|
404
|
+
events: { "change": "onChange" },
|
|
405
|
+
children: true,
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
tag: "np-accordion-summary",
|
|
409
|
+
component: "AccordionSummary",
|
|
410
|
+
properties: {},
|
|
411
|
+
events: {},
|
|
412
|
+
slots: ["expandIcon"],
|
|
413
|
+
children: true,
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
tag: "np-accordion-details",
|
|
417
|
+
component: "AccordionDetails",
|
|
418
|
+
properties: {},
|
|
419
|
+
events: {},
|
|
420
|
+
children: true,
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
tag: "np-date-picker",
|
|
424
|
+
component: "DatePickerField",
|
|
425
|
+
properties: { "value": "string", "minDate": "string", "maxDate": "string", "timeZone": "string", "label": "string", "helperText": "string", "error": "boolean", "disabled": "boolean" },
|
|
426
|
+
events: { "change": "onChange" },
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
tag: "np-filter-single-date",
|
|
430
|
+
component: "FilterSingleDateField",
|
|
431
|
+
properties: { "value": "string", "preset": "string", "presets": "array", "timeZone": "string", "label": "string", "placeholder": "string", "customLabel": "string", "helperText": "string", "error": "boolean", "required": "boolean", "disabled": "boolean", "minDate": "string", "maxDate": "string", "disablePast": "boolean", "disableFuture": "boolean", "hideActionButtons": "boolean" },
|
|
432
|
+
events: { "change": "onChange" },
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
tag: "np-stepper",
|
|
436
|
+
component: "Stepper",
|
|
437
|
+
properties: { "activeStep": "number", "orientation": "string", "alternativeLabel": "boolean", "nonLinear": "boolean" },
|
|
438
|
+
events: {},
|
|
439
|
+
values: { "orientation": ["horizontal", "vertical"] },
|
|
440
|
+
children: true,
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
tag: "np-step",
|
|
444
|
+
component: "Step",
|
|
445
|
+
properties: { "index": "number", "last": "boolean", "active": "boolean", "completed": "boolean", "disabled": "boolean" },
|
|
446
|
+
events: {},
|
|
447
|
+
children: true,
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
tag: "np-step-label",
|
|
451
|
+
component: "StepLabel",
|
|
452
|
+
properties: { "error": "boolean" },
|
|
453
|
+
events: {},
|
|
454
|
+
slots: ["optional"],
|
|
455
|
+
children: true,
|
|
456
|
+
},
|
|
381
457
|
];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `FilterSingleDateField` takes from a plugin and passes back, which its contract can only type as an array and
|
|
3
|
+
* an event. Instants are ISO-8601 strings.
|
|
4
|
+
*/
|
|
5
|
+
/** A choice listed above the calendar, resolved by the plugin when it renders ("in 7 days"). */
|
|
6
|
+
export interface FilterSingleDatePreset {
|
|
7
|
+
/** Any key but `custom`, which names the field's own calendar entry. */
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** The preset's instant; `null` or left out for a preset that stands for no date ("No expiration"). */
|
|
11
|
+
value?: string | null;
|
|
12
|
+
/** Listed but not selectable. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** What `onChange` passes. */
|
|
16
|
+
export interface FilterSingleDateChange {
|
|
17
|
+
/** The chosen instant as UTC ISO-8601, or `null` for no date. */
|
|
18
|
+
value: string | null;
|
|
19
|
+
/** The chosen preset's key, or `null` for a day picked on the calendar. */
|
|
20
|
+
preset: string | null;
|
|
21
|
+
}
|
package/dist/host.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ComponentType } from "react";
|
|
2
|
-
import type { AnnouncedCall } from "./protocol.js";
|
|
3
2
|
export declare function registerTag(component: object, tag: string): void;
|
|
4
3
|
/** Called by the worker runtime with the elements the host announced on `init`. */
|
|
5
4
|
export declare function setHostElements(elements: unknown): void;
|
|
@@ -9,10 +8,3 @@ export declare function setHostElements(elements: unknown): void;
|
|
|
9
8
|
* predate every element that needs the check.
|
|
10
9
|
*/
|
|
11
10
|
export declare function hostRenders(component: ComponentType<any>): boolean;
|
|
12
|
-
/** Called by the worker runtime with the calls the host announced on `init`. */
|
|
13
|
-
export declare function setHostCalls(calls: unknown): void;
|
|
14
|
-
/**
|
|
15
|
-
* Whether this host serves `call`, one a host may lack: an older host, or one whose app cannot do it, refuses it. Offer
|
|
16
|
-
* what the call does only when this is true. False on hosts that announce no calls, which predate every call here.
|
|
17
|
-
*/
|
|
18
|
-
export declare function hostSupports(call: AnnouncedCall): boolean;
|
package/dist/host.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// The tag each catalog component renders, filled in by `component()`.
|
|
2
2
|
const TAGS = new WeakMap();
|
|
3
3
|
let hostElements = new Set();
|
|
4
|
-
let hostCalls = new Set();
|
|
5
4
|
export function registerTag(component, tag) {
|
|
6
5
|
TAGS.set(component, tag);
|
|
7
6
|
}
|
|
@@ -18,14 +17,3 @@ export function hostRenders(component) {
|
|
|
18
17
|
const tag = TAGS.get(component);
|
|
19
18
|
return tag !== undefined && hostElements.has(tag);
|
|
20
19
|
}
|
|
21
|
-
/** Called by the worker runtime with the calls the host announced on `init`. */
|
|
22
|
-
export function setHostCalls(calls) {
|
|
23
|
-
hostCalls = new Set(Array.isArray(calls) ? calls.filter((call) => typeof call === "string") : []);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Whether this host serves `call`, one a host may lack: an older host, or one whose app cannot do it, refuses it. Offer
|
|
27
|
-
* what the call does only when this is true. False on hosts that announce no calls, which predate every call here.
|
|
28
|
-
*/
|
|
29
|
-
export function hostSupports(call) {
|
|
30
|
-
return hostCalls.has(call);
|
|
31
|
-
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { usePluginContext, useNullplatform, useQuery, type WidgetProps, type Que
|
|
|
4
4
|
export { nullplatform, type NullplatformBridge } from './bridge.js';
|
|
5
5
|
export { useTopic, useSetTopic, type UseTopicOptions, type UseTopicResult, type UseSetTopicOptions, type SetTopicState, type TopicMap, type ServiceDraftV1, } from './topics.js';
|
|
6
6
|
export * from './components.js';
|
|
7
|
-
export { hostRenders
|
|
7
|
+
export { hostRenders } from './host.js';
|
|
8
8
|
export { Canvas, useCanvas, canDrawCanvas, type CanvasProps, type CanvasHandle, type CanvasOptions, type CanvasFrame, type CanvasItem, type CanvasInput, type CanvasTheme, type CanvasTooltip, } from './canvas.js';
|
|
9
|
-
export type { PluginContext, ApiRequest, HttpRequest, HttpResponse, NavigationTarget, SnackbarOptions, ConfirmOptions,
|
|
9
|
+
export type { PluginContext, ApiRequest, HttpRequest, HttpResponse, NavigationTarget, SnackbarOptions, ConfirmOptions, TopicSnapshot, TopicStatus } from './protocol.js';
|
|
10
10
|
export { BridgeError } from './protocol.js';
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,6 @@ export { usePluginContext, useNullplatform, useQuery } from './context.js';
|
|
|
4
4
|
export { nullplatform } from './bridge.js';
|
|
5
5
|
export { useTopic, useSetTopic, } from './topics.js';
|
|
6
6
|
export * from './components.js';
|
|
7
|
-
export { hostRenders
|
|
7
|
+
export { hostRenders } from './host.js';
|
|
8
8
|
export { Canvas, useCanvas, canDrawCanvas, } from './canvas.js';
|
|
9
9
|
export { BridgeError } from './protocol.js';
|
package/dist/protocol.d.ts
CHANGED
|
@@ -49,20 +49,6 @@ export interface PluginContext {
|
|
|
49
49
|
name?: string;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
/**
|
|
53
|
-
* Set on a service's own pages, and for each service of a list when the host asks which of a plugin's sections
|
|
54
|
-
* apply to it. `specification` is the kind of service it is, the same a `when` reads as `service.specification.*`.
|
|
55
|
-
*/
|
|
56
|
-
service?: {
|
|
57
|
-
id: number | string;
|
|
58
|
-
slug?: string;
|
|
59
|
-
name?: string;
|
|
60
|
-
specification?: {
|
|
61
|
-
id: string;
|
|
62
|
-
slug?: string;
|
|
63
|
-
name?: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
52
|
/** Set on deployment pages. Not usable in `when` yet (see `CONTEXT_ROOTS`). */
|
|
67
53
|
deployment?: {
|
|
68
54
|
id: number | string;
|
|
@@ -136,87 +122,6 @@ export declare const CONFIRM_LIMITS: {
|
|
|
136
122
|
readonly label: 40;
|
|
137
123
|
readonly confirmationToken: 100;
|
|
138
124
|
};
|
|
139
|
-
/**
|
|
140
|
-
* One line of the host's progress panel: one of the things a longer piece of work is made of (a file of an upload).
|
|
141
|
-
* `waiting` has not started, `running` is in flight, `done` and `failed` are over.
|
|
142
|
-
*/
|
|
143
|
-
export interface ProgressItem {
|
|
144
|
-
/** Names the line across updates of the same panel. */
|
|
145
|
-
id: string;
|
|
146
|
-
label: string;
|
|
147
|
-
/** A short note under the label: a size, or why it failed. */
|
|
148
|
-
detail?: string;
|
|
149
|
-
status: 'waiting' | 'running' | 'done' | 'failed';
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Work that takes a while, as the host draws it in a corner of the page: a plugin cannot draw over the page. The
|
|
153
|
-
* host counts how many items are over out of `items`; it rejects a panel over a cap (see `PROGRESS_LIMITS`) rather
|
|
154
|
-
* than cutting what the person reads.
|
|
155
|
-
*/
|
|
156
|
-
export interface ProgressPanel {
|
|
157
|
-
title: string;
|
|
158
|
-
items: ProgressItem[];
|
|
159
|
-
}
|
|
160
|
-
/** Caps of a `ProgressPanel`: how many items, and the length of each string. */
|
|
161
|
-
export declare const PROGRESS_LIMITS: {
|
|
162
|
-
readonly title: 120;
|
|
163
|
-
readonly items: 100;
|
|
164
|
-
readonly id: 64;
|
|
165
|
-
readonly label: 200;
|
|
166
|
-
readonly detail: 200;
|
|
167
|
-
};
|
|
168
|
-
/** What `files.pick` asks the host's file picker for. */
|
|
169
|
-
export interface FilePickOptions {
|
|
170
|
-
/** The kinds of file the picker offers, as an `<input accept>` list: extensions (`.csv`) or media types (`image/*`). */
|
|
171
|
-
accept?: string[];
|
|
172
|
-
/** Lets the person pick several files at once (`FILE_LIMITS.picked` at most); one file otherwise. */
|
|
173
|
-
multiple?: boolean;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* A file the person picked in the host's file picker. Its bytes stay in the host: a plugin never reads them. `id`
|
|
177
|
-
* names the file for `files.upload`, for as long as the plugin runs.
|
|
178
|
-
*/
|
|
179
|
-
export interface PickedFile {
|
|
180
|
-
id: string;
|
|
181
|
-
name: string;
|
|
182
|
-
/** Size in bytes. */
|
|
183
|
-
size: number;
|
|
184
|
-
/** The media type the browser reports for the file; empty when it knows none. */
|
|
185
|
-
type: string;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Sends a picked file with an HTML form POST (`multipart/form-data`): every field in `fields`, then the file as
|
|
189
|
-
* `file`. This is the shape of an S3 presigned POST. The host sends it without the person's session and cannot read
|
|
190
|
-
* the answer (the upload's host need not allow the dashboard's origin), so check afterwards that the file arrived.
|
|
191
|
-
*/
|
|
192
|
-
export interface FileUpload {
|
|
193
|
-
/** The `id` of a `PickedFile`. */
|
|
194
|
-
file: string;
|
|
195
|
-
/** An https URL whose host is declared in `permissions.upload`. */
|
|
196
|
-
url: string;
|
|
197
|
-
/** Form fields sent before the file. */
|
|
198
|
-
fields?: Record<string, string>;
|
|
199
|
-
}
|
|
200
|
-
/** Caps of `FilePickOptions` and `FileUpload`: counts and string lengths. `picked` is how many files one pick hands back. */
|
|
201
|
-
export declare const FILE_LIMITS: {
|
|
202
|
-
readonly accept: 20;
|
|
203
|
-
readonly acceptEntry: 100;
|
|
204
|
-
readonly picked: 100;
|
|
205
|
-
readonly url: 2048;
|
|
206
|
-
readonly fields: 50;
|
|
207
|
-
readonly fieldName: 200;
|
|
208
|
-
readonly fieldValue: 8192;
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* An approval request's id, as the approvals API routes it (`/approval/:id([0-9]{1,})`): digits only. At most 19, a
|
|
212
|
-
* 64-bit integer, which holds any id it stores; the host rejects anything else.
|
|
213
|
-
*/
|
|
214
|
-
export declare const APPROVAL_ID: RegExp;
|
|
215
|
-
/**
|
|
216
|
-
* Bridge calls a host may lack: one older than the call, or whose app leaves its adapter out, refuses it. A host
|
|
217
|
-
* that serves one announces it on `init` (see `hostSupports`). Only calls added since that announcement are here.
|
|
218
|
-
*/
|
|
219
|
-
export type AnnouncedCall = 'ui.approval';
|
|
220
125
|
/** Methods a plugin can call on the host. */
|
|
221
126
|
export interface BridgeMethods {
|
|
222
127
|
'assets.url': (path: string) => Promise<string>;
|
|
@@ -226,14 +131,6 @@ export interface BridgeMethods {
|
|
|
226
131
|
'ui.snackbar': (options: SnackbarOptions) => Promise<void>;
|
|
227
132
|
/** Resolves `true` only when the person confirms; `false` when they cancel or the host draws no dialog. */
|
|
228
133
|
'ui.confirm': (options: ConfirmOptions) => Promise<boolean>;
|
|
229
|
-
/** Draws, replaces or (with `null`) removes the plugin's progress panel. */
|
|
230
|
-
'ui.progress': (panel: ProgressPanel | null) => Promise<void>;
|
|
231
|
-
/** Shows an approval request in the host's modal; resolves once the person closes it, saying nothing of what they did. */
|
|
232
|
-
'ui.approval': (approvalId: string) => Promise<void>;
|
|
233
|
-
/** Resolves the files the person picked: none when they cancel, one unless `multiple`. */
|
|
234
|
-
'files.pick': (options?: FilePickOptions) => Promise<PickedFile[]>;
|
|
235
|
-
/** Resolves once the form was sent; it does not say whether the upload's host accepted it. */
|
|
236
|
-
'files.upload': (upload: FileUpload) => Promise<void>;
|
|
237
134
|
'context.get': () => Promise<PluginContext>;
|
|
238
135
|
'topics.get': (topic: string) => Promise<TopicSnapshot>;
|
|
239
136
|
'topics.subscribe': (topic: string) => Promise<TopicSnapshot>;
|
|
@@ -361,16 +258,12 @@ export type WorkerMessage = {
|
|
|
361
258
|
error: SerializedError;
|
|
362
259
|
};
|
|
363
260
|
export type HostMessage =
|
|
364
|
-
/**
|
|
365
|
-
* `elements`: the catalog tags this host draws. Hosts before it fail a widget that renders a tag they lack.
|
|
366
|
-
* `calls`: the `AnnouncedCall`s this host serves; hosts before it serve none of them.
|
|
367
|
-
*/
|
|
261
|
+
/** `elements`: the catalog tags this host draws. Hosts before it fail a widget that renders a tag they lack. */
|
|
368
262
|
{
|
|
369
263
|
type: 'init';
|
|
370
264
|
pluginId: string;
|
|
371
265
|
context: PluginContext;
|
|
372
266
|
elements?: string[];
|
|
373
|
-
calls?: string[];
|
|
374
267
|
} | {
|
|
375
268
|
type: 'mount';
|
|
376
269
|
mountId: string;
|
package/dist/protocol.js
CHANGED
|
@@ -9,25 +9,11 @@
|
|
|
9
9
|
export const PROTOCOL_VERSION = 1;
|
|
10
10
|
/** Maximum length of each `ConfirmOptions` string. */
|
|
11
11
|
export const CONFIRM_LIMITS = { title: 200, message: 1000, label: 40, confirmationToken: 100 };
|
|
12
|
-
/** Caps of a `ProgressPanel`: how many items, and the length of each string. */
|
|
13
|
-
export const PROGRESS_LIMITS = { title: 120, items: 100, id: 64, label: 200, detail: 200 };
|
|
14
|
-
/** Caps of `FilePickOptions` and `FileUpload`: counts and string lengths. `picked` is how many files one pick hands back. */
|
|
15
|
-
export const FILE_LIMITS = { accept: 20, acceptEntry: 100, picked: 100, url: 2048, fields: 50, fieldName: 200, fieldValue: 8192 };
|
|
16
|
-
/**
|
|
17
|
-
* An approval request's id, as the approvals API routes it (`/approval/:id([0-9]{1,})`): digits only. At most 19, a
|
|
18
|
-
* 64-bit integer, which holds any id it stores; the host rejects anything else.
|
|
19
|
-
*/
|
|
20
|
-
export const APPROVAL_ID = /^[0-9]{1,19}$/;
|
|
21
12
|
/** How long the host gives a bridge call before it answers `TIMEOUT`. */
|
|
22
13
|
export const BRIDGE_CALL_DEADLINE_MS = 30000;
|
|
23
14
|
/** Calls that wait for a person, not a machine, and so get longer than `BRIDGE_CALL_DEADLINE_MS`. */
|
|
24
15
|
export const BRIDGE_CALL_DEADLINES_MS = {
|
|
25
16
|
'ui.confirm': 10 * 60 * 1000,
|
|
26
|
-
// Reading an approval and completing its checklist takes longer than a yes or no.
|
|
27
|
-
'ui.approval': 30 * 60 * 1000,
|
|
28
|
-
'files.pick': 10 * 60 * 1000,
|
|
29
|
-
// Not a person, but a file on a slow connection: the same ten minutes.
|
|
30
|
-
'files.upload': 10 * 60 * 1000,
|
|
31
17
|
};
|
|
32
18
|
/** The host's deadline for one call. */
|
|
33
19
|
export function bridgeCallDeadline(method) {
|
package/dist/worker.js
CHANGED
|
@@ -9,7 +9,7 @@ import { BatchingRemoteConnection } from '@remote-dom/core/elements';
|
|
|
9
9
|
import { defineCatalogElements, ROOT_TAG } from './elements.js';
|
|
10
10
|
import { bridge } from './bridge.js';
|
|
11
11
|
import { PluginContextProvider, broadcastContext } from './context.js';
|
|
12
|
-
import {
|
|
12
|
+
import { setHostElements } from './host.js';
|
|
13
13
|
import { receiveTopic } from './topics.js';
|
|
14
14
|
import { attachCanvasPort, receiveCanvas } from './canvas.js';
|
|
15
15
|
import { PROTOCOL_VERSION, createIdGenerator, serializeError, serializeFunctions, } from './protocol.js';
|
|
@@ -89,7 +89,6 @@ function handle(port, message) {
|
|
|
89
89
|
case 'init':
|
|
90
90
|
pluginId = message.pluginId;
|
|
91
91
|
setHostElements(message.elements);
|
|
92
|
-
setHostCalls(message.calls);
|
|
93
92
|
broadcastContext(message.context);
|
|
94
93
|
break;
|
|
95
94
|
case 'mount':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nullplatform/ui-plugin-sdk",
|
|
3
|
-
"version": "0.20.0
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "SDK for nullplatform UI plugins: catalog components, bridge client and defineUI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"test": "vitest run --passWithNoTests",
|
|
43
43
|
"sync:contracts": "node scripts/sync-contracts.mjs"
|
|
44
44
|
},
|
|
45
|
-
"uiComponentsContracts": "0.16.
|
|
45
|
+
"uiComponentsContracts": "0.16.15",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@remote-dom/core": "^1.11.1",
|
|
48
48
|
"@remote-dom/react": "^1.2.2",
|