@satoshibits/react-json-schema-builder 1.1.4 → 1.1.5

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.
Files changed (234) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs10.js +1 -1
  3. package/dist/index.cjs10.js.map +1 -1
  4. package/dist/index.cjs11.js +1 -1
  5. package/dist/index.cjs11.js.map +1 -1
  6. package/dist/index.cjs12.js +1 -1
  7. package/dist/index.cjs12.js.map +1 -1
  8. package/dist/index.cjs13.js +1 -1
  9. package/dist/index.cjs13.js.map +1 -1
  10. package/dist/index.cjs14.js +1 -1
  11. package/dist/index.cjs14.js.map +1 -1
  12. package/dist/index.cjs15.js +6 -1
  13. package/dist/index.cjs15.js.map +1 -1
  14. package/dist/index.cjs16.js +1 -1
  15. package/dist/index.cjs16.js.map +1 -1
  16. package/dist/index.cjs17.js +1 -1
  17. package/dist/index.cjs17.js.map +1 -1
  18. package/dist/index.cjs18.js +1 -1
  19. package/dist/index.cjs18.js.map +1 -1
  20. package/dist/index.cjs19.js +1 -1
  21. package/dist/index.cjs19.js.map +1 -1
  22. package/dist/index.cjs2.js +1 -1
  23. package/dist/index.cjs2.js.map +1 -1
  24. package/dist/index.cjs20.js +1 -1
  25. package/dist/index.cjs20.js.map +1 -1
  26. package/dist/index.cjs21.js +1 -1
  27. package/dist/index.cjs21.js.map +1 -1
  28. package/dist/index.cjs22.js +1 -1
  29. package/dist/index.cjs22.js.map +1 -1
  30. package/dist/index.cjs23.js +1 -6
  31. package/dist/index.cjs23.js.map +1 -1
  32. package/dist/index.cjs24.js +1 -6
  33. package/dist/index.cjs24.js.map +1 -1
  34. package/dist/index.cjs25.js +1 -6
  35. package/dist/index.cjs25.js.map +1 -1
  36. package/dist/index.cjs26.js +1 -1
  37. package/dist/index.cjs26.js.map +1 -1
  38. package/dist/index.cjs27.js +1 -1
  39. package/dist/index.cjs27.js.map +1 -1
  40. package/dist/index.cjs28.js +6 -1
  41. package/dist/index.cjs28.js.map +1 -1
  42. package/dist/index.cjs29.js +6 -1
  43. package/dist/index.cjs29.js.map +1 -1
  44. package/dist/index.cjs3.js +1 -1
  45. package/dist/index.cjs3.js.map +1 -1
  46. package/dist/index.cjs30.js +1 -1
  47. package/dist/index.cjs30.js.map +1 -1
  48. package/dist/index.cjs31.js +1 -1
  49. package/dist/index.cjs34.js +1 -1
  50. package/dist/index.cjs36.js +1 -1
  51. package/dist/index.cjs37.js +1 -1
  52. package/dist/index.cjs37.js.map +1 -1
  53. package/dist/index.cjs38.js +1 -6
  54. package/dist/index.cjs38.js.map +1 -1
  55. package/dist/index.cjs39.js +1 -6
  56. package/dist/index.cjs39.js.map +1 -1
  57. package/dist/index.cjs4.js +1 -1
  58. package/dist/index.cjs4.js.map +1 -1
  59. package/dist/index.cjs40.js +1 -6
  60. package/dist/index.cjs40.js.map +1 -1
  61. package/dist/index.cjs41.js +1 -1
  62. package/dist/index.cjs41.js.map +1 -1
  63. package/dist/index.cjs42.js +1 -1
  64. package/dist/index.cjs42.js.map +1 -1
  65. package/dist/index.cjs43.js +1 -1
  66. package/dist/index.cjs43.js.map +1 -1
  67. package/dist/index.cjs44.js +6 -1
  68. package/dist/index.cjs44.js.map +1 -1
  69. package/dist/index.cjs45.js +6 -1
  70. package/dist/index.cjs45.js.map +1 -1
  71. package/dist/index.cjs46.js +6 -1
  72. package/dist/index.cjs46.js.map +1 -1
  73. package/dist/index.cjs47.js +1 -1
  74. package/dist/index.cjs5.js +1 -1
  75. package/dist/index.cjs5.js.map +1 -1
  76. package/dist/index.cjs55.js +1 -5
  77. package/dist/index.cjs55.js.map +1 -1
  78. package/dist/index.cjs56.js +1 -1
  79. package/dist/index.cjs56.js.map +1 -1
  80. package/dist/index.cjs58.js +1 -1
  81. package/dist/index.cjs58.js.map +1 -1
  82. package/dist/index.cjs59.js +1 -1
  83. package/dist/index.cjs59.js.map +1 -1
  84. package/dist/index.cjs6.js +1 -1
  85. package/dist/index.cjs6.js.map +1 -1
  86. package/dist/index.cjs60.js +1 -1
  87. package/dist/index.cjs60.js.map +1 -1
  88. package/dist/index.cjs61.js +1 -1
  89. package/dist/index.cjs61.js.map +1 -1
  90. package/dist/index.cjs62.js +5 -1
  91. package/dist/index.cjs62.js.map +1 -1
  92. package/dist/index.cjs63.js +1 -1
  93. package/dist/index.cjs63.js.map +1 -1
  94. package/dist/index.cjs65.js +1 -1
  95. package/dist/index.cjs67.js +1 -1
  96. package/dist/index.cjs69.js +1 -1
  97. package/dist/index.cjs7.js +1 -1
  98. package/dist/index.cjs7.js.map +1 -1
  99. package/dist/index.cjs71.js +1 -1
  100. package/dist/index.cjs72.js +1 -1
  101. package/dist/index.cjs75.js +1 -1
  102. package/dist/index.cjs78.js +1 -1
  103. package/dist/index.cjs78.js.map +1 -1
  104. package/dist/index.cjs79.js +1 -1
  105. package/dist/index.cjs79.js.map +1 -1
  106. package/dist/index.cjs8.js +1 -1
  107. package/dist/index.cjs8.js.map +1 -1
  108. package/dist/index.cjs80.js +1 -1
  109. package/dist/index.cjs80.js.map +1 -1
  110. package/dist/index.cjs81.js +1 -1
  111. package/dist/index.cjs81.js.map +1 -1
  112. package/dist/index.cjs82.js +1 -1
  113. package/dist/index.cjs82.js.map +1 -1
  114. package/dist/index.cjs9.js +1 -1
  115. package/dist/index.cjs9.js.map +1 -1
  116. package/dist/index.d.mts +5 -4
  117. package/dist/index.d.mts.map +1 -1
  118. package/dist/index.es.js +18 -28
  119. package/dist/index.es10.js +22 -22
  120. package/dist/index.es10.js.map +1 -1
  121. package/dist/index.es11.js +14 -42
  122. package/dist/index.es11.js.map +1 -1
  123. package/dist/index.es12.js +5 -65
  124. package/dist/index.es12.js.map +1 -1
  125. package/dist/index.es13.js +43 -24
  126. package/dist/index.es13.js.map +1 -1
  127. package/dist/index.es14.js +21 -126
  128. package/dist/index.es14.js.map +1 -1
  129. package/dist/index.es15.js +13 -20
  130. package/dist/index.es15.js.map +1 -1
  131. package/dist/index.es16.js +129 -130
  132. package/dist/index.es16.js.map +1 -1
  133. package/dist/index.es17.js +3 -137
  134. package/dist/index.es17.js.map +1 -1
  135. package/dist/index.es18.js +20 -61
  136. package/dist/index.es18.js.map +1 -1
  137. package/dist/index.es19.js +65 -10
  138. package/dist/index.es19.js.map +1 -1
  139. package/dist/index.es2.js +156 -115
  140. package/dist/index.es2.js.map +1 -1
  141. package/dist/index.es20.js +134 -22
  142. package/dist/index.es20.js.map +1 -1
  143. package/dist/index.es21.js +131 -421
  144. package/dist/index.es21.js.map +1 -1
  145. package/dist/index.es22.js +63 -5
  146. package/dist/index.es22.js.map +1 -1
  147. package/dist/index.es23.js +11 -13
  148. package/dist/index.es23.js.map +1 -1
  149. package/dist/index.es24.js +23 -16
  150. package/dist/index.es24.js.map +1 -1
  151. package/dist/index.es25.js +428 -13
  152. package/dist/index.es25.js.map +1 -1
  153. package/dist/index.es26.js +7 -13
  154. package/dist/index.es26.js.map +1 -1
  155. package/dist/index.es27.js +9 -3
  156. package/dist/index.es27.js.map +1 -1
  157. package/dist/index.es28.js +13 -19
  158. package/dist/index.es28.js.map +1 -1
  159. package/dist/index.es29.js +19 -23
  160. package/dist/index.es29.js.map +1 -1
  161. package/dist/index.es3.js +129 -340
  162. package/dist/index.es3.js.map +1 -1
  163. package/dist/index.es30.js +4 -7
  164. package/dist/index.es30.js.map +1 -1
  165. package/dist/index.es31.js +1 -1
  166. package/dist/index.es34.js +1 -1
  167. package/dist/index.es36.js +6 -6
  168. package/dist/index.es37.js +97 -815
  169. package/dist/index.es37.js.map +1 -1
  170. package/dist/index.es38.js +56 -10
  171. package/dist/index.es38.js.map +1 -1
  172. package/dist/index.es39.js +24 -10
  173. package/dist/index.es39.js.map +1 -1
  174. package/dist/index.es4.js +92 -70
  175. package/dist/index.es4.js.map +1 -1
  176. package/dist/index.es40.js +45 -10
  177. package/dist/index.es40.js.map +1 -1
  178. package/dist/index.es41.js +71 -99
  179. package/dist/index.es41.js.map +1 -1
  180. package/dist/index.es42.js +56 -52
  181. package/dist/index.es42.js.map +1 -1
  182. package/dist/index.es43.js +827 -19
  183. package/dist/index.es43.js.map +1 -1
  184. package/dist/index.es44.js +10 -45
  185. package/dist/index.es44.js.map +1 -1
  186. package/dist/index.es45.js +10 -86
  187. package/dist/index.es45.js.map +1 -1
  188. package/dist/index.es46.js +10 -60
  189. package/dist/index.es46.js.map +1 -1
  190. package/dist/index.es47.js +3 -3
  191. package/dist/index.es5.js +225 -79
  192. package/dist/index.es5.js.map +1 -1
  193. package/dist/index.es55.js +30 -252
  194. package/dist/index.es55.js.map +1 -1
  195. package/dist/index.es56.js +26 -21
  196. package/dist/index.es56.js.map +1 -1
  197. package/dist/index.es58.js +62 -23
  198. package/dist/index.es58.js.map +1 -1
  199. package/dist/index.es59.js +27 -63
  200. package/dist/index.es59.js.map +1 -1
  201. package/dist/index.es6.js +117 -57
  202. package/dist/index.es6.js.map +1 -1
  203. package/dist/index.es60.js +5 -29
  204. package/dist/index.es60.js.map +1 -1
  205. package/dist/index.es61.js +24 -5
  206. package/dist/index.es61.js.map +1 -1
  207. package/dist/index.es62.js +254 -24
  208. package/dist/index.es62.js.map +1 -1
  209. package/dist/index.es63.js +21 -32
  210. package/dist/index.es63.js.map +1 -1
  211. package/dist/index.es65.js +2 -2
  212. package/dist/index.es67.js +3 -3
  213. package/dist/index.es69.js +2 -2
  214. package/dist/index.es7.js +345 -48
  215. package/dist/index.es7.js.map +1 -1
  216. package/dist/index.es71.js +7 -7
  217. package/dist/index.es72.js +1 -1
  218. package/dist/index.es75.js +1 -1
  219. package/dist/index.es78.js +67 -11
  220. package/dist/index.es78.js.map +1 -1
  221. package/dist/index.es79.js +10 -203
  222. package/dist/index.es79.js.map +1 -1
  223. package/dist/index.es8.js +73 -163
  224. package/dist/index.es8.js.map +1 -1
  225. package/dist/index.es80.js +203 -20
  226. package/dist/index.es80.js.map +1 -1
  227. package/dist/index.es81.js +21 -392
  228. package/dist/index.es81.js.map +1 -1
  229. package/dist/index.es82.js +386 -61
  230. package/dist/index.es82.js.map +1 -1
  231. package/dist/index.es9.js +18 -3
  232. package/dist/index.es9.js.map +1 -1
  233. package/dist/packages/builder/add-dialog.d.ts +5 -5
  234. package/package.json +1 -1
@@ -1,26 +1,22 @@
1
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import { cn as c } from "./index.es22.js";
3
- function n({
4
- children: s,
5
- errorCode: e,
6
- errorDescription: t,
7
- showError: i = !1,
8
- className: l
9
- }) {
10
- return /* @__PURE__ */ m("div", { className: c("space-y-2", l), children: [
11
- i && e && /* @__PURE__ */ a(
12
- "div",
13
- {
14
- className: "text-sm font-medium text-destructive",
15
- "aria-live": "polite",
16
- children: e
17
- }
18
- ),
19
- s,
20
- i && t && /* @__PURE__ */ a("div", { className: "text-sm text-destructive", "aria-live": "polite", children: t })
21
- ] });
22
- }
1
+ import c from "./index.es49.js";
2
+ /**
3
+ * @license lucide-react v0.477.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ const e = [
9
+ [
10
+ "path",
11
+ {
12
+ d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",
13
+ key: "yt0hxn"
14
+ }
15
+ ],
16
+ ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }]
17
+ ], t = c("Bolt", e);
23
18
  export {
24
- n as InputErrorWrapper
19
+ e as __iconNode,
20
+ t as default
25
21
  };
26
22
  //# sourceMappingURL=index.es29.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es29.js","sources":["../src/components/input-error.tsx"],"sourcesContent":["import type React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface InputErrorWrapperProps {\n children: React.ReactNode;\n errorCode?: string;\n errorDescription?: string;\n showError?: boolean;\n className?: string;\n}\n\nexport function InputErrorWrapper({\n children,\n errorCode,\n errorDescription,\n showError = false,\n className,\n}: InputErrorWrapperProps) {\n return (\n <div className={cn(\"space-y-2\", className)}>\n {showError && errorCode && (\n <div\n className=\"text-sm font-medium text-destructive\"\n aria-live=\"polite\"\n >\n {errorCode}\n </div>\n )}\n\n {children}\n\n {showError && errorDescription && (\n <div className=\"text-sm text-destructive\" aria-live=\"polite\">\n {errorDescription}\n </div>\n )}\n </div>\n );\n}\n"],"names":["InputErrorWrapper","children","errorCode","errorDescription","showError","className","cn","jsx"],"mappings":";;AAWO,SAASA,EAAkB;AAAA,EAChC,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AACF,GAA2B;AACzB,2BACG,OAAI,EAAA,WAAWC,EAAG,aAAaD,CAAS,GACtC,UAAA;AAAA,IAAAD,KAAaF,KACZ,gBAAAK;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,aAAU;AAAA,QAET,UAAAL;AAAA,MAAA;AAAA,IACH;AAAA,IAGDD;AAAA,IAEAG,KAAaD,KACX,gBAAAI,EAAA,OAAA,EAAI,WAAU,4BAA2B,aAAU,UACjD,UACHJ,EAAA,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"index.es29.js","sources":["../../../node_modules/.pnpm/lucide-react@0.477.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/bolt.js"],"sourcesContent":["/**\n * @license lucide-react v0.477.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z\",\n key: \"yt0hxn\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }]\n];\nconst Bolt = createLucideIcon(\"Bolt\", __iconNode);\n\nexport { __iconNode, Bolt as default };\n//# sourceMappingURL=bolt.js.map\n"],"names":["__iconNode","Bolt","createLucideIcon"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAACA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACG;AAAA,EACD,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAU,CAAA;AAC1D,GACMC,IAAOC,EAAiB,QAAQF,CAAU;","x_google_ignoreList":[0]}
package/dist/index.es3.js CHANGED
@@ -1,356 +1,145 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useState as s, useEffect as ce, Fragment as se } from "react";
3
- import { useSchema as de } from "./index.es2.js";
4
- import { Button as d } from "./index.es11.js";
5
- import { Breadcrumb as me, BreadcrumbList as he, BreadcrumbItem as q, BreadcrumbLink as V, BreadcrumbSeparator as ue } from "./index.es12.js";
6
- import { Switch as fe } from "./index.es13.js";
7
- import { Select as $, SelectTrigger as F, SelectValue as L, SelectContent as O, SelectItem as l } from "./index.es14.js";
8
- import { Label as U } from "./index.es15.js";
9
- import { a as ge } from "./index.es10.js";
10
- import { usePluginSystem as pe, useConstraints as ve } from "./index.es4.js";
11
- import { EditPropertyDialog as ye } from "./index.es16.js";
12
- import { AlertDialog as be, AlertDialogContent as Ce, AlertDialogHeader as De, AlertDialogTitle as Ae, AlertDialogDescription as Pe, AlertDialogFooter as Se, AlertDialogCancel as Ne, AlertDialogAction as je } from "./index.es17.js";
13
- import { Alert as Ee, AlertTitle as Be, AlertDescription as we } from "./index.es18.js";
14
- import { validateSchema as xe } from "./index.es19.js";
15
- import Te from "ajv";
16
- import { DebouncedInput as C } from "./index.es20.js";
17
- import { AddPropertyDialog as ze } from "./index.es21.js";
18
- import { cn as D } from "./index.es22.js";
19
- import Ke from "./index.es23.js";
20
- import Re from "./index.es24.js";
21
- import Ie from "./index.es25.js";
22
- import qe from "./index.es26.js";
23
- import Ve from "./index.es27.js";
24
- const ot = (a) => {
25
- const [k, h] = s(!1), [H, p] = s(!1), [G, u] = s(!1), [f, v] = s(), [A, P] = s(), [S, N] = s(), [j, g] = s(null);
26
- pe(a.plugins ?? []);
27
- const {
28
- getCurrentSchema: J,
29
- setPath: m,
30
- path: o,
31
- handleAddProperty: M,
32
- handlePropertyChange: c,
33
- handleKeyChange: E,
34
- handleDeleteProperty: Q,
35
- setSchema: W,
36
- isPropertyRequired: B,
37
- handleDuplicateProperty: X
38
- } = de({ onSchemaChange: a.onSchemaChange }), { getConstraintDefinitionsForType: Y } = ve();
39
- ce(() => {
40
- if (a.initialSchema)
41
- try {
42
- xe(a.initialSchema), W(ge(a.initialSchema)), g(null);
43
- } catch (t) {
44
- t instanceof Error ? g(t.message) : t instanceof Te.ValidationError ? g(`Schema validation error: ${t.message}`) : g("Unknown schema validation error");
45
- }
46
- }, [a.initialSchema]);
47
- const Z = J(), w = (t) => {
48
- m([...o, t]);
49
- }, x = () => {
50
- m(o.slice(0, -1));
51
- }, _ = (t, r) => {
52
- P(t), N(r), p(!0);
53
- }, T = (t) => {
54
- v(t), u(!0);
55
- }, ee = () => {
56
- f && (Q(f), v(void 0)), u(!1);
57
- }, te = () => {
58
- v(void 0), u(!1);
59
- }, z = (t) => {
60
- const r = X(t);
61
- r?.status === "error" ? a.onPropertyAddError?.(r) : r?.status === "success" && a.onPropertyAddSuccess?.(r);
62
- }, re = (...t) => {
63
- const r = M(...t);
64
- r.status === "error" ? a.onPropertyAddError?.(r) : r.status === "success" && a.onPropertyAddSuccess?.(r), h(!1);
65
- }, K = a.propertyComponent, ne = (t, r) => K ? /* @__PURE__ */ e(
66
- K,
67
- {
68
- property: {
69
- key: t,
70
- schema: r,
71
- isRequired: B(t)
72
- },
73
- onPropertyChange: c,
74
- onKeyChange: E,
75
- onDelete: T,
76
- onDuplicate: z,
77
- onNavigate: r.type === "object" || r.type === "array" && typeof r.items == "object" && r.items.type === "object" ? w : void 0
78
- },
79
- t
80
- ) : /* @__PURE__ */ i(
81
- "div",
1
+ import { jsx as i, jsxs as n } from "react/jsx-runtime";
2
+ import { Input as p } from "./index.es9.js";
3
+ import { InputErrorWrapper as d } from "./index.es10.js";
4
+ import { Label as b } from "./index.es11.js";
5
+ import { cn as x } from "./index.es12.js";
6
+ import { useConstraints as h } from "./index.es8.js";
7
+ import { Button as f } from "./index.es13.js";
8
+ import v from "./index.es15.js";
9
+ const t = ({
10
+ constraintName: r,
11
+ value: s,
12
+ onConstraintChange: a,
13
+ disabled: u,
14
+ error: m,
15
+ onRemoveConstraint: l
16
+ }) => {
17
+ const { getConstraintDefinition: o } = h(), e = o(r);
18
+ return e ? /* @__PURE__ */ i(
19
+ d,
82
20
  {
83
- className: "flex flex-col md:grid grid-cols-(--my-autofit-grid) gap-4 md:items-center border p-2 rounded-md mb-2",
84
- children: [
85
- /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ e(
86
- C,
87
- {
88
- value: t,
89
- onDebounce: (n) => E(t, n),
90
- placeholder: "Property Key",
91
- "aria-label": `Property key for ${t}`,
92
- delay: 500
93
- }
94
- ) }),
95
- /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
96
- /* @__PURE__ */ e(
97
- fe,
98
- {
99
- checked: B(t),
100
- onCheckedChange: (n) => c(t, { isRequired: n }),
101
- "aria-label": "Required"
102
- }
103
- ),
104
- /* @__PURE__ */ e(U, { htmlFor: `required-${t}`, children: "Required" })
105
- ] }),
106
- /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ i(
107
- $,
108
- {
109
- value: typeof r == "object" && !Array.isArray(r.type) ? r.type : void 0,
110
- onValueChange: (n) => c(t, {
111
- type: n
112
- }),
113
- "aria-label": "Type",
114
- children: [
115
- /* @__PURE__ */ e(F, { className: "w-full", "aria-label": "Select type", children: /* @__PURE__ */ e(L, {}) }),
116
- /* @__PURE__ */ i(O, { children: [
117
- /* @__PURE__ */ e(l, { value: "string", children: "string" }),
118
- /* @__PURE__ */ e(l, { value: "number", children: "number" }),
119
- /* @__PURE__ */ e(l, { value: "integer", children: "integer" }),
120
- /* @__PURE__ */ e(l, { value: "boolean", children: "boolean" }),
121
- /* @__PURE__ */ e(l, { value: "object", children: "object" }),
122
- /* @__PURE__ */ e(l, { value: "array", children: "array" }),
123
- /* @__PURE__ */ e(l, { value: "null", children: "null" }),
124
- /* @__PURE__ */ e(l, { value: "enum", children: "enum" })
125
- ] })
126
- ]
127
- }
128
- ) }),
129
- /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ e(
130
- C,
131
- {
132
- value: typeof r == "object" ? r.title : void 0,
133
- onDebounce: (n) => c(t, { title: n }),
134
- placeholder: "Title"
135
- }
136
- ) }),
137
- /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ e(
138
- C,
139
- {
140
- value: typeof r == "object" ? r.description : void 0,
141
- onDebounce: (n) => c(t, { description: n }),
142
- placeholder: "Description"
143
- }
144
- ) }),
145
- /* @__PURE__ */ i("div", { className: "order-last md:order-none flex gap-2", children: [
146
- /* @__PURE__ */ e(
147
- d,
21
+ errorCode: m?.code,
22
+ errorDescription: m?.message,
23
+ showError: !!m,
24
+ children: /* @__PURE__ */ n("div", { children: [
25
+ /* @__PURE__ */ i(b, { className: "mb-2", htmlFor: e.name, children: e.name }),
26
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
27
+ /* @__PURE__ */ i(
28
+ p,
148
29
  {
149
- variant: "outline",
150
- size: "sm",
151
- onClick: () => T(t),
152
- "aria-label": "Delete",
153
- className: "block!",
154
- children: /* @__PURE__ */ e(Re, { size: 16, className: "text-destructive" })
30
+ id: e.name,
31
+ type: "number",
32
+ value: s,
33
+ onChange: (c) => a(Number(c.target.value)),
34
+ disabled: u,
35
+ className: x({ "border-destructive": m })
155
36
  }
156
37
  ),
157
- /* @__PURE__ */ e(
158
- d,
38
+ /* @__PURE__ */ i(
39
+ f,
159
40
  {
160
- variant: "outline",
161
- size: "sm",
162
- onClick: () => z(t),
163
- "aria-label": "Duplicate",
164
- className: "block!",
165
- children: /* @__PURE__ */ e(Ie, { size: 16 })
41
+ type: "button",
42
+ variant: "ghost",
43
+ size: "icon",
44
+ onClick: () => l(),
45
+ children: /* @__PURE__ */ i(v, { className: "size-4" })
166
46
  }
167
- ),
168
- ae(t, r),
169
- R(t, r)
47
+ )
170
48
  ] }),
171
- ie(t, r)
172
- ]
173
- },
174
- t
175
- ), ie = (t, r) => {
176
- if (typeof r != "object" || r.type !== "array")
177
- return null;
178
- const n = r.items, y = !Array.isArray(n) && typeof n == "object" && typeof n.type == "string" ? n?.type : "string";
179
- return /* @__PURE__ */ i("div", { className: "col-span-full flex items-center gap-4 pl-8 mt-2 bg-gray-50 p-2 rounded-md", children: [
180
- /* @__PURE__ */ e(U, { children: "Items of type:" }),
181
- /* @__PURE__ */ i(
182
- $,
49
+ e.description && /* @__PURE__ */ i("div", { className: "mt-2 text-sm text-gray-500", children: e.description })
50
+ ] })
51
+ }
52
+ ) : null;
53
+ }, g = t, M = t, C = t, y = t, N = t, q = {
54
+ id: "number-constraints",
55
+ hooks: {
56
+ registerConstraints() {
57
+ return [
183
58
  {
184
- value: y,
185
- onValueChange: (I) => {
186
- const b = {
187
- ...typeof n == "object" ? n : {},
188
- type: I
189
- };
190
- I === "object" && (b.properties = b.properties ?? {}), c(t, { items: b });
59
+ name: "minimum",
60
+ label: "Minimum",
61
+ appliesTo: ["number", "integer"],
62
+ schema: {
63
+ type: "number",
64
+ title: "Minimum Constraint",
65
+ description: "The minimum value for this constraint",
66
+ examples: [0, 1, 10]
191
67
  },
192
- children: [
193
- /* @__PURE__ */ e(
194
- F,
195
- {
196
- className: "w-[200px]",
197
- "aria-label": "Select items of type",
198
- children: /* @__PURE__ */ e(L, {})
199
- }
200
- ),
201
- /* @__PURE__ */ i(O, { children: [
202
- /* @__PURE__ */ e(l, { value: "string", children: "string" }),
203
- /* @__PURE__ */ e(l, { value: "number", children: "number" }),
204
- /* @__PURE__ */ e(l, { value: "integer", children: "integer" }),
205
- /* @__PURE__ */ e(l, { value: "boolean", children: "boolean" }),
206
- /* @__PURE__ */ e(l, { value: "object", children: "object" }),
207
- /* @__PURE__ */ e(l, { value: "array", children: "array" }),
208
- /* @__PURE__ */ e(l, { value: "null", children: "null" })
209
- ] })
210
- ]
211
- }
212
- ),
213
- R(t, n)
214
- ] });
215
- }, ae = (t, r) => {
216
- if (typeof r != "object") return null;
217
- const n = Y(
218
- typeof r.type == "string" ? r.type : ""
219
- ), y = Array.isArray(r?.enum);
220
- return n.length || y ? /* @__PURE__ */ e(
221
- d,
222
- {
223
- variant: "outline",
224
- size: "sm",
225
- onClick: () => _(t, r),
226
- "aria-label": "Edit constraints",
227
- children: /* @__PURE__ */ e(qe, { size: 16 })
228
- }
229
- ) : null;
230
- }, R = (t, r) => !Array.isArray(r) && typeof r == "object" && r?.type === "object" ? /* @__PURE__ */ i(
231
- d,
232
- {
233
- variant: "outline",
234
- size: "sm",
235
- onClick: () => w(t),
236
- "aria-label": "Navigate",
237
- children: [
238
- /* @__PURE__ */ e("span", { className: "sr-only", children: "Navigate" }),
239
- /* @__PURE__ */ e(Ve, { size: 16 })
240
- ]
241
- }
242
- ) : null, le = () => {
243
- const t = a.navigationComponent;
244
- return t ? /* @__PURE__ */ e(
245
- t,
246
- {
247
- currentPath: o,
248
- onNavigateUp: x,
249
- onNavigateTo: m,
250
- isRootPath: o.length === 0
251
- }
252
- ) : /* @__PURE__ */ i("div", { className: "flex items-center space-x-4", children: [
253
- /* @__PURE__ */ e(
254
- d,
68
+ description: "Constrains a number or integer to a minimum value",
69
+ defaultValue: 0
70
+ },
255
71
  {
256
- variant: "outline",
257
- size: "sm",
258
- onClick: x,
259
- disabled: o.length === 0,
260
- className: D(a.backButtonClassName),
261
- children: "Back"
262
- }
263
- ),
264
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ i(he, { children: [
265
- /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(V, { href: "#", onClick: () => m([]), children: "Root" }) }),
266
- o.map((r, n) => /* @__PURE__ */ i(se, { children: [
267
- /* @__PURE__ */ e(ue, {}),
268
- /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(
269
- V,
270
- {
271
- href: "#",
272
- onClick: () => m(o.slice(0, n + 1)),
273
- children: r
274
- }
275
- ) })
276
- ] }, `path-${n}`))
277
- ] }) })
278
- ] });
279
- }, oe = () => {
280
- const t = a.addPropertyButtonComponent;
281
- return t ? /* @__PURE__ */ e(
282
- t,
283
- {
284
- onClick: () => h(!0)
285
- }
286
- ) : /* @__PURE__ */ i(
287
- d,
288
- {
289
- type: "button",
290
- className: D("self-center", a.addPropertyButtonClassName),
291
- onClick: () => {
292
- h(!0);
72
+ name: "maximum",
73
+ label: "Maximum",
74
+ appliesTo: ["number", "integer"],
75
+ schema: {
76
+ type: "number",
77
+ title: "Maximum Constraint",
78
+ description: "The maximum value for this constraint",
79
+ examples: [10, 100, 1e3]
80
+ },
81
+ description: "Constrains a number or integer to a maximum value",
82
+ defaultValue: 100
293
83
  },
294
- children: [
295
- /* @__PURE__ */ e(Ke, { className: "h-4 w-4 mr-2" }),
296
- "Add Property"
297
- ]
298
- }
299
- );
300
- };
301
- return /* @__PURE__ */ i("div", { children: [
302
- j && /* @__PURE__ */ i(Ee, { variant: "destructive", children: [
303
- /* @__PURE__ */ e(Be, { children: "Schema Error" }),
304
- /* @__PURE__ */ e(we, { children: j })
305
- ] }),
306
- le(),
307
- /* @__PURE__ */ e(
308
- "div",
309
- {
310
- className: D("mt-6 overflow-x-hidden", a.propertiesListClassName),
311
- children: Object.entries(Z.properties ?? {}).map(
312
- ([t, r]) => typeof r == "boolean" ? null : ne(t, r)
313
- )
314
- }
315
- ),
316
- oe(),
317
- /* @__PURE__ */ e(
318
- ze,
319
- {
320
- open: k,
321
- onOpenChange: h,
322
- onSubmit: re
323
- }
324
- ),
325
- A && S && /* @__PURE__ */ e(
326
- ye,
327
- {
328
- propertyKey: A,
329
- property: S,
330
- open: H,
331
- onOpenChange: p,
332
- onSubmit: (t) => {
333
- c(...t), P(void 0), N(void 0), p(!1);
84
+ {
85
+ name: "exclusiveMinimum",
86
+ label: "Exclusive Minimum",
87
+ appliesTo: ["number", "integer"],
88
+ schema: {
89
+ type: "number",
90
+ title: "Exclusive Minimum Constraint",
91
+ description: "The value must be strictly greater than this",
92
+ examples: [0, 1, 10]
93
+ },
94
+ description: "Value must be strictly greater than (not equal to) this value",
95
+ defaultValue: 0
96
+ },
97
+ {
98
+ name: "exclusiveMaximum",
99
+ label: "Exclusive Maximum",
100
+ appliesTo: ["number", "integer"],
101
+ schema: {
102
+ type: "number",
103
+ title: "Exclusive Maximum Constraint",
104
+ description: "The value must be strictly less than this",
105
+ examples: [10, 100, 1e3]
106
+ },
107
+ description: "Value must be strictly less than (not equal to) this value",
108
+ defaultValue: 100
109
+ },
110
+ {
111
+ name: "multipleOf",
112
+ label: "Multiple Of",
113
+ appliesTo: ["number", "integer"],
114
+ schema: {
115
+ type: "number",
116
+ title: "Multiple Of Constraint",
117
+ description: "Value must be a multiple of this number",
118
+ examples: [2, 5, 10],
119
+ exclusiveMinimum: 0
120
+ },
121
+ description: "Value must be divisible by this number (e.g., 5 for multiples of 5)",
122
+ defaultValue: 1
334
123
  }
335
- }
336
- ),
337
- /* @__PURE__ */ e(be, { open: G, onOpenChange: u, children: /* @__PURE__ */ i(Ce, { children: [
338
- /* @__PURE__ */ i(De, { children: [
339
- /* @__PURE__ */ e(Ae, { children: "Are you sure?" }),
340
- /* @__PURE__ */ i(Pe, { children: [
341
- "This action cannot be undone. This will permanently delete the property",
342
- f ? ` "${f}"` : "",
343
- " from the schema."
344
- ] })
345
- ] }),
346
- /* @__PURE__ */ i(Se, { children: [
347
- /* @__PURE__ */ e(Ne, { onClick: te, children: "Cancel" }),
348
- /* @__PURE__ */ e(je, { onClick: ee, children: "Delete" })
349
- ] })
350
- ] }) })
351
- ] });
124
+ ];
125
+ },
126
+ registerRenderers() {
127
+ return {
128
+ minimum: g,
129
+ maximum: M,
130
+ exclusiveMinimum: C,
131
+ exclusiveMaximum: y,
132
+ multipleOf: N
133
+ };
134
+ }
135
+ }
352
136
  };
353
137
  export {
354
- ot as SchemaBuilder
138
+ y as NumberExclusiveMaximumRenderer,
139
+ C as NumberExclusiveMinimumRenderer,
140
+ M as NumberMaximumRenderer,
141
+ g as NumberMinimumRenderer,
142
+ N as NumberMultipleOfRenderer,
143
+ q as default
355
144
  };
356
145
  //# sourceMappingURL=index.es3.js.map