@keemakr/ui-sdk 1.6.0-dev-20261030215401 → 1.6.0-dev-20261031060456
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/chat-blocks.d.ts +2 -0
- package/dist/chat-blocks.js +25 -1
- package/package.json +1 -1
package/dist/chat-blocks.d.ts
CHANGED
|
@@ -144,6 +144,8 @@ export type ChatBlocksCheck = {
|
|
|
144
144
|
ok: false;
|
|
145
145
|
issue: string;
|
|
146
146
|
};
|
|
147
|
+
/** Shown by a reply's table with no rows when Kee leaves `empty` out. */
|
|
148
|
+
export declare const CHAT_TABLE_EMPTY = "Nothing to show";
|
|
147
149
|
/** Check blocks Kee wrote: allowed types, nothing pressable, within limits, and the real schema. */
|
|
148
150
|
export declare function checkChatBlocks(input: unknown): ChatBlocksCheck;
|
|
149
151
|
/** Parse one fence body. */
|
package/dist/chat-blocks.js
CHANGED
|
@@ -118,6 +118,26 @@ function walk(value, path, out) {
|
|
|
118
118
|
walk(child, path ? `${path}.${key}` : key, out);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
/** Shown by a reply's table with no rows when Kee leaves `empty` out. */
|
|
122
|
+
export const CHAT_TABLE_EMPTY = 'Nothing to show';
|
|
123
|
+
/**
|
|
124
|
+
* A table in a reply holds the rows Kee already has, so its empty text is
|
|
125
|
+
* almost never seen. Kee often leaves it out; the schema needs it. Fill it in
|
|
126
|
+
* (in a section's children too) rather than refuse a table that draws fine.
|
|
127
|
+
*/
|
|
128
|
+
function withTableEmpty(block) {
|
|
129
|
+
if (!block || typeof block !== 'object' || Array.isArray(block))
|
|
130
|
+
return block;
|
|
131
|
+
const node = block;
|
|
132
|
+
let out = node;
|
|
133
|
+
if (node.type === 'table' && node.empty === undefined) {
|
|
134
|
+
out = { ...out, empty: CHAT_TABLE_EMPTY };
|
|
135
|
+
}
|
|
136
|
+
if (Array.isArray(node.children)) {
|
|
137
|
+
out = { ...out, children: node.children.map(withTableEmpty) };
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
121
141
|
/** Check blocks Kee wrote: allowed types, nothing pressable, within limits, and the real schema. */
|
|
122
142
|
export function checkChatBlocks(input) {
|
|
123
143
|
if (!Array.isArray(input))
|
|
@@ -141,7 +161,11 @@ export function checkChatBlocks(input) {
|
|
|
141
161
|
};
|
|
142
162
|
}
|
|
143
163
|
}
|
|
144
|
-
const parsed = screenTreeSchema.safeParse({
|
|
164
|
+
const parsed = screenTreeSchema.safeParse({
|
|
165
|
+
version: 1,
|
|
166
|
+
title: 'reply',
|
|
167
|
+
children: input.map(withTableEmpty),
|
|
168
|
+
});
|
|
145
169
|
if (!parsed.success) {
|
|
146
170
|
const issue = parsed.error.issues[0];
|
|
147
171
|
return {
|
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-20261031060456",
|
|
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",
|