@valbuild/ui 0.45.0 → 0.46.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.
@@ -32447,7 +32447,7 @@ var Schema = /* @__PURE__ */ function() {
32447
32447
  return Schema2;
32448
32448
  }();
32449
32449
  var GetSchema = Symbol("GetSchema");
32450
- var Path = Symbol("Path");
32450
+ var Path$1 = Symbol("Path");
32451
32451
  var GetSource = Symbol("GetSource");
32452
32452
  function getSchema(selector) {
32453
32453
  return selector[GetSchema];
@@ -32496,10 +32496,10 @@ function isSerializedVal(val) {
32496
32496
  return _typeof(val) === "object" && val !== null && val !== void 0 && ("val" in val || "valPath" in val);
32497
32497
  }
32498
32498
  function isVal(val) {
32499
- return _typeof(val) === "object" && val !== null && val !== void 0 && Path in val && "val" in val;
32499
+ return _typeof(val) === "object" && val !== null && val !== void 0 && Path$1 in val && "val" in val;
32500
32500
  }
32501
32501
  function getValPath(valOrSelector) {
32502
- return valOrSelector[Path];
32502
+ return valOrSelector[Path$1];
32503
32503
  }
32504
32504
  function hasOwn$1(obj, prop) {
32505
32505
  return Object.prototype.hasOwnProperty.call(obj, prop);
@@ -32511,7 +32511,7 @@ function _andThen(f, source, path) {
32511
32511
  return newSelectorProxy(source, path);
32512
32512
  }
32513
32513
  function isSelector(source) {
32514
- return _typeof(source) === "object" && source !== null && (GetSource in source || Path in source);
32514
+ return _typeof(source) === "object" && source !== null && (GetSource in source || Path$1 in source);
32515
32515
  }
32516
32516
  function newSelectorProxy(source, path, moduleSchema) {
32517
32517
  if (_typeof(source) === "object") {
@@ -32540,7 +32540,7 @@ function newSelectorProxy(source, path, moduleSchema) {
32540
32540
  if (prop === GetSource) {
32541
32541
  return true;
32542
32542
  }
32543
- if (prop === Path) {
32543
+ if (prop === Path$1) {
32544
32544
  return true;
32545
32545
  }
32546
32546
  if (prop === "andThen") {
@@ -32555,7 +32555,7 @@ function newSelectorProxy(source, path, moduleSchema) {
32555
32555
  if (prop === GetSource) {
32556
32556
  return source;
32557
32557
  }
32558
- if (prop === Path) {
32558
+ if (prop === Path$1) {
32559
32559
  return path;
32560
32560
  }
32561
32561
  if (prop === GetSchema) {
@@ -32622,7 +32622,7 @@ function newSelectorProxy(source, path, moduleSchema) {
32622
32622
  andThen: function andThen(f) {
32623
32623
  return _andThen(f, source === void 0 ? null : source, path);
32624
32624
  }
32625
- }, GetSource, source === void 0 ? null : source), Path, path), GetSchema, moduleSchema);
32625
+ }, GetSource, source === void 0 ? null : source), Path$1, path), GetSchema, moduleSchema);
32626
32626
  }
32627
32627
  }
32628
32628
  function createValPathOfItem$1(arrayPath, prop) {
@@ -32632,7 +32632,7 @@ function createValPathOfItem$1(arrayPath, prop) {
32632
32632
  return arrayPath && "".concat(arrayPath, ".").concat(JSON.stringify(prop));
32633
32633
  }
32634
32634
  function unValify(valueOrSelector) {
32635
- if (_typeof(valueOrSelector) === "object" && (GetSource in valueOrSelector || Path in valueOrSelector)) {
32635
+ if (_typeof(valueOrSelector) === "object" && (GetSource in valueOrSelector || Path$1 in valueOrSelector)) {
32636
32636
  var selectorValue = valueOrSelector[GetSource];
32637
32637
  return selectorValue;
32638
32638
  }
@@ -33443,6 +33443,96 @@ function parsePath$1(input) {
33443
33443
  }
33444
33444
  return result2;
33445
33445
  }
33446
+ var StringSchema = /* @__PURE__ */ function(_Schema) {
33447
+ _inherits(StringSchema2, _Schema);
33448
+ var _super = _createSuper(StringSchema2);
33449
+ function StringSchema2(options) {
33450
+ var _this;
33451
+ var opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
33452
+ var isRaw = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
33453
+ _classCallCheck(this, StringSchema2);
33454
+ _this = _super.call(this);
33455
+ _this.options = options;
33456
+ _this.opt = opt;
33457
+ _this.isRaw = isRaw;
33458
+ return _this;
33459
+ }
33460
+ _createClass(StringSchema2, [{
33461
+ key: "validate",
33462
+ value: function validate(path, src) {
33463
+ var _this$options, _this$options2, _this$options3;
33464
+ if (this.opt && (src === null || src === void 0)) {
33465
+ return false;
33466
+ }
33467
+ if (typeof src !== "string") {
33468
+ return _defineProperty$1({}, path, [{
33469
+ message: "Expected 'string', got '".concat(_typeof(src), "'"),
33470
+ value: src
33471
+ }]);
33472
+ }
33473
+ var errors = [];
33474
+ if ((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.maxLength && src.length > this.options.maxLength) {
33475
+ errors.push({
33476
+ message: "Expected string to be at most ".concat(this.options.maxLength, " characters long, got ").concat(src.length),
33477
+ value: src
33478
+ });
33479
+ }
33480
+ if ((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.minLength && src.length < this.options.minLength) {
33481
+ errors.push({
33482
+ message: "Expected string to be at least ".concat(this.options.minLength, " characters long, got ").concat(src.length),
33483
+ value: src
33484
+ });
33485
+ }
33486
+ if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.regexp && !this.options.regexp.test(src)) {
33487
+ errors.push({
33488
+ message: "Expected string to match reg exp: ".concat(this.options.regexp.toString(), ", got '").concat(src, "'"),
33489
+ value: src
33490
+ });
33491
+ }
33492
+ if (errors.length > 0) {
33493
+ return _defineProperty$1({}, path, errors);
33494
+ }
33495
+ return false;
33496
+ }
33497
+ }, {
33498
+ key: "assert",
33499
+ value: function assert(src) {
33500
+ if (this.opt && (src === null || src === void 0)) {
33501
+ return true;
33502
+ }
33503
+ return typeof src === "string";
33504
+ }
33505
+ }, {
33506
+ key: "optional",
33507
+ value: function optional() {
33508
+ return new StringSchema2(this.options, true, this.isRaw);
33509
+ }
33510
+ }, {
33511
+ key: "raw",
33512
+ value: function raw() {
33513
+ return new StringSchema2(this.options, this.opt, true);
33514
+ }
33515
+ }, {
33516
+ key: "serialize",
33517
+ value: function serialize() {
33518
+ var _this$options4, _this$options5, _this$options6;
33519
+ return {
33520
+ type: "string",
33521
+ options: {
33522
+ maxLength: (_this$options4 = this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.maxLength,
33523
+ minLength: (_this$options5 = this.options) === null || _this$options5 === void 0 ? void 0 : _this$options5.minLength,
33524
+ regexp: ((_this$options6 = this.options) === null || _this$options6 === void 0 ? void 0 : _this$options6.regexp) && {
33525
+ source: this.options.regexp.source,
33526
+ flags: this.options.regexp.flags
33527
+ }
33528
+ },
33529
+ opt: this.opt,
33530
+ raw: this.isRaw
33531
+ };
33532
+ }
33533
+ }]);
33534
+ return StringSchema2;
33535
+ }(Schema);
33446
33536
  function getVal(selector) {
33447
33537
  return newValProxy(serializedValOfSelectorSource(selector));
33448
33538
  }
@@ -33465,7 +33555,7 @@ function serializedValOfSelectorSource(selector) {
33465
33555
  var isObject = isObjectOrObjectSelector(child);
33466
33556
  if (isArray) {
33467
33557
  var array = GetSource in child ? child[GetSource] : child;
33468
- var valPath = Path in child ? child[Path] : void 0;
33558
+ var valPath = Path$1 in child ? child[Path$1] : void 0;
33469
33559
  return {
33470
33560
  val: array.map(function(item, i) {
33471
33561
  return rec(isSelector(item) ? item : newSelectorProxy(item, createValPathOfItem$1(valPath, i)));
@@ -33474,7 +33564,7 @@ function serializedValOfSelectorSource(selector) {
33474
33564
  };
33475
33565
  } else if (isObject) {
33476
33566
  var obj = GetSource in child ? child[GetSource] : child;
33477
- var _valPath = Path in child ? child[Path] : void 0;
33567
+ var _valPath = Path$1 in child ? child[Path$1] : void 0;
33478
33568
  return {
33479
33569
  val: obj !== null && Object.fromEntries(Object.entries(obj).map(function(_ref) {
33480
33570
  var _ref2 = _slicedToArray$1(_ref, 2), key = _ref2[0], value = _ref2[1];
@@ -33485,7 +33575,7 @@ function serializedValOfSelectorSource(selector) {
33485
33575
  } else if (isSelector(child)) {
33486
33576
  return {
33487
33577
  val: rec(child[GetSource]),
33488
- valPath: child[Path]
33578
+ valPath: child[Path$1]
33489
33579
  };
33490
33580
  } else {
33491
33581
  return child;
@@ -33527,13 +33617,13 @@ function newValProxy(val) {
33527
33617
  if (prop === "val") {
33528
33618
  return true;
33529
33619
  }
33530
- if (prop === Path) {
33620
+ if (prop === Path$1) {
33531
33621
  return true;
33532
33622
  }
33533
33623
  return hasOwn(target, prop);
33534
33624
  },
33535
33625
  get: function get(target, prop) {
33536
- if (prop === Path) {
33626
+ if (prop === Path$1) {
33537
33627
  return val.valPath;
33538
33628
  }
33539
33629
  if (prop === "val") {
@@ -33554,7 +33644,7 @@ function newValProxy(val) {
33554
33644
  });
33555
33645
  }
33556
33646
  default:
33557
- return _defineProperty$1(_defineProperty$1({}, Path, val.valPath), "val", val.val);
33647
+ return _defineProperty$1(_defineProperty$1({}, Path$1, val.valPath), "val", val.val);
33558
33648
  }
33559
33649
  }
33560
33650
  function hasOwn(obj, prop) {
@@ -38008,14 +38098,21 @@ const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
38008
38098
  function cn(...inputs) {
38009
38099
  return twMerge(clsx(inputs));
38010
38100
  }
38011
- const ScrollArea = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
38101
+ const ScrollArea = reactExports.forwardRef(({ className: className2, children, innerRef, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
38012
38102
  $57acba87d6e25586$export$be92b6f5f03c0fe9,
38013
38103
  {
38014
38104
  ref,
38015
38105
  className: cn("relative overflow-hidden", className2),
38016
38106
  ...props,
38017
38107
  children: [
38018
- /* @__PURE__ */ jsxRuntimeExports.jsx($57acba87d6e25586$export$d5c6c08dc2d3ca7, { className: "h-full w-full rounded-[inherit]", children }),
38108
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38109
+ $57acba87d6e25586$export$d5c6c08dc2d3ca7,
38110
+ {
38111
+ className: "h-full w-full rounded-[inherit]",
38112
+ ref: innerRef,
38113
+ children
38114
+ }
38115
+ ),
38019
38116
  /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollBar, {}),
38020
38117
  /* @__PURE__ */ jsxRuntimeExports.jsx($57acba87d6e25586$export$ac61190d9fc311a9, {})
38021
38118
  ]
@@ -38046,6 +38143,105 @@ const ScrollBar = reactExports.forwardRef(({ className: className2, orientation
38046
38143
  }
38047
38144
  ));
38048
38145
  ScrollBar.displayName = $57acba87d6e25586$export$2fabd85d0eba3c57.displayName;
38146
+ var defaultAttributes = {
38147
+ xmlns: "http://www.w3.org/2000/svg",
38148
+ width: 24,
38149
+ height: 24,
38150
+ viewBox: "0 0 24 24",
38151
+ fill: "none",
38152
+ stroke: "currentColor",
38153
+ strokeWidth: 2,
38154
+ strokeLinecap: "round",
38155
+ strokeLinejoin: "round"
38156
+ };
38157
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
38158
+ const createLucideIcon = (iconName, iconNode) => {
38159
+ const Component = reactExports.forwardRef(
38160
+ ({ color = "currentColor", size: size2 = 24, strokeWidth = 2, absoluteStrokeWidth, children, ...rest }, ref) => reactExports.createElement(
38161
+ "svg",
38162
+ {
38163
+ ref,
38164
+ ...defaultAttributes,
38165
+ width: size2,
38166
+ height: size2,
38167
+ stroke: color,
38168
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size2) : strokeWidth,
38169
+ className: `lucide lucide-${toKebabCase(iconName)}`,
38170
+ ...rest
38171
+ },
38172
+ [
38173
+ ...iconNode.map(([tag, attrs]) => reactExports.createElement(tag, attrs)),
38174
+ ...(Array.isArray(children) ? children : [children]) || []
38175
+ ]
38176
+ )
38177
+ );
38178
+ Component.displayName = `${iconName}`;
38179
+ return Component;
38180
+ };
38181
+ const Check$2 = createLucideIcon("Check", [
38182
+ ["polyline", { points: "20 6 9 17 4 12", key: "10jjfj" }]
38183
+ ]);
38184
+ const ChevronDown = createLucideIcon("ChevronDown", [
38185
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
38186
+ ]);
38187
+ const ChevronLeft = createLucideIcon("ChevronLeft", [
38188
+ ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
38189
+ ]);
38190
+ const LogIn = createLucideIcon("LogIn", [
38191
+ ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }],
38192
+ ["polyline", { points: "10 17 15 12 10 7", key: "1ail0h" }],
38193
+ ["line", { x1: "15", x2: "3", y1: "12", y2: "12", key: "v6grx8" }]
38194
+ ]);
38195
+ const Maximize2 = createLucideIcon("Maximize2", [
38196
+ ["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
38197
+ ["polyline", { points: "9 21 3 21 3 15", key: "1avn1i" }],
38198
+ ["line", { x1: "21", x2: "14", y1: "3", y2: "10", key: "ota7mn" }],
38199
+ ["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
38200
+ ]);
38201
+ const Menu = createLucideIcon("Menu", [
38202
+ ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
38203
+ ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
38204
+ ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
38205
+ ]);
38206
+ const Minimize2 = createLucideIcon("Minimize2", [
38207
+ ["polyline", { points: "4 14 10 14 10 20", key: "11kfnr" }],
38208
+ ["polyline", { points: "20 10 14 10 14 4", key: "rlmsce" }],
38209
+ ["line", { x1: "14", x2: "21", y1: "10", y2: "3", key: "o5lafz" }],
38210
+ ["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
38211
+ ]);
38212
+ const Moon = createLucideIcon("Moon", [
38213
+ ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
38214
+ ]);
38215
+ const Pause = createLucideIcon("Pause", [
38216
+ ["rect", { width: "4", height: "16", x: "6", y: "4", key: "iffhe4" }],
38217
+ ["rect", { width: "4", height: "16", x: "14", y: "4", key: "sjin7j" }]
38218
+ ]);
38219
+ const Play = createLucideIcon("Play", [
38220
+ ["polygon", { points: "5 3 19 12 5 21 5 3", key: "191637" }]
38221
+ ]);
38222
+ const Power = createLucideIcon("Power", [
38223
+ ["path", { d: "M12 2v10", key: "mnfbl" }],
38224
+ ["path", { d: "M18.4 6.6a9 9 0 1 1-12.77.04", key: "obofu9" }]
38225
+ ]);
38226
+ const Send = createLucideIcon("Send", [
38227
+ ["path", { d: "m22 2-7 20-4-9-9-4Z", key: "1q3vgg" }],
38228
+ ["path", { d: "M22 2 11 13", key: "nzbqef" }]
38229
+ ]);
38230
+ const Sun = createLucideIcon("Sun", [
38231
+ ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
38232
+ ["path", { d: "M12 2v2", key: "tus03m" }],
38233
+ ["path", { d: "M12 20v2", key: "1lh1kg" }],
38234
+ ["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
38235
+ ["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
38236
+ ["path", { d: "M2 12h2", key: "1t8f8n" }],
38237
+ ["path", { d: "M20 12h2", key: "1q8mjw" }],
38238
+ ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
38239
+ ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
38240
+ ]);
38241
+ const X$2 = createLucideIcon("X", [
38242
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
38243
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
38244
+ ]);
38049
38245
  function Grid({ children }) {
38050
38246
  const leftColRef = reactExports.useRef(null);
38051
38247
  const rightColRef = reactExports.useRef(null);
@@ -38053,6 +38249,7 @@ function Grid({ children }) {
38053
38249
  const x = reactExports.useRef(0);
38054
38250
  const dragRef = reactExports.useRef(null);
38055
38251
  const originalWidth = reactExports.useRef(0);
38252
+ const [showMobileLeftMenu, setShowMobileLeftMenu] = reactExports.useState(true);
38056
38253
  const handleMouseUp = () => {
38057
38254
  isResizing.current = false;
38058
38255
  dragRef.current = null;
@@ -38093,17 +38290,40 @@ function Grid({ children }) {
38093
38290
  document.removeEventListener("mousemove", handleMouseMove);
38094
38291
  };
38095
38292
  }, []);
38096
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-screen", children: [
38293
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-screen", children: [
38097
38294
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
38098
38295
  "div",
38099
38296
  {
38100
38297
  ref: leftColRef,
38101
- className: "relative border-r border-border",
38102
- style: { width: 300 },
38298
+ className: classNames(
38299
+ "absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",
38300
+ {
38301
+ "w-[300px]": showMobileLeftMenu,
38302
+ "w-0 md:w-[300px]": !showMobileLeftMenu
38303
+ }
38304
+ ),
38103
38305
  children: [
38104
38306
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid.Column, { children: [
38105
- header1,
38106
- /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { style: { height: "calc(100vh - 50px)" }, children: body1 })
38307
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38308
+ MenuButton$1,
38309
+ {
38310
+ showOnMobile: !showMobileLeftMenu,
38311
+ onClick: () => {
38312
+ setShowMobileLeftMenu(!showMobileLeftMenu);
38313
+ },
38314
+ children: header1
38315
+ }
38316
+ ),
38317
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38318
+ ScrollArea,
38319
+ {
38320
+ style: { height: "calc(100vh - 50px)" },
38321
+ onClick: () => {
38322
+ setShowMobileLeftMenu(false);
38323
+ },
38324
+ children: body1
38325
+ }
38326
+ )
38107
38327
  ] }),
38108
38328
  /* @__PURE__ */ jsxRuntimeExports.jsx(
38109
38329
  "div",
@@ -38122,7 +38342,28 @@ function Grid({ children }) {
38122
38342
  "w-full": !header3 && !body3
38123
38343
  }),
38124
38344
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid.Column, { children: [
38125
- header2,
38345
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex w-full border-b border-border", children: [
38346
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38347
+ MenuButton$1,
38348
+ {
38349
+ className: "md:hidden",
38350
+ showOnMobile: showMobileLeftMenu,
38351
+ onClick: () => {
38352
+ setShowMobileLeftMenu(!showMobileLeftMenu);
38353
+ },
38354
+ children: header1
38355
+ }
38356
+ ),
38357
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38358
+ "span",
38359
+ {
38360
+ className: classNames({
38361
+ "pl-[300px] md:pl-0": showMobileLeftMenu
38362
+ }),
38363
+ children: header2
38364
+ }
38365
+ )
38366
+ ] }),
38126
38367
  /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { style: { height: "calc(100vh - 50px)" }, children: body2 })
38127
38368
  ] })
38128
38369
  }
@@ -38150,134 +38391,30 @@ function Grid({ children }) {
38150
38391
  )
38151
38392
  ] });
38152
38393
  }
38153
- Grid.Column = ({ children }) => {
38154
- const [header, body] = reactExports.Children.toArray(children);
38155
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
38156
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center border-b border-border", children: header }),
38157
- body
38158
- ] });
38159
- };
38160
- const ImageIcon = ({ className: className2 }) => {
38161
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
38162
- "svg",
38163
- {
38164
- width: "12",
38165
- height: "12",
38166
- viewBox: "0 0 9 10",
38167
- fill: "none",
38168
- xmlns: "http://www.w3.org/2000/svg",
38169
- className: className2,
38170
- children: [
38171
- /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { clipPath: "url(#clip0_1225_1638)", children: [
38172
- /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "0.5", width: "9", height: "9" }),
38173
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M0 7L8.5 5", stroke: "currentColor" }),
38174
- /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "3", cy: "3.5", r: "1", fill: "currentColor" })
38175
- ] }),
38176
- /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "0.5", y: "1", width: "8", height: "8", stroke: "currentColor" }),
38177
- /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_1225_1638", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "0.5", width: "9", height: "9", fill: "white" }) }) })
38178
- ]
38179
- }
38180
- );
38181
- };
38182
- const ImageIcon$1 = ImageIcon;
38183
- const Section = ({ className: className2 }) => {
38394
+ function MenuButton$1({
38395
+ className: className2,
38396
+ showOnMobile,
38397
+ onClick,
38398
+ children
38399
+ }) {
38184
38400
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
38185
- "svg",
38401
+ "div",
38186
38402
  {
38187
- width: "9",
38188
- height: "10",
38189
- viewBox: "0 0 9 10",
38190
- className: className2,
38191
- fill: "currentColor",
38192
- xmlns: "http://www.w3.org/2000/svg",
38403
+ className: classNames("flex items-center px-4 md:px-4", className2, {
38404
+ "hidden md:flex": showOnMobile
38405
+ }),
38193
38406
  children: [
38194
- /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { clipPath: "url(#clip0_1222_1618)", children: [
38195
- /* @__PURE__ */ jsxRuntimeExports.jsx(
38196
- "path",
38197
- {
38198
- fillRule: "evenodd",
38199
- clipRule: "evenodd",
38200
- d: "M9 1.5H0V0.5H9V1.5Z",
38201
- fill: "currentColor"
38202
- }
38203
- ),
38204
- /* @__PURE__ */ jsxRuntimeExports.jsx(
38205
- "path",
38206
- {
38207
- fillRule: "evenodd",
38208
- clipRule: "evenodd",
38209
- d: "M9 9.5H0V8.5H9V9.5Z",
38210
- fill: "currentColor"
38211
- }
38212
- )
38213
- ] }),
38214
- /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_1222_1618", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38215
- "rect",
38216
- {
38217
- width: "9",
38218
- height: "9",
38219
- fill: "white",
38220
- transform: "translate(0 0.5)"
38221
- }
38222
- ) }) })
38407
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "md:hidden", onClick, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, {}) }),
38408
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center justify-between w-full", children })
38223
38409
  ]
38224
38410
  }
38225
38411
  );
38226
- };
38227
- const Section$1 = Section;
38228
- const TextIcon = ({ className: className2 }) => {
38229
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
38230
- "svg",
38231
- {
38232
- width: "9",
38233
- height: "10",
38234
- viewBox: "0 0 9 10",
38235
- fill: "currentColor",
38236
- xmlns: "http://www.w3.org/2000/svg",
38237
- className: className2,
38238
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("g", { clipPath: "url(#clip0_1229_1625)", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M0.0145513 0.5H8.98545L9 3.18569H8.57074C8.43007 2.2276 8.02749 1.57948 7.36298 1.24133C6.98949 1.05491 6.43169 0.953035 5.68957 0.935694V7.94581C5.68957 8.43569 5.78416 8.76084 5.97332 8.92124C6.16734 9.08165 6.5675 9.16185 7.17381 9.16185V9.5H1.86257V9.16185C2.44462 9.16185 2.83023 9.08165 3.0194 8.92124C3.21342 8.7565 3.31043 8.43136 3.31043 7.94581V0.935694C2.58286 0.953035 2.02506 1.05491 1.63703 1.24133C0.92401 1.58815 0.521423 2.23627 0.429264 3.18569H0L0.0145513 0.5Z" }) })
38239
- }
38240
- );
38241
- };
38242
- const TextIcon$1 = TextIcon;
38243
- function Tree({ children, rootPath }) {
38244
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col w-full py-2 text-xs", children: reactExports.Children.map(children, (child) => {
38245
- return reactExports.cloneElement(child, {
38246
- paths: [rootPath]
38247
- });
38248
- }) });
38249
38412
  }
38250
- Tree.Node = ({
38251
- children,
38252
- paths = [],
38253
- path,
38254
- level = 1,
38255
- type,
38256
- setActivePath
38257
- }) => {
38258
- const paddingLeft = level * 30;
38259
- const logo = type === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(TextIcon$1, {}) : type === "image" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ImageIcon$1, { className: "h-[9px] w-[9px]" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Section$1, {});
38260
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
38261
- /* @__PURE__ */ jsxRuntimeExports.jsx(
38262
- "button",
38263
- {
38264
- className: "flex justify-between w-full group py-2 text-xs font-[400] shrink-0",
38265
- onClick: () => {
38266
- setActivePath && setActivePath(path);
38267
- },
38268
- style: { paddingLeft },
38269
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
38270
- logo,
38271
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: path })
38272
- ] })
38273
- }
38274
- ),
38275
- children && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: reactExports.Children.map(children, (child) => {
38276
- return reactExports.cloneElement(child, {
38277
- level: level + 1,
38278
- paths: [...paths, path]
38279
- });
38280
- }) })
38413
+ Grid.Column = ({ children, className: className2 }) => {
38414
+ const [header, body] = reactExports.Children.toArray(children);
38415
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames("flex flex-col", className2), children: [
38416
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center border-b border-border", children: header }),
38417
+ body
38281
38418
  ] });
38282
38419
  };
38283
38420
  var Lexical_prod = {};
@@ -62198,6 +62335,29 @@ const Bold = ({ className: className2 }) => {
62198
62335
  );
62199
62336
  };
62200
62337
  const Bold$1 = Bold;
62338
+ const ImageIcon = ({ className: className2 }) => {
62339
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
62340
+ "svg",
62341
+ {
62342
+ width: "12",
62343
+ height: "12",
62344
+ viewBox: "0 0 9 10",
62345
+ fill: "none",
62346
+ xmlns: "http://www.w3.org/2000/svg",
62347
+ className: className2,
62348
+ children: [
62349
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { clipPath: "url(#clip0_1225_1638)", children: [
62350
+ /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "0.5", width: "9", height: "9" }),
62351
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M0 7L8.5 5", stroke: "currentColor" }),
62352
+ /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "3", cy: "3.5", r: "1", fill: "currentColor" })
62353
+ ] }),
62354
+ /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { x: "0.5", y: "1", width: "8", height: "8", stroke: "currentColor" }),
62355
+ /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_1225_1638", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "0.5", width: "9", height: "9", fill: "white" }) }) })
62356
+ ]
62357
+ }
62358
+ );
62359
+ };
62360
+ const ImageIcon$1 = ImageIcon;
62201
62361
  const Italic = ({ className: className2 }) => {
62202
62362
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
62203
62363
  "svg",
@@ -63507,7 +63667,7 @@ function _objectWithoutPropertiesLoose$3(source, excluded) {
63507
63667
  }
63508
63668
  return target;
63509
63669
  }
63510
- var Check$1 = reactExports.forwardRef(function(_ref, ref) {
63670
+ var Check = reactExports.forwardRef(function(_ref, ref) {
63511
63671
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size2 = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties$2(_ref, ["color", "size"]);
63512
63672
  return /* @__PURE__ */ React.createElement("svg", _extends$5({
63513
63673
  ref,
@@ -63524,12 +63684,12 @@ var Check$1 = reactExports.forwardRef(function(_ref, ref) {
63524
63684
  points: "20 6 9 17 4 12"
63525
63685
  }));
63526
63686
  });
63527
- Check$1.propTypes = {
63687
+ Check.propTypes = {
63528
63688
  color: PropTypes.string,
63529
63689
  size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
63530
63690
  };
63531
- Check$1.displayName = "Check";
63532
- const Check$2 = Check$1;
63691
+ Check.displayName = "Check";
63692
+ const Check$1 = Check;
63533
63693
  function _extends$4() {
63534
63694
  _extends$4 = Object.assign || function(target) {
63535
63695
  for (var i = 1; i < arguments.length; i++) {
@@ -63647,7 +63807,7 @@ function _objectWithoutPropertiesLoose$1(source, excluded) {
63647
63807
  }
63648
63808
  return target;
63649
63809
  }
63650
- var X$1 = reactExports.forwardRef(function(_ref, ref) {
63810
+ var X = reactExports.forwardRef(function(_ref, ref) {
63651
63811
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size2 = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties(_ref, ["color", "size"]);
63652
63812
  return /* @__PURE__ */ React.createElement("svg", _extends$3({
63653
63813
  ref,
@@ -63672,12 +63832,12 @@ var X$1 = reactExports.forwardRef(function(_ref, ref) {
63672
63832
  y2: "18"
63673
63833
  }));
63674
63834
  });
63675
- X$1.propTypes = {
63835
+ X.propTypes = {
63676
63836
  color: PropTypes.string,
63677
63837
  size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
63678
63838
  };
63679
- X$1.displayName = "X";
63680
- const X$2 = X$1;
63839
+ X.displayName = "X";
63840
+ const X$1 = X;
63681
63841
  const Toolbar = ({
63682
63842
  fontSizes,
63683
63843
  fontsFamilies,
@@ -63852,7 +64012,7 @@ const Toolbar = ({
63852
64012
  }
63853
64013
  });
63854
64014
  }, [activeEditor]);
63855
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sticky top-0 flex flex-col px-4 py-2 border-b bg-background border-highlight", children: [
64015
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sticky top-0 flex flex-col px-4 py-2 border rounded-md rounded-b-none border-input bg-background", children: [
63856
64016
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-row gap-1", children: [
63857
64017
  /* @__PURE__ */ jsxRuntimeExports.jsx(
63858
64018
  Dropdown$1,
@@ -63960,7 +64120,7 @@ const Toolbar = ({
63960
64120
  ev.preventDefault();
63961
64121
  dispatchLinkChange(url || null);
63962
64122
  },
63963
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Check$2, { size: 14 })
64123
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Check$1, { size: 14 })
63964
64124
  }
63965
64125
  ),
63966
64126
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -63971,7 +64131,7 @@ const Toolbar = ({
63971
64131
  ev.preventDefault();
63972
64132
  dispatchLinkChange(null);
63973
64133
  },
63974
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, { size: 14 })
64134
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { size: 14 })
63975
64135
  }
63976
64136
  )
63977
64137
  ] })
@@ -63981,12 +64141,10 @@ const Toolbar$1 = Toolbar;
63981
64141
  function onError(error) {
63982
64142
  console.error(error);
63983
64143
  }
63984
- const TOOLBAR_HEIGHT = 28;
63985
64144
  const RichTextEditor = ({
63986
64145
  richtext,
63987
64146
  onEditor
63988
64147
  }) => {
63989
- const { windowSize } = useValOverlayContext();
63990
64148
  const prePopulatedState = (editor) => {
63991
64149
  editor.setEditorState(
63992
64150
  editor.parseEditorState({
@@ -64029,17 +64187,8 @@ const RichTextEditor = ({
64029
64187
  /* @__PURE__ */ jsxRuntimeExports.jsx(
64030
64188
  LexicalRichTextPlugin_1.RichTextPlugin,
64031
64189
  {
64032
- contentEditable: /* @__PURE__ */ jsxRuntimeExports.jsx(
64033
- "div",
64034
- {
64035
- className: "font-sans border-b text-primary border-highlight",
64036
- style: {
64037
- minHeight: (windowSize == null ? void 0 : windowSize.innerHeight) ? (windowSize == null ? void 0 : windowSize.innerHeight) - TOOLBAR_HEIGHT : void 0
64038
- },
64039
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(LexicalContentEditable, { className: "p-4 outline-none bg-fill" })
64040
- }
64041
- ),
64042
- placeholder: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "", children: "Enter some text..." }),
64190
+ contentEditable: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-3 py-2 text-sm border-b rounded-md rounded-t-none border-x border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LexicalContentEditable, { className: "p-4 outline-none bg-fill" }) }),
64191
+ placeholder: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "" }),
64043
64192
  ErrorBoundary: LexicalErrorBoundary$1
64044
64193
  }
64045
64194
  ),
@@ -64050,119 +64199,40 @@ const RichTextEditor = ({
64050
64199
  /* @__PURE__ */ jsxRuntimeExports.jsx(LexicalHistoryPlugin_1.HistoryPlugin, {})
64051
64200
  ] });
64052
64201
  };
64053
- var defaultAttributes = {
64054
- xmlns: "http://www.w3.org/2000/svg",
64055
- width: 24,
64056
- height: 24,
64057
- viewBox: "0 0 24 24",
64058
- fill: "none",
64059
- stroke: "currentColor",
64060
- strokeWidth: 2,
64061
- strokeLinecap: "round",
64062
- strokeLinejoin: "round"
64063
- };
64064
- const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
64065
- const createLucideIcon = (iconName, iconNode) => {
64066
- const Component = reactExports.forwardRef(
64067
- ({ color = "currentColor", size: size2 = 24, strokeWidth = 2, absoluteStrokeWidth, children, ...rest }, ref) => reactExports.createElement(
64068
- "svg",
64069
- {
64070
- ref,
64071
- ...defaultAttributes,
64072
- width: size2,
64073
- height: size2,
64074
- stroke: color,
64075
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size2) : strokeWidth,
64076
- className: `lucide lucide-${toKebabCase(iconName)}`,
64077
- ...rest
64078
- },
64079
- [
64080
- ...iconNode.map(([tag, attrs]) => reactExports.createElement(tag, attrs)),
64081
- ...(Array.isArray(children) ? children : [children]) || []
64082
- ]
64083
- )
64084
- );
64085
- Component.displayName = `${iconName}`;
64086
- return Component;
64087
- };
64088
- const Check = createLucideIcon("Check", [
64089
- ["polyline", { points: "20 6 9 17 4 12", key: "10jjfj" }]
64090
- ]);
64091
- const ChevronDown = createLucideIcon("ChevronDown", [
64092
- ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
64093
- ]);
64094
- const ChevronLeft = createLucideIcon("ChevronLeft", [
64095
- ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
64096
- ]);
64097
- const LogIn = createLucideIcon("LogIn", [
64098
- ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }],
64099
- ["polyline", { points: "10 17 15 12 10 7", key: "1ail0h" }],
64100
- ["line", { x1: "15", x2: "3", y1: "12", y2: "12", key: "v6grx8" }]
64101
- ]);
64102
- const Maximize = createLucideIcon("Maximize", [
64103
- ["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
64104
- ["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
64105
- ["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
64106
- ["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
64107
- ]);
64108
- const Minimize = createLucideIcon("Minimize", [
64109
- ["path", { d: "M8 3v3a2 2 0 0 1-2 2H3", key: "hohbtr" }],
64110
- ["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3", key: "5jw1f3" }],
64111
- ["path", { d: "M3 16h3a2 2 0 0 1 2 2v3", key: "198tvr" }],
64112
- ["path", { d: "M16 21v-3a2 2 0 0 1 2-2h3", key: "ph8mxp" }]
64113
- ]);
64114
- const Moon = createLucideIcon("Moon", [
64115
- ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
64116
- ]);
64117
- const Pause = createLucideIcon("Pause", [
64118
- ["rect", { width: "4", height: "16", x: "6", y: "4", key: "iffhe4" }],
64119
- ["rect", { width: "4", height: "16", x: "14", y: "4", key: "sjin7j" }]
64120
- ]);
64121
- const Play = createLucideIcon("Play", [
64122
- ["polygon", { points: "5 3 19 12 5 21 5 3", key: "191637" }]
64123
- ]);
64124
- const Power = createLucideIcon("Power", [
64125
- ["path", { d: "M12 2v10", key: "mnfbl" }],
64126
- ["path", { d: "M18.4 6.6a9 9 0 1 1-12.77.04", key: "obofu9" }]
64127
- ]);
64128
- const Send = createLucideIcon("Send", [
64129
- ["path", { d: "m22 2-7 20-4-9-9-4Z", key: "1q3vgg" }],
64130
- ["path", { d: "M22 2 11 13", key: "nzbqef" }]
64131
- ]);
64132
- const Sun = createLucideIcon("Sun", [
64133
- ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
64134
- ["path", { d: "M12 2v2", key: "tus03m" }],
64135
- ["path", { d: "M12 20v2", key: "1lh1kg" }],
64136
- ["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
64137
- ["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
64138
- ["path", { d: "M2 12h2", key: "1t8f8n" }],
64139
- ["path", { d: "M20 12h2", key: "1q8mjw" }],
64140
- ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
64141
- ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
64142
- ]);
64143
- const X = createLucideIcon("X", [
64144
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
64145
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
64146
- ]);
64147
64202
  const className = "p-1 border rounded-full shadow border-accent";
64148
64203
  const PREV_URL_KEY = "valbuild:urlBeforeNavigation";
64149
64204
  function ValMenu({
64150
64205
  api,
64151
64206
  patches,
64207
+ direction,
64152
64208
  onCommit
64153
64209
  }) {
64154
64210
  const { theme: theme2, setTheme, editMode, setEditMode, session } = useValOverlayContext();
64155
64211
  if (session.status === "success" && session.data.mode === "unauthorized") {
64156
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(SingleItemMenu, { href: api.getLoginUrl(window.location.href), children: [
64157
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Login" }),
64158
- /* @__PURE__ */ jsxRuntimeExports.jsx(LogIn, { size: 18 })
64159
- ] });
64212
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
64213
+ SingleItemMenu,
64214
+ {
64215
+ direction,
64216
+ href: api.getLoginUrl(window.location.href),
64217
+ children: [
64218
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Login" }),
64219
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LogIn, { size: 18 })
64220
+ ]
64221
+ }
64222
+ );
64160
64223
  }
64161
64224
  if (session.status === "success" && !session.data.enabled) {
64162
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(SingleItemMenu, { href: api.getEnableUrl(window.location.href), children: [
64163
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Enable" }),
64164
- /* @__PURE__ */ jsxRuntimeExports.jsx(LogIn, { size: 18 })
64165
- ] });
64225
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
64226
+ SingleItemMenu,
64227
+ {
64228
+ direction,
64229
+ href: api.getEnableUrl(window.location.href),
64230
+ children: [
64231
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Enable" }),
64232
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LogIn, { size: 18 })
64233
+ ]
64234
+ }
64235
+ );
64166
64236
  }
64167
64237
  const [patchCount, setPatchCount] = reactExports.useState();
64168
64238
  reactExports.useEffect(() => {
@@ -64172,7 +64242,7 @@ function ValMenu({
64172
64242
  }
64173
64243
  setPatchCount(patchCount2);
64174
64244
  }, [patches]);
64175
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(MenuContainer, { children: [
64245
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(MenuContainer, { direction, children: [
64176
64246
  /* @__PURE__ */ jsxRuntimeExports.jsx(
64177
64247
  MenuButton,
64178
64248
  {
@@ -64208,7 +64278,7 @@ function ValMenu({
64208
64278
  window.location.href = prevUrl || "/";
64209
64279
  }
64210
64280
  },
64211
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[24px] w-[24px] flex justify-center items-center", children: editMode === "full" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Minimize, { size: 15 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Maximize, { size: 15 }) })
64281
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[24px] w-[24px] flex justify-center items-center", children: editMode === "full" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Minimize2, { size: 15 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Maximize2, { size: 15 }) })
64212
64282
  }
64213
64283
  ),
64214
64284
  patchCount !== void 0 && session.status === "success" && session.data.mode === "proxy" && /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -64240,14 +64310,40 @@ function ValMenu({
64240
64310
  }
64241
64311
  function SingleItemMenu({
64242
64312
  href,
64313
+ direction,
64243
64314
  children
64244
64315
  }) {
64245
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row items-center justify-center w-full h-full font-sans border-2 rounded-full gap-x-3 text-primary bg-background border-fill", children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { className, href, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center px-2 gap-x-2", children }) }) });
64316
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
64317
+ "div",
64318
+ {
64319
+ className: classNames(
64320
+ "flex items-start justify-center w-full h-full font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
64321
+ {
64322
+ "flex-col items-start": direction === "vertical",
64323
+ "flex-row items-center": direction === "horizontal"
64324
+ }
64325
+ ),
64326
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { className, href, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center px-2 gap-y-2", children }) })
64327
+ }
64328
+ );
64246
64329
  }
64247
64330
  function MenuContainer({
64248
- children
64331
+ children,
64332
+ direction
64249
64333
  }) {
64250
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-row items-center justify-center w-full h-full px-2 py-2 font-sans border-2 rounded-full gap-x-3 text-primary bg-background border-fill", children });
64334
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
64335
+ "div",
64336
+ {
64337
+ className: classNames(
64338
+ "flex justify-center w-full h-full px-2 py-2 font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
64339
+ {
64340
+ "flex-col items-start": direction === "vertical",
64341
+ "flex-row items-center": direction === "horizontal"
64342
+ }
64343
+ ),
64344
+ children
64345
+ }
64346
+ );
64251
64347
  }
64252
64348
  function MenuButton({
64253
64349
  active,
@@ -64258,7 +64354,7 @@ function MenuButton({
64258
64354
  "button",
64259
64355
  {
64260
64356
  className: classNames(className, {
64261
- "bg-accent drop-shadow-[0px_0px_12px_rgba(56,205,152,0.60)]": active
64357
+ "bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]": active
64262
64358
  }),
64263
64359
  onClick,
64264
64360
  children
@@ -72577,7 +72673,7 @@ const SelectItem = reactExports.forwardRef(({ className: className2, children, .
72577
72673
  ),
72578
72674
  ...props,
72579
72675
  children: [
72580
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx($cc7e05a45900e73f$export$c3468e2714d175fa, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "w-4 h-4" }) }) }),
72676
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx($cc7e05a45900e73f$export$c3468e2714d175fa, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check$2, { className: "w-4 h-4" }) }) }),
72581
72677
  /* @__PURE__ */ jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d6e5bf9c43ea9319, { children })
72582
72678
  ]
72583
72679
  }
@@ -72604,8 +72700,10 @@ function ValFormField({
72604
72700
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
72605
72701
  StringField,
72606
72702
  {
72703
+ path,
72607
72704
  defaultValue: source,
72608
72705
  disabled,
72706
+ schema,
72609
72707
  registerPatchCallback,
72610
72708
  onSubmit
72611
72709
  }
@@ -72680,7 +72778,13 @@ function ValFormField({
72680
72778
  }
72681
72779
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
72682
72780
  "Unsupported schema: ",
72683
- schema.type
72781
+ schema.type,
72782
+ " (source type: ",
72783
+ typeof source,
72784
+ " source:",
72785
+ " ",
72786
+ JSON.stringify(source),
72787
+ ")"
72684
72788
  ] });
72685
72789
  }
72686
72790
  function createImagePatch(path, data, filename, metadata) {
@@ -72739,6 +72843,7 @@ function ImageField({
72739
72843
  onSubmit,
72740
72844
  registerPatchCallback
72741
72845
  }) {
72846
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
72742
72847
  const [data, setData] = reactExports.useState(
72743
72848
  null
72744
72849
  );
@@ -72762,7 +72867,7 @@ function ImageField({
72762
72867
  }
72763
72868
  }, [data, defaultValue]);
72764
72869
  reactExports.useEffect(() => {
72765
- var _a;
72870
+ var _a2;
72766
72871
  if (hotspot) {
72767
72872
  if (metadata) {
72768
72873
  const newMetadata = {
@@ -72779,111 +72884,125 @@ function ImageField({
72779
72884
  console.error("Neither image metadata nor value is set");
72780
72885
  }
72781
72886
  } else {
72782
- if ((_a = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _a.hotspot) {
72887
+ if ((_a2 = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _a2.hotspot) {
72783
72888
  setHotspot(defaultValue.metadata.hotspot);
72784
72889
  }
72785
72890
  }
72786
72891
  }, [hotspot, defaultValue]);
72787
72892
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
72788
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col max-w-4xl p-4 gap-y-4", children: [
72789
- data || url ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
72790
- hotspot && /* @__PURE__ */ jsxRuntimeExports.jsx(
72791
- "div",
72792
- {
72793
- className: "rounded-full h-[20px] w-[20px] bg-accent absolute",
72794
- style: {
72795
- top: `${hotspot.y * 100}%`,
72796
- left: `${hotspot.x * 100}%`
72893
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
72894
+ "div",
72895
+ {
72896
+ className: "flex flex-col max-w-4xl p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",
72897
+ children: data || url ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
72898
+ hotspot && /* @__PURE__ */ jsxRuntimeExports.jsx(
72899
+ "div",
72900
+ {
72901
+ className: "rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",
72902
+ style: {
72903
+ top: `${hotspot.y * 100}%`,
72904
+ left: `${hotspot.x * 100}%`
72905
+ }
72797
72906
  }
72798
- }
72799
- ),
72800
- /* @__PURE__ */ jsxRuntimeExports.jsx(
72801
- "img",
72802
- {
72803
- src: (data == null ? void 0 : data.src) || url,
72804
- className: "w-full cursor-crosshair",
72805
- onClick: (ev) => {
72806
- const x = ev.nativeEvent.offsetX;
72807
- const y = ev.nativeEvent.offsetY;
72808
- const width = ev.currentTarget.clientWidth;
72809
- const height = ev.currentTarget.clientHeight;
72810
- const hotspotX = Math.round(x / width * 100) / 100;
72811
- const hotspotY = Math.round(y / height * 100) / 100;
72812
- setHotspot({ x: hotspotX, y: hotspotY, width: 1, height: 1 });
72907
+ ),
72908
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
72909
+ "img",
72910
+ {
72911
+ src: (data == null ? void 0 : data.src) || url,
72912
+ draggable: false,
72913
+ className: "w-full",
72914
+ style: {
72915
+ cursor: "crosshair"
72916
+ },
72917
+ onClick: (ev) => {
72918
+ const { width, height, left, top } = ev.currentTarget.getBoundingClientRect();
72919
+ const hotspotX = (ev.clientX - 6 - left) / width;
72920
+ const hotspotY = (ev.clientY - 6 - top) / height;
72921
+ setHotspot({
72922
+ x: hotspotX,
72923
+ y: hotspotY,
72924
+ width: 1,
72925
+ height: 1
72926
+ });
72927
+ }
72813
72928
  }
72814
- }
72815
- )
72816
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Select image below" }),
72817
- /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: `img_input:${path}`, className: "", children: [
72818
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 py-2 text-center rounded-md bg-primary text-background", children: "Update image" }),
72819
- /* @__PURE__ */ jsxRuntimeExports.jsx(
72820
- "input",
72821
- {
72822
- hidden: true,
72823
- id: `img_input:${path}`,
72824
- type: "file",
72825
- onChange: (ev) => {
72826
- readImage(ev).then((res) => {
72827
- setData({ src: res.src, filename: res.filename });
72828
- if (res.width && res.height && res.mimeType) {
72829
- setMetadata({
72830
- sha256: res.sha256,
72831
- width: res.width,
72832
- height: res.height,
72833
- mimeType: res.mimeType,
72834
- hotspot
72835
- });
72836
- } else {
72837
- setMetadata(void 0);
72838
- setHotspot(void 0);
72839
- }
72840
- }).catch((err2) => {
72841
- console.error(err2.message);
72842
- setData(null);
72843
- setHotspot(void 0);
72929
+ )
72930
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Select image below" })
72931
+ },
72932
+ path
72933
+ ),
72934
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full p-4 border border-t-0 rounded-b-sm bg-background border-input", children: [
72935
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
72936
+ "label",
72937
+ {
72938
+ htmlFor: `img_input:${path}`,
72939
+ className: "block w-full px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",
72940
+ children: "Update"
72941
+ }
72942
+ ),
72943
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
72944
+ "input",
72945
+ {
72946
+ hidden: true,
72947
+ id: `img_input:${path}`,
72948
+ type: "file",
72949
+ onChange: (ev) => {
72950
+ readImage(ev).then((res) => {
72951
+ setData({ src: res.src, filename: res.filename });
72952
+ if (res.width && res.height && res.mimeType) {
72953
+ setMetadata({
72954
+ sha256: res.sha256,
72955
+ width: res.width,
72956
+ height: res.height,
72957
+ mimeType: res.mimeType,
72958
+ hotspot
72959
+ });
72960
+ } else {
72844
72961
  setMetadata(void 0);
72845
- });
72846
- }
72962
+ setHotspot(void 0);
72963
+ }
72964
+ }).catch((err2) => {
72965
+ console.error(err2.message);
72966
+ setData(null);
72967
+ setHotspot(void 0);
72968
+ setMetadata(void 0);
72969
+ });
72847
72970
  }
72848
- )
72849
- ] })
72850
- ] }, path),
72851
- onSubmit && data && /* @__PURE__ */ jsxRuntimeExports.jsx(
72852
- SubmitButton,
72853
- {
72854
- loading,
72855
- onClick: () => {
72856
- setLoading(true);
72857
- onSubmit(
72858
- (path2) => Promise.resolve(
72859
- createImagePatch(
72860
- path2,
72861
- data.src,
72862
- data.filename ?? null,
72863
- metadata
72864
- )
72865
- )
72866
- ).finally(() => {
72867
- setLoading(false);
72868
- setData(null);
72869
- setMetadata(void 0);
72870
- });
72871
72971
  }
72872
- }
72873
- ),
72874
- onSubmit && !data && metadata && /* @__PURE__ */ jsxRuntimeExports.jsx(
72972
+ )
72973
+ ] }),
72974
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
72875
72975
  SubmitButton,
72876
72976
  {
72877
72977
  loading,
72978
+ enabled: !!data || ((_b = (_a = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _a.hotspot) == null ? void 0 : _b.height) !== (hotspot == null ? void 0 : hotspot.height) || ((_d = (_c = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _c.hotspot) == null ? void 0 : _d.width) !== (hotspot == null ? void 0 : hotspot.width) || ((_f = (_e = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _e.hotspot) == null ? void 0 : _f.x) !== (hotspot == null ? void 0 : hotspot.x) || ((_h = (_g = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _g.hotspot) == null ? void 0 : _h.y) !== (hotspot == null ? void 0 : hotspot.y) || ((_i = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _i.width) !== (metadata == null ? void 0 : metadata.width) || ((_j = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _j.height) !== (metadata == null ? void 0 : metadata.height) || ((_k = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _k.mimeType) !== (metadata == null ? void 0 : metadata.mimeType) || ((_l = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _l.sha256) !== (metadata == null ? void 0 : metadata.sha256),
72878
72979
  onClick: () => {
72879
- setLoading(true);
72880
- onSubmit(
72881
- (path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
72882
- ).finally(() => {
72883
- setLoading(false);
72884
- setData(null);
72885
- setMetadata(void 0);
72886
- });
72980
+ if (data) {
72981
+ setLoading(true);
72982
+ onSubmit(
72983
+ (path2) => Promise.resolve(
72984
+ createImagePatch(
72985
+ path2,
72986
+ data.src,
72987
+ data.filename ?? null,
72988
+ metadata
72989
+ )
72990
+ )
72991
+ ).finally(() => {
72992
+ setLoading(false);
72993
+ setData(null);
72994
+ setMetadata(void 0);
72995
+ });
72996
+ } else if (metadata) {
72997
+ setLoading(true);
72998
+ onSubmit(
72999
+ (path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
73000
+ ).finally(() => {
73001
+ setLoading(false);
73002
+ setData(null);
73003
+ setMetadata(void 0);
73004
+ });
73005
+ }
72887
73006
  }
72888
73007
  }
72889
73008
  )
@@ -72964,10 +73083,11 @@ function RichTextField({
72964
73083
  }
72965
73084
  }
72966
73085
  ),
72967
- onSubmit && didChange && /* @__PURE__ */ jsxRuntimeExports.jsx(
73086
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
72968
73087
  SubmitButton,
72969
73088
  {
72970
73089
  loading: loading || !editor,
73090
+ enabled: didChange,
72971
73091
  onClick: () => {
72972
73092
  if (editor) {
72973
73093
  setLoading(true);
@@ -73049,10 +73169,11 @@ function KeyOfField({
73049
73169
  ]
73050
73170
  }
73051
73171
  ),
73052
- onSubmit && defaultValue !== value && /* @__PURE__ */ jsxRuntimeExports.jsx(
73172
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
73053
73173
  SubmitButton,
73054
73174
  {
73055
73175
  loading,
73176
+ enabled: defaultValue !== value,
73056
73177
  onClick: () => {
73057
73178
  setLoading(true);
73058
73179
  onSubmit(async (path) => [
@@ -73106,10 +73227,11 @@ function NumberField({
73106
73227
  type: "number"
73107
73228
  }
73108
73229
  ),
73109
- onSubmit && defaultValue !== value && /* @__PURE__ */ jsxRuntimeExports.jsx(
73230
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
73110
73231
  SubmitButton,
73111
73232
  {
73112
73233
  loading,
73234
+ enabled: defaultValue !== value,
73113
73235
  onClick: () => {
73114
73236
  setLoading(true);
73115
73237
  onSubmit(async (path) => {
@@ -73132,6 +73254,8 @@ function NumberField({
73132
73254
  function StringField({
73133
73255
  disabled,
73134
73256
  defaultValue,
73257
+ path,
73258
+ schema,
73135
73259
  registerPatchCallback,
73136
73260
  onSubmit
73137
73261
  }) {
@@ -73143,18 +73267,28 @@ function StringField({
73143
73267
  const ref = reactExports.useRef(null);
73144
73268
  reactExports.useEffect(() => {
73145
73269
  if (registerPatchCallback) {
73146
- registerPatchCallback(async (path) => {
73270
+ registerPatchCallback(async (path2) => {
73147
73271
  var _a;
73148
73272
  return [
73149
73273
  {
73150
73274
  op: "replace",
73151
- path,
73275
+ path: path2,
73152
73276
  value: ((_a = ref.current) == null ? void 0 : _a.value) || ""
73153
73277
  }
73154
73278
  ];
73155
73279
  });
73156
73280
  }
73157
73281
  }, []);
73282
+ const actualSchema = new StringSchema(
73283
+ schema.options ? {
73284
+ ...schema.options,
73285
+ regexp: schema.options.regexp ? new RegExp(
73286
+ schema.options.regexp.source,
73287
+ schema.options.regexp.flags
73288
+ ) : void 0
73289
+ } : void 0
73290
+ );
73291
+ const validationErrors = actualSchema.validate(path, value);
73158
73292
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
73159
73293
  /* @__PURE__ */ jsxRuntimeExports.jsx(
73160
73294
  Input,
@@ -73165,18 +73299,20 @@ function StringField({
73165
73299
  onChange: (e) => setValue(e.target.value)
73166
73300
  }
73167
73301
  ),
73168
- onSubmit && defaultValue !== value && /* @__PURE__ */ jsxRuntimeExports.jsx(
73302
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
73169
73303
  SubmitButton,
73170
73304
  {
73305
+ validationErrors: validationErrors && validationErrors[path],
73171
73306
  loading,
73307
+ enabled: defaultValue !== value && !validationErrors,
73172
73308
  onClick: () => {
73173
73309
  setLoading(true);
73174
- onSubmit(async (path) => {
73310
+ onSubmit(async (path2) => {
73175
73311
  var _a;
73176
73312
  return [
73177
73313
  {
73178
73314
  op: "replace",
73179
- path,
73315
+ path: path2,
73180
73316
  value: ((_a = ref.current) == null ? void 0 : _a.value) || ""
73181
73317
  }
73182
73318
  ];
@@ -73188,14 +73324,24 @@ function StringField({
73188
73324
  )
73189
73325
  ] });
73190
73326
  }
73327
+ function InlineValidationErrors({ errors }) {
73328
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-y-1 p-2 rounded-md text-sm text-destructive-foreground bg-destructive", children: errors.map((error, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: error.message }, i)) });
73329
+ }
73191
73330
  function FieldContainer({ children }) {
73192
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative p-4 border rounded border-card", children });
73331
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative p-4", children });
73193
73332
  }
73194
73333
  function SubmitButton({
73195
73334
  loading,
73335
+ enabled,
73336
+ validationErrors,
73196
73337
  onClick
73197
73338
  }) {
73198
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sticky bottom-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end w-full py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: loading, onClick, children: loading ? "Saving..." : "Save" }) }) });
73339
+ const { session } = useValOverlayContext();
73340
+ const isProxy = session.status === "success" && session.data.mode === "proxy";
73341
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sticky bottom-0 m-4 ml-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between w-full gap-2 py-2 text-sm", children: [
73342
+ validationErrors ? /* @__PURE__ */ jsxRuntimeExports.jsx(InlineValidationErrors, { errors: validationErrors || [] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {}),
73343
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: loading || !enabled, onClick, children: loading ? isProxy ? "Staging..." : "Saving..." : isProxy ? "Stage" : "Save" })
73344
+ ] }) });
73199
73345
  }
73200
73346
  const Logo = ({ className: className2 }) => {
73201
73347
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -73212,7 +73358,7 @@ const Logo = ({ className: className2 }) => {
73212
73358
  "path",
73213
73359
  {
73214
73360
  d: "M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",
73215
- fill: "#38CD98"
73361
+ fill: "hsl(var(--accent))"
73216
73362
  }
73217
73363
  ) }),
73218
73364
  /* @__PURE__ */ jsxRuntimeExports.jsx("g", { filter: "url(#filter1_i_21_1677)", children: /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "11.4656", cy: "23.7595", r: "2.18557", fill: "currentColor" }) }),
@@ -76902,6 +77048,33 @@ function mapRouteProperties(route) {
76902
77048
  }
76903
77049
  return updates;
76904
77050
  }
77051
+ function Path({ children }) {
77052
+ const segs = children.split("/").filter((seg) => seg);
77053
+ return segs.map((seg, i) => {
77054
+ if (i !== segs.length - 1) {
77055
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
77056
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: seg }),
77057
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-[2px] text-muted", children: "/" })
77058
+ ] }, `${children}/${seg}`);
77059
+ }
77060
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Seg, { children: seg }, children);
77061
+ });
77062
+ }
77063
+ function Seg({ children }) {
77064
+ if (children.includes(".")) {
77065
+ const segs = children.split(".");
77066
+ return segs.map((seg, i) => {
77067
+ if (i !== segs.length - 1) {
77068
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
77069
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: i === 0 ? seg : JSON.parse(seg) }),
77070
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-[2px] text-muted", children: "." })
77071
+ ] }, `${children}.${seg}`);
77072
+ }
77073
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: i === 0 ? seg : JSON.parse(seg) }, children);
77074
+ });
77075
+ }
77076
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children });
77077
+ }
76905
77078
  const ValModulesContext = React.createContext(null);
76906
77079
  const useValModuleFromPath = (sourcePath) => {
76907
77080
  var _a, _b;
@@ -77052,12 +77225,13 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77052
77225
  "div",
77053
77226
  {
77054
77227
  id: "val-fullscreen-container",
77055
- className: "relative font-serif antialiased",
77228
+ className: "relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary",
77056
77229
  "data-mode": theme2,
77057
77230
  children: [
77058
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-x-1/2 z-overlay left-1/2 bottom-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77231
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-y-1/2 right-4 top-1/2 z-overlay", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77059
77232
  ValMenu,
77060
77233
  {
77234
+ direction: "vertical",
77061
77235
  api,
77062
77236
  patches,
77063
77237
  onCommit: () => setPatchResetId((prev) => prev + 1)
@@ -77070,18 +77244,19 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77070
77244
  value: {
77071
77245
  hoverElem: hoverElemRef == null ? void 0 : hoverElemRef.current
77072
77246
  },
77073
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { children: [
77247
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { children: [
77074
77248
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 h-[50px] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Logo$1, {}) }),
77075
77249
  /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "px-4", children: modules ? /* @__PURE__ */ jsxRuntimeExports.jsx(
77076
77250
  PathTree,
77077
77251
  {
77252
+ selectedPath,
77078
77253
  paths: Object.keys(modules),
77079
77254
  setSelectedModuleId: (path) => {
77080
77255
  navigate(path);
77081
77256
  }
77082
77257
  }
77083
77258
  ) : !error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "py-4", children: "Loading..." }) }),
77084
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start w-full h-[50px] gap-2 font-serif text-xs", children: [
77259
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start h-[50px] gap-2 font-serif text-xs", children: [
77085
77260
  /* @__PURE__ */ jsxRuntimeExports.jsx(
77086
77261
  "button",
77087
77262
  {
@@ -77091,10 +77266,10 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77091
77266
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, {})
77092
77267
  }
77093
77268
  ),
77094
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: selectedPath || "/" })
77269
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: selectedPath || "/" }) })
77095
77270
  ] }),
77096
77271
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
77097
- error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-lg text-destructive-foreground", children: [
77272
+ error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 text-lg bg-destructive text-destructive-foreground max-w-xl", children: [
77098
77273
  "ERROR: ",
77099
77274
  error
77100
77275
  ] }),
@@ -77163,7 +77338,7 @@ function AnyVal({
77163
77338
  initOnSubmit,
77164
77339
  top
77165
77340
  }) {
77166
- if (source === null || schema.opt) {
77341
+ if (schema.opt) {
77167
77342
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77168
77343
  ValOptional,
77169
77344
  {
@@ -77176,6 +77351,18 @@ function AnyVal({
77176
77351
  }
77177
77352
  );
77178
77353
  }
77354
+ if (source === null) {
77355
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
77356
+ ValDefaultOf,
77357
+ {
77358
+ source,
77359
+ schema,
77360
+ path,
77361
+ setSelectedPath,
77362
+ initOnSubmit
77363
+ }
77364
+ );
77365
+ }
77179
77366
  if (schema.type === "object") {
77180
77367
  if (typeof source !== "object" || isJsonArray(source)) {
77181
77368
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -77201,15 +77388,18 @@ function AnyVal({
77201
77388
  typeof source
77202
77389
  ] });
77203
77390
  }
77204
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
77205
- ValList,
77206
- {
77207
- source,
77208
- path,
77209
- schema,
77210
- setSelectedPath
77211
- }
77212
- );
77391
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77392
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }),
77393
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77394
+ ValList,
77395
+ {
77396
+ source,
77397
+ path,
77398
+ schema,
77399
+ setSelectedPath
77400
+ }
77401
+ )
77402
+ ] });
77213
77403
  } else if (schema.type === "record") {
77214
77404
  if (typeof source !== "object") {
77215
77405
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -77225,18 +77415,38 @@ function AnyVal({
77225
77415
  schema.type
77226
77416
  ] });
77227
77417
  }
77228
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
77229
- ValRecord,
77230
- {
77231
- source,
77232
- path,
77233
- schema,
77234
- setSelectedPath
77235
- }
77236
- );
77418
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77419
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }),
77420
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77421
+ ValRecord,
77422
+ {
77423
+ source,
77424
+ path,
77425
+ schema,
77426
+ setSelectedPath
77427
+ }
77428
+ )
77429
+ ] });
77430
+ } else if ((schema == null ? void 0 : schema.type) === "union") {
77431
+ if (schema.key && typeof source === "object" && !isJsonArray(source)) {
77432
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
77433
+ ValTaggedUnion,
77434
+ {
77435
+ tag: schema.key,
77436
+ source,
77437
+ path,
77438
+ schema,
77439
+ initOnSubmit,
77440
+ setSelectedPath,
77441
+ top
77442
+ }
77443
+ );
77444
+ }
77445
+ } else if ((schema == null ? void 0 : schema.type) === "literal") {
77446
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
77237
77447
  }
77238
77448
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-2 gap-y-4", children: [
77239
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field || path }),
77449
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }),
77240
77450
  /* @__PURE__ */ jsxRuntimeExports.jsx(
77241
77451
  ValFormField,
77242
77452
  {
@@ -77249,6 +77459,97 @@ function AnyVal({
77249
77459
  )
77250
77460
  ] });
77251
77461
  }
77462
+ function ValTaggedUnion({
77463
+ tag,
77464
+ path,
77465
+ source,
77466
+ schema,
77467
+ setSelectedPath,
77468
+ initOnSubmit,
77469
+ top
77470
+ }) {
77471
+ const [currentKey, setCurrentKey] = reactExports.useState(null);
77472
+ const [current, setCurrent] = reactExports.useState(null);
77473
+ const keys = schema.items.flatMap((item) => {
77474
+ if (item.type === "object" && item.items[tag]) {
77475
+ const maybeLiteral = item.items[tag];
77476
+ if (maybeLiteral.type === "literal") {
77477
+ return [maybeLiteral.value];
77478
+ }
77479
+ }
77480
+ return [];
77481
+ });
77482
+ reactExports.useEffect(() => {
77483
+ if (!currentKey) {
77484
+ const maybeCurrentKey = source == null ? void 0 : source[tag];
77485
+ if (maybeCurrentKey && typeof maybeCurrentKey === "string") {
77486
+ setCurrentKey(maybeCurrentKey);
77487
+ }
77488
+ } else {
77489
+ const sourceKey = source[tag];
77490
+ const unionSchema = schema.items.find((item) => {
77491
+ if (item.type === "object" && item.items[tag]) {
77492
+ const maybeLiteral = item.items[tag];
77493
+ if (maybeLiteral.type === "literal") {
77494
+ return maybeLiteral.value === currentKey;
77495
+ }
77496
+ return false;
77497
+ }
77498
+ });
77499
+ if (sourceKey && typeof sourceKey === "string" && unionSchema) {
77500
+ setCurrent({ source, schema: unionSchema });
77501
+ } else {
77502
+ console.error(
77503
+ "Could not find source or schema of key",
77504
+ currentKey,
77505
+ source,
77506
+ schema
77507
+ );
77508
+ setCurrent(null);
77509
+ }
77510
+ }
77511
+ }, [currentKey, source, schema, keys]);
77512
+ if (keys.length !== schema.items.length) {
77513
+ console.warn("Not all items have tag:", tag);
77514
+ }
77515
+ const loading = false;
77516
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
77517
+ "div",
77518
+ {
77519
+ className: classNames("flex flex-col gap-y-8", {
77520
+ "border-l-2 border-border pl-6": !top
77521
+ }),
77522
+ children: [
77523
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
77524
+ Select,
77525
+ {
77526
+ defaultValue: currentKey ?? void 0,
77527
+ disabled: loading,
77528
+ onValueChange: (key) => {
77529
+ setCurrentKey(key);
77530
+ },
77531
+ children: [
77532
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select type" }) }),
77533
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: keys.map((tag2) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: tag2.toString(), children: tag2.toString() }, tag2)) })
77534
+ ]
77535
+ }
77536
+ ),
77537
+ current && /* @__PURE__ */ jsxRuntimeExports.jsx(
77538
+ AnyVal,
77539
+ {
77540
+ path,
77541
+ source: current.source,
77542
+ schema: current.schema,
77543
+ setSelectedPath,
77544
+ initOnSubmit,
77545
+ top
77546
+ }
77547
+ )
77548
+ ]
77549
+ },
77550
+ path
77551
+ );
77552
+ }
77252
77553
  function ValObject({
77253
77554
  path,
77254
77555
  source,
@@ -77269,7 +77570,7 @@ function ValObject({
77269
77570
  AnyVal,
77270
77571
  {
77271
77572
  path: subPath,
77272
- source: source[key],
77573
+ source: (source == null ? void 0 : source[key]) ?? null,
77273
77574
  schema: property,
77274
77575
  setSelectedPath,
77275
77576
  field: key,
@@ -77592,8 +77893,8 @@ function ValOptional({
77592
77893
  field
77593
77894
  }) {
77594
77895
  const [enable, setEnable] = reactExports.useState(source !== null);
77595
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-y-6", children: [
77596
- field ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start gap-x-4", children: [
77896
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-y-2", children: [
77897
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start gap-x-4", children: [
77597
77898
  /* @__PURE__ */ jsxRuntimeExports.jsx(
77598
77899
  Switch,
77599
77900
  {
@@ -77603,16 +77904,8 @@ function ValOptional({
77603
77904
  }
77604
77905
  }
77605
77906
  ),
77606
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: field })
77607
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
77608
- Switch,
77609
- {
77610
- checked: enable,
77611
- onClick: () => {
77612
- setEnable((prev) => !prev);
77613
- }
77614
- }
77615
- ),
77907
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: field ? field : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) })
77908
+ ] }),
77616
77909
  enable && /* @__PURE__ */ jsxRuntimeExports.jsx(
77617
77910
  ValDefaultOf,
77618
77911
  {
@@ -77681,61 +77974,62 @@ function ValDefaultOf({
77681
77974
  function isJsonArray(source) {
77682
77975
  return Array.isArray(source);
77683
77976
  }
77684
- function pathsToTree(paths) {
77685
- const tree = {};
77977
+ function dirPaths(paths) {
77978
+ const res = {};
77686
77979
  paths.forEach((path) => {
77687
- const parts = path.split("/").filter((part) => part !== "");
77688
- let current = tree;
77689
- parts.forEach((part) => {
77690
- if (!current[part]) {
77691
- current[part] = {};
77980
+ const allParts = path.split("/").filter((part) => part !== "");
77981
+ if (allParts.length === 1) {
77982
+ if (!res[""]) {
77983
+ res[""] = [];
77692
77984
  }
77693
- current = current[part];
77694
- });
77985
+ res[""].push(allParts[0]);
77986
+ } else if (allParts.length > 1) {
77987
+ const dir = allParts.slice(0, allParts.length - 1).join("/");
77988
+ const file = allParts.slice(-1)[0];
77989
+ if (!res[dir]) {
77990
+ res[dir] = [];
77991
+ }
77992
+ res[dir].push(file);
77993
+ }
77695
77994
  });
77696
- return tree;
77995
+ return res;
77697
77996
  }
77698
77997
  function PathTree({
77998
+ selectedPath,
77699
77999
  paths,
77700
78000
  setSelectedModuleId
77701
78001
  }) {
77702
- const tree = pathsToTree(paths);
77703
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Tree, { children: Object.entries(tree).map(([name, subTree]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77704
- PathNode,
77705
- {
77706
- name,
77707
- tree: subTree,
77708
- moduleId: `/${name}`,
77709
- setSelectedModuleId
77710
- }
77711
- ) }, `/${name}`)) });
77712
- }
77713
- function PathNode({
77714
- name,
77715
- tree,
77716
- moduleId,
77717
- setSelectedModuleId
77718
- }) {
77719
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77720
- /* @__PURE__ */ jsxRuntimeExports.jsx(
77721
- "button",
77722
- {
77723
- onClick: () => {
77724
- setSelectedModuleId(moduleId);
77725
- },
77726
- children: name
77727
- }
77728
- ),
77729
- Object.entries(tree).map(([childName, childTree]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77730
- PathNode,
77731
- {
77732
- name: childName,
77733
- tree: childTree,
77734
- moduleId: `${moduleId}/${childName}`,
77735
- setSelectedModuleId
77736
- }
77737
- ) }, `${moduleId}/${childName}`))
77738
- ] });
78002
+ const tree = dirPaths(paths);
78003
+ const selectedModuleId = selectedPath && Internal.splitModuleIdAndModulePath(selectedPath)[0];
78004
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col w-full py-2 text-xs", children: Object.entries(tree).map(([dir, files]) => {
78005
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 py-2", children: [
78006
+ dir && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: dir }) }),
78007
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
78008
+ "div",
78009
+ {
78010
+ className: classNames({
78011
+ "flex flex-col py-2 justify-start items-start": !!dir
78012
+ }),
78013
+ children: files.map((file) => {
78014
+ const moduleId = `/${dir}/${file}`;
78015
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
78016
+ "button",
78017
+ {
78018
+ className: classNames("block px-2 py-1 rounded-full", {
78019
+ "bg-accent text-accent-foreground": selectedModuleId === moduleId
78020
+ }),
78021
+ onClick: () => {
78022
+ setSelectedModuleId(moduleId);
78023
+ },
78024
+ children: file
78025
+ },
78026
+ moduleId
78027
+ );
78028
+ })
78029
+ }
78030
+ )
78031
+ ] }, `/${dir}`);
78032
+ }) });
77739
78033
  }
77740
78034
  const theme = {
77741
78035
  tags: {
@@ -79162,7 +79456,7 @@ function fallbackRender({ error, resetErrorBoundary }) {
79162
79456
  /* @__PURE__ */ jsxRuntimeExports.jsx(Logo$1, {}),
79163
79457
  " encountered an error"
79164
79458
  ] }),
79165
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: resetErrorBoundary, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, {}) })
79459
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: resetErrorBoundary, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, {}) })
79166
79460
  ] }),
79167
79461
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-4xl font-normal ", children: "Message:" }),
79168
79462
  /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: error.message }),