@keemakr/ui-sdk 1.6.0-dev-20261027080125 → 1.6.0-dev-20261027082128

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.
@@ -63,8 +63,12 @@ import type { ChatPress, ScreenRootNode, ScreenTree } from './schema.js';
63
63
  * would draw read-only anyway; core drops it on purpose all the same (`withoutInlineEdit`), so
64
64
  * a client never gets half an edit (a column's options without its action, say) and the
65
65
  * fallback list says the block was made read-only. The data is all still there.
66
+ * - `timeline.time_tag`: a timeline item's `time` ("07:30", never zone-converted) drawn in a
67
+ * column of its own, and its `tag` drawn as a grey pill after the label (newer than any
68
+ * published release; core's own renderer draws them). An older parse strips both without a
69
+ * sign, so without it they are written into the label ("07:30 · Brief sent · brief").
66
70
  */
67
- 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';
71
+ 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';
68
72
  /** The node types and features one ui-sdk release, or one client, draws. */
69
73
  export interface NodeSet {
70
74
  /** For messages: "ui-sdk 1.4.0", "mobile 0.2.5". */
@@ -101,7 +105,7 @@ export declare const UI_SDK_SNAPSHOTS: {
101
105
  readonly current: {
102
106
  readonly name: "ui-sdk (this package)";
103
107
  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"];
104
- 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"];
108
+ 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"];
105
109
  };
106
110
  };
107
111
  export type UiSdkSnapshot = keyof typeof UI_SDK_SNAPSHOTS;
package/dist/negotiate.js CHANGED
@@ -49,6 +49,7 @@ const ALL_FEATURES = [
49
49
  'form.disabled',
50
50
  'press.seek',
51
51
  'edit.inline',
52
+ 'timeline.time_tag',
52
53
  ];
53
54
  /** The nodes of ui-sdk 1.1.0 and 1.2.0 (one schema). */
54
55
  const NODES_1_1_0 = [
@@ -380,6 +381,8 @@ export function negotiateTree(tree, set) {
380
381
  }
381
382
  case 'choice_cards':
382
383
  return features.has('choice.action') ? node : foldChoiceActions(node, path, fallbacks);
384
+ case 'timeline':
385
+ return features.has('timeline.time_tag') ? node : foldTimeAndTag(node, path, fallbacks);
383
386
  case 'markdown': {
384
387
  if (features.has('markdown.links'))
385
388
  return node;
@@ -791,6 +794,29 @@ function withoutSeeks(node, path, fallbacks) {
791
794
  }
792
795
  return next;
793
796
  }
797
+ /**
798
+ * The timeline as a client that cannot draw an item's `time` or `tag` should get it
799
+ * (`timeline.time_tag` above): both written into the label. Returns the same object when there is
800
+ * nothing to change.
801
+ */
802
+ function foldTimeAndTag(node, path, fallbacks) {
803
+ if (!node.items.some((item) => item.time || item.tag))
804
+ return node;
805
+ const items = node.items.map((item, i) => {
806
+ if (!item.time && !item.tag)
807
+ return item;
808
+ fallbacks.push({
809
+ path: `${path}.items[${i}]`,
810
+ type: 'timeline',
811
+ reason: 'timeline.time_tag',
812
+ as: 'folded',
813
+ });
814
+ const { time, tag, ...rest } = item;
815
+ const label = [time, item.label, tag].filter(Boolean).join(' · ');
816
+ return { ...rest, label: clip(label, 200) };
817
+ });
818
+ return { ...node, items };
819
+ }
794
820
  /** A copy of `value` without `key`. */
795
821
  function omit(value, key) {
796
822
  const copy = { ...value };
package/dist/schema.d.ts CHANGED
@@ -954,6 +954,7 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
954
954
  }, z.core.$strip>>;
955
955
  }, z.core.$strip>>;
956
956
  empty: z.ZodString;
957
+ hideHeader: z.ZodOptional<z.ZodBoolean>;
957
958
  }, z.core.$strip>, z.ZodObject<{
958
959
  type: z.ZodLiteral<"timeline">;
959
960
  items: z.ZodArray<z.ZodObject<{
@@ -990,6 +991,8 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
990
991
  player: z.ZodString;
991
992
  at: z.ZodNumber;
992
993
  }, z.core.$strip>>;
994
+ time: z.ZodOptional<z.ZodString>;
995
+ tag: z.ZodOptional<z.ZodString>;
993
996
  }, z.core.$strip>>;
994
997
  }, z.core.$strip>, z.ZodObject<{
995
998
  type: z.ZodLiteral<"pending_request">;
package/dist/schema.js CHANGED
@@ -2021,9 +2021,32 @@ const leafNodeSchema = z.discriminatedUnion('type', [
2021
2021
  .optional(),
2022
2022
  /** Shown when `rows` is empty — every data-bound surface needs an empty state. */
2023
2023
  empty: z.string().max(200),
2024
+ /**
2025
+ * Draw no column header row, so the table reads as a list (My Day's actions, a Red list).
2026
+ * The column labels stay for screen readers. The header holds the sort and filter controls
2027
+ * and the select-all tick, so a headerless table takes no sortable or filtered column and
2028
+ * no `bulk`. Default false.
2029
+ */
2030
+ hideHeader: z.boolean().optional(),
2024
2031
  })
2025
2032
  .superRefine((node, ctx) => {
2033
+ if (node.hideHeader && node.bulk) {
2034
+ ctx.addIssue({
2035
+ code: 'custom',
2036
+ path: ['bulk'],
2037
+ message: 'a table with hideHeader has no header for the select-all tick',
2038
+ });
2039
+ }
2026
2040
  for (const [i, column] of node.columns.entries()) {
2041
+ for (const control of ['sortable', 'filter']) {
2042
+ if (node.hideHeader && column[control]) {
2043
+ ctx.addIssue({
2044
+ code: 'custom',
2045
+ path: ['columns', i, control],
2046
+ message: `a table with hideHeader has no header for a ${control} column`,
2047
+ });
2048
+ }
2049
+ }
2027
2050
  if (column.edit && column.key === 'row') {
2028
2051
  ctx.addIssue({
2029
2052
  code: 'custom',
@@ -2094,6 +2117,13 @@ const leafNodeSchema = z.discriminatedUnion('type', [
2094
2117
  * as its time ("4:10"), a button that plays the recording from there.
2095
2118
  */
2096
2119
  seek: seekPointSchema.optional(),
2120
+ /**
2121
+ * A clock time as the module wrote it ("07:30"), drawn in a column of its own at the
2122
+ * item's left. Never converted: use `at` for a moment the viewer reads in their zone.
2123
+ */
2124
+ time: z.string().min(1).max(16).optional(),
2125
+ /** A short kind ("brief", "health", "escalation"), drawn as a grey pill after the label. */
2126
+ tag: z.string().min(1).max(40).optional(),
2097
2127
  }))
2098
2128
  .max(200),
2099
2129
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keemakr/ui-sdk",
3
- "version": "1.6.0-dev-20261027080125",
3
+ "version": "1.6.0-dev-20261027082128",
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",