@keemakr/ui-sdk 1.1.0-dev-20260818182255 → 1.1.0-dev-20260819050233
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/schema.d.ts +0 -36
- package/dist/schema.js +14 -56
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -148,42 +148,6 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
148
148
|
screen: z.ZodString;
|
|
149
149
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
150
150
|
}, z.core.$strip>], "kind">>;
|
|
151
|
-
expand: z.ZodOptional<z.ZodObject<{
|
|
152
|
-
children: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
153
|
-
type: z.ZodLiteral<"heading">;
|
|
154
|
-
text: z.ZodString;
|
|
155
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
156
|
-
type: z.ZodLiteral<"text">;
|
|
157
|
-
value: z.ZodString;
|
|
158
|
-
muted: z.ZodDefault<z.ZodBoolean>;
|
|
159
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
-
type: z.ZodLiteral<"markdown">;
|
|
161
|
-
value: z.ZodString;
|
|
162
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
163
|
-
type: z.ZodLiteral<"stat">;
|
|
164
|
-
label: z.ZodString;
|
|
165
|
-
value: z.ZodString;
|
|
166
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
167
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
-
type: z.ZodLiteral<"button">;
|
|
169
|
-
label: z.ZodString;
|
|
170
|
-
onPress: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
171
|
-
kind: z.ZodLiteral<"action">;
|
|
172
|
-
action: z.ZodString;
|
|
173
|
-
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
|
-
confirm: z.ZodOptional<z.ZodString>;
|
|
175
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
-
kind: z.ZodLiteral<"navigate">;
|
|
177
|
-
screen: z.ZodString;
|
|
178
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
179
|
-
}, z.core.$strip>], "kind">;
|
|
180
|
-
variant: z.ZodDefault<z.ZodEnum<{
|
|
181
|
-
destructive: "destructive";
|
|
182
|
-
primary: "primary";
|
|
183
|
-
secondary: "secondary";
|
|
184
|
-
}>>;
|
|
185
|
-
}, z.core.$strip>], "type">>;
|
|
186
|
-
}, z.core.$strip>>;
|
|
187
151
|
}, z.core.$strip>>;
|
|
188
152
|
empty: z.ZodString;
|
|
189
153
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/schema.js
CHANGED
|
@@ -97,44 +97,21 @@ const chartSchema = z
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
-
const headingSchema = z.object({ type: z.literal('heading'), text: z.string().max(120) });
|
|
101
|
-
const textSchema = z.object({
|
|
102
|
-
type: z.literal('text'),
|
|
103
|
-
value: z.string().max(5000),
|
|
104
|
-
muted: z.boolean().default(false),
|
|
105
|
-
});
|
|
106
|
-
/** Rendered by core's sanitizing markdown renderer — never raw HTML. */
|
|
107
|
-
const markdownSchema = z.object({ type: z.literal('markdown'), value: z.string().max(20000) });
|
|
108
|
-
const statSchema = z.object({
|
|
109
|
-
type: z.literal('stat'),
|
|
110
|
-
label: z.string().max(80),
|
|
111
|
-
value: z.string().max(40),
|
|
112
|
-
hint: z.string().max(120).optional(),
|
|
113
|
-
});
|
|
114
|
-
/**
|
|
115
|
-
* What a table row may reveal in place. Deliberately NOT the leaf union and NOT
|
|
116
|
-
* `nodeSchema`: `table` is itself a leaf, so either reference re-opens the
|
|
117
|
-
* recursion — both were measured accepting a 200-level `table -> expand -> table`
|
|
118
|
-
* chain, escaping MAX_SECTION_DEPTH entirely, and both collapsed type inference
|
|
119
|
-
* (TS7022 on the leaf union, TS7024 on the lazy callback). Naming the five
|
|
120
|
-
* content branches explicitly keeps this non-recursive by construction, which is
|
|
121
|
-
* why the depth test asserts REJECTION rather than slowness: the validator
|
|
122
|
-
* handles 200 levels in tens of milliseconds, so nothing upstream would catch it.
|
|
123
|
-
*
|
|
124
|
-
* The general rule: any leaf that references the leaf union re-opens the recursion.
|
|
125
|
-
*/
|
|
126
|
-
const expandContentSchema = z.discriminatedUnion('type', [
|
|
127
|
-
headingSchema,
|
|
128
|
-
textSchema,
|
|
129
|
-
markdownSchema,
|
|
130
|
-
statSchema,
|
|
131
|
-
buttonSchema,
|
|
132
|
-
]);
|
|
133
100
|
const leafNodeSchema = z.discriminatedUnion('type', [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
101
|
+
z.object({ type: z.literal('heading'), text: z.string().max(120) }),
|
|
102
|
+
z.object({
|
|
103
|
+
type: z.literal('text'),
|
|
104
|
+
value: z.string().max(5000),
|
|
105
|
+
muted: z.boolean().default(false),
|
|
106
|
+
}),
|
|
107
|
+
/** Rendered by core's sanitizing markdown renderer — never raw HTML. */
|
|
108
|
+
z.object({ type: z.literal('markdown'), value: z.string().max(20000) }),
|
|
109
|
+
z.object({
|
|
110
|
+
type: z.literal('stat'),
|
|
111
|
+
label: z.string().max(80),
|
|
112
|
+
value: z.string().max(40),
|
|
113
|
+
hint: z.string().max(120).optional(),
|
|
114
|
+
}),
|
|
138
115
|
buttonSchema,
|
|
139
116
|
z.object({
|
|
140
117
|
type: z.literal('form'),
|
|
@@ -160,25 +137,6 @@ const leafNodeSchema = z.discriminatedUnion('type', [
|
|
|
160
137
|
key: z.string().max(128),
|
|
161
138
|
cells: z.record(slug, cellSchema),
|
|
162
139
|
onPress: pressSchema.optional(),
|
|
163
|
-
/**
|
|
164
|
-
* Content the row reveals in place, no navigation hop. Content nodes
|
|
165
|
-
* only — no nested `table`, no `section`.
|
|
166
|
-
*
|
|
167
|
-
* A row declaring `expand` WITH CONTENT toggles disclosure when
|
|
168
|
-
* activated, and its `onPress` is IGNORED. The renderer already gives a
|
|
169
|
-
* pressable row `role="button"` with an Enter/Space handler, so a second
|
|
170
|
-
* focusable control inside it would be invalid ARIA with two handlers on
|
|
171
|
-
* one key. Expansion is local view state; a press means "call my
|
|
172
|
-
* runtime". They stay apart deliberately.
|
|
173
|
-
*
|
|
174
|
-
* Zero children is allowed and means NO disclosure — the row behaves
|
|
175
|
-
* exactly as if `expand` were absent, `onPress` included. A body built
|
|
176
|
-
* from data legitimately drops to nothing, and rejecting that would fail
|
|
177
|
-
* the whole screen load rather than degrade one row (the same cliff the
|
|
178
|
-
* tab strip's minimum had). The maximum stays: an oversize body has no
|
|
179
|
-
* safe degradation — truncating it would be silent data loss.
|
|
180
|
-
*/
|
|
181
|
-
expand: z.object({ children: z.array(expandContentSchema).max(20) }).optional(),
|
|
182
140
|
}))
|
|
183
141
|
.max(500),
|
|
184
142
|
/** Shown when `rows` is empty — every data-bound surface needs an empty state. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keemakr/ui-sdk",
|
|
3
|
-
"version": "1.1.0-dev-
|
|
3
|
+
"version": "1.1.0-dev-20260819050233",
|
|
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",
|