@valbuild/ui 0.45.0 → 0.46.1

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,43 +72884,63 @@ 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}%`
72797
- }
72798
- }
72799
- ),
72893
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-fit", children: [
72894
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
72895
+ "div",
72896
+ {
72897
+ className: "flex flex-col justify-start 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
+ }
72907
+ }
72908
+ ),
72909
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
72910
+ "img",
72911
+ {
72912
+ src: (data == null ? void 0 : data.src) || url,
72913
+ draggable: false,
72914
+ className: "object-contain w-full max-h-[500px]",
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
+ }
72929
+ }
72930
+ )
72931
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Select image below" })
72932
+ },
72933
+ path
72934
+ ),
72935
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border border-t-0 rounded-b-sm bg-background border-input", children: [
72800
72936
  /* @__PURE__ */ jsxRuntimeExports.jsx(
72801
- "img",
72937
+ "label",
72802
72938
  {
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 });
72813
- }
72939
+ htmlFor: `img_input:${path}`,
72940
+ className: "block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",
72941
+ children: "Update"
72814
72942
  }
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" }),
72943
+ ),
72819
72944
  /* @__PURE__ */ jsxRuntimeExports.jsx(
72820
72945
  "input",
72821
72946
  {
@@ -72847,43 +72972,39 @@ function ImageField({
72847
72972
  }
72848
72973
  )
72849
72974
  ] })
72850
- ] }, path),
72851
- onSubmit && data && /* @__PURE__ */ jsxRuntimeExports.jsx(
72975
+ ] }),
72976
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
72852
72977
  SubmitButton,
72853
72978
  {
72854
72979
  loading,
72980
+ 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),
72855
72981
  onClick: () => {
72856
- setLoading(true);
72857
- onSubmit(
72858
- (path2) => Promise.resolve(
72859
- createImagePatch(
72860
- path2,
72861
- data.src,
72862
- data.filename ?? null,
72863
- metadata
72982
+ if (data) {
72983
+ setLoading(true);
72984
+ onSubmit(
72985
+ (path2) => Promise.resolve(
72986
+ createImagePatch(
72987
+ path2,
72988
+ data.src,
72989
+ data.filename ?? null,
72990
+ metadata
72991
+ )
72864
72992
  )
72865
- )
72866
- ).finally(() => {
72867
- setLoading(false);
72868
- setData(null);
72869
- setMetadata(void 0);
72870
- });
72871
- }
72872
- }
72873
- ),
72874
- onSubmit && !data && metadata && /* @__PURE__ */ jsxRuntimeExports.jsx(
72875
- SubmitButton,
72876
- {
72877
- loading,
72878
- 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
- });
72993
+ ).finally(() => {
72994
+ setLoading(false);
72995
+ setData(null);
72996
+ setMetadata(void 0);
72997
+ });
72998
+ } else if (metadata) {
72999
+ setLoading(true);
73000
+ onSubmit(
73001
+ (path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
73002
+ ).finally(() => {
73003
+ setLoading(false);
73004
+ setData(null);
73005
+ setMetadata(void 0);
73006
+ });
73007
+ }
72887
73008
  }
72888
73009
  }
72889
73010
  )
@@ -72964,10 +73085,11 @@ function RichTextField({
72964
73085
  }
72965
73086
  }
72966
73087
  ),
72967
- onSubmit && didChange && /* @__PURE__ */ jsxRuntimeExports.jsx(
73088
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
72968
73089
  SubmitButton,
72969
73090
  {
72970
73091
  loading: loading || !editor,
73092
+ enabled: didChange,
72971
73093
  onClick: () => {
72972
73094
  if (editor) {
72973
73095
  setLoading(true);
@@ -73049,10 +73171,11 @@ function KeyOfField({
73049
73171
  ]
73050
73172
  }
73051
73173
  ),
73052
- onSubmit && defaultValue !== value && /* @__PURE__ */ jsxRuntimeExports.jsx(
73174
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
73053
73175
  SubmitButton,
73054
73176
  {
73055
73177
  loading,
73178
+ enabled: defaultValue !== value,
73056
73179
  onClick: () => {
73057
73180
  setLoading(true);
73058
73181
  onSubmit(async (path) => [
@@ -73106,10 +73229,11 @@ function NumberField({
73106
73229
  type: "number"
73107
73230
  }
73108
73231
  ),
73109
- onSubmit && defaultValue !== value && /* @__PURE__ */ jsxRuntimeExports.jsx(
73232
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
73110
73233
  SubmitButton,
73111
73234
  {
73112
73235
  loading,
73236
+ enabled: defaultValue !== value,
73113
73237
  onClick: () => {
73114
73238
  setLoading(true);
73115
73239
  onSubmit(async (path) => {
@@ -73132,6 +73256,8 @@ function NumberField({
73132
73256
  function StringField({
73133
73257
  disabled,
73134
73258
  defaultValue,
73259
+ path,
73260
+ schema,
73135
73261
  registerPatchCallback,
73136
73262
  onSubmit
73137
73263
  }) {
@@ -73143,18 +73269,28 @@ function StringField({
73143
73269
  const ref = reactExports.useRef(null);
73144
73270
  reactExports.useEffect(() => {
73145
73271
  if (registerPatchCallback) {
73146
- registerPatchCallback(async (path) => {
73272
+ registerPatchCallback(async (path2) => {
73147
73273
  var _a;
73148
73274
  return [
73149
73275
  {
73150
73276
  op: "replace",
73151
- path,
73277
+ path: path2,
73152
73278
  value: ((_a = ref.current) == null ? void 0 : _a.value) || ""
73153
73279
  }
73154
73280
  ];
73155
73281
  });
73156
73282
  }
73157
73283
  }, []);
73284
+ const actualSchema = new StringSchema(
73285
+ schema.options ? {
73286
+ ...schema.options,
73287
+ regexp: schema.options.regexp ? new RegExp(
73288
+ schema.options.regexp.source,
73289
+ schema.options.regexp.flags
73290
+ ) : void 0
73291
+ } : void 0
73292
+ );
73293
+ const validationErrors = actualSchema.validate(path, value);
73158
73294
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
73159
73295
  /* @__PURE__ */ jsxRuntimeExports.jsx(
73160
73296
  Input,
@@ -73165,18 +73301,20 @@ function StringField({
73165
73301
  onChange: (e) => setValue(e.target.value)
73166
73302
  }
73167
73303
  ),
73168
- onSubmit && defaultValue !== value && /* @__PURE__ */ jsxRuntimeExports.jsx(
73304
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
73169
73305
  SubmitButton,
73170
73306
  {
73307
+ validationErrors: validationErrors && validationErrors[path],
73171
73308
  loading,
73309
+ enabled: defaultValue !== value && !validationErrors,
73172
73310
  onClick: () => {
73173
73311
  setLoading(true);
73174
- onSubmit(async (path) => {
73312
+ onSubmit(async (path2) => {
73175
73313
  var _a;
73176
73314
  return [
73177
73315
  {
73178
73316
  op: "replace",
73179
- path,
73317
+ path: path2,
73180
73318
  value: ((_a = ref.current) == null ? void 0 : _a.value) || ""
73181
73319
  }
73182
73320
  ];
@@ -73188,14 +73326,28 @@ function StringField({
73188
73326
  )
73189
73327
  ] });
73190
73328
  }
73191
- function FieldContainer({ children }) {
73192
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative p-4 border rounded border-card", children });
73329
+ function InlineValidationErrors({ errors }) {
73330
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive", children: errors.map((error, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: error.message }, i)) });
73331
+ }
73332
+ function FieldContainer({
73333
+ children,
73334
+ className: className2
73335
+ }) {
73336
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames("relative max-w-lg px-4 pt-4", className2), children });
73193
73337
  }
73194
73338
  function SubmitButton({
73195
73339
  loading,
73340
+ enabled,
73341
+ validationErrors,
73196
73342
  onClick
73197
73343
  }) {
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" }) }) });
73344
+ const { session } = useValOverlayContext();
73345
+ const isProxy = session.status === "success" && session.data.mode === "proxy";
73346
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "sticky bottom-0 m-4 mt-2 ml-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-start w-full gap-2 text-sm", children: [
73347
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: loading || !enabled, onClick, children: loading ? isProxy ? "Staging..." : "Saving..." : isProxy ? "Stage" : "Save" }),
73348
+ " ",
73349
+ validationErrors ? /* @__PURE__ */ jsxRuntimeExports.jsx(InlineValidationErrors, { errors: validationErrors || [] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {})
73350
+ ] }) });
73199
73351
  }
73200
73352
  const Logo = ({ className: className2 }) => {
73201
73353
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -73212,7 +73364,7 @@ const Logo = ({ className: className2 }) => {
73212
73364
  "path",
73213
73365
  {
73214
73366
  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"
73367
+ fill: "hsl(var(--accent))"
73216
73368
  }
73217
73369
  ) }),
73218
73370
  /* @__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 +77054,33 @@ function mapRouteProperties(route) {
76902
77054
  }
76903
77055
  return updates;
76904
77056
  }
77057
+ function Path({ children }) {
77058
+ const segs = children.split("/").filter((seg) => seg);
77059
+ return segs.map((seg, i) => {
77060
+ if (i !== segs.length - 1) {
77061
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
77062
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: seg }),
77063
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-[2px] text-muted", children: "/" })
77064
+ ] }, `${children}/${seg}`);
77065
+ }
77066
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Seg, { children: seg }, children);
77067
+ });
77068
+ }
77069
+ function Seg({ children }) {
77070
+ if (children.includes(".")) {
77071
+ const segs = children.split(".");
77072
+ return segs.map((seg, i) => {
77073
+ if (i !== segs.length - 1) {
77074
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
77075
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: i === 0 ? seg : JSON.parse(seg) }),
77076
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-[2px] text-muted", children: "." })
77077
+ ] }, `${children}.${seg}`);
77078
+ }
77079
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: i === 0 ? seg : JSON.parse(seg) }, children);
77080
+ });
77081
+ }
77082
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children });
77083
+ }
76905
77084
  const ValModulesContext = React.createContext(null);
76906
77085
  const useValModuleFromPath = (sourcePath) => {
76907
77086
  var _a, _b;
@@ -77052,12 +77231,13 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77052
77231
  "div",
77053
77232
  {
77054
77233
  id: "val-fullscreen-container",
77055
- className: "relative font-serif antialiased",
77234
+ className: "relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary",
77056
77235
  "data-mode": theme2,
77057
77236
  children: [
77058
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-x-1/2 z-overlay left-1/2 bottom-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77237
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-y-1/2 right-4 top-1/2 z-overlay", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77059
77238
  ValMenu,
77060
77239
  {
77240
+ direction: "vertical",
77061
77241
  api,
77062
77242
  patches,
77063
77243
  onCommit: () => setPatchResetId((prev) => prev + 1)
@@ -77070,18 +77250,19 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77070
77250
  value: {
77071
77251
  hoverElem: hoverElemRef == null ? void 0 : hoverElemRef.current
77072
77252
  },
77073
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { children: [
77253
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { children: [
77074
77254
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 h-[50px] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Logo$1, {}) }),
77075
77255
  /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "px-4", children: modules ? /* @__PURE__ */ jsxRuntimeExports.jsx(
77076
77256
  PathTree,
77077
77257
  {
77258
+ selectedPath,
77078
77259
  paths: Object.keys(modules),
77079
77260
  setSelectedModuleId: (path) => {
77080
77261
  navigate(path);
77081
77262
  }
77082
77263
  }
77083
77264
  ) : !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: [
77265
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start h-[50px] gap-2 font-serif text-xs", children: [
77085
77266
  /* @__PURE__ */ jsxRuntimeExports.jsx(
77086
77267
  "button",
77087
77268
  {
@@ -77091,10 +77272,18 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77091
77272
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, {})
77092
77273
  }
77093
77274
  ),
77094
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: selectedPath || "/" })
77275
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77276
+ "div",
77277
+ {
77278
+ className: "truncate max-w-[300px]",
77279
+ dir: "rtl",
77280
+ title: selectedPath,
77281
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: selectedPath || "/" })
77282
+ }
77283
+ )
77095
77284
  ] }),
77096
77285
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
77097
- error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-lg text-destructive-foreground", children: [
77286
+ error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-xl p-4 text-lg bg-destructive text-destructive-foreground", children: [
77098
77287
  "ERROR: ",
77099
77288
  error
77100
77289
  ] }),
@@ -77163,7 +77352,7 @@ function AnyVal({
77163
77352
  initOnSubmit,
77164
77353
  top
77165
77354
  }) {
77166
- if (source === null || schema.opt) {
77355
+ if (schema.opt) {
77167
77356
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77168
77357
  ValOptional,
77169
77358
  {
@@ -77176,6 +77365,18 @@ function AnyVal({
77176
77365
  }
77177
77366
  );
77178
77367
  }
77368
+ if (source === null) {
77369
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
77370
+ ValDefaultOf,
77371
+ {
77372
+ source,
77373
+ schema,
77374
+ path,
77375
+ setSelectedPath,
77376
+ initOnSubmit
77377
+ }
77378
+ );
77379
+ }
77179
77380
  if (schema.type === "object") {
77180
77381
  if (typeof source !== "object" || isJsonArray(source)) {
77181
77382
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -77201,15 +77402,18 @@ function AnyVal({
77201
77402
  typeof source
77202
77403
  ] });
77203
77404
  }
77204
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
77205
- ValList,
77206
- {
77207
- source,
77208
- path,
77209
- schema,
77210
- setSelectedPath
77211
- }
77212
- );
77405
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77406
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate max-w-[300px]", title: path, dir: "rtl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) }),
77407
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77408
+ ValList,
77409
+ {
77410
+ source,
77411
+ path,
77412
+ schema,
77413
+ setSelectedPath
77414
+ }
77415
+ )
77416
+ ] });
77213
77417
  } else if (schema.type === "record") {
77214
77418
  if (typeof source !== "object") {
77215
77419
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -77225,18 +77429,39 @@ function AnyVal({
77225
77429
  schema.type
77226
77430
  ] });
77227
77431
  }
77228
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
77229
- ValRecord,
77230
- {
77231
- source,
77232
- path,
77233
- schema,
77234
- setSelectedPath
77235
- }
77236
- );
77432
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77433
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate max-w-[300px]", title: path, dir: "rtl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) }),
77434
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77435
+ ValRecord,
77436
+ {
77437
+ source,
77438
+ path,
77439
+ schema,
77440
+ setSelectedPath
77441
+ }
77442
+ )
77443
+ ] });
77444
+ } else if ((schema == null ? void 0 : schema.type) === "union") {
77445
+ if (schema.key && typeof source === "object" && !isJsonArray(source)) {
77446
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
77447
+ ValTaggedUnion,
77448
+ {
77449
+ field,
77450
+ tag: schema.key,
77451
+ source,
77452
+ path,
77453
+ schema,
77454
+ initOnSubmit,
77455
+ setSelectedPath,
77456
+ top
77457
+ }
77458
+ );
77459
+ }
77460
+ } else if ((schema == null ? void 0 : schema.type) === "literal") {
77461
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
77237
77462
  }
77238
77463
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-2 gap-y-4", children: [
77239
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field || path }),
77464
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate max-w-[300px]", title: path, dir: "rtl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) }),
77240
77465
  /* @__PURE__ */ jsxRuntimeExports.jsx(
77241
77466
  ValFormField,
77242
77467
  {
@@ -77249,6 +77474,110 @@ function AnyVal({
77249
77474
  )
77250
77475
  ] });
77251
77476
  }
77477
+ function ValTaggedUnion({
77478
+ tag,
77479
+ field,
77480
+ path,
77481
+ source,
77482
+ schema,
77483
+ setSelectedPath,
77484
+ initOnSubmit,
77485
+ top
77486
+ }) {
77487
+ const [currentKey, setCurrentKey] = reactExports.useState(null);
77488
+ const [current, setCurrent] = reactExports.useState(null);
77489
+ const keys = schema.items.flatMap((item) => {
77490
+ if (item.type === "object" && item.items[tag]) {
77491
+ const maybeLiteral = item.items[tag];
77492
+ if (maybeLiteral.type === "literal") {
77493
+ return [maybeLiteral.value];
77494
+ }
77495
+ }
77496
+ return [];
77497
+ });
77498
+ reactExports.useEffect(() => {
77499
+ if (!currentKey) {
77500
+ const maybeCurrentKey = source == null ? void 0 : source[tag];
77501
+ if (maybeCurrentKey && typeof maybeCurrentKey === "string") {
77502
+ setCurrentKey(maybeCurrentKey);
77503
+ }
77504
+ } else {
77505
+ const sourceKey = source[tag];
77506
+ const unionSchema = schema.items.find((item) => {
77507
+ if (item.type === "object" && item.items[tag]) {
77508
+ const maybeLiteral = item.items[tag];
77509
+ if (maybeLiteral.type === "literal") {
77510
+ return maybeLiteral.value === currentKey;
77511
+ }
77512
+ return false;
77513
+ }
77514
+ });
77515
+ if (sourceKey && typeof sourceKey === "string" && unionSchema) {
77516
+ setCurrent({ source, schema: unionSchema });
77517
+ } else if (unionSchema) {
77518
+ setCurrent({ schema: unionSchema });
77519
+ } else {
77520
+ console.error(
77521
+ "Could not find source or schema of key",
77522
+ currentKey,
77523
+ source,
77524
+ schema
77525
+ );
77526
+ setCurrent(null);
77527
+ }
77528
+ }
77529
+ }, [currentKey, source, tag, schema, keys]);
77530
+ if (keys.length !== schema.items.length) {
77531
+ console.warn("Not all items have tag:", tag);
77532
+ }
77533
+ const loading = false;
77534
+ const onSubmit = initOnSubmit(path);
77535
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
77536
+ FieldContainer,
77537
+ {
77538
+ className: classNames("flex flex-col gap-y-4", {
77539
+ "border-l-2 border-border pl-6": !top
77540
+ }),
77541
+ children: [
77542
+ field ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate max-w-[300px]", title: path, dir: "rtl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) }),
77543
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
77544
+ Select,
77545
+ {
77546
+ value: currentKey ?? void 0,
77547
+ disabled: loading,
77548
+ onValueChange: (key) => {
77549
+ setCurrentKey(key);
77550
+ },
77551
+ children: [
77552
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select type" }) }),
77553
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: keys.map((tag2) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: tag2.toString(), children: tag2.toString() }, tag2)) })
77554
+ ]
77555
+ }
77556
+ ),
77557
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
77558
+ SubmitButton,
77559
+ {
77560
+ loading,
77561
+ enabled: false,
77562
+ onClick: () => onSubmit(async () => [])
77563
+ }
77564
+ ),
77565
+ current && /* @__PURE__ */ jsxRuntimeExports.jsx(
77566
+ AnyVal,
77567
+ {
77568
+ path,
77569
+ source: current.source ?? null,
77570
+ schema: current.schema,
77571
+ setSelectedPath,
77572
+ initOnSubmit,
77573
+ top
77574
+ }
77575
+ )
77576
+ ]
77577
+ },
77578
+ path
77579
+ );
77580
+ }
77252
77581
  function ValObject({
77253
77582
  path,
77254
77583
  source,
@@ -77260,7 +77589,7 @@ function ValObject({
77260
77589
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77261
77590
  "div",
77262
77591
  {
77263
- className: classNames("flex flex-col gap-y-8", {
77592
+ className: classNames("flex flex-col gap-y-1", {
77264
77593
  "border-l-2 border-border pl-6": !top
77265
77594
  }),
77266
77595
  children: Object.entries(schema.items).map(([key, property]) => {
@@ -77269,7 +77598,7 @@ function ValObject({
77269
77598
  AnyVal,
77270
77599
  {
77271
77600
  path: subPath,
77272
- source: source[key],
77601
+ source: (source == null ? void 0 : source[key]) ?? null,
77273
77602
  schema: property,
77274
77603
  setSelectedPath,
77275
77604
  field: key,
@@ -77353,7 +77682,7 @@ function ValList({
77353
77682
  setSelectedPath
77354
77683
  }) {
77355
77684
  const navigate = useNavigate();
77356
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4 p-2", children: source.map((item, index2) => {
77685
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4 p-2 pb-8", children: source.map((item, index2) => {
77357
77686
  const subPath = createValPathOfItem(path, index2);
77358
77687
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77359
77688
  "button",
@@ -77592,9 +77921,10 @@ function ValOptional({
77592
77921
  field
77593
77922
  }) {
77594
77923
  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: [
77597
- /* @__PURE__ */ jsxRuntimeExports.jsx(
77924
+ const { editMode } = useValOverlayContext();
77925
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-y-2", children: [
77926
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start gap-x-4", children: [
77927
+ editMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(
77598
77928
  Switch,
77599
77929
  {
77600
77930
  checked: enable,
@@ -77603,16 +77933,8 @@ function ValOptional({
77603
77933
  }
77604
77934
  }
77605
77935
  ),
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
- ),
77936
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate max-w-[300px]", title: path, dir: "rtl", children: field ? field : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) })
77937
+ ] }),
77616
77938
  enable && /* @__PURE__ */ jsxRuntimeExports.jsx(
77617
77939
  ValDefaultOf,
77618
77940
  {
@@ -77681,61 +78003,62 @@ function ValDefaultOf({
77681
78003
  function isJsonArray(source) {
77682
78004
  return Array.isArray(source);
77683
78005
  }
77684
- function pathsToTree(paths) {
77685
- const tree = {};
78006
+ function dirPaths(paths) {
78007
+ const res = {};
77686
78008
  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] = {};
78009
+ const allParts = path.split("/").filter((part) => part !== "");
78010
+ if (allParts.length === 1) {
78011
+ if (!res[""]) {
78012
+ res[""] = [];
77692
78013
  }
77693
- current = current[part];
77694
- });
78014
+ res[""].push(allParts[0]);
78015
+ } else if (allParts.length > 1) {
78016
+ const dir = allParts.slice(0, allParts.length - 1).join("/");
78017
+ const file = allParts.slice(-1)[0];
78018
+ if (!res[dir]) {
78019
+ res[dir] = [];
78020
+ }
78021
+ res[dir].push(file);
78022
+ }
77695
78023
  });
77696
- return tree;
78024
+ return res;
77697
78025
  }
77698
78026
  function PathTree({
78027
+ selectedPath,
77699
78028
  paths,
77700
78029
  setSelectedModuleId
77701
78030
  }) {
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
- ] });
78031
+ const tree = dirPaths(paths);
78032
+ const selectedModuleId = selectedPath && Internal.splitModuleIdAndModulePath(selectedPath)[0];
78033
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col w-full py-2 text-xs", children: Object.entries(tree).map(([dir, files]) => {
78034
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 py-2", children: [
78035
+ dir && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold truncate max-w-[300px]", title: dir, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: dir }) }),
78036
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
78037
+ "div",
78038
+ {
78039
+ className: classNames({
78040
+ "flex flex-col py-2 justify-start items-start": !!dir
78041
+ }),
78042
+ children: files.map((file) => {
78043
+ const moduleId = `/${dir}/${file}`;
78044
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
78045
+ "button",
78046
+ {
78047
+ className: classNames("block px-2 py-1 rounded-full", {
78048
+ "bg-accent text-accent-foreground": selectedModuleId === moduleId
78049
+ }),
78050
+ onClick: () => {
78051
+ setSelectedModuleId(moduleId);
78052
+ },
78053
+ children: file
78054
+ },
78055
+ moduleId
78056
+ );
78057
+ })
78058
+ }
78059
+ )
78060
+ ] }, `/${dir}`);
78061
+ }) });
77739
78062
  }
77740
78063
  const theme = {
77741
78064
  tags: {
@@ -79162,7 +79485,7 @@ function fallbackRender({ error, resetErrorBoundary }) {
79162
79485
  /* @__PURE__ */ jsxRuntimeExports.jsx(Logo$1, {}),
79163
79486
  " encountered an error"
79164
79487
  ] }),
79165
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: resetErrorBoundary, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, {}) })
79488
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: resetErrorBoundary, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, {}) })
79166
79489
  ] }),
79167
79490
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-4xl font-normal ", children: "Message:" }),
79168
79491
  /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: error.message }),