@antelopejs/interface-dms 0.15.1-next.1020.g0c3c63d → 0.16.0
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/CHANGELOG.md +22 -0
- package/dist/base/activity-feed.d.ts +38 -137
- package/dist/base/banner.d.ts +34 -60
- package/dist/base/block-registry/helpers.d.ts +5 -5
- package/dist/base/block-registry/helpers.js.map +1 -1
- package/dist/base/block-registry/internal/describe.d.ts +3 -3
- package/dist/base/block-registry/internal/describe.js +120 -126
- package/dist/base/block-registry/internal/describe.js.map +1 -1
- package/dist/base/block-registry/internal/ui.d.ts +6 -4
- package/dist/base/block-registry/internal/ui.js +6 -2
- package/dist/base/block-registry/internal/ui.js.map +1 -1
- package/dist/base/block-registry/registry.d.ts +2 -2
- package/dist/base/block-registry/registry.js.map +1 -1
- package/dist/base/block-registry/types.d.ts +4 -4
- package/dist/base/card.d.ts +24 -46
- package/dist/base/chart-card.d.ts +10 -39
- package/dist/base/chart-schemas.d.ts +404 -2542
- package/dist/base/code-block.d.ts +12 -22
- package/dist/base/data-types/default/address.d.ts +1 -19
- package/dist/base/data-types/default/choices.d.ts +1 -1
- package/dist/base/data-types/default/files.d.ts +6 -30
- package/dist/base/data-types/default/numbers.d.ts +5 -17
- package/dist/base/data-types/default/numbers.js.map +1 -1
- package/dist/base/data-types/default/strings.d.ts +1 -1
- package/dist/base/data-types/field-types.d.ts +7 -17
- package/dist/base/display.d.ts +42 -48
- package/dist/base/empty-state.d.ts +48 -70
- package/dist/base/export-jobs.d.ts +3 -3
- package/dist/base/form-block-schema.d.ts +56 -510
- package/dist/base/form-block-schema.js +1 -1
- package/dist/base/form-block-schema.js.map +1 -1
- package/dist/base/form-schema.d.ts +0 -1
- package/dist/base/form-schema.js +0 -1
- package/dist/base/form-schema.js.map +1 -1
- package/dist/base/form-types.d.ts +2 -2
- package/dist/base/grid.d.ts +2 -12
- package/dist/base/guard.d.ts +55 -132
- package/dist/base/internal/composed-text.d.ts +3 -3
- package/dist/base/internal/composed-text.js +1 -1
- package/dist/base/internal/composed-text.js.map +1 -1
- package/dist/base/internal/display.d.ts +1 -1
- package/dist/base/internal/display.js.map +1 -1
- package/dist/base/internal/export-jobs.d.ts +2 -2
- package/dist/base/internal/export-jobs.js.map +1 -1
- package/dist/base/internal/form-schema-components.d.ts +11 -0
- package/dist/base/internal/form-schema-components.js +82 -2
- package/dist/base/internal/form-schema-components.js.map +1 -1
- package/dist/base/internal/form-schema-validation.d.ts +3 -5
- package/dist/base/internal/form-schema-validation.js +1 -1
- package/dist/base/internal/form-schema-validation.js.map +1 -1
- package/dist/base/key-value-list.d.ts +25 -92
- package/dist/base/kpi-card.d.ts +15 -49
- package/dist/base/live-toggle.d.ts +15 -16
- package/dist/base/meter.d.ts +56 -92
- package/dist/base/nav-card-grid.d.ts +29 -92
- package/dist/base/page-toolbar.d.ts +6 -10
- package/dist/base/period-selector.d.ts +95 -44
- package/dist/base/period-selector.js +2 -2
- package/dist/base/period-selector.js.map +1 -1
- package/dist/base/placeholder.d.ts +1 -9
- package/dist/base/resource-form-schema.d.ts +10 -25
- package/dist/base/resource-form-schema.js +1 -1
- package/dist/base/resource-form-schema.js.map +1 -1
- package/dist/base/section.d.ts +7 -25
- package/dist/base/stack.d.ts +31 -37
- package/dist/base/stat-group.d.ts +37 -84
- package/dist/base/tab.d.ts +19 -124
- package/dist/base/table-view/internal/meta-helpers.js +23 -1
- package/dist/base/table-view/internal/meta-helpers.js.map +1 -1
- package/dist/base/table-view/internal/row-actions-schema.d.ts +42 -258
- package/dist/base/table-view/schema.d.ts +135 -1222
- package/dist/base/table-view/schema.js +3 -3
- package/dist/base/table-view/schema.js.map +1 -1
- package/dist/base/top-list-card.d.ts +37 -151
- package/dist/invite-extensions/internal/types.d.ts +3 -4
- package/dist/invite-extensions/types.d.ts +2 -2
- package/docs/1.core/6.invites.md +1 -1
- package/docs/3.base/1.introduction.md +1 -1
- package/docs/3.base/9.helpers.md +1 -1
- package/package.json +3 -4
|
@@ -11,42 +11,33 @@ const MAX_DEPTH = 6;
|
|
|
11
11
|
const MAX_WRAPPERS = 8;
|
|
12
12
|
/**
|
|
13
13
|
* The accessor of the schema a wrapper kind wraps, `undefined` for any other
|
|
14
|
-
* kind. Nothing is read from the wrapper until the accessor is called.
|
|
14
|
+
* kind. Nothing is read from the wrapper until the accessor is called. A pipe
|
|
15
|
+
* is described by what it accepts: its input, unless that input is a
|
|
16
|
+
* transform, as `z.preprocess` builds, which accepts anything.
|
|
15
17
|
*/
|
|
16
|
-
function innerAccessor(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return () => def.type;
|
|
27
|
-
case zod_1.ZodFirstPartyTypeKind.ZodEffects:
|
|
28
|
-
return () => def.schema;
|
|
29
|
-
case zod_1.ZodFirstPartyTypeKind.ZodLazy:
|
|
30
|
-
return () => def.getter();
|
|
31
|
-
case zod_1.ZodFirstPartyTypeKind.ZodPipeline:
|
|
32
|
-
return () => def.in;
|
|
33
|
-
default:
|
|
34
|
-
return undefined;
|
|
18
|
+
function innerAccessor(schema) {
|
|
19
|
+
if (schema instanceof zod_1.z.core.$ZodOptional ||
|
|
20
|
+
schema instanceof zod_1.z.core.$ZodNullable ||
|
|
21
|
+
schema instanceof zod_1.z.core.$ZodDefault ||
|
|
22
|
+
schema instanceof zod_1.z.core.$ZodPrefault ||
|
|
23
|
+
schema instanceof zod_1.z.core.$ZodCatch ||
|
|
24
|
+
schema instanceof zod_1.z.core.$ZodReadonly ||
|
|
25
|
+
schema instanceof zod_1.z.core.$ZodNonOptional ||
|
|
26
|
+
schema instanceof zod_1.z.core.$ZodPromise) {
|
|
27
|
+
return () => schema._zod.def.innerType;
|
|
35
28
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
* The walker reads zod 3's internal `_def.typeName`. A zod whose schemas carry
|
|
43
|
-
* none would describe every option as shapeless, which is worse than not
|
|
44
|
-
* answering at all — so say so instead.
|
|
45
|
-
*/
|
|
46
|
-
function assertDescribable(def) {
|
|
47
|
-
if (def.typeName === undefined) {
|
|
48
|
-
throw new Error("block-registry: this zod exposes no _def.typeName; the option walker supports zod 3");
|
|
29
|
+
if (schema instanceof zod_1.z.core.$ZodLazy) {
|
|
30
|
+
return () => schema._zod.def.getter();
|
|
31
|
+
}
|
|
32
|
+
if (schema instanceof zod_1.z.core.$ZodPipe) {
|
|
33
|
+
const { in: input, out } = schema._zod.def;
|
|
34
|
+
return () => (input instanceof zod_1.z.core.$ZodTransform ? out : input);
|
|
49
35
|
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
/** The description `.describe()` or `.meta()` gave a schema, if any. */
|
|
39
|
+
function descriptionOf(schema) {
|
|
40
|
+
return zod_1.z.globalRegistry.get(schema)?.description;
|
|
50
41
|
}
|
|
51
42
|
/** Peel wrappers off a schema, collecting the flags and hints they carry. */
|
|
52
43
|
function unwrap(schema) {
|
|
@@ -61,22 +52,22 @@ function unwrap(schema) {
|
|
|
61
52
|
let peeled = true;
|
|
62
53
|
for (let step = 0; step < MAX_WRAPPERS && peeled; step++) {
|
|
63
54
|
hints.push((0, ui_1.getUiHints)(current));
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const inner = innerAccessor(def);
|
|
55
|
+
descriptions.push(descriptionOf(current));
|
|
56
|
+
const inner = innerAccessor(current);
|
|
67
57
|
if (!inner) {
|
|
68
58
|
peeled = false;
|
|
69
59
|
break;
|
|
70
60
|
}
|
|
71
|
-
result.optional ||=
|
|
72
|
-
result.nullable ||=
|
|
73
|
-
if (
|
|
74
|
-
result.defaultValue = def.defaultValue
|
|
61
|
+
result.optional ||= current instanceof zod_1.z.core.$ZodOptional;
|
|
62
|
+
result.nullable ||= current instanceof zod_1.z.core.$ZodNullable;
|
|
63
|
+
if (current instanceof zod_1.z.core.$ZodDefault) {
|
|
64
|
+
result.defaultValue = current._zod.def.defaultValue;
|
|
75
65
|
}
|
|
76
66
|
current = inner();
|
|
77
67
|
}
|
|
78
68
|
hints.push((0, ui_1.getUiHints)(current));
|
|
79
|
-
|
|
69
|
+
descriptions.push(descriptionOf(current));
|
|
70
|
+
result.exhausted = peeled && innerAccessor(current) !== undefined;
|
|
80
71
|
result.schema = current;
|
|
81
72
|
result.ui = (0, ui_1.mergeUiHints)(hints);
|
|
82
73
|
result.description = descriptions.find((entry) => !!entry);
|
|
@@ -107,31 +98,21 @@ function cloneDefault(value) {
|
|
|
107
98
|
}
|
|
108
99
|
}
|
|
109
100
|
const PRIMITIVE = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
[zod_1.ZodFirstPartyTypeKind.ZodUnknown]: "unknown",
|
|
117
|
-
[zod_1.ZodFirstPartyTypeKind.ZodNull]: "unknown",
|
|
118
|
-
[zod_1.ZodFirstPartyTypeKind.ZodUndefined]: "unknown",
|
|
119
|
-
[zod_1.ZodFirstPartyTypeKind.ZodVoid]: "unknown",
|
|
120
|
-
[zod_1.ZodFirstPartyTypeKind.ZodNever]: "unknown",
|
|
121
|
-
[zod_1.ZodFirstPartyTypeKind.ZodSymbol]: "unknown",
|
|
122
|
-
[zod_1.ZodFirstPartyTypeKind.ZodFunction]: "unknown",
|
|
123
|
-
[zod_1.ZodFirstPartyTypeKind.ZodMap]: "unknown",
|
|
124
|
-
[zod_1.ZodFirstPartyTypeKind.ZodSet]: "unknown",
|
|
101
|
+
string: "string",
|
|
102
|
+
template_literal: "string",
|
|
103
|
+
number: "number",
|
|
104
|
+
bigint: "number",
|
|
105
|
+
boolean: "boolean",
|
|
106
|
+
date: "string",
|
|
125
107
|
};
|
|
126
108
|
/** The kinds whose shape the walker descends into, and what they report as. */
|
|
127
109
|
const STRUCTURED_TYPE = {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[zod_1.ZodFirstPartyTypeKind.ZodIntersection]: "object",
|
|
110
|
+
object: "object",
|
|
111
|
+
array: "array",
|
|
112
|
+
record: "record",
|
|
113
|
+
tuple: "array",
|
|
114
|
+
union: "union",
|
|
115
|
+
intersection: "object",
|
|
135
116
|
};
|
|
136
117
|
/**
|
|
137
118
|
* A literal is described by the value it fixes when the descriptor protocol can
|
|
@@ -140,7 +121,7 @@ const STRUCTURED_TYPE = {
|
|
|
140
121
|
* is reported as `unknown` with no `enum`, the same as the schema kinds of
|
|
141
122
|
* those values.
|
|
142
123
|
*/
|
|
143
|
-
function
|
|
124
|
+
function describeLiteralValue(value) {
|
|
144
125
|
if ((0, type_check_1.isString)(value))
|
|
145
126
|
return { type: "string", enum: [value] };
|
|
146
127
|
if ((0, type_check_1.isBoolean)(value))
|
|
@@ -165,68 +146,82 @@ function mergeLiteralBranches(branches) {
|
|
|
165
146
|
}
|
|
166
147
|
return { type: branches[0].type, enum: values };
|
|
167
148
|
}
|
|
168
|
-
function describeUnion(def, depth) {
|
|
169
|
-
const
|
|
170
|
-
const branches = options.map((option) => describeSchema(option, depth + 1));
|
|
149
|
+
function describeUnion({ _zod: { def } }, depth) {
|
|
150
|
+
const branches = def.options.map((option) => describeSchema(option, depth + 1));
|
|
171
151
|
const merged = mergeLiteralBranches(branches);
|
|
172
152
|
if (merged) {
|
|
173
153
|
return merged;
|
|
174
154
|
}
|
|
175
|
-
const discriminator = def.typeName === zod_1.ZodFirstPartyTypeKind.ZodDiscriminatedUnion
|
|
176
|
-
? def.discriminator
|
|
177
|
-
: undefined;
|
|
178
155
|
const described = {
|
|
179
156
|
type: "union",
|
|
180
157
|
oneOf: branches,
|
|
181
158
|
};
|
|
182
|
-
if (discriminator)
|
|
183
|
-
described.discriminator = discriminator;
|
|
159
|
+
if ("discriminator" in def && (0, type_check_1.isString)(def.discriminator)) {
|
|
160
|
+
described.discriminator = def.discriminator;
|
|
161
|
+
}
|
|
184
162
|
return described;
|
|
185
163
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
};
|
|
164
|
+
function describeLiteral({ _zod: { def }, }) {
|
|
165
|
+
const branches = def.values.map(describeLiteralValue);
|
|
166
|
+
return ((branches.length === 1 ? branches[0] : mergeLiteralBranches(branches)) ?? {
|
|
167
|
+
type: "unknown",
|
|
168
|
+
});
|
|
191
169
|
}
|
|
192
|
-
function describeKind(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
170
|
+
function describeKind(schema, depth) {
|
|
171
|
+
const at = depth + 1;
|
|
172
|
+
if (schema instanceof zod_1.z.core.$ZodObject) {
|
|
173
|
+
return {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: describeProperties(schema._zod.def.shape, at),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (schema instanceof zod_1.z.core.$ZodUnion)
|
|
179
|
+
return describeUnion(schema, depth);
|
|
180
|
+
if (schema instanceof zod_1.z.core.$ZodArray) {
|
|
181
|
+
return {
|
|
182
|
+
type: "array",
|
|
183
|
+
items: describeSchema(schema._zod.def.element, at),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (schema instanceof zod_1.z.core.$ZodTuple) {
|
|
187
|
+
return {
|
|
188
|
+
type: "array",
|
|
189
|
+
prefixItems: schema._zod.def.items.map((item) => describeSchema(item, at)),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
if (schema instanceof zod_1.z.core.$ZodRecord) {
|
|
193
|
+
return {
|
|
194
|
+
type: "record",
|
|
195
|
+
keys: describeSchema(schema._zod.def.keyType, at),
|
|
196
|
+
values: describeSchema(schema._zod.def.valueType, at),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (schema instanceof zod_1.z.core.$ZodIntersection) {
|
|
200
|
+
return {
|
|
201
|
+
type: "object",
|
|
202
|
+
allOf: [
|
|
203
|
+
describeSchema(schema._zod.def.left, at),
|
|
204
|
+
describeSchema(schema._zod.def.right, at),
|
|
205
|
+
],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
if (schema instanceof zod_1.z.core.$ZodLiteral)
|
|
209
|
+
return describeLiteral(schema);
|
|
210
|
+
if (schema instanceof zod_1.z.core.$ZodEnum) {
|
|
211
|
+
return {
|
|
212
|
+
type: "string",
|
|
213
|
+
enum: zod_1.z.core.util.getEnumValues(schema._zod.def.entries),
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The walker reads zod 4's `_zod.def`. A schema built by another zod major
|
|
220
|
+
* carries none, and would be described as nothing at all, so say so instead.
|
|
221
|
+
*/
|
|
222
|
+
function assertDescribable(schema) {
|
|
223
|
+
if (!(0, type_check_1.isObject)(schema._zod) || schema._zod === null) {
|
|
224
|
+
throw new Error("block-registry: this schema exposes no _zod.def; the option walker supports zod 4");
|
|
230
225
|
}
|
|
231
226
|
}
|
|
232
227
|
/**
|
|
@@ -235,15 +230,15 @@ function describeKind(def, depth) {
|
|
|
235
230
|
* @internal
|
|
236
231
|
*/
|
|
237
232
|
function describeSchema(schema, depth = 0) {
|
|
233
|
+
assertDescribable(schema);
|
|
238
234
|
const unwrapped = unwrap(schema);
|
|
239
|
-
const
|
|
240
|
-
assertDescribable(def);
|
|
235
|
+
const kind = unwrapped.schema._zod.def.type;
|
|
241
236
|
const truncated = unwrapped.exhausted === true ||
|
|
242
|
-
(depth >= MAX_DEPTH &&
|
|
237
|
+
(depth >= MAX_DEPTH && kind in STRUCTURED_TYPE);
|
|
243
238
|
const base = (truncated
|
|
244
239
|
? undefined
|
|
245
|
-
: describeKind(
|
|
246
|
-
type: STRUCTURED_TYPE[
|
|
240
|
+
: describeKind(unwrapped.schema, depth)) ?? {
|
|
241
|
+
type: STRUCTURED_TYPE[kind] ?? PRIMITIVE[kind] ?? "unknown",
|
|
247
242
|
};
|
|
248
243
|
if (truncated)
|
|
249
244
|
base.truncated = true;
|
|
@@ -276,12 +271,11 @@ function describeOptions(schema) {
|
|
|
276
271
|
if (!schema) {
|
|
277
272
|
return {};
|
|
278
273
|
}
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return describeProperties(def.shape(), 0);
|
|
274
|
+
assertDescribable(schema);
|
|
275
|
+
const { schema: unwrapped } = unwrap(schema);
|
|
276
|
+
return unwrapped instanceof zod_1.z.core.$ZodObject
|
|
277
|
+
? describeProperties(unwrapped._zod.def.shape, 0)
|
|
278
|
+
: {};
|
|
285
279
|
}
|
|
286
280
|
/**
|
|
287
281
|
* The default value of every option that declares one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../../src/base/block-registry/internal/describe.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../../src/base/block-registry/internal/describe.ts"],"names":[],"mappings":";;;;;;AAAA,6BAAwB;AAOxB,6BAAgD;AAChD,mEAK4C;AAE5C,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,YAAY,GAAG,CAAC,CAAC;AAgBvB;;;;;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E,MAAM,CAAC,OAAO,CAAC,CAAC,CAC5D,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { z } from "zod";
|
|
2
2
|
import type { BlockOptionUi } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Hints live in a side table rather than in the schema, so validation and type
|
|
@@ -7,13 +7,15 @@ import type { BlockOptionUi } from "../types";
|
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare const UI_HINTS: WeakMap<
|
|
10
|
+
export declare const UI_HINTS: WeakMap<z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, BlockOptionUi>;
|
|
11
11
|
/**
|
|
12
|
-
* The hints attached to a schema node,
|
|
12
|
+
* The hints attached to a schema node or to a schema it was cloned from, as
|
|
13
|
+
* `.refine()`, `.describe()` and every check clone it. The clone's own hints
|
|
14
|
+
* win.
|
|
13
15
|
*
|
|
14
16
|
* @internal
|
|
15
17
|
*/
|
|
16
|
-
export declare function getUiHints(schema:
|
|
18
|
+
export declare function getUiHints(schema: z.core.$ZodType): BlockOptionUi | undefined;
|
|
17
19
|
/**
|
|
18
20
|
* Merge hints collected while unwrapping a schema. Outer wrappers
|
|
19
21
|
* (`optional`, `default`) are visited first, so an inner hint wins.
|
|
@@ -12,12 +12,16 @@ exports.mergeUiHints = mergeUiHints;
|
|
|
12
12
|
*/
|
|
13
13
|
exports.UI_HINTS = new WeakMap();
|
|
14
14
|
/**
|
|
15
|
-
* The hints attached to a schema node,
|
|
15
|
+
* The hints attached to a schema node or to a schema it was cloned from, as
|
|
16
|
+
* `.refine()`, `.describe()` and every check clone it. The clone's own hints
|
|
17
|
+
* win.
|
|
16
18
|
*
|
|
17
19
|
* @internal
|
|
18
20
|
*/
|
|
19
21
|
function getUiHints(schema) {
|
|
20
|
-
|
|
22
|
+
const parent = schema._zod.parent;
|
|
23
|
+
const own = exports.UI_HINTS.get(schema);
|
|
24
|
+
return parent ? mergeUiHints([getUiHints(parent), own]) : own;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Merge hints collected while unwrapping a schema. Outer wrappers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../../src/base/block-registry/internal/ui.ts"],"names":[],"mappings":";;;;;AAGA;;;;;;GAMG;AACU,QAAA,QAAQ,GAAG,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../../src/base/block-registry/internal/ui.ts"],"names":[],"mappings":";;;;;AAGA;;;;;;GAMG;AACU,QAAA,QAAQ,GAAG,IAAI,OAAO,EAAkC,CAAC;AAEtE;;;;;;GAMG;AACH,oBAA2B,MAAuB;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IAClC,MAAM,GAAG,GAAG,QAAA,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,sBACE,KAAuC;IAEvC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAyB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,EAC1C,EAAE,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { z } from "zod";
|
|
2
2
|
import type { BlockTypeDefinition, BlockTypeDescriptor } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Declare a block type so builder tooling can list, describe and validate it.
|
|
@@ -15,7 +15,7 @@ export declare function ListBlockTypes(): BlockTypeDescriptor[];
|
|
|
15
15
|
/** One declared block type, or `undefined` when the type is unknown. */
|
|
16
16
|
export declare function GetBlockType(type: string): BlockTypeDescriptor | undefined;
|
|
17
17
|
/** The raw options schema of a block type, for callers that hold zod. */
|
|
18
|
-
export declare function GetBlockSchema(type: string):
|
|
18
|
+
export declare function GetBlockSchema(type: string): z.ZodType | undefined;
|
|
19
19
|
/** A validation failure, addressed by a JSON pointer into the options object. */
|
|
20
20
|
export interface BlockOptionIssue {
|
|
21
21
|
pointer: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/base/block-registry/registry.ts"],"names":[],"mappings":";;;;;;;AACA,kDAI6B;AAE7B,gEAA2D;AAE3D,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;AAC3D,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE3D;;;;;;;;GAQG;AACH,2BAAkC,UAA+B;IAC/D,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClD,IAAI,QAAQ,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CACV,0BAA0B,UAAU,CAAC,IAAI,gEAAgE,CAC1G,CAAC;IACJ,CAAC;IACD,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC7C,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,QAAQ,CAAC,UAA+B;IAC/C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,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K;QACZ,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC1C,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;YAChC,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { z } from "zod";
|
|
2
2
|
/**
|
|
3
3
|
* Asserts an options schema against the factory's own options type: a schema
|
|
4
4
|
* whose input drifts from the interface stops compiling.
|
|
@@ -7,7 +7,7 @@ import type { ZodType, ZodTypeAny, ZodTypeDef } from "zod";
|
|
|
7
7
|
* export const GridSchema = z.object({ … }) satisfies BlockOptionsFor<GridOptions>;
|
|
8
8
|
* ```
|
|
9
9
|
*/
|
|
10
|
-
export type BlockOptionsFor<Options> = ZodType<unknown,
|
|
10
|
+
export type BlockOptionsFor<Options> = z.ZodType<unknown, Options>;
|
|
11
11
|
/**
|
|
12
12
|
* The editor control a block option is best edited with. `text` is the fallback
|
|
13
13
|
* when no hint is declared and the option is a plain string.
|
|
@@ -206,7 +206,7 @@ export interface BlockTypeDefinition {
|
|
|
206
206
|
* reactivity wiring `.watch()` emits, not a value an author sets by hand, so a
|
|
207
207
|
* builder has no business offering it.
|
|
208
208
|
*/
|
|
209
|
-
schema?:
|
|
209
|
+
schema?: z.ZodType;
|
|
210
210
|
/** Whether the block accepts `.child(...)`. */
|
|
211
211
|
container?: boolean;
|
|
212
212
|
/** Block types accepted as children; any type when absent. */
|
|
@@ -214,7 +214,7 @@ export interface BlockTypeDefinition {
|
|
|
214
214
|
slots?: BlockSlotDefinition[];
|
|
215
215
|
dynamicSlots?: BlockDynamicSlots;
|
|
216
216
|
/** Schema of the metadata a child carries, e.g. `{ colSpan }`. */
|
|
217
|
-
childMeta?:
|
|
217
|
+
childMeta?: z.ZodType;
|
|
218
218
|
/**
|
|
219
219
|
* Options the factory sets itself, whatever the caller passes — a chart's
|
|
220
220
|
* `type`, which is what tells `dms-chart-block` which chart to draw. A consumer
|
package/dist/base/card.d.ts
CHANGED
|
@@ -47,56 +47,34 @@ export declare function Card(options?: CardProps): ComponentBuilder<CardProps>;
|
|
|
47
47
|
/** The options `Card` accepts. */
|
|
48
48
|
export declare const CardSchema: z.ZodObject<{
|
|
49
49
|
title: z.ZodOptional<z.ZodString>;
|
|
50
|
-
count: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
50
|
+
count: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
51
51
|
description: z.ZodOptional<z.ZodString>;
|
|
52
52
|
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
53
|
label: z.ZodString;
|
|
54
54
|
to: z.ZodString;
|
|
55
55
|
icon: z.ZodOptional<z.ZodString>;
|
|
56
|
-
variant: z.ZodOptional<z.ZodEnum<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
ghost: "ghost";
|
|
58
|
+
link: "link";
|
|
59
|
+
outline: "outline";
|
|
60
|
+
soft: "soft";
|
|
61
|
+
solid: "solid";
|
|
62
|
+
subtle: "subtle";
|
|
63
|
+
}>>;
|
|
64
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
error: "error";
|
|
66
|
+
info: "info";
|
|
67
|
+
neutral: "neutral";
|
|
68
|
+
primary: "primary";
|
|
69
|
+
secondary: "secondary";
|
|
70
|
+
success: "success";
|
|
71
|
+
warning: "warning";
|
|
72
|
+
}>>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
71
74
|
footer: z.ZodOptional<z.ZodString>;
|
|
72
75
|
padded: z.ZodDefault<z.ZodBoolean>;
|
|
73
|
-
variant: z.ZodDefault<z.ZodEnum<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
actions?: {
|
|
79
|
-
label: string;
|
|
80
|
-
to: string;
|
|
81
|
-
icon?: string | undefined;
|
|
82
|
-
variant?: "ghost" | "link" | "outline" | "soft" | "solid" | "subtle" | undefined;
|
|
83
|
-
color?: "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
84
|
-
}[] | undefined;
|
|
85
|
-
footer?: string | undefined;
|
|
86
|
-
padded: boolean;
|
|
87
|
-
variant: "default" | "elevated";
|
|
88
|
-
}, {
|
|
89
|
-
title?: string | undefined;
|
|
90
|
-
count?: string | number | undefined;
|
|
91
|
-
description?: string | undefined;
|
|
92
|
-
actions?: {
|
|
93
|
-
label: string;
|
|
94
|
-
to: string;
|
|
95
|
-
icon?: string | undefined;
|
|
96
|
-
variant?: "ghost" | "link" | "outline" | "soft" | "solid" | "subtle" | undefined;
|
|
97
|
-
color?: "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
98
|
-
}[] | undefined;
|
|
99
|
-
footer?: string | undefined;
|
|
100
|
-
padded?: boolean | undefined;
|
|
101
|
-
variant?: "default" | "elevated" | undefined;
|
|
102
|
-
}>;
|
|
76
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
77
|
+
default: "default";
|
|
78
|
+
elevated: "elevated";
|
|
79
|
+
}>>;
|
|
80
|
+
}, z.core.$strip>;
|