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