@keemakr/ui-sdk 1.7.0-dev-20261113063821 → 1.7.0-dev-20261113094009
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/README.md +34 -0
- package/catalog.json +5407 -0
- package/dist/catalog.d.ts +71 -0
- package/dist/catalog.js +175 -0
- package/dist/chat-blocks.d.ts +2 -0
- package/dist/chat-blocks.js +10 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/node-limits.d.ts +587 -0
- package/dist/node-limits.js +546 -0
- package/dist/schema.d.ts +2185 -0
- package/dist/schema.js +24 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -238,3 +238,37 @@ POST('/screens/badges', async (req) => {
|
|
|
238
238
|
- Core asks about once a minute per person, waits about two seconds, and draws no badge when you
|
|
239
239
|
are slow, fail, or have no such route (404). Answer from stored state.
|
|
240
240
|
- A person's own screen action makes their next menu read ask again sooner.
|
|
241
|
+
|
|
242
|
+
## 9. Look up a node, and its limits
|
|
243
|
+
|
|
244
|
+
`@keemakr/ui-sdk/catalog.json` lists every node a screen may hold, generated from the schema this
|
|
245
|
+
package validates with:
|
|
246
|
+
|
|
247
|
+
- `schema`: one JSON Schema 2020-12 document. `$defs.ScreenTree` is a whole screen and
|
|
248
|
+
`$defs.<type>` each node, so an editor, a linter or an agent can check a tree without running
|
|
249
|
+
this package. Checks written as code (a tab key used twice, a field that needs another) are not
|
|
250
|
+
in it: core's own parse still decides.
|
|
251
|
+
- `nodes.<type>`: the first release that has the node, whether it holds children, whether Kee may
|
|
252
|
+
draw it in a chat reply, what the newest release of each app does with it (`draws`, `fallback`,
|
|
253
|
+
or `core` when core draws it into plain blocks first), and its size caps.
|
|
254
|
+
- `chatBlocks`: the blocks a chat reply may hold, their caps and the keys a chat block may not
|
|
255
|
+
hold.
|
|
256
|
+
- `catalogId`: `kee/1+<hash>`. Two catalogs with one id accept exactly the same trees.
|
|
257
|
+
|
|
258
|
+
The size caps are also exported as `NODE_LIMITS` (per node) and `SCREEN_LIMITS` (the screen's own
|
|
259
|
+
fields). Trim to them rather than copying the numbers, so a changed cap reaches your Pack with the
|
|
260
|
+
next release:
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
import { NODE_LIMITS } from '@keemakr/ui-sdk';
|
|
264
|
+
|
|
265
|
+
const value = summary.slice(0, NODE_LIMITS.text.value); // 5000
|
|
266
|
+
const rows = leads.slice(0, NODE_LIMITS.table.rows); // 500
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
A path names fields with dots (`columns[].label`); `[]` steps into an array's items, `{}` into a
|
|
270
|
+
map's values, and `@<value>` into the variant whose `type` or `kind` is that value
|
|
271
|
+
(`NODE_LIMITS.table['rows[].cells{}@badge.value']`). A cap is the most characters of a string,
|
|
272
|
+
items of an array or keys of a map.
|
|
273
|
+
Numeric ranges (`dataset.limit` is 1 to 100) are not caps, so they are not in `NODE_LIMITS`: read
|
|
274
|
+
them from `schema` (`minimum`, `maximum`, `default`).
|