@keemakr/ui-sdk 2.0.0-dev-20261115112837 → 2.0.0-dev-20261115120427

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/catalog.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "catalogId": "kee/1+16ceecb4bef9",
2
+ "catalogId": "kee/1+fba2282b8879",
3
3
  "schemaVersion": 1,
4
4
  "nodeTypes": [
5
5
  "heading",
@@ -1875,6 +1875,11 @@
1875
1875
  "properties": {
1876
1876
  "label": { "type": "string", "maxLength": 80 },
1877
1877
  "action": { "type": "string", "maxLength": 64, "pattern": "^[a-z][a-z0-9_-]*$" },
1878
+ "input": {
1879
+ "type": "object",
1880
+ "propertyNames": { "type": "string" },
1881
+ "additionalProperties": {}
1882
+ },
1878
1883
  "confirm": { "type": "string", "maxLength": 500 },
1879
1884
  "disabled": { "type": "boolean" },
1880
1885
  "disabledUntilValid": { "type": "boolean" },
package/dist/form.d.ts CHANGED
@@ -116,6 +116,7 @@ export interface FormSubmit {
116
116
  interface SendLike {
117
117
  label: string;
118
118
  action: string;
119
+ input?: Record<string, unknown>;
119
120
  confirm?: string;
120
121
  disabled?: boolean;
121
122
  disabledUntilValid?: boolean;
@@ -129,7 +130,6 @@ interface SendLike {
129
130
  export declare function formSubmits(form: {
130
131
  submit: SendLike;
131
132
  secondary?: ReadonlyArray<SendLike & {
132
- input?: Record<string, unknown>;
133
133
  validate?: boolean;
134
134
  }>;
135
135
  }, valid?: boolean): FormSubmit[];
@@ -51,6 +51,11 @@ import type { ChatPress, ScreenRootNode, ScreenTree } from './schema.js';
51
51
  * is dropped, and a form whose `submit` is disabled becomes one calm line (`submit` is
52
52
  * required, and promoting a `secondary` would change what Enter posts). A reason on an
53
53
  * enabled send means nothing and is left for the parse to strip.
54
+ * - `form.submit_input`: the primary `submit`'s static `input`, posted under the field values
55
+ * as a `secondary`'s is (newer than any published release; core's own renderer draws it). An
56
+ * older parse strips it, so the send would post the fields alone and the action would refuse
57
+ * it only after the reader typed. Without it, a form whose `submit` has `input` becomes one
58
+ * calm line, as a form whose `submit` is disabled does.
54
59
  * - `press.seek`: a `seek` press moves an `audio` or `video` playhead on the same screen, and a
55
60
  * timeline item's or conversation turn's `seek` draws its time as a button that does the same
56
61
  * (newer than any published release; core's own renderer draws them). Without it, each seek
@@ -130,7 +135,7 @@ import type { ChatPress, ScreenRootNode, ScreenTree } from './schema.js';
130
135
  * poster on a video whose src is a path is dropped. Core removes every URL not on the
131
136
  * module's list (or every URL, with the registry key `ui.media-urls` off) before this runs.
132
137
  */
133
- export type UiFeature = 'breadcrumbs' | 'button.disabled' | 'section.row' | 'form.field_kinds' | 'form.confirm' | 'press.chat' | 'form.radio' | 'table.cells' | 'header.meta' | 'tabs.many' | 'choice.action' | 'markdown.links' | 'form.disabled' | 'press.seek' | 'edit.inline' | 'timeline.time_tag' | 'stat.bar' | 'stat.sparkline' | 'section.action' | 'facts.meter' | 'form.show_when' | 'press.focus' | 'press.app' | 'press.app.patient' | 'pending.open' | 'form.allowed_days' | 'section.roles' | 'media.url';
138
+ export type UiFeature = 'breadcrumbs' | 'button.disabled' | 'section.row' | 'form.field_kinds' | 'form.confirm' | 'press.chat' | 'form.radio' | 'table.cells' | 'header.meta' | 'tabs.many' | 'choice.action' | 'markdown.links' | 'form.disabled' | 'press.seek' | 'edit.inline' | 'timeline.time_tag' | 'stat.bar' | 'stat.sparkline' | 'section.action' | 'facts.meter' | 'form.show_when' | 'press.focus' | 'press.app' | 'press.app.patient' | 'pending.open' | 'form.allowed_days' | 'section.roles' | 'media.url' | 'form.submit_input';
134
139
  /** The node types and features one ui-sdk release, or one client, draws. */
135
140
  export interface NodeSet {
136
141
  /** For messages: "ui-sdk 1.4.0", "mobile 0.2.5". */
@@ -167,7 +172,7 @@ export declare const UI_SDK_SNAPSHOTS: {
167
172
  readonly current: {
168
173
  readonly name: "ui-sdk (this package)";
169
174
  readonly nodes: readonly ["heading", "text", "markdown", "stat", "button", "form", "table", "timeline", "pending_request", "pending_requests", "choice_cards", "progress", "chart", "section", "tabs", "pagination", "select", "alert", "details", "timestamp", "divider", "board", "link", "tags", "toggle", "segmented", "progress_bar", "conversation", "composer", "calendar", "image", "video", "stacked_bar", "heatmap", "audio", "document"];
170
- readonly features: readonly ["breadcrumbs", "button.disabled", "section.row", "form.field_kinds", "form.confirm", "press.chat", "form.radio", "table.cells", "header.meta", "tabs.many", "choice.action", "markdown.links", "form.disabled", "press.seek", "edit.inline", "timeline.time_tag", "stat.bar", "stat.sparkline", "section.action", "facts.meter", "form.show_when", "press.focus", "press.app", "press.app.patient", "pending.open", "form.allowed_days", "section.roles", "media.url"];
175
+ readonly features: readonly ["breadcrumbs", "button.disabled", "section.row", "form.field_kinds", "form.confirm", "press.chat", "form.radio", "table.cells", "header.meta", "tabs.many", "choice.action", "markdown.links", "form.disabled", "press.seek", "edit.inline", "timeline.time_tag", "stat.bar", "stat.sparkline", "section.action", "facts.meter", "form.show_when", "press.focus", "press.app", "press.app.patient", "pending.open", "form.allowed_days", "section.roles", "media.url", "form.submit_input"];
171
176
  };
172
177
  };
173
178
  export type UiSdkSnapshot = keyof typeof UI_SDK_SNAPSHOTS;
package/dist/negotiate.js CHANGED
@@ -66,6 +66,7 @@ const ALL_FEATURES = [
66
66
  'form.allowed_days',
67
67
  'section.roles',
68
68
  'media.url',
69
+ 'form.submit_input',
69
70
  ];
70
71
  /**
71
72
  * What the web dev-channel build draws: every feature but `press.app.patient`, which kee-clients
@@ -411,6 +412,13 @@ export function negotiateTree(screen, set) {
411
412
  fallbacks.push({ path, type: 'form', reason: 'form.confirm', as: 'text' });
412
413
  return { type: 'text', value: SAFETY_FALLBACK_TEXT, muted: true };
413
414
  }
415
+ // A send that would post without its static input must not reach a client that drops it.
416
+ // Empty input loses nothing when the parse strips it, so it is left alone.
417
+ const input = node.submit.input;
418
+ if (input && Object.keys(input).length > 0 && !features.has('form.submit_input')) {
419
+ fallbacks.push({ path, type: 'form', reason: 'form.submit_input', as: 'text' });
420
+ return { type: 'text', value: SAFETY_FALLBACK_TEXT, muted: true };
421
+ }
414
422
  const form = features.has('form.disabled')
415
423
  ? node
416
424
  : foldDisabledSends(node, path, fallbacks);
package/dist/reach.js CHANGED
@@ -47,17 +47,20 @@ const FEATURE_NODES = {
47
47
  'form.allowed_days': ['form'],
48
48
  'section.roles': ['section'],
49
49
  'media.url': ['image', 'video'],
50
+ 'form.submit_input': ['form'],
50
51
  };
51
52
  /**
52
53
  * The nodes negotiation replaces or drops outright, rather than keeping without the feature, when
53
- * a client lacks it (negotiate.ts, beside each UiFeature): a form with a confirm or a disabled
54
- * submit becomes one line (a disabled secondary send is only dropped); a body button that is
55
- * disabled or carries a chat or seek press becomes muted text; a control with a focus or app press
56
- * is dropped; choice cards whose only presses are ones the client lacks become one line of titles.
54
+ * a client lacks it (negotiate.ts, beside each UiFeature): a form with a confirm, a disabled
55
+ * submit or a submit with static input becomes one line (a disabled secondary send is only
56
+ * dropped); a body button that is disabled or carries a chat or seek press becomes muted text; a
57
+ * control with a focus or app press is dropped; choice cards whose only presses are ones the
58
+ * client lacks become one line of titles.
57
59
  */
58
60
  const FEATURE_REPLACES = {
59
61
  'form.confirm': ['form'],
60
62
  'form.disabled': ['form'],
63
+ 'form.submit_input': ['form'],
61
64
  'button.disabled': ['button'],
62
65
  'press.chat': ['button', 'choice_cards'],
63
66
  'press.seek': ['button', 'choice_cards'],
package/dist/schema.d.ts CHANGED
@@ -767,6 +767,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
767
767
  submit: z.ZodObject<{
768
768
  label: z.ZodString;
769
769
  action: z.ZodString;
770
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
770
771
  confirm: z.ZodOptional<z.ZodString>;
771
772
  disabled: z.ZodOptional<z.ZodBoolean>;
772
773
  disabledUntilValid: z.ZodOptional<z.ZodBoolean>;
@@ -2738,6 +2739,7 @@ export declare function catalogSchemas(child: z.ZodType<ScreenNode, ScreenNodeIn
2738
2739
  submit: z.ZodObject<{
2739
2740
  label: z.ZodString;
2740
2741
  action: z.ZodString;
2742
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2741
2743
  confirm: z.ZodOptional<z.ZodString>;
2742
2744
  disabled: z.ZodOptional<z.ZodBoolean>;
2743
2745
  disabledUntilValid: z.ZodOptional<z.ZodBoolean>;
package/dist/schema.js CHANGED
@@ -2055,6 +2055,12 @@ const leafNodeSchema = z.discriminatedUnion('type', [
2055
2055
  submit: z.object({
2056
2056
  label: z.string().max(80),
2057
2057
  action: slug,
2058
+ /**
2059
+ * Static values posted with the fields, as a button's input is and as each `secondary`'s is
2060
+ * (a field wins over a same-named key, because the reader typed it). A client that would
2061
+ * drop it gets one line instead of the form (`form.submit_input`).
2062
+ */
2063
+ input: z.record(z.string(), z.unknown()).optional(),
2058
2064
  /** Asked before the form posts, as a button's confirm is. */
2059
2065
  confirm: z.string().max(500).optional(),
2060
2066
  /**
@@ -1,6 +1,6 @@
1
1
  import { type UiNode, type UiNodeProps } from './ui-build.js';
2
2
  /** The catalog these builders were generated from. A test holds it to a fresh build. */
3
- export declare const UI_NODES_CATALOG_ID = "kee/1+16ceecb4bef9";
3
+ export declare const UI_NODES_CATALOG_ID = "kee/1+fba2282b8879";
4
4
  /**
5
5
  * One builder per screen node. Each takes the node's fields without `type`, applies the
6
6
  * schema's defaults, and throws a `UiBuildError` naming the field path for a value the schema
package/dist/ui-nodes.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // `npm run gen:catalog -w @keemakr/ui-sdk` after changing the schema.
3
3
  import { buildNode } from './ui-build.js';
4
4
  /** The catalog these builders were generated from. A test holds it to a fresh build. */
5
- export const UI_NODES_CATALOG_ID = 'kee/1+16ceecb4bef9';
5
+ export const UI_NODES_CATALOG_ID = 'kee/1+fba2282b8879';
6
6
  /**
7
7
  * One builder per screen node. Each takes the node's fields without `type`, applies the
8
8
  * schema's defaults, and throws a `UiBuildError` naming the field path for a value the schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keemakr/ui-sdk",
3
- "version": "2.0.0-dev-20261115112837",
3
+ "version": "2.0.0-dev-20261115120427",
4
4
  "description": "Product screens for keemakr marketplace modules: a versioned, server-driven UI tree schema plus defineScreen() handlers. Module code never ships to the browser — keemakr-core validates the tree and renders it with platform components.",
5
5
  "license": "MIT",
6
6
  "type": "module",