@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.
- package/dist/valbuild-ui.cjs.js +775 -451
- package/dist/valbuild-ui.esm.js +775 -451
- package/package.json +3 -3
- package/server/.tmp/assets/index-0Qeyj20F.css +1 -0
- package/server/.tmp/assets/index-yY5yCkWt.js +201 -0
- package/server/.tmp/index.html +2 -2
- package/server/dist/valbuild-ui-main.cjs.js +764 -441
- package/server/dist/valbuild-ui-main.esm.js +764 -441
- package/server/dist/valbuild-ui-server.cjs.js +1 -1
- package/server/dist/valbuild-ui-server.esm.js +1 -1
- package/server/.tmp/assets/index-C9FCHcaG.js +0 -201
- package/server/.tmp/assets/index-Ol9liWWf.css +0 -1
|
@@ -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(
|
|
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:
|
|
38101
|
-
|
|
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
|
-
|
|
38105
|
-
|
|
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
|
-
|
|
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
|
-
|
|
38153
|
-
|
|
38154
|
-
|
|
38155
|
-
|
|
38156
|
-
|
|
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
|
-
"
|
|
38400
|
+
"div",
|
|
38185
38401
|
{
|
|
38186
|
-
|
|
38187
|
-
|
|
38188
|
-
|
|
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.
|
|
38194
|
-
|
|
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
|
-
|
|
38250
|
-
children
|
|
38251
|
-
|
|
38252
|
-
|
|
38253
|
-
|
|
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
|
|
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
|
|
63686
|
+
Check.propTypes = {
|
|
63527
63687
|
color: PropTypes.string,
|
|
63528
63688
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
63529
63689
|
};
|
|
63530
|
-
Check
|
|
63531
|
-
const Check$
|
|
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
|
|
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
|
|
63834
|
+
X.propTypes = {
|
|
63675
63835
|
color: PropTypes.string,
|
|
63676
63836
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
63677
63837
|
};
|
|
63678
|
-
X
|
|
63679
|
-
const X$
|
|
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
|
|
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$
|
|
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$
|
|
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
|
-
|
|
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(
|
|
64156
|
-
|
|
64157
|
-
|
|
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(
|
|
64162
|
-
|
|
64163
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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-[
|
|
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
|
|
72871
|
+
var _a2;
|
|
72767
72872
|
if (hotspot) {
|
|
72768
72873
|
if (metadata) {
|
|
72769
72874
|
const newMetadata = {
|
|
@@ -72780,43 +72885,63 @@ function ImageField({
|
|
|
72780
72885
|
console.error("Neither image metadata nor value is set");
|
|
72781
72886
|
}
|
|
72782
72887
|
} else {
|
|
72783
|
-
if ((
|
|
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: "
|
|
72790
|
-
|
|
72791
|
-
|
|
72792
|
-
|
|
72793
|
-
|
|
72794
|
-
|
|
72795
|
-
|
|
72796
|
-
|
|
72797
|
-
|
|
72798
|
-
|
|
72799
|
-
|
|
72800
|
-
|
|
72894
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-fit", children: [
|
|
72895
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72896
|
+
"div",
|
|
72897
|
+
{
|
|
72898
|
+
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",
|
|
72899
|
+
children: data || url ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
72900
|
+
hotspot && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72901
|
+
"div",
|
|
72902
|
+
{
|
|
72903
|
+
className: "rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",
|
|
72904
|
+
style: {
|
|
72905
|
+
top: `${hotspot.y * 100}%`,
|
|
72906
|
+
left: `${hotspot.x * 100}%`
|
|
72907
|
+
}
|
|
72908
|
+
}
|
|
72909
|
+
),
|
|
72910
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72911
|
+
"img",
|
|
72912
|
+
{
|
|
72913
|
+
src: (data == null ? void 0 : data.src) || url,
|
|
72914
|
+
draggable: false,
|
|
72915
|
+
className: "object-contain w-full max-h-[500px]",
|
|
72916
|
+
style: {
|
|
72917
|
+
cursor: "crosshair"
|
|
72918
|
+
},
|
|
72919
|
+
onClick: (ev) => {
|
|
72920
|
+
const { width, height, left, top } = ev.currentTarget.getBoundingClientRect();
|
|
72921
|
+
const hotspotX = (ev.clientX - 6 - left) / width;
|
|
72922
|
+
const hotspotY = (ev.clientY - 6 - top) / height;
|
|
72923
|
+
setHotspot({
|
|
72924
|
+
x: hotspotX,
|
|
72925
|
+
y: hotspotY,
|
|
72926
|
+
width: 1,
|
|
72927
|
+
height: 1
|
|
72928
|
+
});
|
|
72929
|
+
}
|
|
72930
|
+
}
|
|
72931
|
+
)
|
|
72932
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Select image below" })
|
|
72933
|
+
},
|
|
72934
|
+
path
|
|
72935
|
+
),
|
|
72936
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border border-t-0 rounded-b-sm bg-background border-input", children: [
|
|
72801
72937
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72802
|
-
"
|
|
72938
|
+
"label",
|
|
72803
72939
|
{
|
|
72804
|
-
|
|
72805
|
-
className: "
|
|
72806
|
-
|
|
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 });
|
|
72814
|
-
}
|
|
72940
|
+
htmlFor: `img_input:${path}`,
|
|
72941
|
+
className: "block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",
|
|
72942
|
+
children: "Update"
|
|
72815
72943
|
}
|
|
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" }),
|
|
72944
|
+
),
|
|
72820
72945
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72821
72946
|
"input",
|
|
72822
72947
|
{
|
|
@@ -72848,43 +72973,39 @@ function ImageField({
|
|
|
72848
72973
|
}
|
|
72849
72974
|
)
|
|
72850
72975
|
] })
|
|
72851
|
-
] }
|
|
72852
|
-
onSubmit &&
|
|
72976
|
+
] }),
|
|
72977
|
+
onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72853
72978
|
SubmitButton,
|
|
72854
72979
|
{
|
|
72855
72980
|
loading,
|
|
72981
|
+
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),
|
|
72856
72982
|
onClick: () => {
|
|
72857
|
-
|
|
72858
|
-
|
|
72859
|
-
(
|
|
72860
|
-
|
|
72861
|
-
|
|
72862
|
-
|
|
72863
|
-
|
|
72864
|
-
|
|
72983
|
+
if (data) {
|
|
72984
|
+
setLoading(true);
|
|
72985
|
+
onSubmit(
|
|
72986
|
+
(path2) => Promise.resolve(
|
|
72987
|
+
createImagePatch(
|
|
72988
|
+
path2,
|
|
72989
|
+
data.src,
|
|
72990
|
+
data.filename ?? null,
|
|
72991
|
+
metadata
|
|
72992
|
+
)
|
|
72865
72993
|
)
|
|
72866
|
-
)
|
|
72867
|
-
|
|
72868
|
-
|
|
72869
|
-
|
|
72870
|
-
|
|
72871
|
-
})
|
|
72872
|
-
|
|
72873
|
-
|
|
72874
|
-
|
|
72875
|
-
|
|
72876
|
-
|
|
72877
|
-
|
|
72878
|
-
|
|
72879
|
-
|
|
72880
|
-
|
|
72881
|
-
onSubmit(
|
|
72882
|
-
(path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
|
|
72883
|
-
).finally(() => {
|
|
72884
|
-
setLoading(false);
|
|
72885
|
-
setData(null);
|
|
72886
|
-
setMetadata(void 0);
|
|
72887
|
-
});
|
|
72994
|
+
).finally(() => {
|
|
72995
|
+
setLoading(false);
|
|
72996
|
+
setData(null);
|
|
72997
|
+
setMetadata(void 0);
|
|
72998
|
+
});
|
|
72999
|
+
} else if (metadata) {
|
|
73000
|
+
setLoading(true);
|
|
73001
|
+
onSubmit(
|
|
73002
|
+
(path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
|
|
73003
|
+
).finally(() => {
|
|
73004
|
+
setLoading(false);
|
|
73005
|
+
setData(null);
|
|
73006
|
+
setMetadata(void 0);
|
|
73007
|
+
});
|
|
73008
|
+
}
|
|
72888
73009
|
}
|
|
72889
73010
|
}
|
|
72890
73011
|
)
|
|
@@ -72965,10 +73086,11 @@ function RichTextField({
|
|
|
72965
73086
|
}
|
|
72966
73087
|
}
|
|
72967
73088
|
),
|
|
72968
|
-
onSubmit &&
|
|
73089
|
+
onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
72969
73090
|
SubmitButton,
|
|
72970
73091
|
{
|
|
72971
73092
|
loading: loading || !editor,
|
|
73093
|
+
enabled: didChange,
|
|
72972
73094
|
onClick: () => {
|
|
72973
73095
|
if (editor) {
|
|
72974
73096
|
setLoading(true);
|
|
@@ -73050,10 +73172,11 @@ function KeyOfField({
|
|
|
73050
73172
|
]
|
|
73051
73173
|
}
|
|
73052
73174
|
),
|
|
73053
|
-
onSubmit &&
|
|
73175
|
+
onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73054
73176
|
SubmitButton,
|
|
73055
73177
|
{
|
|
73056
73178
|
loading,
|
|
73179
|
+
enabled: defaultValue !== value,
|
|
73057
73180
|
onClick: () => {
|
|
73058
73181
|
setLoading(true);
|
|
73059
73182
|
onSubmit(async (path) => [
|
|
@@ -73107,10 +73230,11 @@ function NumberField({
|
|
|
73107
73230
|
type: "number"
|
|
73108
73231
|
}
|
|
73109
73232
|
),
|
|
73110
|
-
onSubmit &&
|
|
73233
|
+
onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73111
73234
|
SubmitButton,
|
|
73112
73235
|
{
|
|
73113
73236
|
loading,
|
|
73237
|
+
enabled: defaultValue !== value,
|
|
73114
73238
|
onClick: () => {
|
|
73115
73239
|
setLoading(true);
|
|
73116
73240
|
onSubmit(async (path) => {
|
|
@@ -73133,6 +73257,8 @@ function NumberField({
|
|
|
73133
73257
|
function StringField({
|
|
73134
73258
|
disabled,
|
|
73135
73259
|
defaultValue,
|
|
73260
|
+
path,
|
|
73261
|
+
schema,
|
|
73136
73262
|
registerPatchCallback,
|
|
73137
73263
|
onSubmit
|
|
73138
73264
|
}) {
|
|
@@ -73144,18 +73270,28 @@ function StringField({
|
|
|
73144
73270
|
const ref = reactExports.useRef(null);
|
|
73145
73271
|
reactExports.useEffect(() => {
|
|
73146
73272
|
if (registerPatchCallback) {
|
|
73147
|
-
registerPatchCallback(async (
|
|
73273
|
+
registerPatchCallback(async (path2) => {
|
|
73148
73274
|
var _a;
|
|
73149
73275
|
return [
|
|
73150
73276
|
{
|
|
73151
73277
|
op: "replace",
|
|
73152
|
-
path,
|
|
73278
|
+
path: path2,
|
|
73153
73279
|
value: ((_a = ref.current) == null ? void 0 : _a.value) || ""
|
|
73154
73280
|
}
|
|
73155
73281
|
];
|
|
73156
73282
|
});
|
|
73157
73283
|
}
|
|
73158
73284
|
}, []);
|
|
73285
|
+
const actualSchema = new StringSchema(
|
|
73286
|
+
schema.options ? {
|
|
73287
|
+
...schema.options,
|
|
73288
|
+
regexp: schema.options.regexp ? new RegExp(
|
|
73289
|
+
schema.options.regexp.source,
|
|
73290
|
+
schema.options.regexp.flags
|
|
73291
|
+
) : void 0
|
|
73292
|
+
} : void 0
|
|
73293
|
+
);
|
|
73294
|
+
const validationErrors = actualSchema.validate(path, value);
|
|
73159
73295
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
|
|
73160
73296
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73161
73297
|
Input,
|
|
@@ -73166,18 +73302,20 @@ function StringField({
|
|
|
73166
73302
|
onChange: (e) => setValue(e.target.value)
|
|
73167
73303
|
}
|
|
73168
73304
|
),
|
|
73169
|
-
onSubmit &&
|
|
73305
|
+
onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73170
73306
|
SubmitButton,
|
|
73171
73307
|
{
|
|
73308
|
+
validationErrors: validationErrors && validationErrors[path],
|
|
73172
73309
|
loading,
|
|
73310
|
+
enabled: defaultValue !== value && !validationErrors,
|
|
73173
73311
|
onClick: () => {
|
|
73174
73312
|
setLoading(true);
|
|
73175
|
-
onSubmit(async (
|
|
73313
|
+
onSubmit(async (path2) => {
|
|
73176
73314
|
var _a;
|
|
73177
73315
|
return [
|
|
73178
73316
|
{
|
|
73179
73317
|
op: "replace",
|
|
73180
|
-
path,
|
|
73318
|
+
path: path2,
|
|
73181
73319
|
value: ((_a = ref.current) == null ? void 0 : _a.value) || ""
|
|
73182
73320
|
}
|
|
73183
73321
|
];
|
|
@@ -73189,14 +73327,28 @@ function StringField({
|
|
|
73189
73327
|
)
|
|
73190
73328
|
] });
|
|
73191
73329
|
}
|
|
73192
|
-
function
|
|
73193
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "
|
|
73330
|
+
function InlineValidationErrors({ errors }) {
|
|
73331
|
+
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)) });
|
|
73332
|
+
}
|
|
73333
|
+
function FieldContainer({
|
|
73334
|
+
children,
|
|
73335
|
+
className: className2
|
|
73336
|
+
}) {
|
|
73337
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames("relative max-w-lg px-4 pt-4", className2), children });
|
|
73194
73338
|
}
|
|
73195
73339
|
function SubmitButton({
|
|
73196
73340
|
loading,
|
|
73341
|
+
enabled,
|
|
73342
|
+
validationErrors,
|
|
73197
73343
|
onClick
|
|
73198
73344
|
}) {
|
|
73199
|
-
|
|
73345
|
+
const { session } = useValOverlayContext();
|
|
73346
|
+
const isProxy = session.status === "success" && session.data.mode === "proxy";
|
|
73347
|
+
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: [
|
|
73348
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { disabled: loading || !enabled, onClick, children: loading ? isProxy ? "Staging..." : "Saving..." : isProxy ? "Stage" : "Save" }),
|
|
73349
|
+
" ",
|
|
73350
|
+
validationErrors ? /* @__PURE__ */ jsxRuntimeExports.jsx(InlineValidationErrors, { errors: validationErrors || [] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {})
|
|
73351
|
+
] }) });
|
|
73200
73352
|
}
|
|
73201
73353
|
const Logo = ({ className: className2 }) => {
|
|
73202
73354
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -73213,7 +73365,7 @@ const Logo = ({ className: className2 }) => {
|
|
|
73213
73365
|
"path",
|
|
73214
73366
|
{
|
|
73215
73367
|
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: "
|
|
73368
|
+
fill: "hsl(var(--accent))"
|
|
73217
73369
|
}
|
|
73218
73370
|
) }),
|
|
73219
73371
|
/* @__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 +77055,33 @@ function mapRouteProperties(route) {
|
|
|
76903
77055
|
}
|
|
76904
77056
|
return updates;
|
|
76905
77057
|
}
|
|
77058
|
+
function Path({ children }) {
|
|
77059
|
+
const segs = children.split("/").filter((seg) => seg);
|
|
77060
|
+
return segs.map((seg, i) => {
|
|
77061
|
+
if (i !== segs.length - 1) {
|
|
77062
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
|
|
77063
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: seg }),
|
|
77064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-[2px] text-muted", children: "/" })
|
|
77065
|
+
] }, `${children}/${seg}`);
|
|
77066
|
+
}
|
|
77067
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Seg, { children: seg }, children);
|
|
77068
|
+
});
|
|
77069
|
+
}
|
|
77070
|
+
function Seg({ children }) {
|
|
77071
|
+
if (children.includes(".")) {
|
|
77072
|
+
const segs = children.split(".");
|
|
77073
|
+
return segs.map((seg, i) => {
|
|
77074
|
+
if (i !== segs.length - 1) {
|
|
77075
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
|
|
77076
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: i === 0 ? seg : JSON.parse(seg) }),
|
|
77077
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-[2px] text-muted", children: "." })
|
|
77078
|
+
] }, `${children}.${seg}`);
|
|
77079
|
+
}
|
|
77080
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: i === 0 ? seg : JSON.parse(seg) }, children);
|
|
77081
|
+
});
|
|
77082
|
+
}
|
|
77083
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children });
|
|
77084
|
+
}
|
|
76906
77085
|
const ValModulesContext = React.createContext(null);
|
|
76907
77086
|
const useValModuleFromPath = (sourcePath) => {
|
|
76908
77087
|
var _a, _b;
|
|
@@ -77053,12 +77232,13 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
|
|
|
77053
77232
|
"div",
|
|
77054
77233
|
{
|
|
77055
77234
|
id: "val-fullscreen-container",
|
|
77056
|
-
className: "relative font-serif antialiased",
|
|
77235
|
+
className: "relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary",
|
|
77057
77236
|
"data-mode": theme2,
|
|
77058
77237
|
children: [
|
|
77059
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-
|
|
77238
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-y-1/2 right-4 top-1/2 z-overlay", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77060
77239
|
ValMenu,
|
|
77061
77240
|
{
|
|
77241
|
+
direction: "vertical",
|
|
77062
77242
|
api,
|
|
77063
77243
|
patches,
|
|
77064
77244
|
onCommit: () => setPatchResetId((prev) => prev + 1)
|
|
@@ -77071,18 +77251,19 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
|
|
|
77071
77251
|
value: {
|
|
77072
77252
|
hoverElem: hoverElemRef == null ? void 0 : hoverElemRef.current
|
|
77073
77253
|
},
|
|
77074
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary
|
|
77254
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { children: [
|
|
77075
77255
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 h-[50px] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Logo$1, {}) }),
|
|
77076
77256
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "px-4", children: modules ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77077
77257
|
PathTree,
|
|
77078
77258
|
{
|
|
77259
|
+
selectedPath,
|
|
77079
77260
|
paths: Object.keys(modules),
|
|
77080
77261
|
setSelectedModuleId: (path) => {
|
|
77081
77262
|
navigate(path);
|
|
77082
77263
|
}
|
|
77083
77264
|
}
|
|
77084
77265
|
) : !error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "py-4", children: "Loading..." }) }),
|
|
77085
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start
|
|
77266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start h-[50px] gap-2 font-serif text-xs", children: [
|
|
77086
77267
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77087
77268
|
"button",
|
|
77088
77269
|
{
|
|
@@ -77092,10 +77273,18 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
|
|
|
77092
77273
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, {})
|
|
77093
77274
|
}
|
|
77094
77275
|
),
|
|
77095
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77276
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77277
|
+
"div",
|
|
77278
|
+
{
|
|
77279
|
+
className: "truncate max-w-[300px]",
|
|
77280
|
+
dir: "rtl",
|
|
77281
|
+
title: selectedPath,
|
|
77282
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: selectedPath || "/" })
|
|
77283
|
+
}
|
|
77284
|
+
)
|
|
77096
77285
|
] }),
|
|
77097
77286
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
|
|
77098
|
-
error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-lg text-destructive-foreground", children: [
|
|
77287
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-xl p-4 text-lg bg-destructive text-destructive-foreground", children: [
|
|
77099
77288
|
"ERROR: ",
|
|
77100
77289
|
error
|
|
77101
77290
|
] }),
|
|
@@ -77164,7 +77353,7 @@ function AnyVal({
|
|
|
77164
77353
|
initOnSubmit,
|
|
77165
77354
|
top
|
|
77166
77355
|
}) {
|
|
77167
|
-
if (
|
|
77356
|
+
if (schema.opt) {
|
|
77168
77357
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77169
77358
|
ValOptional,
|
|
77170
77359
|
{
|
|
@@ -77177,6 +77366,18 @@ function AnyVal({
|
|
|
77177
77366
|
}
|
|
77178
77367
|
);
|
|
77179
77368
|
}
|
|
77369
|
+
if (source === null) {
|
|
77370
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77371
|
+
ValDefaultOf,
|
|
77372
|
+
{
|
|
77373
|
+
source,
|
|
77374
|
+
schema,
|
|
77375
|
+
path,
|
|
77376
|
+
setSelectedPath,
|
|
77377
|
+
initOnSubmit
|
|
77378
|
+
}
|
|
77379
|
+
);
|
|
77380
|
+
}
|
|
77180
77381
|
if (schema.type === "object") {
|
|
77181
77382
|
if (typeof source !== "object" || isJsonArray(source)) {
|
|
77182
77383
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -77202,15 +77403,18 @@ function AnyVal({
|
|
|
77202
77403
|
typeof source
|
|
77203
77404
|
] });
|
|
77204
77405
|
}
|
|
77205
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
77206
|
-
|
|
77207
|
-
|
|
77208
|
-
|
|
77209
|
-
|
|
77210
|
-
|
|
77211
|
-
|
|
77212
|
-
|
|
77213
|
-
|
|
77406
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
77407
|
+
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 }) }),
|
|
77408
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77409
|
+
ValList,
|
|
77410
|
+
{
|
|
77411
|
+
source,
|
|
77412
|
+
path,
|
|
77413
|
+
schema,
|
|
77414
|
+
setSelectedPath
|
|
77415
|
+
}
|
|
77416
|
+
)
|
|
77417
|
+
] });
|
|
77214
77418
|
} else if (schema.type === "record") {
|
|
77215
77419
|
if (typeof source !== "object") {
|
|
77216
77420
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -77226,18 +77430,39 @@ function AnyVal({
|
|
|
77226
77430
|
schema.type
|
|
77227
77431
|
] });
|
|
77228
77432
|
}
|
|
77229
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
77230
|
-
|
|
77231
|
-
|
|
77232
|
-
|
|
77233
|
-
|
|
77234
|
-
|
|
77235
|
-
|
|
77236
|
-
|
|
77237
|
-
|
|
77433
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
77434
|
+
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 }) }),
|
|
77435
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77436
|
+
ValRecord,
|
|
77437
|
+
{
|
|
77438
|
+
source,
|
|
77439
|
+
path,
|
|
77440
|
+
schema,
|
|
77441
|
+
setSelectedPath
|
|
77442
|
+
}
|
|
77443
|
+
)
|
|
77444
|
+
] });
|
|
77445
|
+
} else if ((schema == null ? void 0 : schema.type) === "union") {
|
|
77446
|
+
if (schema.key && typeof source === "object" && !isJsonArray(source)) {
|
|
77447
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77448
|
+
ValTaggedUnion,
|
|
77449
|
+
{
|
|
77450
|
+
field,
|
|
77451
|
+
tag: schema.key,
|
|
77452
|
+
source,
|
|
77453
|
+
path,
|
|
77454
|
+
schema,
|
|
77455
|
+
initOnSubmit,
|
|
77456
|
+
setSelectedPath,
|
|
77457
|
+
top
|
|
77458
|
+
}
|
|
77459
|
+
);
|
|
77460
|
+
}
|
|
77461
|
+
} else if ((schema == null ? void 0 : schema.type) === "literal") {
|
|
77462
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
77238
77463
|
}
|
|
77239
77464
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-2 gap-y-4", children: [
|
|
77240
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: field
|
|
77465
|
+
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 }) }),
|
|
77241
77466
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77242
77467
|
ValFormField,
|
|
77243
77468
|
{
|
|
@@ -77250,6 +77475,110 @@ function AnyVal({
|
|
|
77250
77475
|
)
|
|
77251
77476
|
] });
|
|
77252
77477
|
}
|
|
77478
|
+
function ValTaggedUnion({
|
|
77479
|
+
tag,
|
|
77480
|
+
field,
|
|
77481
|
+
path,
|
|
77482
|
+
source,
|
|
77483
|
+
schema,
|
|
77484
|
+
setSelectedPath,
|
|
77485
|
+
initOnSubmit,
|
|
77486
|
+
top
|
|
77487
|
+
}) {
|
|
77488
|
+
const [currentKey, setCurrentKey] = reactExports.useState(null);
|
|
77489
|
+
const [current, setCurrent] = reactExports.useState(null);
|
|
77490
|
+
const keys = schema.items.flatMap((item) => {
|
|
77491
|
+
if (item.type === "object" && item.items[tag]) {
|
|
77492
|
+
const maybeLiteral = item.items[tag];
|
|
77493
|
+
if (maybeLiteral.type === "literal") {
|
|
77494
|
+
return [maybeLiteral.value];
|
|
77495
|
+
}
|
|
77496
|
+
}
|
|
77497
|
+
return [];
|
|
77498
|
+
});
|
|
77499
|
+
reactExports.useEffect(() => {
|
|
77500
|
+
if (!currentKey) {
|
|
77501
|
+
const maybeCurrentKey = source == null ? void 0 : source[tag];
|
|
77502
|
+
if (maybeCurrentKey && typeof maybeCurrentKey === "string") {
|
|
77503
|
+
setCurrentKey(maybeCurrentKey);
|
|
77504
|
+
}
|
|
77505
|
+
} else {
|
|
77506
|
+
const sourceKey = source[tag];
|
|
77507
|
+
const unionSchema = schema.items.find((item) => {
|
|
77508
|
+
if (item.type === "object" && item.items[tag]) {
|
|
77509
|
+
const maybeLiteral = item.items[tag];
|
|
77510
|
+
if (maybeLiteral.type === "literal") {
|
|
77511
|
+
return maybeLiteral.value === currentKey;
|
|
77512
|
+
}
|
|
77513
|
+
return false;
|
|
77514
|
+
}
|
|
77515
|
+
});
|
|
77516
|
+
if (sourceKey && typeof sourceKey === "string" && unionSchema) {
|
|
77517
|
+
setCurrent({ source, schema: unionSchema });
|
|
77518
|
+
} else if (unionSchema) {
|
|
77519
|
+
setCurrent({ schema: unionSchema });
|
|
77520
|
+
} else {
|
|
77521
|
+
console.error(
|
|
77522
|
+
"Could not find source or schema of key",
|
|
77523
|
+
currentKey,
|
|
77524
|
+
source,
|
|
77525
|
+
schema
|
|
77526
|
+
);
|
|
77527
|
+
setCurrent(null);
|
|
77528
|
+
}
|
|
77529
|
+
}
|
|
77530
|
+
}, [currentKey, source, tag, schema, keys]);
|
|
77531
|
+
if (keys.length !== schema.items.length) {
|
|
77532
|
+
console.warn("Not all items have tag:", tag);
|
|
77533
|
+
}
|
|
77534
|
+
const loading = false;
|
|
77535
|
+
const onSubmit = initOnSubmit(path);
|
|
77536
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
77537
|
+
FieldContainer,
|
|
77538
|
+
{
|
|
77539
|
+
className: classNames("flex flex-col gap-y-4", {
|
|
77540
|
+
"border-l-2 border-border pl-6": !top
|
|
77541
|
+
}),
|
|
77542
|
+
children: [
|
|
77543
|
+
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 }) }),
|
|
77544
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
77545
|
+
Select,
|
|
77546
|
+
{
|
|
77547
|
+
value: currentKey ?? void 0,
|
|
77548
|
+
disabled: loading,
|
|
77549
|
+
onValueChange: (key) => {
|
|
77550
|
+
setCurrentKey(key);
|
|
77551
|
+
},
|
|
77552
|
+
children: [
|
|
77553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select type" }) }),
|
|
77554
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: keys.map((tag2) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: tag2.toString(), children: tag2.toString() }, tag2)) })
|
|
77555
|
+
]
|
|
77556
|
+
}
|
|
77557
|
+
),
|
|
77558
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77559
|
+
SubmitButton,
|
|
77560
|
+
{
|
|
77561
|
+
loading,
|
|
77562
|
+
enabled: false,
|
|
77563
|
+
onClick: () => onSubmit(async () => [])
|
|
77564
|
+
}
|
|
77565
|
+
),
|
|
77566
|
+
current && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77567
|
+
AnyVal,
|
|
77568
|
+
{
|
|
77569
|
+
path,
|
|
77570
|
+
source: current.source ?? null,
|
|
77571
|
+
schema: current.schema,
|
|
77572
|
+
setSelectedPath,
|
|
77573
|
+
initOnSubmit,
|
|
77574
|
+
top
|
|
77575
|
+
}
|
|
77576
|
+
)
|
|
77577
|
+
]
|
|
77578
|
+
},
|
|
77579
|
+
path
|
|
77580
|
+
);
|
|
77581
|
+
}
|
|
77253
77582
|
function ValObject({
|
|
77254
77583
|
path,
|
|
77255
77584
|
source,
|
|
@@ -77261,7 +77590,7 @@ function ValObject({
|
|
|
77261
77590
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77262
77591
|
"div",
|
|
77263
77592
|
{
|
|
77264
|
-
className: classNames("flex flex-col gap-y-
|
|
77593
|
+
className: classNames("flex flex-col gap-y-1", {
|
|
77265
77594
|
"border-l-2 border-border pl-6": !top
|
|
77266
77595
|
}),
|
|
77267
77596
|
children: Object.entries(schema.items).map(([key, property]) => {
|
|
@@ -77270,7 +77599,7 @@ function ValObject({
|
|
|
77270
77599
|
AnyVal,
|
|
77271
77600
|
{
|
|
77272
77601
|
path: subPath,
|
|
77273
|
-
source: source[key],
|
|
77602
|
+
source: (source == null ? void 0 : source[key]) ?? null,
|
|
77274
77603
|
schema: property,
|
|
77275
77604
|
setSelectedPath,
|
|
77276
77605
|
field: key,
|
|
@@ -77354,7 +77683,7 @@ function ValList({
|
|
|
77354
77683
|
setSelectedPath
|
|
77355
77684
|
}) {
|
|
77356
77685
|
const navigate = useNavigate();
|
|
77357
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4 p-2", children: source.map((item, index2) => {
|
|
77686
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4 p-2 pb-8", children: source.map((item, index2) => {
|
|
77358
77687
|
const subPath = createValPathOfItem(path, index2);
|
|
77359
77688
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77360
77689
|
"button",
|
|
@@ -77593,9 +77922,10 @@ function ValOptional({
|
|
|
77593
77922
|
field
|
|
77594
77923
|
}) {
|
|
77595
77924
|
const [enable, setEnable] = reactExports.useState(source !== null);
|
|
77596
|
-
|
|
77597
|
-
|
|
77598
|
-
|
|
77925
|
+
const { editMode } = useValOverlayContext();
|
|
77926
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-y-2", children: [
|
|
77927
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-start gap-x-4", children: [
|
|
77928
|
+
editMode === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77599
77929
|
Switch,
|
|
77600
77930
|
{
|
|
77601
77931
|
checked: enable,
|
|
@@ -77604,16 +77934,8 @@ function ValOptional({
|
|
|
77604
77934
|
}
|
|
77605
77935
|
}
|
|
77606
77936
|
),
|
|
77607
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
77608
|
-
] })
|
|
77609
|
-
Switch,
|
|
77610
|
-
{
|
|
77611
|
-
checked: enable,
|
|
77612
|
-
onClick: () => {
|
|
77613
|
-
setEnable((prev) => !prev);
|
|
77614
|
-
}
|
|
77615
|
-
}
|
|
77616
|
-
),
|
|
77937
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate max-w-[300px]", title: path, dir: "rtl", children: field ? field : /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: path }) })
|
|
77938
|
+
] }),
|
|
77617
77939
|
enable && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
77618
77940
|
ValDefaultOf,
|
|
77619
77941
|
{
|
|
@@ -77682,61 +78004,62 @@ function ValDefaultOf({
|
|
|
77682
78004
|
function isJsonArray(source) {
|
|
77683
78005
|
return Array.isArray(source);
|
|
77684
78006
|
}
|
|
77685
|
-
function
|
|
77686
|
-
const
|
|
78007
|
+
function dirPaths(paths) {
|
|
78008
|
+
const res = {};
|
|
77687
78009
|
paths.forEach((path) => {
|
|
77688
|
-
const
|
|
77689
|
-
|
|
77690
|
-
|
|
77691
|
-
|
|
77692
|
-
current[part] = {};
|
|
78010
|
+
const allParts = path.split("/").filter((part) => part !== "");
|
|
78011
|
+
if (allParts.length === 1) {
|
|
78012
|
+
if (!res[""]) {
|
|
78013
|
+
res[""] = [];
|
|
77693
78014
|
}
|
|
77694
|
-
|
|
77695
|
-
})
|
|
78015
|
+
res[""].push(allParts[0]);
|
|
78016
|
+
} else if (allParts.length > 1) {
|
|
78017
|
+
const dir = allParts.slice(0, allParts.length - 1).join("/");
|
|
78018
|
+
const file = allParts.slice(-1)[0];
|
|
78019
|
+
if (!res[dir]) {
|
|
78020
|
+
res[dir] = [];
|
|
78021
|
+
}
|
|
78022
|
+
res[dir].push(file);
|
|
78023
|
+
}
|
|
77696
78024
|
});
|
|
77697
|
-
return
|
|
78025
|
+
return res;
|
|
77698
78026
|
}
|
|
77699
78027
|
function PathTree({
|
|
78028
|
+
selectedPath,
|
|
77700
78029
|
paths,
|
|
77701
78030
|
setSelectedModuleId
|
|
77702
78031
|
}) {
|
|
77703
|
-
const tree =
|
|
77704
|
-
|
|
77705
|
-
|
|
77706
|
-
{
|
|
77707
|
-
|
|
77708
|
-
|
|
77709
|
-
|
|
77710
|
-
|
|
77711
|
-
|
|
77712
|
-
|
|
77713
|
-
}
|
|
77714
|
-
|
|
77715
|
-
|
|
77716
|
-
|
|
77717
|
-
|
|
77718
|
-
|
|
77719
|
-
|
|
77720
|
-
|
|
77721
|
-
|
|
77722
|
-
|
|
77723
|
-
|
|
77724
|
-
|
|
77725
|
-
|
|
77726
|
-
|
|
77727
|
-
|
|
77728
|
-
|
|
77729
|
-
|
|
77730
|
-
|
|
77731
|
-
|
|
77732
|
-
|
|
77733
|
-
|
|
77734
|
-
tree: childTree,
|
|
77735
|
-
moduleId: `${moduleId}/${childName}`,
|
|
77736
|
-
setSelectedModuleId
|
|
77737
|
-
}
|
|
77738
|
-
) }, `${moduleId}/${childName}`))
|
|
77739
|
-
] });
|
|
78032
|
+
const tree = dirPaths(paths);
|
|
78033
|
+
const selectedModuleId = selectedPath && Internal.splitModuleIdAndModulePath(selectedPath)[0];
|
|
78034
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col w-full py-2 text-xs", children: Object.entries(tree).map(([dir, files]) => {
|
|
78035
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 py-2", children: [
|
|
78036
|
+
dir && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold truncate max-w-[300px]", title: dir, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Path, { children: dir }) }),
|
|
78037
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
78038
|
+
"div",
|
|
78039
|
+
{
|
|
78040
|
+
className: classNames({
|
|
78041
|
+
"flex flex-col py-2 justify-start items-start": !!dir
|
|
78042
|
+
}),
|
|
78043
|
+
children: files.map((file) => {
|
|
78044
|
+
const moduleId = `/${dir}/${file}`;
|
|
78045
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
78046
|
+
"button",
|
|
78047
|
+
{
|
|
78048
|
+
className: classNames("block px-2 py-1 rounded-full", {
|
|
78049
|
+
"bg-accent text-accent-foreground": selectedModuleId === moduleId
|
|
78050
|
+
}),
|
|
78051
|
+
onClick: () => {
|
|
78052
|
+
setSelectedModuleId(moduleId);
|
|
78053
|
+
},
|
|
78054
|
+
children: file
|
|
78055
|
+
},
|
|
78056
|
+
moduleId
|
|
78057
|
+
);
|
|
78058
|
+
})
|
|
78059
|
+
}
|
|
78060
|
+
)
|
|
78061
|
+
] }, `/${dir}`);
|
|
78062
|
+
}) });
|
|
77740
78063
|
}
|
|
77741
78064
|
const theme = {
|
|
77742
78065
|
tags: {
|
|
@@ -79163,7 +79486,7 @@ function fallbackRender({ error, resetErrorBoundary }) {
|
|
|
79163
79486
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Logo$1, {}),
|
|
79164
79487
|
" encountered an error"
|
|
79165
79488
|
] }),
|
|
79166
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: resetErrorBoundary, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, {}) })
|
|
79489
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: resetErrorBoundary, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, {}) })
|
|
79167
79490
|
] }),
|
|
79168
79491
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-4xl font-normal ", children: "Message:" }),
|
|
79169
79492
|
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: error.message }),
|