@plitzi/sdk-authoring 0.38.14 → 0.38.16
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/CHANGELOG.md +163 -0
- package/dist/index-src.js +459 -407
- package/dist/index.d.ts +162 -19
- package/dist/index.js +3 -3
- package/dist/node.d.ts +77 -1
- package/dist/node.js +227 -3
- package/dist/plugin.d.ts +2 -1
- package/package.json +6 -6
- package/skills/plitzi-authoring/SKILL.md +1 -1
- package/skills/plitzi-authoring/reference/index.md +3 -2
- package/skills/plitzi-authoring/reference/plugin-reach.md +91 -0
- package/skills/plitzi-authoring/reference/plugins.md +15 -31
- package/skills/plitzi-authoring/reference/realtime.md +11 -0
- package/skills/plitzi-authoring/reference/testing.md +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,9 @@ export declare type ActionAccess =
|
|
|
57
57
|
/** What the action answers: its output, or a function of the input the page sent. */
|
|
58
58
|
export declare type ActionAnswer = Record<string, unknown> | ((input: Record<string, unknown>) => Record<string, unknown>);
|
|
59
59
|
|
|
60
|
+
/** What a page hands an action: its `call` way in's fields, typed. */
|
|
61
|
+
export declare type ActionCallInput<Spec extends ActionSpec> = CallFieldsOf<Spec> extends Readonly<Record<string, ActionField>> ? ActionInputOf<CallFieldsOf<Spec>> : Record<string, unknown>;
|
|
62
|
+
|
|
60
63
|
/**
|
|
61
64
|
* A server action: a declarative flow, stored per space, executed by the server.
|
|
62
65
|
*
|
|
@@ -123,6 +126,16 @@ export declare type ActionField = {
|
|
|
123
126
|
*/
|
|
124
127
|
export declare type ActionFieldType = 'text' | 'number' | 'boolean' | 'date' | 'json' | 'file';
|
|
125
128
|
|
|
129
|
+
/** What a caller sends for a field of a type: text for `text`, `date` and `file`, anything parseable for `json`. */
|
|
130
|
+
declare type ActionFieldValue<T extends ActionFieldType> = T extends 'number' ? number : T extends 'boolean' ? boolean : T extends 'json' ? unknown : string;
|
|
131
|
+
|
|
132
|
+
/** The input a caller hands an action, from the fields it declares: those `required: true` must be there. */
|
|
133
|
+
declare type ActionInputOf<Fields extends Readonly<Record<string, ActionField>>> = {
|
|
134
|
+
-readonly [K in keyof Fields as Fields[K]['required'] extends true ? K : never]: ActionFieldValue<Fields[K]['type']>;
|
|
135
|
+
} & {
|
|
136
|
+
-readonly [K in keyof Fields as Fields[K]['required'] extends true ? never : K]?: ActionFieldValue<Fields[K]['type']>;
|
|
137
|
+
};
|
|
138
|
+
|
|
126
139
|
/** Ceilings for one run. A per-action value may only tighten the deployment's own. */
|
|
127
140
|
export declare type ActionLimits = {
|
|
128
141
|
timeoutMs?: number;
|
|
@@ -1906,7 +1919,8 @@ export declare interface AuthorSpaceOptions {
|
|
|
1906
1919
|
drawsNothingTypes?: readonly string[];
|
|
1907
1920
|
/**
|
|
1908
1921
|
* The types that show only some of their children, chosen as they run (a plugin's `choosesChildren`), under the name
|
|
1909
|
-
* a space uses them by. Everything inside them is `conditional`, so a page check owes none of it on screen
|
|
1922
|
+
* a space uses them by. Everything inside them is `conditional`, so a page check owes none of it on screen — until it
|
|
1923
|
+
* is drawn: then its handle's `shownWith` makes it owed like the rest of the page.
|
|
1910
1924
|
*/
|
|
1911
1925
|
choosesChildrenTypes?: readonly string[];
|
|
1912
1926
|
/**
|
|
@@ -2217,8 +2231,36 @@ export declare const button: ElementFactory<Partial<{
|
|
|
2217
2231
|
ariaPressed?: boolean | undefined;
|
|
2218
2232
|
}>>;
|
|
2219
2233
|
|
|
2234
|
+
/**
|
|
2235
|
+
* The key a typed action's input and output ride under, in its type only — nothing holds it at run time. Exported so a
|
|
2236
|
+
* package that emits declarations can name the type of an action it exports (`export const actions = [defineAction(…)]`):
|
|
2237
|
+
* a symbol it cannot import is one its `.d.ts` cannot write (TS4023).
|
|
2238
|
+
*/
|
|
2239
|
+
export declare const CALL_TYPES: unique symbol;
|
|
2240
|
+
|
|
2220
2241
|
declare type CallbackName<D extends DeclaresInteractions> = keyof NonNullable<D['callbacks']> & string;
|
|
2221
2242
|
|
|
2243
|
+
/** The fields an action's `call` way in declares — the one a page runs — or none, for an action with no such way. */
|
|
2244
|
+
declare type CallFieldsOf<Spec extends ActionSpec> = Extract<Spec['trigger'] extends readonly (infer Trigger)[] ? Trigger : Spec['trigger'], {
|
|
2245
|
+
type: 'call';
|
|
2246
|
+
}> extends {
|
|
2247
|
+
input?: infer Fields;
|
|
2248
|
+
} ? Fields : undefined;
|
|
2249
|
+
|
|
2250
|
+
/** The input an action's `call` way in takes, from its type — any object, for an action whose type does not say. */
|
|
2251
|
+
export declare type CallInputOf<Action> = Action extends {
|
|
2252
|
+
readonly [CALL_TYPES]?: {
|
|
2253
|
+
input: infer Input;
|
|
2254
|
+
};
|
|
2255
|
+
} ? unknown extends Input ? Record<string, unknown> : Input : Record<string, unknown>;
|
|
2256
|
+
|
|
2257
|
+
/** What an action answers, from its type — `unknown` for one whose type does not say. */
|
|
2258
|
+
export declare type CallOutputOf<Action> = Action extends {
|
|
2259
|
+
readonly [CALL_TYPES]?: {
|
|
2260
|
+
output: infer Output;
|
|
2261
|
+
};
|
|
2262
|
+
} ? Output : unknown;
|
|
2263
|
+
|
|
2222
2264
|
/**
|
|
2223
2265
|
* Stops an `apiContainer`'s request in flight, by id — a STOP for a slow report: the request is dropped, on the
|
|
2224
2266
|
* server too, and what the container shows stays. Its `isLoading` turns false.
|
|
@@ -2351,6 +2393,13 @@ export declare type ChannelDeclaration = {
|
|
|
2351
2393
|
* a locked board.
|
|
2352
2394
|
*/
|
|
2353
2395
|
grant?: boolean;
|
|
2396
|
+
/**
|
|
2397
|
+
* Whether the server keeps the latest message of each type on a topic, and hands them to every page that joins: state
|
|
2398
|
+
* all the screens share — a dashboard's lists, a board's settings — said once by the server (`ctx.publish`, a flow's
|
|
2399
|
+
* `realtime.publish`) and there for a page that opens later, as `<channel>.retained.<type>`. Kept until the next of
|
|
2400
|
+
* its type; `null` forgets it. Only on a channel the server alone publishes on (`publish: 'server'`).
|
|
2401
|
+
*/
|
|
2402
|
+
retain?: boolean;
|
|
2354
2403
|
/** The largest `data` a page may send, as JSON bytes. 4 KB when absent. */
|
|
2355
2404
|
maxMessageBytes?: number;
|
|
2356
2405
|
/** How many messages one connection may send a second. 30 when absent. */
|
|
@@ -2784,7 +2833,7 @@ export declare const defaultAttributes: (type: string) => Record<string, unknown
|
|
|
2784
2833
|
/** The name a factory gives an element of this type in the builder's tree, unless the author gave it another. */
|
|
2785
2834
|
export declare const defaultLabel: (type: string) => string;
|
|
2786
2835
|
|
|
2787
|
-
export declare const defineAction: (spec:
|
|
2836
|
+
export declare const defineAction: <const Spec extends ActionSpec>(spec: Spec) => TypedActionEntry<ActionCallInput<Spec>>;
|
|
2788
2837
|
|
|
2789
2838
|
/** What {@link definePlugin} answers: the declaration, its events and actions named, and its attributes in its type. */
|
|
2790
2839
|
export declare type DefinedPlugin<A extends object, T extends Record<string, PluginTriggerSpec>, C extends Record<string, PluginCallbackSpec>> = Omit<PluginDeclaration<A>, 'triggers' | 'callbacks'> & {
|
|
@@ -3202,7 +3251,8 @@ export declare interface ElementDeclarationData {
|
|
|
3202
3251
|
/**
|
|
3203
3252
|
* Whether the element shows only some of the children put inside it, chosen as it runs — a dashboard showing the
|
|
3204
3253
|
* panels of the layout saved for this device, a wizard its current step. Read by the page checks, which then owe none
|
|
3205
|
-
* of them on screen;
|
|
3254
|
+
* of them on screen; the ones it draws are checked like the rest of the page — there, visible, and what is named
|
|
3255
|
+
* inside them too.
|
|
3206
3256
|
*/
|
|
3207
3257
|
choosesChildren?: boolean;
|
|
3208
3258
|
/**
|
|
@@ -6858,6 +6908,12 @@ export declare interface ElementHandle {
|
|
|
6858
6908
|
* Present only when true: almost nothing on a page is conditional, and the handles are serialized.
|
|
6859
6909
|
*/
|
|
6860
6910
|
conditional?: true;
|
|
6911
|
+
/**
|
|
6912
|
+
* For an element an element that chooses its children (`choosesChildren`) may draw — one of those children, or what
|
|
6913
|
+
* is inside one under no condition of its own: that child, by id. It is `conditional`, since a bare visit owes none
|
|
6914
|
+
* of it; once the child is drawn, it and everything it holds are owed like the rest of the page.
|
|
6915
|
+
*/
|
|
6916
|
+
shownWith?: string;
|
|
6861
6917
|
/**
|
|
6862
6918
|
* Whether this element sits inside a list's row, so it renders once per row — several times, or not at all while the
|
|
6863
6919
|
* list is empty. Its selector matches every copy: address one with the driver's `.first()` / `.nth()`.
|
|
@@ -8614,6 +8670,34 @@ export declare const nodeHtml: ElementFactory<Partial<{
|
|
|
8614
8670
|
subType?: "span" | undefined;
|
|
8615
8671
|
}>>;
|
|
8616
8672
|
|
|
8673
|
+
/** How a notification looks: the `addNotification` step's `appearance`, and `useNotify`'s. */
|
|
8674
|
+
export declare const NOTIFICATION_APPEARANCES: readonly ["success", "danger", "warning", "info"];
|
|
8675
|
+
|
|
8676
|
+
/** The defaults of a notification, the step's and the hook's alike. */
|
|
8677
|
+
export declare const NOTIFICATION_DEFAULTS: {
|
|
8678
|
+
readonly placement: "top-right";
|
|
8679
|
+
readonly appearance: "success";
|
|
8680
|
+
readonly autoDismiss: true;
|
|
8681
|
+
readonly autoDismissTimeout: 5000;
|
|
8682
|
+
};
|
|
8683
|
+
|
|
8684
|
+
/** Where a notification may appear: the `addNotification` step's `placement`, and `useNotify`'s. */
|
|
8685
|
+
export declare const NOTIFICATION_PLACEMENTS: readonly ["top-right", "top-center", "top-left", "bottom-right", "bottom-center", "bottom-left"];
|
|
8686
|
+
|
|
8687
|
+
export declare type NotificationAppearance = (typeof NOTIFICATION_APPEARANCES)[number];
|
|
8688
|
+
|
|
8689
|
+
/** What a notification takes besides its text — every one with the default the `addNotification` step has. */
|
|
8690
|
+
declare type NotificationOptions_2 = {
|
|
8691
|
+
placement?: NotificationPlacement;
|
|
8692
|
+
appearance?: NotificationAppearance;
|
|
8693
|
+
autoDismiss?: boolean;
|
|
8694
|
+
/** Milliseconds before it dismisses itself, with `autoDismiss`. */
|
|
8695
|
+
autoDismissTimeout?: number;
|
|
8696
|
+
};
|
|
8697
|
+
export { NotificationOptions_2 as NotificationOptions }
|
|
8698
|
+
|
|
8699
|
+
export declare type NotificationPlacement = (typeof NOTIFICATION_PLACEMENTS)[number];
|
|
8700
|
+
|
|
8617
8701
|
/** Every field `notifications` takes — what an editor of the setting (the builder, the MCP server's `patchSettings`) offers. */
|
|
8618
8702
|
export declare const NOTIFICATIONS_FIELDS: readonly (keyof NotificationsSpec)[];
|
|
8619
8703
|
|
|
@@ -8674,6 +8758,16 @@ declare type OfflineDataRaw = {
|
|
|
8674
8758
|
plugins?: PluginRaw[];
|
|
8675
8759
|
};
|
|
8676
8760
|
|
|
8761
|
+
/**
|
|
8762
|
+
* `on('onClick')`, and the same for every other trigger — a plugin's too (`on('onPick')`). What the event carries is
|
|
8763
|
+
* read through the step's id, so name it: `[named('picked', on('onPick')), setState({ key: 'seat', type: 'text', value:
|
|
8764
|
+
* '{{ picked.seat }}' })]`.
|
|
8765
|
+
*
|
|
8766
|
+
* The basic set every element registers is named and autocompletes; any other string is accepted because a TYPE
|
|
8767
|
+
* may publish triggers of its own — a form's `onSubmit`, a provider's page change — and refusing those would make
|
|
8768
|
+
* the builders useless for exactly the flows that matter most. A plugin's, typed by its declaration:
|
|
8769
|
+
* `declaredTrigger(declaration, 'onPick')`.
|
|
8770
|
+
*/
|
|
8677
8771
|
export declare const on: (trigger: ElementTriggerName | (string & {}), params?: Record<string, unknown>) => StepSpec;
|
|
8678
8772
|
|
|
8679
8773
|
export declare const onClick: (params?: {
|
|
@@ -8729,6 +8823,12 @@ export declare const onPointerDown: (params?: {
|
|
|
8729
8823
|
*/
|
|
8730
8824
|
export declare const onScreen: (handles: SpaceHandles, page: string, options?: OnScreenOptions) => ElementHandle[];
|
|
8731
8825
|
|
|
8826
|
+
/**
|
|
8827
|
+
* What a page owes only if an element that chooses its children draws them (`shownWith`): left out of `onScreen`,
|
|
8828
|
+
* since a bare visit may show none, and owed like the rest once the child they come with is on screen.
|
|
8829
|
+
*/
|
|
8830
|
+
export declare const onScreenIfChosen: (handles: SpaceHandles, page: string, options?: OnScreenOptions) => ElementHandle[];
|
|
8831
|
+
|
|
8732
8832
|
export declare interface OnScreenOptions {
|
|
8733
8833
|
/**
|
|
8734
8834
|
* Which elements a freshly opened page owes: `named` (the default) is what an author bothered to name — the contract
|
|
@@ -8909,7 +9009,10 @@ export declare const pageRegions: () => PictureRegion[];
|
|
|
8909
9009
|
export declare interface PageReport {
|
|
8910
9010
|
/** The page that was inspected, by id. */
|
|
8911
9011
|
page: string;
|
|
8912
|
-
/**
|
|
9012
|
+
/**
|
|
9013
|
+
* How many elements were owed and checked — what an element that chooses its children drew counted in, and what it
|
|
9014
|
+
* did not draw left out.
|
|
9015
|
+
*/
|
|
8913
9016
|
checked: number;
|
|
8914
9017
|
/**
|
|
8915
9018
|
* Everything wrong, one sentence each, naming the element and the reason — empty when the page is whole.
|
|
@@ -9288,7 +9391,10 @@ export declare interface PluginDeclarationData {
|
|
|
9288
9391
|
sourceType?: string;
|
|
9289
9392
|
/** Behaviour rather than content: it draws nothing on a page, so no check waits for it on screen. */
|
|
9290
9393
|
drawsNothing?: boolean;
|
|
9291
|
-
/**
|
|
9394
|
+
/**
|
|
9395
|
+
* It shows only some of its children, chosen as it runs: no check waits for any of them on screen, and the ones it
|
|
9396
|
+
* draws are checked like the rest of the page.
|
|
9397
|
+
*/
|
|
9292
9398
|
choosesChildren?: boolean;
|
|
9293
9399
|
/** The events it fires beyond the ones every element does, by action. */
|
|
9294
9400
|
triggers?: Readonly<Record<string, {
|
|
@@ -9454,6 +9560,8 @@ export declare interface ProbeFindings {
|
|
|
9454
9560
|
id: string;
|
|
9455
9561
|
reason: string;
|
|
9456
9562
|
}[];
|
|
9563
|
+
/** Owed only with an element that chooses its children drawing it, and not drawn: not checked, and not a problem. */
|
|
9564
|
+
notDrawn: string[];
|
|
9457
9565
|
/** Owed, and hidden at this width by a breakpoint on purpose — checked at the width it shows at, not a problem. */
|
|
9458
9566
|
byWidth: string[];
|
|
9459
9567
|
/** Each with the element it is in, by id, when one of the space's holds it. */
|
|
@@ -9486,11 +9594,15 @@ export declare interface ProbeFindings {
|
|
|
9486
9594
|
* Plain data both ways, because it crosses into the page as a serialized argument and comes back the same way.
|
|
9487
9595
|
*/
|
|
9488
9596
|
export declare interface ProbeInput {
|
|
9489
|
-
/**
|
|
9597
|
+
/**
|
|
9598
|
+
* `list`: a list, whose box is only its rows — none drawn is a list with nothing in it, not one hidden. `shownWith`:
|
|
9599
|
+
* the selector of the element an element that chooses its children drew it with — owed only while that one shows.
|
|
9600
|
+
*/
|
|
9490
9601
|
expected: {
|
|
9491
9602
|
id: string;
|
|
9492
9603
|
selector: string;
|
|
9493
9604
|
list?: true;
|
|
9605
|
+
shownWith?: string;
|
|
9494
9606
|
}[];
|
|
9495
9607
|
images: boolean;
|
|
9496
9608
|
overflow: boolean;
|
|
@@ -9554,6 +9666,15 @@ export declare const readDevTools: (driver: DevToolsDriver, input: DevToolsInput
|
|
|
9554
9666
|
/** Runs in the page. Self-contained — it is serialised — and it trusts nothing it reads off `window`. */
|
|
9555
9667
|
export declare const readDevToolsInPage: ({ state, element }: DevToolsInput) => DevToolsReport;
|
|
9556
9668
|
|
|
9669
|
+
/**
|
|
9670
|
+
* What a notification was handed, kept to what it takes — a flow's values arrive as written, and a plugin may be plain
|
|
9671
|
+
* JavaScript — with each field set aside named, so the caller says so rather than showing the default in silence.
|
|
9672
|
+
*/
|
|
9673
|
+
export declare const readNotificationOptions: (given: Readonly<Record<string, unknown>>) => {
|
|
9674
|
+
options: NotificationOptions_2;
|
|
9675
|
+
ignored: string[];
|
|
9676
|
+
};
|
|
9677
|
+
|
|
9557
9678
|
/** Reconcile supplied params to a catalog schema: drop unknown keys when the set is CLOSED (strict), then fill the
|
|
9558
9679
|
* builder's defaults for any declared param the agent omitted whose `when` guard holds. Mirrors what the builder
|
|
9559
9680
|
* stores, so the persisted node round-trips cleanly. */
|
|
@@ -11239,19 +11360,7 @@ export declare type TagType = 'class' | 'element' | 'id';
|
|
|
11239
11360
|
/** Colour names beside the palette: a space's tokens (`surface: 'var(--surface)'`), or a palette name redefined. */
|
|
11240
11361
|
export declare type TailwindColors = Readonly<Record<string, string>>;
|
|
11241
11362
|
|
|
11242
|
-
|
|
11243
|
-
* A server action that runs one of the space's tasks and answers its result — the way in a task is reached by from a
|
|
11244
|
-
* page (`call`), the HTML (`render`) or anywhere else, written once: the task's params are the action's input, its
|
|
11245
|
-
* title and description the action's, its address the id.
|
|
11246
|
-
*
|
|
11247
|
-
* ```ts
|
|
11248
|
-
* export const make = taskAction(tasks.make, { trigger: { type: 'call', access: 'public' } });
|
|
11249
|
-
* runServerAction({ actionId: make.id, input: { title: '{{ state.title }}' } });
|
|
11250
|
-
* ```
|
|
11251
|
-
*
|
|
11252
|
-
* An action of more than one step, or one whose input is not the task's params, is a `defineAction`.
|
|
11253
|
-
*/
|
|
11254
|
-
export declare const taskAction: (task: ActionTask, { trigger, id, name, description, output, limits }: TaskActionOptions) => ActionEntry;
|
|
11363
|
+
export declare const taskAction: <Task extends ActionTask>(task: Task, { trigger, id, name, description, output, limits }: TaskActionOptions) => TypedActionEntry<TaskInput<Task>, TaskOutput<Task>>;
|
|
11255
11364
|
|
|
11256
11365
|
export declare interface TaskActionOptions {
|
|
11257
11366
|
trigger: TaskActionTrigger | TaskActionTrigger[];
|
|
@@ -11271,6 +11380,28 @@ export declare type TaskActionTrigger = ActionTriggerSpec extends infer Trigger
|
|
|
11271
11380
|
input?: Record<string, ActionField>;
|
|
11272
11381
|
} : never : never;
|
|
11273
11382
|
|
|
11383
|
+
/**
|
|
11384
|
+
* A server action that runs one of the space's tasks and answers its result — the way in a task is reached by from a
|
|
11385
|
+
* page (`call`), the HTML (`render`) or anywhere else, written once: the task's params are the action's input, its
|
|
11386
|
+
* title and description the action's, its address the id.
|
|
11387
|
+
*
|
|
11388
|
+
* ```ts
|
|
11389
|
+
* export const make = taskAction(tasks.make, { trigger: { type: 'call', access: 'public' } });
|
|
11390
|
+
* runServerAction({ actionId: make.id, input: { title: '{{ state.title }}' } });
|
|
11391
|
+
* ```
|
|
11392
|
+
*
|
|
11393
|
+
* An action of more than one step, or one whose input is not the task's params, is a `defineAction`.
|
|
11394
|
+
*/
|
|
11395
|
+
/** What a task takes, from its `run` — any object, for a task described without one. */
|
|
11396
|
+
declare type TaskInput<Task> = Task extends {
|
|
11397
|
+
run: (params: infer Params, ...rest: never[]) => unknown;
|
|
11398
|
+
} ? Params : Record<string, unknown>;
|
|
11399
|
+
|
|
11400
|
+
/** What a task answers, from its `run` — awaited: a page receives the value, never the promise. */
|
|
11401
|
+
declare type TaskOutput<Task> = Task extends {
|
|
11402
|
+
run: (...args: never[]) => infer Result;
|
|
11403
|
+
} ? Awaited<Result> : unknown;
|
|
11404
|
+
|
|
11274
11405
|
/** What a binding's template hands its attribute: its rendered text, or the value of its one `{{ expression }}`. */
|
|
11275
11406
|
export declare type TemplateReturns = 'text' | 'value';
|
|
11276
11407
|
|
|
@@ -11499,6 +11630,18 @@ export declare interface TwOptions {
|
|
|
11499
11630
|
/** The callbacks only some types answer to, by action name — with their params, for whatever explains or checks one. */
|
|
11500
11631
|
export declare const typeCallbackDefinitions: Record<string, InteractionCallback>;
|
|
11501
11632
|
|
|
11633
|
+
/**
|
|
11634
|
+
* An action whose `call` way in is known to the types — what it takes and what it answers: what `defineAction` and
|
|
11635
|
+
* `taskAction` answer, so a page that runs it (`useServerAction<typeof saveHabit>('save-habit')`) is held to the input
|
|
11636
|
+
* it declares and handed the output typed. Nothing of it exists at run time — the action is the same document.
|
|
11637
|
+
*/
|
|
11638
|
+
export declare type TypedActionEntry<Input, Output = unknown> = ActionEntry & {
|
|
11639
|
+
readonly [CALL_TYPES]?: {
|
|
11640
|
+
input: Input;
|
|
11641
|
+
output: Output;
|
|
11642
|
+
};
|
|
11643
|
+
};
|
|
11644
|
+
|
|
11502
11645
|
/** A list fed by a typed source: its `row` is handed the item typed as the sample's (`g => text({ from: g.item.title })`). */
|
|
11503
11646
|
declare type TypedListProps<Item> = Omit<ListProps, 'items' | 'row'> & {
|
|
11504
11647
|
items: SourcePath<readonly Item[]>;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { n as e$1, r as r$
|
|
3
|
-
export { AUTHORING_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, a as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, t as BUILTIN_PARAM_TYPES, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, t$1 as DOCUMENT_SCROLLS, ELEMENT_FIELDS, EXPLAIN_KINDS, FIXABLE_CODES, GLOBAL_CALLBACK_BUILDERS, GLOBAL_SOURCES, t$2 as MOTION_ENTERS, r as MOTION_LOOPS, n as MOTION_TRIGGERS, i as NOTIFICATIONS_FIELDS, PAGE_SPEC_FIELDS, PAGE_TEXT_LIMIT, SCHEMA_SETTINGS, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STYLE_STATES, SpaceRefusedError, actionSource, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, alignPictures, announceOn, answerAction, apiContainer, appendState, applyBuiltinCallback, s as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, bindTemplate, blankSpace, space as blankSpaceSpec, blankTemplateFiles, blockHtml, blockJsx, boundAttribute, buildHandles, button, cancelApi, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, className, classNames, classRefs, clearState, closeDialog, closeModal, closest, column, compactSvg, comparePictures, compareSpaces, compareTexts, component, container, copyToClipboard, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, dataIssues, declaredCallback, declaredTrigger, defaultAttributes, defaultLabel, defineAction, defineElement, a$1 as definePlugin, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, r$
|
|
1
|
+
import { $ as EXPLAIN_KINDS, $i as hiddenWhen, $n as toggleState, $r as withPluginCatalogs, $t as STYLE_STATES, A as unrollPage, Aa as a, Ai as svg, An as applyUtility, Ar as onClick, At as withNotificationsCss, B as CATALOG_TEMPLATE_IDENTITY, Bi as defaultLabel, Bn as copyToClipboard, Br as onSubmit, Bt as column, C as pageTexts, Ca as elementTriggers, Ci as modalContainer, Cn as selectorFor, Cr as carouselPlay, Ct as suggestClassOverrides, D as pageRegions, Da as n$2, Di as plitziSdk, Dn as defineAction, Dr as declaredCallback, Dt as familyOf, E as diffPictures, Ea as typeTriggerDefinitions, Ei as paragraph, En as authoringCodesTable, Er as closeModal, Et as refusalOf, F as failedFlowText, Fa as n$1, Fi as text, Fn as authLogin, Fr as onKey, Ft as r, G as toPortableSource, Gi as GLOBAL_SOURCES, Gn as moveState, Gr as resetForm, Gt as classRefs, H as blankTemplateFiles, Hi as element, Hn as delay, Hr as openModal, Ht as row, I as readDevTools, Ia as r$3, Ii as themeToggle, In as authLogout, Ir as onLoad, It as t$2, J as darkScheme, Ji as authorBinding, Jn as runServerAction, Jr as scrollTo, Jt as isStyleDeclaration, K as space$1, Ki as activeOn, Kn as navigate, Kr as scrollBy, Kt as isClassModifier, L as readDevToolsInPage, La as s$1, Li as video, Ln as authRefreshDetails, Lr as onPageLoad, Lt as tokens, M as inspectPage, Ma as o, Mi as tabContainerBody, Mn as SET_STATE_TYPES, Mr as onFlowError, Mt as i, N as onScreen, Na as s, Ni as tabContainerHeader, Nn as addNotification, Nr as onFlowProgress, Nt as FIXABLE_CODES, O as profilePictures, Oa as t$1, Oi as reference, On as taskAction, Or as declaredTrigger, Ot as pageFamily, P as onScreenIfChosen, Pa as c, Pi as tabContainerItem, Pn as appendState, Pr as onInterval, Pt as n, Q as BUILDER_NAMES, Qi as hasVisibilityBinding, Qn as toggleInState, Qr as elementsFromManifest, Qt as BREAKPOINTS, R as dataIssues, Ra as t, Ri as component, Rn as cancelServerAction, Rr as onPointerDown, Rt as createTw, S as compareTexts, Sa as elementSourceTypes, Si as markdown, Sn as pathForSlug, Sr as carouselPause, St as withoutQuieted, T as comparePictures, Ta as typeCallbackDefinitions, Ti as pagination, Tn as flagSpecOf, Tr as closeDialog, Tt as SpaceRefusedError, U as catalogTemplateFiles, Ui as inferredLinkMode, Un as hostAction, Ur as publishOn, Ut as className, V as blankSpace, Vi as defineElement, Vn as cycleState, Vr as openDialog, Vt as grid, W as emptyTemplateFiles, Wi as COMPONENT_SOURCES, Wn as invalidateQueries, Wr as reloadApi, Wt as classNames, X as importedFiles, Xi as boundAttribute, Xn as setState, Xr as toggleElement, Xt as splitClassList, Y as importSlug, Yi as bindTemplate, Yn as runServerActionOrNotify, Yr as setFieldValue, Yt as modifierClassName, Z as importProbe, Zi as groupBindings, Zn as stepState, Zr as updateElement, Zt as styles, _ as shortcutKey, _a as elementCatalog, _i as heading, _n as digest, _r as t$3, _t as transformerCatalog, a as locateClasses, aa as actionSource, ai as carousel, an as cssShorthands, ar as named, at as ELEMENT_FIELDS, b as summariseRenders, ba as elementPartTypes, bi as list, bn as instanceSelectorFor, br as carouselGoTo, bt as assertSpaceValid, c as validateSnippet, ca as closest, ci as container, cn as expandShorthandTraced, cr as whenSucceeded, ct as SCHEMA_SETTINGS, d as i$3, da as AuthoringError, di as dropdown, dn as cssProperties, dr as applyBuiltinCallback, dt as actionSpecFromEntry, ea as resolveSource, en as css, er as twigTemplate, et as GLOBAL_CALLBACK_BUILDERS, f as o$1, fa as authoringCodeEntry, fi as dropdownPopup, fn as cssPropertyName, fr as getGlobalCallback, ft as actionToSource, g as pressShortcut, ga as elementCallbacks, gi as formControl, gr as r$1, gt as suggestTransformer, h as withElement, ha as elementAttributeValues, hi as form, hn as suggestCssProperty, hr as n$3, ht as getTransformer, i as lintSpace, ia as withVisibility, ii as button, in as toResponsive, ir as flowStepIds, it as explanationText, j as inspectDocument, ja as i$1, ji as tabContainer, jn as getUtility, jr as onFlowEnd, jt as d, k as loadImages, ka as elementAttributeNames, ki as richText, kn as BUILTIN_UTILITIES, kr as on, kt as notificationsCss, l as validateSpace, la as scope, li as custom, ln as shorthandLonghands, lr as whileRunning, lt as specFromSpace, m as singlePageSpace, ma as elementAncestorTypes, mi as fontAwesome, mn as isCustomProperty, mr as i$2, mt as BUILTIN_TRANSFORMERS, n as authorSpace, na as variantFrom, ni as blockHtml, nn as sameBlocks, nr as authorFlow, nt as explainKindOf, o as locateElements, oa as source, oi as carouselTrack, on as expandShorthand, or as when, ot as SPACE_FIELDS, p as compactSvg, pa as isSuggestionCode, pi as embed, pn as isCssProperty, pr as e, pt as withNamedIds, q as space, qi as activeWhen, qn as removeState, qr as scrollIntoView, qt as isClassRef, r as fixSpace, ra as visibleWhen, ri as blockJsx, rn as toBlocks, rr as authorFlows, rt as explainList, s as planFixes, sa as twig, si as channel, sn as expandShorthandPatch, sr as whenFailed, st as specToSource, t as authorSnippet, ta as toBindingSpecs, ti as apiContainer, tn as isRuleSetSpec, tr as webHook, tt as explain, u as a$2, ua as AUTHORING_CODES, ui as dialogContainer, un as cssNumberValue, ur as BUILTIN_GLOBAL_CALLBACKS, ut as compareSpaces, v as openPage, va as elementDefaultAttributes, vi as image, vn as slugify, vr as announceOn, vt as assertSnippetValid, w as alignPictures, wa as elementTypeNames, wi as nodeHtml, wn as flagGateOf, wr as carouselPrevious, wt as unusedDeclarations, x as PAGE_TEXT_LIMIT, xa as elementSlots, xi as listItem, xn as locate, xr as carouselNext, xt as suggestSpace, y as inspectRenders, ya as elementLeafTypes, yi as link, yn as buildHandles, yr as cancelApi, yt as PAGE_SPEC_FIELDS, z as answerAction, zi as defaultAttributes, zn as clearState, zr as onScroll, zt as tw } from "./index-src.js";
|
|
2
|
+
import { n as e$1, r as r$2, t as a$1 } from "./index-declare.js";
|
|
3
|
+
export { AUTHORING_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, a as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, t as BUILTIN_PARAM_TYPES, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, t$1 as DOCUMENT_SCROLLS, ELEMENT_FIELDS, EXPLAIN_KINDS, FIXABLE_CODES, GLOBAL_CALLBACK_BUILDERS, GLOBAL_SOURCES, t$2 as MOTION_ENTERS, r as MOTION_LOOPS, n as MOTION_TRIGGERS, i as NOTIFICATIONS_FIELDS, t$3 as NOTIFICATION_APPEARANCES, r$1 as NOTIFICATION_DEFAULTS, e as NOTIFICATION_PLACEMENTS, PAGE_SPEC_FIELDS, PAGE_TEXT_LIMIT, SCHEMA_SETTINGS, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STYLE_STATES, SpaceRefusedError, actionSource, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, alignPictures, announceOn, answerAction, apiContainer, appendState, applyBuiltinCallback, s as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, bindTemplate, blankSpace, space as blankSpaceSpec, blankTemplateFiles, blockHtml, blockJsx, boundAttribute, buildHandles, button, cancelApi, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, className, classNames, classRefs, clearState, closeDialog, closeModal, closest, column, compactSvg, comparePictures, compareSpaces, compareTexts, component, container, copyToClipboard, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, dataIssues, declaredCallback, declaredTrigger, defaultAttributes, defaultLabel, defineAction, defineElement, a$1 as definePlugin, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, r$2 as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementPartTypes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, space$1 as emptySpaceSpec, emptyTemplateFiles, expandShorthand, expandShorthandPatch, expandShorthandTraced, explain, explainKindOf, explainList, explanationText, failedFlowText, familyOf, fixSpace, flagGateOf, flagSpecOf, flowStepIds, fontAwesome, form, formControl, o as getElementCallback, getGlobalCallback, getTransformer, getUtility, grid, groupBindings, hasVisibilityBinding, heading, n$1 as hiddenParams, hiddenWhen, hostAction, image, importProbe, importSlug, importedFiles, inferredLinkMode, inspectDocument, inspectPage, inspectRenders, instanceSelectorFor, s$1 as invalidParams, invalidateQueries, isClassModifier, isClassRef, isCssProperty, isCustomProperty, n$2 as isDocumentScroll, isRuleSetSpec, isStyleDeclaration, isSuggestionCode, link, lintSpace, list, listItem, loadImages, locate, locateClasses, locateElements, markdown, r$3 as missingRequiredParams, modalContainer, modifierClassName, moveState, named, navigate, nodeHtml, notificationsCss, on, onClick, onFlowEnd, onFlowError, onFlowProgress, onInterval, onKey, onLoad, onPageLoad, onPointerDown, onScreen, onScreenIfChosen, onScroll, onSubmit, openDialog, openModal, openPage, pageFamily, pageRegions, pageTexts, pagination, paragraph, pathForSlug, planFixes, plitziSdk, pressShortcut, profilePictures, publishOn, readDevTools, readDevToolsInPage, n$3 as readNotificationOptions, c as reconcileParams, reference, refusalOf, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, runServerActionOrNotify, sameBlocks, scope, scrollBy, scrollIntoView, scrollTo, selectorFor, setFieldValue, setState, shortcutKey, shorthandLonghands, singlePageSpace, slugify, source, i$2 as spaceCallbacks, specFromSpace, specToSource, splitClassList, d as splitNotificationsCss, stepState, styles, suggestClassOverrides, suggestCssProperty, suggestSpace, suggestTransformer, summariseRenders, svg, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, taskAction, text, themeToggle, toBindingSpecs, toBlocks, i$3 as toBuilderParams, a$2 as toInteractionCallback, o$1 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, tokens, transformerCatalog, tw, twig, twigTemplate, typeCallbackDefinitions, typeTriggerDefinitions, unrollPage, unusedDeclarations, updateElement, validateSnippet, validateSpace, e$1 as valuesOf, variantFrom, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, whileRunning, withElement, withNamedIds, withNotificationsCss, withPluginCatalogs, withVisibility, withoutQuieted };
|
package/dist/node.d.ts
CHANGED
|
@@ -1094,6 +1094,8 @@ declare const AUTHORING_CODES: {
|
|
|
1094
1094
|
|
|
1095
1095
|
declare type AuthoringCode = keyof Codes;
|
|
1096
1096
|
|
|
1097
|
+
export declare const authorIsolated: (file: string, options?: IsolatedOptions) => Promise<IsolatedAuthoring>;
|
|
1098
|
+
|
|
1097
1099
|
/**
|
|
1098
1100
|
* The project's space, authored: what a project's server serves — `serveProject({ space: authorProjectSpace })` — and
|
|
1099
1101
|
* its visual tests read. `projectSpace`, then `authorSpace` with what it is checked against.
|
|
@@ -1187,6 +1189,13 @@ declare type ChannelDeclaration = {
|
|
|
1187
1189
|
* a locked board.
|
|
1188
1190
|
*/
|
|
1189
1191
|
grant?: boolean;
|
|
1192
|
+
/**
|
|
1193
|
+
* Whether the server keeps the latest message of each type on a topic, and hands them to every page that joins: state
|
|
1194
|
+
* all the screens share — a dashboard's lists, a board's settings — said once by the server (`ctx.publish`, a flow's
|
|
1195
|
+
* `realtime.publish`) and there for a page that opens later, as `<channel>.retained.<type>`. Kept until the next of
|
|
1196
|
+
* its type; `null` forgets it. Only on a channel the server alone publishes on (`publish: 'server'`).
|
|
1197
|
+
*/
|
|
1198
|
+
retain?: boolean;
|
|
1190
1199
|
/** The largest `data` a page may send, as JSON bytes. 4 KB when absent. */
|
|
1191
1200
|
maxMessageBytes?: number;
|
|
1192
1201
|
/** How many messages one connection may send a second. 30 when absent. */
|
|
@@ -1454,6 +1463,12 @@ declare interface ElementHandle {
|
|
|
1454
1463
|
* Present only when true: almost nothing on a page is conditional, and the handles are serialized.
|
|
1455
1464
|
*/
|
|
1456
1465
|
conditional?: true;
|
|
1466
|
+
/**
|
|
1467
|
+
* For an element an element that chooses its children (`choosesChildren`) may draw — one of those children, or what
|
|
1468
|
+
* is inside one under no condition of its own: that child, by id. It is `conditional`, since a bare visit owes none
|
|
1469
|
+
* of it; once the child is drawn, it and everything it holds are owed like the rest of the page.
|
|
1470
|
+
*/
|
|
1471
|
+
shownWith?: string;
|
|
1457
1472
|
/**
|
|
1458
1473
|
* Whether this element sits inside a list's row, so it renders once per row — several times, or not at all while the
|
|
1459
1474
|
* list is empty. Its selector matches every copy: address one with the driver's `.first()` / `.nth()`.
|
|
@@ -1715,6 +1730,53 @@ declare type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback'
|
|
|
1715
1730
|
|
|
1716
1731
|
declare type InteractionParamType = 'boolean' | 'select' | 'text' | 'number' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
|
|
1717
1732
|
|
|
1733
|
+
export declare type IsolatedAuthoring = {
|
|
1734
|
+
ok: true;
|
|
1735
|
+
space: AuthoredSpace;
|
|
1736
|
+
}
|
|
1737
|
+
/** `authorSpace` refused it: `message` is its report, `refusals` the problems as data. */
|
|
1738
|
+
| {
|
|
1739
|
+
ok: false;
|
|
1740
|
+
reason: 'refused';
|
|
1741
|
+
message: string;
|
|
1742
|
+
refusals: SpaceRefusal[];
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* `failed`: the module did not load, exports no `space`, or its process died — `message` says which, and where;
|
|
1746
|
+
* `timeout`: it ran past `timeoutMs`; `invalid`: what it answered is not a space `validateSpace` passes.
|
|
1747
|
+
*/
|
|
1748
|
+
| {
|
|
1749
|
+
ok: false;
|
|
1750
|
+
reason: 'failed' | 'timeout' | 'invalid';
|
|
1751
|
+
message: string;
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* A space module somebody else wrote — an agent's, a visitor's — authored in a process of its own, which may read the
|
|
1756
|
+
* module's folder and the packages it imports and nothing else: no file written, no process or worker started, no
|
|
1757
|
+
* native addon, no environment variable of this one. What it answers is checked again here (`validateSpace`), so a
|
|
1758
|
+
* module that forges its own answer gains nothing by it.
|
|
1759
|
+
*
|
|
1760
|
+
* Network access is not one Node's permission model takes away before Node 25: serve what it authors on an origin of
|
|
1761
|
+
* its own (`createAuthoringHost` of `@plitzi/sdk-server`), never the app's, and do not run it where the network it
|
|
1762
|
+
* reaches is one to keep it from.
|
|
1763
|
+
*
|
|
1764
|
+
* ```ts
|
|
1765
|
+
* const result = await authorIsolated('tmp/pages/weather.ts');
|
|
1766
|
+
* if (result.ok) {
|
|
1767
|
+
* host.put(result.space);
|
|
1768
|
+
* } else {
|
|
1769
|
+
* reply(result.message); // a refusal reads as `authorSpace`'s: every problem, where it is and what to write
|
|
1770
|
+
* }
|
|
1771
|
+
* ```
|
|
1772
|
+
*/
|
|
1773
|
+
export declare interface IsolatedOptions {
|
|
1774
|
+
/** How long the module may take, loaded and authored, before its process is killed. 10 s by default. */
|
|
1775
|
+
timeoutMs?: number;
|
|
1776
|
+
/** The most memory its process may hold, in MB. 512 by default. */
|
|
1777
|
+
memoryMb?: number;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1718
1780
|
/**
|
|
1719
1781
|
* A space's keyframes as an author writes them: by name, each frame keyed by its offset — `from`, `to`, `'50%'`,
|
|
1720
1782
|
* `'0%, 100%'` — and its rules as any other CSS is written, shorthands allowed:
|
|
@@ -1976,7 +2038,10 @@ declare interface PluginDeclarationData {
|
|
|
1976
2038
|
sourceType?: string;
|
|
1977
2039
|
/** Behaviour rather than content: it draws nothing on a page, so no check waits for it on screen. */
|
|
1978
2040
|
drawsNothing?: boolean;
|
|
1979
|
-
/**
|
|
2041
|
+
/**
|
|
2042
|
+
* It shows only some of its children, chosen as it runs: no check waits for any of them on screen, and the ones it
|
|
2043
|
+
* draws are checked like the rest of the page.
|
|
2044
|
+
*/
|
|
1980
2045
|
choosesChildren?: boolean;
|
|
1981
2046
|
/** The events it fires beyond the ones every element does, by action. */
|
|
1982
2047
|
triggers?: Readonly<Record<string, {
|
|
@@ -2408,6 +2473,17 @@ declare interface SpaceHandles {
|
|
|
2408
2473
|
page(idOrSlug: string): PageHandle;
|
|
2409
2474
|
}
|
|
2410
2475
|
|
|
2476
|
+
/** One element `authorSpace` could not write: where to find it, and why. */
|
|
2477
|
+
declare type SpaceRefusal = {
|
|
2478
|
+
/** The nearest named element and the steps from it — `"store-footer" › container[1]`. Empty for the space itself. */
|
|
2479
|
+
place: string;
|
|
2480
|
+
/** The line of the author's own code that wrote it — `src/space/layout.ts:417` — when a factory recorded one. */
|
|
2481
|
+
at?: string;
|
|
2482
|
+
/** What `authoring-errors.md` files it under — a code of `AUTHORING_CODES`, or a structural one of `validateSchema`. */
|
|
2483
|
+
code?: string;
|
|
2484
|
+
message: string;
|
|
2485
|
+
};
|
|
2486
|
+
|
|
2411
2487
|
declare interface SpaceSpec {
|
|
2412
2488
|
name: string;
|
|
2413
2489
|
permanentUrl: string;
|