@keemakr/ui-sdk 1.6.0-dev-20261027081136 → 1.6.0-dev-20261027083052
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/negotiate.d.ts +6 -2
- package/dist/negotiate.js +26 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +7 -0
- package/package.json +1 -1
package/dist/negotiate.d.ts
CHANGED
|
@@ -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
|
@@ -991,6 +991,8 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
991
991
|
player: z.ZodString;
|
|
992
992
|
at: z.ZodNumber;
|
|
993
993
|
}, z.core.$strip>>;
|
|
994
|
+
time: z.ZodOptional<z.ZodString>;
|
|
995
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
994
996
|
}, z.core.$strip>>;
|
|
995
997
|
}, z.core.$strip>, z.ZodObject<{
|
|
996
998
|
type: z.ZodLiteral<"pending_request">;
|
package/dist/schema.js
CHANGED
|
@@ -2117,6 +2117,13 @@ const leafNodeSchema = z.discriminatedUnion('type', [
|
|
|
2117
2117
|
* as its time ("4:10"), a button that plays the recording from there.
|
|
2118
2118
|
*/
|
|
2119
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(),
|
|
2120
2127
|
}))
|
|
2121
2128
|
.max(200),
|
|
2122
2129
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keemakr/ui-sdk",
|
|
3
|
-
"version": "1.6.0-dev-
|
|
3
|
+
"version": "1.6.0-dev-20261027083052",
|
|
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",
|