@flowgram.ai/json-schema 0.4.7 → 0.4.9
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/esm/index.js +123 -56
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +126 -59
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -70,7 +70,7 @@ BaseTypeManager = __decorateClass([
|
|
|
70
70
|
], BaseTypeManager);
|
|
71
71
|
|
|
72
72
|
// src/json-schema/json-schema-type-manager.tsx
|
|
73
|
-
import
|
|
73
|
+
import React11 from "react";
|
|
74
74
|
import { injectable as injectable2 } from "inversify";
|
|
75
75
|
|
|
76
76
|
// src/json-schema/type-definition/default.tsx
|
|
@@ -116,12 +116,74 @@ var defaultTypeDefinitionRegistry = ({ typeManager }) => ({
|
|
|
116
116
|
getDisplayText: (type) => typeManager.getComplexText(type)
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
-
// src/json-schema/type-definition/
|
|
119
|
+
// src/json-schema/type-definition/date-time.tsx
|
|
120
120
|
import React2 from "react";
|
|
121
|
+
var dateTimeRegistryCreator = () => ({
|
|
122
|
+
type: "date-time",
|
|
123
|
+
label: "DateTime",
|
|
124
|
+
icon: /* @__PURE__ */ React2.createElement(
|
|
125
|
+
"svg",
|
|
126
|
+
{
|
|
127
|
+
viewBox: "0 0 24 24",
|
|
128
|
+
fill: "none",
|
|
129
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
130
|
+
width: "1em",
|
|
131
|
+
height: "1em",
|
|
132
|
+
focusable: "false",
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
},
|
|
135
|
+
/* @__PURE__ */ React2.createElement(
|
|
136
|
+
"path",
|
|
137
|
+
{
|
|
138
|
+
d: "M2 5v14a3 3 0 0 0 3 3h7.1a7.02 7.02 0 0 1-1.43-2H6a2 2 0 0 1-2-2V8a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2.67c.75.36 1.43.85 2 1.43V5a3 3 0 0 0-3-3H5a3 3 0 0 0-3 3Z",
|
|
139
|
+
fill: "currentColor"
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M16 10h1c-.54 0-1.06.06-1.57.18A1 1 0 0 1 16 10Z", fill: "currentColor" }),
|
|
143
|
+
/* @__PURE__ */ React2.createElement(
|
|
144
|
+
"path",
|
|
145
|
+
{
|
|
146
|
+
d: "M13.5 10.94a1 1 0 0 0-1-.94h-1a1 1 0 0 0-1 1v1a1 1 0 0 0 .77.97 7.03 7.03 0 0 1 2.23-2.03Z",
|
|
147
|
+
fill: "currentColor"
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ React2.createElement(
|
|
151
|
+
"path",
|
|
152
|
+
{
|
|
153
|
+
d: "M7 10a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1H7Z",
|
|
154
|
+
fill: "currentColor"
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ React2.createElement(
|
|
158
|
+
"path",
|
|
159
|
+
{
|
|
160
|
+
d: "M6 16a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-1Z",
|
|
161
|
+
fill: "currentColor"
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ React2.createElement(
|
|
165
|
+
"path",
|
|
166
|
+
{
|
|
167
|
+
fillRule: "evenodd",
|
|
168
|
+
clipRule: "evenodd",
|
|
169
|
+
d: "M22 17a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-4-2a1 1 0 1 0-2 0v2c0 .27.1.52.3.7l1.5 1.5a1 1 0 0 0 1.4-1.4L18 16.58V15Z",
|
|
170
|
+
fill: "currentColor"
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
),
|
|
174
|
+
getDefaultSchema: () => ({
|
|
175
|
+
type: "date-time"
|
|
176
|
+
}),
|
|
177
|
+
getValueText: (value) => value ? `${value}` : "",
|
|
178
|
+
getDefaultValue: () => ""
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// src/json-schema/type-definition/string.tsx
|
|
182
|
+
import React3 from "react";
|
|
121
183
|
var stringRegistryCreator = () => ({
|
|
122
184
|
type: "string",
|
|
123
185
|
label: "String",
|
|
124
|
-
icon: /* @__PURE__ */
|
|
186
|
+
icon: /* @__PURE__ */ React3.createElement(
|
|
125
187
|
"svg",
|
|
126
188
|
{
|
|
127
189
|
width: "1em",
|
|
@@ -130,28 +192,28 @@ var stringRegistryCreator = () => ({
|
|
|
130
192
|
fill: "none",
|
|
131
193
|
xmlns: "http://www.w3.org/2000/svg"
|
|
132
194
|
},
|
|
133
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ React3.createElement(
|
|
134
196
|
"path",
|
|
135
197
|
{
|
|
136
198
|
d: "M9.3342 3.33321C8.96601 3.33321 8.66753 3.63169 8.66753 3.99988C8.66753 4.36807 8.96601 4.66655 9.3342 4.66655H14.6675C15.0357 4.66655 15.3342 4.36807 15.3342 3.99988C15.3342 3.63169 15.0357 3.33321 14.6675 3.33321H9.3342Z",
|
|
137
199
|
fill: "currentColor"
|
|
138
200
|
}
|
|
139
201
|
),
|
|
140
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ React3.createElement(
|
|
141
203
|
"path",
|
|
142
204
|
{
|
|
143
205
|
d: "M10.0009 7.99988C10.0009 7.63169 10.2993 7.33321 10.6675 7.33321H14.6675C15.0357 7.33321 15.3342 7.63169 15.3342 7.99988C15.3342 8.36807 15.0357 8.66655 14.6675 8.66655H10.6675C10.2993 8.66655 10.0009 8.36807 10.0009 7.99988Z",
|
|
144
206
|
fill: "currentColor"
|
|
145
207
|
}
|
|
146
208
|
),
|
|
147
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ React3.createElement(
|
|
148
210
|
"path",
|
|
149
211
|
{
|
|
150
212
|
d: "M12.0009 11.3332C11.6327 11.3332 11.3342 11.6317 11.3342 11.9999C11.3342 12.3681 11.6327 12.6665 12.0009 12.6665H14.6675C15.0357 12.6665 15.3342 12.3681 15.3342 11.9999C15.3342 11.6317 15.0357 11.3332 14.6675 11.3332H12.0009Z",
|
|
151
213
|
fill: "currentColor"
|
|
152
214
|
}
|
|
153
215
|
),
|
|
154
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ React3.createElement(
|
|
155
217
|
"path",
|
|
156
218
|
{
|
|
157
219
|
d: "M9.86659 14.1482L8.23444 10.1844H3.18136C3.13868 10.1844 3.09685 10.1808 3.05616 10.1738L1.66589 14.1129C1.53049 14.4965 1.10971 14.6978 0.726058 14.5624C0.342408 14.427 0.141166 14.0062 0.276572 13.6225L4.37566 2.00848C4.71323 1.05202 6.05321 1.01763 6.4394 1.95552L11.2289 13.5872C11.3838 13.9634 11.2044 14.394 10.8282 14.5489C10.452 14.7038 10.0215 14.5244 9.86659 14.1482ZM5.44412 3.40791L3.57241 8.71109H7.62778L5.44412 3.40791Z",
|
|
@@ -167,17 +229,17 @@ var stringRegistryCreator = () => ({
|
|
|
167
229
|
});
|
|
168
230
|
|
|
169
231
|
// src/json-schema/type-definition/object.tsx
|
|
170
|
-
import
|
|
232
|
+
import React4 from "react";
|
|
171
233
|
var objectRegistryCreator = () => ({
|
|
172
234
|
type: "object",
|
|
173
235
|
label: "Object",
|
|
174
|
-
icon: /* @__PURE__ */
|
|
236
|
+
icon: /* @__PURE__ */ React4.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React4.createElement(
|
|
175
237
|
"path",
|
|
176
238
|
{
|
|
177
239
|
d: "M5.33893 1.5835C5.66613 1.5835 5.93137 1.88142 5.93137 2.20862C5.93137 2.53582 5.66613 2.76838 5.33893 2.76838H4.9099C4.34717 2.76838 4.08062 3.07557 4.08062 3.71921V6.58633C4.08062 7.30996 3.80723 7.84734 3.26798 8.19105C3.11426 8.28902 3.10884 8.55273 3.26068 8.65359C3.80476 9.01503 4.08062 9.53994 4.08062 10.2434V13.1251C4.08062 13.7395 4.34717 14.0613 4.9099 14.0613H5.33893C5.66613 14.0613 5.93137 14.3435 5.93137 14.6707C5.93137 14.9979 5.66613 15.2462 5.33893 15.2462H4.64335C3.99177 15.2462 3.48828 15.0268 3.13287 14.6172C2.80708 14.2369 2.64419 13.7103 2.64419 13.0666V10.3165C2.64419 9.8923 2.55534 9.58511 2.37764 9.39494C2.26816 9.27135 1.80618 9.17938 1.38154 9.11602C1.02726 9.06315 0.759057 8.76744 0.765747 8.4093C0.772379 8.0543 1.03439 7.7566 1.38545 7.70346C1.80778 7.63952 2.26906 7.54968 2.37764 7.43477C2.55534 7.22997 2.64419 6.92278 2.64419 6.51319V3.77772C2.64419 3.11945 2.80708 2.59284 3.13287 2.21251C3.48828 1.78829 3.99177 1.5835 4.64335 1.5835H5.33893Z",
|
|
178
240
|
fill: "currentColor"
|
|
179
241
|
}
|
|
180
|
-
), /* @__PURE__ */
|
|
242
|
+
), /* @__PURE__ */ React4.createElement(
|
|
181
243
|
"path",
|
|
182
244
|
{
|
|
183
245
|
d: "M10.962 15.2463C10.6348 15.2463 10.3696 14.9483 10.3696 14.6211C10.3696 14.2939 10.6348 14.0614 10.962 14.0614H11.391C11.9538 14.0614 12.2203 13.7542 12.2203 13.1105V10.2434C12.2203 9.51979 12.4937 8.98241 13.033 8.6387C13.1867 8.54073 13.1921 8.27703 13.0403 8.17616C12.4962 7.81472 12.2203 7.28982 12.2203 6.58638V3.70463C12.2203 3.09024 11.9538 2.76842 11.391 2.76842L10.962 2.76842C10.6348 2.76842 10.3696 2.48627 10.3696 2.15907C10.3696 1.83188 10.6348 1.58354 10.962 1.58354L11.6576 1.58354C12.3092 1.58354 12.8127 1.80296 13.1681 2.21255C13.4939 2.59289 13.6568 3.1195 13.6568 3.76314V6.51324C13.6568 6.93745 13.7456 7.24464 13.9233 7.43481C14.03 7.5553 14.4328 7.64858 14.8186 7.71393C15.1718 7.77376 15.4401 8.06977 15.4334 8.42791C15.4268 8.78291 15.1646 9.08018 14.814 9.13633C14.4306 9.19774 14.0291 9.28303 13.9233 9.39499C13.7456 9.59978 13.6568 9.90697 13.6568 10.3166V13.052C13.6568 13.7103 13.4939 14.2369 13.1681 14.6172C12.8127 15.0415 12.3092 15.2463 11.6576 15.2463H10.962Z",
|
|
@@ -199,24 +261,24 @@ var objectRegistryCreator = () => ({
|
|
|
199
261
|
});
|
|
200
262
|
|
|
201
263
|
// src/json-schema/type-definition/number.tsx
|
|
202
|
-
import
|
|
264
|
+
import React5 from "react";
|
|
203
265
|
var numberRegistryCreator = () => ({
|
|
204
266
|
type: "number",
|
|
205
267
|
label: "Number",
|
|
206
268
|
extend: "integer",
|
|
207
|
-
icon: /* @__PURE__ */
|
|
269
|
+
icon: /* @__PURE__ */ React5.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React5.createElement(
|
|
208
270
|
"path",
|
|
209
271
|
{
|
|
210
272
|
d: "M3.44151 5.3068C3.44151 3.83404 4.71542 2.64014 6.18818 2.64014C7.66094 2.64014 8.93484 3.83404 8.93484 5.3068V10.6135C8.93484 12.0862 7.66094 13.2801 6.18818 13.2801C4.71542 13.2801 3.44151 12.0862 3.44151 10.6135V5.3068ZM7.60151 5.3068C7.60151 4.57042 6.92456 3.97347 6.18818 3.97347C5.4518 3.97347 4.77484 4.57042 4.77484 5.3068V10.6135C4.77484 11.3498 5.4518 11.9468 6.18818 11.9468C6.92456 11.9468 7.60151 11.3498 7.60151 10.6135V5.3068Z",
|
|
211
273
|
fill: "currentColor"
|
|
212
274
|
}
|
|
213
|
-
), /* @__PURE__ */
|
|
275
|
+
), /* @__PURE__ */ React5.createElement(
|
|
214
276
|
"path",
|
|
215
277
|
{
|
|
216
278
|
d: "M12.9882 2.64014C11.5154 2.64014 10.2415 3.83404 10.2415 5.3068V10.6135C10.2415 12.0862 11.5154 13.2801 12.9882 13.2801C14.4609 13.2801 15.7348 12.0862 15.7348 10.6135V5.3068C15.7348 3.83404 14.4609 2.64014 12.9882 2.64014ZM14.4015 10.6135C14.4015 11.3498 13.7246 11.9468 12.9882 11.9468C12.2518 11.9468 11.5748 11.3498 11.5748 10.6135V5.3068C11.5748 4.57042 12.2518 3.97347 12.9882 3.97347C13.7246 3.97347 14.4015 4.57042 14.4015 5.3068V10.6135Z",
|
|
217
279
|
fill: "currentColor"
|
|
218
280
|
}
|
|
219
|
-
), /* @__PURE__ */
|
|
281
|
+
), /* @__PURE__ */ React5.createElement(
|
|
220
282
|
"path",
|
|
221
283
|
{
|
|
222
284
|
d: "M1.21484 13.2001C1.76713 13.2001 2.21484 12.7524 2.21484 12.2001C2.21484 11.6479 1.76713 11.2001 1.21484 11.2001C0.662559 11.2001 0.214844 11.6479 0.214844 12.2001C0.214844 12.7524 0.662559 13.2001 1.21484 13.2001Z",
|
|
@@ -228,11 +290,11 @@ var numberRegistryCreator = () => ({
|
|
|
228
290
|
});
|
|
229
291
|
|
|
230
292
|
// src/json-schema/type-definition/boolean.tsx
|
|
231
|
-
import
|
|
293
|
+
import React6 from "react";
|
|
232
294
|
var booleanRegistryCreator = () => ({
|
|
233
295
|
type: "boolean",
|
|
234
296
|
label: "Boolean",
|
|
235
|
-
icon: /* @__PURE__ */
|
|
297
|
+
icon: /* @__PURE__ */ React6.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React6.createElement(
|
|
236
298
|
"path",
|
|
237
299
|
{
|
|
238
300
|
fillRule: "evenodd",
|
|
@@ -240,7 +302,7 @@ var booleanRegistryCreator = () => ({
|
|
|
240
302
|
d: "M10.668 4.66683H5.33463C3.49369 4.66683 2.0013 6.15921 2.0013 8.00016C2.0013 9.84111 3.49369 11.3335 5.33463 11.3335H10.668C12.5089 11.3335 14.0013 9.84111 14.0013 8.00016C14.0013 6.15921 12.5089 4.66683 10.668 4.66683ZM5.33463 3.3335C2.75731 3.3335 0.667969 5.42283 0.667969 8.00016C0.667969 10.5775 2.75731 12.6668 5.33463 12.6668H10.668C13.2453 12.6668 15.3346 10.5775 15.3346 8.00016C15.3346 5.42283 13.2453 3.3335 10.668 3.3335H5.33463Z",
|
|
241
303
|
fill: "currentColor"
|
|
242
304
|
}
|
|
243
|
-
), /* @__PURE__ */
|
|
305
|
+
), /* @__PURE__ */ React6.createElement(
|
|
244
306
|
"path",
|
|
245
307
|
{
|
|
246
308
|
fillRule: "evenodd",
|
|
@@ -255,15 +317,15 @@ var booleanRegistryCreator = () => ({
|
|
|
255
317
|
});
|
|
256
318
|
|
|
257
319
|
// src/json-schema/type-definition/array.tsx
|
|
258
|
-
import
|
|
320
|
+
import React7 from "react";
|
|
259
321
|
var arrayRegistryCreator = ({ typeManager }) => {
|
|
260
|
-
const icon = /* @__PURE__ */
|
|
322
|
+
const icon = /* @__PURE__ */ React7.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React7.createElement(
|
|
261
323
|
"path",
|
|
262
324
|
{
|
|
263
325
|
d: "M5.23759 1.00342H2.00391V14.997H5.23759V13.6251H3.35127V2.37534H5.23759V1.00342Z",
|
|
264
326
|
fill: "currentColor"
|
|
265
327
|
}
|
|
266
|
-
), /* @__PURE__ */
|
|
328
|
+
), /* @__PURE__ */ React7.createElement(
|
|
267
329
|
"path",
|
|
268
330
|
{
|
|
269
331
|
d: "M10.7624 1.00342H13.9961V14.997H10.7624V13.6251H12.6487V2.37534H10.7624V1.00342Z",
|
|
@@ -275,7 +337,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
275
337
|
const config = typeManager.getTypeBySchema(item);
|
|
276
338
|
switch (config?.type) {
|
|
277
339
|
case "object":
|
|
278
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ React7.createElement(
|
|
279
341
|
"svg",
|
|
280
342
|
{
|
|
281
343
|
width: "16",
|
|
@@ -284,7 +346,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
284
346
|
fill: "none",
|
|
285
347
|
xmlns: "http://www.w3.org/2000/svg"
|
|
286
348
|
},
|
|
287
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ React7.createElement(
|
|
288
350
|
"path",
|
|
289
351
|
{
|
|
290
352
|
fillRule: "evenodd",
|
|
@@ -295,7 +357,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
295
357
|
)
|
|
296
358
|
);
|
|
297
359
|
case "string": {
|
|
298
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ React7.createElement(
|
|
299
361
|
"svg",
|
|
300
362
|
{
|
|
301
363
|
width: "16",
|
|
@@ -304,7 +366,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
304
366
|
fill: "none",
|
|
305
367
|
xmlns: "http://www.w3.org/2000/svg"
|
|
306
368
|
},
|
|
307
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ React7.createElement(
|
|
308
370
|
"path",
|
|
309
371
|
{
|
|
310
372
|
fillRule: "evenodd",
|
|
@@ -316,7 +378,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
316
378
|
);
|
|
317
379
|
}
|
|
318
380
|
case "enum": {
|
|
319
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ React7.createElement(
|
|
320
382
|
"svg",
|
|
321
383
|
{
|
|
322
384
|
width: "16",
|
|
@@ -325,7 +387,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
325
387
|
fill: "none",
|
|
326
388
|
xmlns: "http://www.w3.org/2000/svg"
|
|
327
389
|
},
|
|
328
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ React7.createElement(
|
|
329
391
|
"path",
|
|
330
392
|
{
|
|
331
393
|
fillRule: "evenodd",
|
|
@@ -334,7 +396,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
334
396
|
fill: "currentColor"
|
|
335
397
|
}
|
|
336
398
|
),
|
|
337
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ React7.createElement(
|
|
338
400
|
"path",
|
|
339
401
|
{
|
|
340
402
|
d: "M6.01442 7.34421C5.89401 7.46462 5.89401 7.65985 6.01442 7.78026L7.78218 9.54802C7.9026 9.66844 8.09782 9.66844 8.21823 9.54802L9.986 7.78026C10.1064 7.65985 10.1064 7.46462 9.986 7.34421L9.69137 7.04958C9.57096 6.92917 9.37573 6.92917 9.25532 7.04958L8.00021 8.3047L6.74509 7.04958C6.62468 6.92917 6.42946 6.92917 6.30904 7.04958L6.01442 7.34421ZM3.31699 7.99984C3.31699 10.5864 5.41379 12.6832 8.00033 12.6832C10.5869 12.6832 12.6837 10.5864 12.6837 7.99984C12.6837 5.4133 10.5869 3.3165 8.00033 3.3165C5.41379 3.3165 3.31699 5.4133 3.31699 7.99984ZM11.6503 7.99984C11.6503 10.0157 10.0162 11.6498 8.00033 11.6498C5.98449 11.6498 4.35033 10.0157 4.35033 7.99984C4.35033 5.984 5.98449 4.34984 8.00033 4.34984C10.0162 4.34984 11.6503 5.984 11.6503 7.99984Z",
|
|
@@ -346,7 +408,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
346
408
|
);
|
|
347
409
|
}
|
|
348
410
|
case "integer": {
|
|
349
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ React7.createElement(
|
|
350
412
|
"svg",
|
|
351
413
|
{
|
|
352
414
|
width: "16",
|
|
@@ -355,7 +417,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
355
417
|
fill: "none",
|
|
356
418
|
xmlns: "http://www.w3.org/2000/svg"
|
|
357
419
|
},
|
|
358
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ React7.createElement(
|
|
359
421
|
"path",
|
|
360
422
|
{
|
|
361
423
|
fillRule: "evenodd",
|
|
@@ -367,7 +429,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
367
429
|
);
|
|
368
430
|
}
|
|
369
431
|
case "number": {
|
|
370
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ React7.createElement(
|
|
371
433
|
"svg",
|
|
372
434
|
{
|
|
373
435
|
width: "16",
|
|
@@ -376,7 +438,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
376
438
|
fill: "none",
|
|
377
439
|
xmlns: "http://www.w3.org/2000/svg"
|
|
378
440
|
},
|
|
379
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ React7.createElement(
|
|
380
442
|
"path",
|
|
381
443
|
{
|
|
382
444
|
fillRule: "evenodd",
|
|
@@ -388,7 +450,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
388
450
|
);
|
|
389
451
|
}
|
|
390
452
|
case "boolean":
|
|
391
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ React7.createElement(
|
|
392
454
|
"svg",
|
|
393
455
|
{
|
|
394
456
|
width: "16",
|
|
@@ -397,7 +459,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
397
459
|
fill: "none",
|
|
398
460
|
xmlns: "http://www.w3.org/2000/svg"
|
|
399
461
|
},
|
|
400
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ React7.createElement(
|
|
401
463
|
"path",
|
|
402
464
|
{
|
|
403
465
|
fillRule: "evenodd",
|
|
@@ -409,7 +471,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
409
471
|
);
|
|
410
472
|
case "stream":
|
|
411
473
|
case "map": {
|
|
412
|
-
return /* @__PURE__ */
|
|
474
|
+
return /* @__PURE__ */ React7.createElement(
|
|
413
475
|
"svg",
|
|
414
476
|
{
|
|
415
477
|
width: "16",
|
|
@@ -418,7 +480,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
418
480
|
fill: "none",
|
|
419
481
|
xmlns: "http://www.w3.org/2000/svg"
|
|
420
482
|
},
|
|
421
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ React7.createElement(
|
|
422
484
|
"path",
|
|
423
485
|
{
|
|
424
486
|
fillRule: "evenodd",
|
|
@@ -427,7 +489,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
427
489
|
fill: "currentColor"
|
|
428
490
|
}
|
|
429
491
|
),
|
|
430
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ React7.createElement(
|
|
431
493
|
"path",
|
|
432
494
|
{
|
|
433
495
|
fillRule: "evenodd",
|
|
@@ -436,7 +498,7 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
436
498
|
fill: "currentColor"
|
|
437
499
|
}
|
|
438
500
|
),
|
|
439
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ React7.createElement(
|
|
440
502
|
"path",
|
|
441
503
|
{
|
|
442
504
|
fillRule: "evenodd",
|
|
@@ -518,23 +580,23 @@ var arrayRegistryCreator = ({ typeManager }) => {
|
|
|
518
580
|
};
|
|
519
581
|
|
|
520
582
|
// src/json-schema/type-definition/integer.tsx
|
|
521
|
-
import
|
|
583
|
+
import React8 from "react";
|
|
522
584
|
var integerRegistryCreator = () => ({
|
|
523
585
|
type: "integer",
|
|
524
586
|
label: "Integer",
|
|
525
|
-
icon: /* @__PURE__ */
|
|
587
|
+
icon: /* @__PURE__ */ React8.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React8.createElement(
|
|
526
588
|
"path",
|
|
527
589
|
{
|
|
528
590
|
d: "M15.132 11.4601C15.644 11.0121 15.9 10.3921 15.9 9.60007C15.9 8.60807 15.5 7.93607 14.7 7.58407C15.412 7.23207 15.768 6.62407 15.768 5.76007C15.768 5.05607 15.536 4.48007 15.072 4.03207C14.608 3.59207 14.012 3.37207 13.284 3.37207C12.588 3.37207 12.008 3.58007 11.544 3.99607C11.064 4.42007 10.808 4.98807 10.776 5.70007H12C12.064 4.88407 12.492 4.47607 13.284 4.47607C14.124 4.47607 14.544 4.91607 14.544 5.79607C14.544 6.66007 14.112 7.09207 13.248 7.09207H13.044V8.16007H13.248C14.2 8.16007 14.676 8.62807 14.676 9.56407C14.676 10.5081 14.212 10.9801 13.284 10.9801C12.9 10.9801 12.584 10.8761 12.336 10.6681C12.064 10.4441 11.916 10.1161 11.892 9.68407H10.668C10.692 10.4761 10.964 11.0841 11.484 11.5081C11.948 11.8921 12.548 12.0841 13.284 12.0841C14.036 12.0841 14.652 11.8761 15.132 11.4601Z",
|
|
529
591
|
fill: "currentColor"
|
|
530
592
|
}
|
|
531
|
-
), /* @__PURE__ */
|
|
593
|
+
), /* @__PURE__ */ React8.createElement(
|
|
532
594
|
"path",
|
|
533
595
|
{
|
|
534
596
|
d: "M4.46875 12.0003V10.9083L7.75675 6.91228C8.06075 6.54428 8.21275 6.16428 8.21275 5.77228C8.21275 4.90828 7.79675 4.47628 6.96475 4.47628C6.60475 4.47628 6.31275 4.57628 6.08875 4.77628C5.83275 5.00828 5.70475 5.34828 5.70475 5.79628H4.48075C4.48075 5.07628 4.71275 4.49228 5.17675 4.04428C5.64075 3.60428 6.23675 3.38428 6.96475 3.38428C7.70075 3.38428 8.29675 3.60028 8.75275 4.03228C9.20875 4.47228 9.43675 5.05628 9.43675 5.78428C9.43675 6.13628 9.36875 6.45628 9.23275 6.74428C9.12075 6.97628 8.92075 7.27228 8.63275 7.63228L5.95675 10.9083H9.43675V12.0003H4.46875Z",
|
|
535
597
|
fill: "currentColor"
|
|
536
598
|
}
|
|
537
|
-
), /* @__PURE__ */
|
|
599
|
+
), /* @__PURE__ */ React8.createElement(
|
|
538
600
|
"path",
|
|
539
601
|
{
|
|
540
602
|
d: "M1.668 12.0001V4.78805L0 6.25205V4.89605L1.668 3.45605H2.892V12.0001H1.668Z",
|
|
@@ -547,12 +609,12 @@ var integerRegistryCreator = () => ({
|
|
|
547
609
|
});
|
|
548
610
|
|
|
549
611
|
// src/json-schema/type-definition/unknown.tsx
|
|
550
|
-
import
|
|
612
|
+
import React9 from "react";
|
|
551
613
|
var unknownRegistryCreator = () => ({
|
|
552
614
|
type: "unknown",
|
|
553
615
|
label: "Unknown",
|
|
554
616
|
parentType: [],
|
|
555
|
-
icon: /* @__PURE__ */
|
|
617
|
+
icon: /* @__PURE__ */ React9.createElement(
|
|
556
618
|
"svg",
|
|
557
619
|
{
|
|
558
620
|
viewBox: "0 0 24 24",
|
|
@@ -563,7 +625,7 @@ var unknownRegistryCreator = () => ({
|
|
|
563
625
|
focusable: "false",
|
|
564
626
|
"aria-hidden": "true"
|
|
565
627
|
},
|
|
566
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ React9.createElement(
|
|
567
629
|
"path",
|
|
568
630
|
{
|
|
569
631
|
fillRule: "evenodd",
|
|
@@ -572,7 +634,7 @@ var unknownRegistryCreator = () => ({
|
|
|
572
634
|
fill: "currentColor"
|
|
573
635
|
}
|
|
574
636
|
),
|
|
575
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ React9.createElement(
|
|
576
638
|
"path",
|
|
577
639
|
{
|
|
578
640
|
fillRule: "evenodd",
|
|
@@ -581,7 +643,7 @@ var unknownRegistryCreator = () => ({
|
|
|
581
643
|
fill: "currentColor"
|
|
582
644
|
}
|
|
583
645
|
),
|
|
584
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ React9.createElement(
|
|
585
647
|
"path",
|
|
586
648
|
{
|
|
587
649
|
fillRule: "evenodd",
|
|
@@ -596,9 +658,9 @@ var unknownRegistryCreator = () => ({
|
|
|
596
658
|
});
|
|
597
659
|
|
|
598
660
|
// src/json-schema/type-definition/map.tsx
|
|
599
|
-
import
|
|
661
|
+
import React10 from "react";
|
|
600
662
|
var mapRegistryCreator = ({ typeManager }) => {
|
|
601
|
-
const icon = /* @__PURE__ */
|
|
663
|
+
const icon = /* @__PURE__ */ React10.createElement(
|
|
602
664
|
"svg",
|
|
603
665
|
{
|
|
604
666
|
viewBox: "0 0 1024 1024",
|
|
@@ -607,14 +669,14 @@ var mapRegistryCreator = ({ typeManager }) => {
|
|
|
607
669
|
width: "16",
|
|
608
670
|
height: "16"
|
|
609
671
|
},
|
|
610
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ React10.createElement(
|
|
611
673
|
"path",
|
|
612
674
|
{
|
|
613
675
|
d: "M877.860571 938.642286h-645.851428c-27.574857 0-54.052571-11.337143-73.508572-31.744a110.957714 110.957714 0 0 1-30.500571-76.8V193.828571c0-28.745143 10.971429-56.32 30.500571-76.726857a101.888 101.888 0 0 1 73.508572-31.817143h574.171428c27.501714 0 53.979429 11.337143 73.508572 31.744 19.529143 20.333714 30.500571 48.054857 30.500571 76.8v522.020572a34.157714 34.157714 0 0 1-6.948571 22.820571c-37.156571 19.382857-57.636571 39.350857-57.636572 72.630857 0 39.716571 19.894857 50.029714 57.636572 72.777143a34.816 34.816 0 0 1-8.045714 49.298286 32.256 32.256 0 0 1-17.334858 5.193143z m-32.256-254.537143V193.828571a40.228571 40.228571 0 0 0-39.497142-41.179428H232.009143a40.301714 40.301714 0 0 0-39.497143 41.252571V699.245714c17.773714-9.874286 37.449143-14.994286 57.417143-14.921143h595.675428v-0.073142z m-595.675428 187.245714h566.198857c-22.893714-11.190857-27.940571-39.497143-28.013714-59.977143 0-20.260571 3.218286-43.885714 28.013714-59.904h-566.125714c-31.670857 0-57.417143 26.843429-57.417143 59.977143 0 33.060571 25.746286 59.904 57.344 59.904z",
|
|
614
676
|
fill: "currentColor"
|
|
615
677
|
}
|
|
616
678
|
),
|
|
617
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ React10.createElement(
|
|
618
680
|
"path",
|
|
619
681
|
{
|
|
620
682
|
d: "M320 128m32.036571 0l-0.073142 0q32.036571 0 32.036571 32.036571l0 511.926858q0 32.036571-32.036571 32.036571l0.073142 0q-32.036571 0-32.036571-32.036571l0-511.926858q0-32.036571 32.036571-32.036571Z",
|
|
@@ -728,7 +790,7 @@ var JsonSchemaTypeManager = class extends BaseTypeManager {
|
|
|
728
790
|
};
|
|
729
791
|
this.getDisplayIcon = (type) => {
|
|
730
792
|
const registry = this.getTypeBySchema(type);
|
|
731
|
-
return registry?.getDisplayIcon(type) || registry?.icon || /* @__PURE__ */
|
|
793
|
+
return registry?.getDisplayIcon(type) || registry?.icon || /* @__PURE__ */ React11.createElement(React11.Fragment, null);
|
|
732
794
|
};
|
|
733
795
|
this.getTypeSchemaProperties = (type) => {
|
|
734
796
|
const registry = this.getTypeBySchema(type);
|
|
@@ -759,7 +821,8 @@ var JsonSchemaTypeManager = class extends BaseTypeManager {
|
|
|
759
821
|
objectRegistryCreator,
|
|
760
822
|
arrayRegistryCreator,
|
|
761
823
|
unknownRegistryCreator,
|
|
762
|
-
mapRegistryCreator
|
|
824
|
+
mapRegistryCreator,
|
|
825
|
+
dateTimeRegistryCreator
|
|
763
826
|
];
|
|
764
827
|
registries.forEach((registry) => {
|
|
765
828
|
this.register(
|
|
@@ -779,6 +842,9 @@ var JsonSchemaTypeManager = class extends BaseTypeManager {
|
|
|
779
842
|
if (typeSchema.enum) {
|
|
780
843
|
return "enum";
|
|
781
844
|
}
|
|
845
|
+
if (typeSchema.format && typeSchema.type === "string") {
|
|
846
|
+
return typeSchema.format;
|
|
847
|
+
}
|
|
782
848
|
return typeSchema.type || typeSchema.$ref || "unknown";
|
|
783
849
|
}
|
|
784
850
|
};
|
|
@@ -833,7 +899,7 @@ var JsonSchemaUtils;
|
|
|
833
899
|
valueType: schemaToAST(jsonSchema.additionalProperties)
|
|
834
900
|
});
|
|
835
901
|
case "string":
|
|
836
|
-
return ASTFactory.createString();
|
|
902
|
+
return ASTFactory.createString({ format: jsonSchema.format });
|
|
837
903
|
case "number":
|
|
838
904
|
return ASTFactory.createNumber();
|
|
839
905
|
case "boolean":
|
|
@@ -857,7 +923,8 @@ var JsonSchemaUtils;
|
|
|
857
923
|
}
|
|
858
924
|
if (ASTMatch.isString(typeAST)) {
|
|
859
925
|
return {
|
|
860
|
-
type: "string"
|
|
926
|
+
type: "string",
|
|
927
|
+
format: typeAST.format
|
|
861
928
|
};
|
|
862
929
|
}
|
|
863
930
|
if (ASTMatch.isBoolean(typeAST)) {
|
|
@@ -933,7 +1000,7 @@ var JsonSchemaUtils;
|
|
|
933
1000
|
var jsonSchemaTypeManager = new JsonSchemaTypeManager();
|
|
934
1001
|
|
|
935
1002
|
// src/context.tsx
|
|
936
|
-
import
|
|
1003
|
+
import React12, { createContext, useContext, useMemo } from "react";
|
|
937
1004
|
import { usePlaygroundContainer } from "@flowgram.ai/core";
|
|
938
1005
|
var TypePresetContext = createContext(null);
|
|
939
1006
|
var useTypeManager = () => {
|
|
@@ -956,7 +1023,7 @@ var TypePresetProvider = ({
|
|
|
956
1023
|
types.forEach((_type) => typeManager.register(_type));
|
|
957
1024
|
return typeManager;
|
|
958
1025
|
}, [...types]);
|
|
959
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ React12.createElement(TypePresetContext.Provider, { value: schemaManager }, children);
|
|
960
1027
|
};
|
|
961
1028
|
|
|
962
1029
|
// src/container-module.tsx
|