@keemakr/ui-sdk 1.6.0-dev-20261027213447 → 1.6.0-dev-20261027214400

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/media.js CHANGED
@@ -1,4 +1,4 @@
1
- // Module-side helpers for the `image`, `video` and `audio` blocks. A module serves its
1
+ // Module-side helpers for the `image`, `video`, `audio` and `document` blocks. A module serves its
2
2
  // media at GET /screens/media/<path> in its screens channel, after verifying the
3
3
  // capability grant exactly as its load and action routes do. Core fetches from
4
4
  // there and passes on only these types, so a module that labels a file with
@@ -21,6 +21,7 @@ export const MEDIA_CONTENT_TYPES = {
21
21
  wav: 'audio/wav',
22
22
  weba: 'audio/webm',
23
23
  vtt: 'text/vtt',
24
+ pdf: 'application/pdf',
24
25
  };
25
26
  /** The Content-Type to serve a media path with, or null when core would refuse it. */
26
27
  export function mediaContentType(path) {
@@ -116,7 +116,7 @@ export declare const UI_SDK_SNAPSHOTS: {
116
116
  };
117
117
  readonly current: {
118
118
  readonly name: "ui-sdk (this package)";
119
- 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"];
119
+ 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"];
120
120
  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", "section.action", "facts.meter"];
121
121
  };
122
122
  };
package/dist/negotiate.js CHANGED
@@ -98,7 +98,7 @@ const NODES_1_4_0 = [
98
98
  * here reaches a client only once a row below says that client draws it; until then it gets its
99
99
  * fallback (`fallbackNode`).
100
100
  */
101
- const NODES_CURRENT = [...NODES_1_4_0, 'stacked_bar', 'heatmap', 'audio'];
101
+ const NODES_CURRENT = [...NODES_1_4_0, 'stacked_bar', 'heatmap', 'audio', 'document'];
102
102
  /**
103
103
  * Nodes a module may send that core draws itself before any client sees the tree: a `dataset`
104
104
  * node becomes plain blocks from the module's rows (dataset-view.ts). No client parses them, so
@@ -1079,6 +1079,9 @@ export function fallbackNode(node, timeZone) {
1079
1079
  return text(`Video: ${n.title}`, true);
1080
1080
  case 'audio':
1081
1081
  return text(`Audio: ${n.title}${n.duration ? `, ${formatPlayhead(n.duration)}` : ''}`, true);
1082
+ case 'document':
1083
+ // Not a link: an app that signs in with a token, not core's cookie, could not open it.
1084
+ return text(`${n.title}: open this screen in the web app to see the document.`, true);
1082
1085
  case 'dataset':
1083
1086
  return text('This list could not be shown here.', true);
1084
1087
  default:
package/dist/nodes.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ScreenRootNode } from './schema.js';
2
2
  /** Every node type the root union admits (KEE-574 item 3). */
3
- export declare const KNOWN_NODE_TYPES: readonly ["heading", "text", "markdown", "stat", "button", "form", "table", "timeline", "pending_request", "pending_requests", "choice_cards", "progress", "chart", "pagination", "select", "alert", "details", "timestamp", "divider", "board", "link", "tags", "toggle", "segmented", "progress_bar", "stacked_bar", "heatmap", "conversation", "composer", "calendar", "image", "video", "audio", "dataset", "section", "tabs"];
3
+ export declare const KNOWN_NODE_TYPES: readonly ["heading", "text", "markdown", "stat", "button", "form", "table", "timeline", "pending_request", "pending_requests", "choice_cards", "progress", "chart", "pagination", "select", "alert", "details", "timestamp", "divider", "board", "link", "tags", "toggle", "segmented", "progress_bar", "stacked_bar", "heatmap", "conversation", "composer", "calendar", "image", "video", "audio", "document", "dataset", "section", "tabs"];
4
4
  export type KnownNodeType = (typeof KNOWN_NODE_TYPES)[number];
5
5
  /**
6
6
  * The node types that hold child nodes. `section` mounts its children
package/dist/nodes.js CHANGED
@@ -43,6 +43,7 @@ export const KNOWN_NODE_TYPES = [
43
43
  'image',
44
44
  'video',
45
45
  'audio',
46
+ 'document',
46
47
  'dataset',
47
48
  'section',
48
49
  'tabs',
package/dist/schema.d.ts CHANGED
@@ -1925,6 +1925,12 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1925
1925
  title: z.ZodString;
1926
1926
  duration: z.ZodOptional<z.ZodNumber>;
1927
1927
  caption: z.ZodOptional<z.ZodString>;
1928
+ }, z.core.$strip>, z.ZodObject<{
1929
+ type: z.ZodLiteral<"document">;
1930
+ src: z.ZodString;
1931
+ title: z.ZodString;
1932
+ download: z.ZodDefault<z.ZodBoolean>;
1933
+ caption: z.ZodOptional<z.ZodString>;
1928
1934
  }, z.core.$strip>, z.ZodObject<{
1929
1935
  type: z.ZodLiteral<"dataset">;
1930
1936
  dataset: z.ZodString;
package/dist/schema.js CHANGED
@@ -1470,6 +1470,22 @@ const audioSchema = z.object({
1470
1470
  duration: z.number().positive().max(SEEK_AT_MAX).optional(),
1471
1471
  caption: z.string().max(200).optional(),
1472
1472
  });
1473
+ /**
1474
+ * A PDF from the module's runtime, drawn in a viewer on the screen: a patient's
1475
+ * intake form, blank or signed. Up to 25 MB, through the same media route as
1476
+ * `image`, so it is never a public link: only a signed-in person who may open the
1477
+ * module's department can fetch it. Put it on a screen opened with
1478
+ * `open: 'drawer'` to show the form over the record.
1479
+ */
1480
+ const documentSchema = z.object({
1481
+ type: z.literal('document'),
1482
+ src: mediaPathSchema,
1483
+ /** Names the document, shown above the viewer and read with it: "Intake form, signed". */
1484
+ title: z.string().min(1).max(120),
1485
+ /** Draws a button that saves the file. */
1486
+ download: z.boolean().default(false),
1487
+ caption: z.string().max(200).optional(),
1488
+ });
1473
1489
  /**
1474
1490
  * A horizontal line that says where one part of a screen ends and the next
1475
1491
  * begins. It carries no content. Use a `section` when the parts need a title.
@@ -2203,6 +2219,7 @@ const leafNodeSchema = z.discriminatedUnion('type', [
2203
2219
  imageSchema,
2204
2220
  videoSchema,
2205
2221
  audioSchema,
2222
+ documentSchema,
2206
2223
  datasetNodeSchema,
2207
2224
  ]);
2208
2225
  const MAX_SECTION_DEPTH = 8;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keemakr/ui-sdk",
3
- "version": "1.6.0-dev-20261027213447",
3
+ "version": "1.6.0-dev-20261027214400",
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",