tinacms 0.0.0-f224124-20251110051725 → 0.0.0-f2577b9-20251119082459
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/index.js +1617 -1351
- package/dist/index.mjs +1362 -1094
- package/dist/toolkit/fields/components/select.d.ts +1 -1
- package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +2 -1
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
- package/dist/toolkit/form-builder/form-builder.d.ts +0 -12
- package/dist/toolkit/form-builder/index.d.ts +1 -0
- package/dist/toolkit/react-sidebar/components/badge.d.ts +2 -1
- package/package.json +8 -9
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
(function(global2, factory) {
|
|
8
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate-heading"), require("is-hotkey"), require("clsx"), require("@radix-ui/react-slot"), require("@udecode/plate-code-block"), require("lucide-react"), require("mermaid"), require("class-variance-authority"), require("cmdk"), require("@radix-ui/react-dialog"), require("@radix-ui/react-popover"), require("@udecode/plate"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-reset-node"), require("@udecode/plate-list"), require("@udecode/plate-resizable"), require("@udecode/plate-dnd"), require("@udecode/plate-table"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-separator"), require("@radix-ui/react-tooltip"), require("final-form"), require("final-form-arrays"), require("final-form-set-field-data"), require("react-final-form"), require("prop-types"), require("
|
|
9
|
-
})(this, function(exports2, zod, React, ReactDOM, cn$2, plateHeading, isHotkey, clsx, reactSlot, plateCodeBlock, lucideReact, mermaid, classVarianceAuthority, cmdk, DialogPrimitive, PopoverPrimitive, plate, react, plateCombobox, plateResetNode, plateList, plateResizable, plateDnd, plateTable, DropdownMenuPrimitive, ToolbarPrimitive, SeparatorPrimitive, TooltipPrimitive, finalForm, arrayMutators, setFieldData, reactFinalForm, PropTypes,
|
|
8
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate-heading"), require("is-hotkey"), require("clsx"), require("@radix-ui/react-slot"), require("@udecode/plate-code-block"), require("lucide-react"), require("mermaid"), require("class-variance-authority"), require("cmdk"), require("@radix-ui/react-dialog"), require("@radix-ui/react-popover"), require("@udecode/plate"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-reset-node"), require("@udecode/plate-list"), require("@udecode/plate-resizable"), require("@udecode/plate-dnd"), require("@udecode/plate-table"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-separator"), require("@radix-ui/react-tooltip"), require("final-form"), require("final-form-arrays"), require("final-form-set-field-data"), require("react-final-form"), require("prop-types"), require("tailwind-merge"), require("@dnd-kit/core"), require("@dnd-kit/sortable"), require("@dnd-kit/utilities"), require("react-color"), require("color-string"), require("graphql"), require("@graphql-inspector/core"), require("react-dropzone"), require("@udecode/cmdk"), require("@headlessui/react"), require("@udecode/plate-trailing-block"), require("@udecode/plate-floating"), require("@udecode/plate-block-quote"), require("@udecode/plate-node-id"), require("@udecode/plate-link"), require("@udecode/plate-autoformat"), require("lodash.get"), require("moment"), require("date-fns"), require("@tinacms/schema-tools"), require("graphql-tag"), require("yup"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate-heading", "is-hotkey", "clsx", "@radix-ui/react-slot", "@udecode/plate-code-block", "lucide-react", "mermaid", "class-variance-authority", "cmdk", "@radix-ui/react-dialog", "@radix-ui/react-popover", "@udecode/plate", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-reset-node", "@udecode/plate-list", "@udecode/plate-resizable", "@udecode/plate-dnd", "@udecode/plate-table", "@radix-ui/react-dropdown-menu", "@radix-ui/react-toolbar", "@radix-ui/react-separator", "@radix-ui/react-tooltip", "final-form", "final-form-arrays", "final-form-set-field-data", "react-final-form", "prop-types", "tailwind-merge", "@dnd-kit/core", "@dnd-kit/sortable", "@dnd-kit/utilities", "react-color", "color-string", "graphql", "@graphql-inspector/core", "react-dropzone", "@udecode/cmdk", "@headlessui/react", "@udecode/plate-trailing-block", "@udecode/plate-floating", "@udecode/plate-block-quote", "@udecode/plate-node-id", "@udecode/plate-link", "@udecode/plate-autoformat", "lodash.get", "moment", "date-fns", "@tinacms/schema-tools", "graphql-tag", "yup", "react-router-dom", "@tinacms/mdx"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.tinacms = {}, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP));
|
|
9
|
+
})(this, function(exports2, zod, React, ReactDOM, cn$2, plateHeading, isHotkey, clsx, reactSlot, plateCodeBlock, lucideReact, mermaid, classVarianceAuthority, cmdk, DialogPrimitive, PopoverPrimitive, plate, react, plateCombobox, plateResetNode, plateList, plateResizable, plateDnd, plateTable, DropdownMenuPrimitive, ToolbarPrimitive, SeparatorPrimitive, TooltipPrimitive, finalForm, arrayMutators, setFieldData, reactFinalForm, PropTypes, tailwindMerge, core$1, sortable, utilities, pkg$1, pkg, graphql$1, core$2, dropzone, cmdk$1, react$1, plateTrailingBlock, plateFloating, plateBlockQuote, plateNodeId, plateLink, plateAutoformat, get$5, moment, dateFns, schemaTools, gql, yup, reactRouterDom, mdx) {
|
|
10
10
|
var _a;
|
|
11
11
|
"use strict";
|
|
12
12
|
function _interopNamespaceDefault(e3) {
|
|
@@ -38308,6 +38308,171 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38308
38308
|
Component: PropTypes.any.isRequired,
|
|
38309
38309
|
children: PropTypes.any
|
|
38310
38310
|
};
|
|
38311
|
+
function cn$1(...inputs) {
|
|
38312
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
38313
|
+
}
|
|
38314
|
+
const Button$1 = ({
|
|
38315
|
+
variant = "secondary",
|
|
38316
|
+
as: Tag2 = "button",
|
|
38317
|
+
size: size2 = "medium",
|
|
38318
|
+
busy,
|
|
38319
|
+
disabled,
|
|
38320
|
+
rounded = "full",
|
|
38321
|
+
children,
|
|
38322
|
+
className = "",
|
|
38323
|
+
...props
|
|
38324
|
+
}) => {
|
|
38325
|
+
const baseClasses = "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out ";
|
|
38326
|
+
const variantClasses = {
|
|
38327
|
+
primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
|
|
38328
|
+
secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
|
|
38329
|
+
white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
|
|
38330
|
+
ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
|
|
38331
|
+
danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
|
|
38332
|
+
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
|
|
38333
|
+
custom: ""
|
|
38334
|
+
};
|
|
38335
|
+
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
38336
|
+
const stateClasses = {
|
|
38337
|
+
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
38338
|
+
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
38339
|
+
default: ``
|
|
38340
|
+
};
|
|
38341
|
+
const roundedClasses = {
|
|
38342
|
+
full: `rounded`,
|
|
38343
|
+
left: `rounded-l`,
|
|
38344
|
+
right: `rounded-r`,
|
|
38345
|
+
custom: "",
|
|
38346
|
+
none: ""
|
|
38347
|
+
};
|
|
38348
|
+
const sizeClasses = {
|
|
38349
|
+
small: `text-xs h-8 px-3`,
|
|
38350
|
+
medium: `text-sm h-10 px-8`,
|
|
38351
|
+
custom: ``
|
|
38352
|
+
};
|
|
38353
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
38354
|
+
Tag2,
|
|
38355
|
+
{
|
|
38356
|
+
className: cn$1(
|
|
38357
|
+
baseClasses,
|
|
38358
|
+
variantClasses[variant],
|
|
38359
|
+
sizeClasses[size2],
|
|
38360
|
+
stateClasses[state],
|
|
38361
|
+
roundedClasses[rounded],
|
|
38362
|
+
className
|
|
38363
|
+
),
|
|
38364
|
+
...props
|
|
38365
|
+
},
|
|
38366
|
+
children
|
|
38367
|
+
);
|
|
38368
|
+
};
|
|
38369
|
+
const IconButton = ({
|
|
38370
|
+
variant = "secondary",
|
|
38371
|
+
size: size2 = "medium",
|
|
38372
|
+
busy,
|
|
38373
|
+
disabled,
|
|
38374
|
+
children,
|
|
38375
|
+
className,
|
|
38376
|
+
...props
|
|
38377
|
+
}) => {
|
|
38378
|
+
const baseClasses = "icon-parent inline-flex items-center border border-transparent text-sm font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out rounded-full";
|
|
38379
|
+
const variantClasses = {
|
|
38380
|
+
primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
|
|
38381
|
+
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
|
|
38382
|
+
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
|
|
38383
|
+
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
|
|
38384
|
+
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
|
|
38385
|
+
};
|
|
38386
|
+
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
38387
|
+
const stateClasses = {
|
|
38388
|
+
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
38389
|
+
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
38390
|
+
default: ``
|
|
38391
|
+
};
|
|
38392
|
+
const sizeClasses = {
|
|
38393
|
+
small: `h-7 w-7`,
|
|
38394
|
+
medium: `h-9 w-9`,
|
|
38395
|
+
custom: ``
|
|
38396
|
+
};
|
|
38397
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
38398
|
+
"button",
|
|
38399
|
+
{
|
|
38400
|
+
className: cn$1(
|
|
38401
|
+
baseClasses,
|
|
38402
|
+
variantClasses[variant],
|
|
38403
|
+
sizeClasses[size2],
|
|
38404
|
+
stateClasses[state],
|
|
38405
|
+
className
|
|
38406
|
+
),
|
|
38407
|
+
...props
|
|
38408
|
+
},
|
|
38409
|
+
children
|
|
38410
|
+
);
|
|
38411
|
+
};
|
|
38412
|
+
function FontLoader() {
|
|
38413
|
+
React__namespace.useEffect(() => {
|
|
38414
|
+
const link = document.createElement("link");
|
|
38415
|
+
link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
|
|
38416
|
+
link.rel = "stylesheet";
|
|
38417
|
+
document.head.appendChild(link);
|
|
38418
|
+
return () => {
|
|
38419
|
+
document.head.removeChild(link);
|
|
38420
|
+
};
|
|
38421
|
+
}, []);
|
|
38422
|
+
return null;
|
|
38423
|
+
}
|
|
38424
|
+
function classNames(...classes) {
|
|
38425
|
+
return classes.filter(Boolean).join(" ");
|
|
38426
|
+
}
|
|
38427
|
+
const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
|
|
38428
|
+
const [open, setOpen] = React.useState(false);
|
|
38429
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(
|
|
38430
|
+
PopoverPrimitive__namespace.Trigger,
|
|
38431
|
+
{
|
|
38432
|
+
className: `cursor-pointer relative justify-center inline-flex items-center p-3 text-sm font-medium focus:outline-1 focus:outline-blue-200 pointer-events-auto ${open ? `text-blue-400` : `text-gray-300 hover:text-blue-500`} ${className}}`
|
|
38433
|
+
},
|
|
38434
|
+
/* @__PURE__ */ React.createElement(
|
|
38435
|
+
"svg",
|
|
38436
|
+
{
|
|
38437
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38438
|
+
className: "h-5 w-5",
|
|
38439
|
+
fill: "none",
|
|
38440
|
+
viewBox: "0 0 24 24",
|
|
38441
|
+
stroke: "currentColor"
|
|
38442
|
+
},
|
|
38443
|
+
/* @__PURE__ */ React.createElement(
|
|
38444
|
+
"path",
|
|
38445
|
+
{
|
|
38446
|
+
strokeLinecap: "round",
|
|
38447
|
+
strokeLinejoin: "round",
|
|
38448
|
+
strokeWidth: 2,
|
|
38449
|
+
d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
|
|
38450
|
+
}
|
|
38451
|
+
)
|
|
38452
|
+
)
|
|
38453
|
+
), /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
|
|
38454
|
+
return /* @__PURE__ */ React.createElement(
|
|
38455
|
+
"span",
|
|
38456
|
+
{
|
|
38457
|
+
"data-test": `${toolbarItem.name}OverflowButton`,
|
|
38458
|
+
key: toolbarItem.name,
|
|
38459
|
+
onMouseDown: (event) => {
|
|
38460
|
+
event.preventDefault();
|
|
38461
|
+
toolbarItem.onMouseDown(event);
|
|
38462
|
+
setOpen(false);
|
|
38463
|
+
},
|
|
38464
|
+
className: classNames(
|
|
38465
|
+
toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
|
|
38466
|
+
"hover:bg-gray-50 hover:text-blue-500 cursor-pointer pointer-events-auto px-4 py-2 text-sm w-full flex items-center whitespace-nowrap",
|
|
38467
|
+
toolbarItem.className ?? ""
|
|
38468
|
+
)
|
|
38469
|
+
},
|
|
38470
|
+
/* @__PURE__ */ React.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
|
|
38471
|
+
" ",
|
|
38472
|
+
toolbarItem.label
|
|
38473
|
+
);
|
|
38474
|
+
}))))));
|
|
38475
|
+
};
|
|
38311
38476
|
var DefaultContext = {
|
|
38312
38477
|
color: void 0,
|
|
38313
38478
|
size: void 0,
|
|
@@ -38549,30 +38714,392 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38549
38714
|
function BiX(props) {
|
|
38550
38715
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z" }, "child": [] }] })(props);
|
|
38551
38716
|
}
|
|
38552
|
-
|
|
38553
|
-
|
|
38554
|
-
|
|
38717
|
+
function BsArrowRightShort(props) {
|
|
38718
|
+
return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8" }, "child": [] }] })(props);
|
|
38719
|
+
}
|
|
38720
|
+
function BsCheckCircleFill(props) {
|
|
38721
|
+
return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }, "child": [] }] })(props);
|
|
38722
|
+
}
|
|
38723
|
+
function BsExclamationOctagonFill(props) {
|
|
38724
|
+
return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2" }, "child": [] }] })(props);
|
|
38725
|
+
}
|
|
38726
|
+
const MessageIcon = ({
|
|
38727
|
+
type = "success",
|
|
38728
|
+
className = ""
|
|
38729
|
+
}) => {
|
|
38730
|
+
const icons = {
|
|
38731
|
+
success: BiCheckCircle,
|
|
38732
|
+
warning: BiError,
|
|
38733
|
+
error: BiError,
|
|
38734
|
+
info: BiInfoCircle
|
|
38735
|
+
};
|
|
38736
|
+
const Icon = icons[type];
|
|
38737
|
+
return /* @__PURE__ */ React.createElement(Icon, { className });
|
|
38738
|
+
};
|
|
38739
|
+
const Message = ({
|
|
38740
|
+
children,
|
|
38741
|
+
type = "success",
|
|
38742
|
+
size: size2 = "medium",
|
|
38743
|
+
className = "",
|
|
38744
|
+
link,
|
|
38745
|
+
linkLabel = "Learn More"
|
|
38746
|
+
}) => {
|
|
38747
|
+
const containerClasses = {
|
|
38748
|
+
success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
|
|
38749
|
+
warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
|
|
38750
|
+
error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
|
|
38751
|
+
info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
|
|
38752
|
+
};
|
|
38753
|
+
const textClasses = {
|
|
38754
|
+
success: "text-green-700",
|
|
38755
|
+
warning: "text-yellow-700",
|
|
38756
|
+
error: "text-red-700",
|
|
38757
|
+
info: "text-blue-700"
|
|
38758
|
+
};
|
|
38759
|
+
const iconClasses = {
|
|
38760
|
+
success: "text-green-400",
|
|
38761
|
+
warning: "text-yellow-400",
|
|
38762
|
+
error: "text-red-400",
|
|
38763
|
+
info: "text-blue-400"
|
|
38764
|
+
};
|
|
38765
|
+
const sizeClasses = {
|
|
38766
|
+
small: "px-3 py-1.5 text-xs",
|
|
38767
|
+
medium: "px-4 py-2.5 text-sm"
|
|
38768
|
+
};
|
|
38769
|
+
return /* @__PURE__ */ React.createElement(
|
|
38770
|
+
"div",
|
|
38771
|
+
{
|
|
38772
|
+
className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
|
|
38773
|
+
},
|
|
38774
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
|
|
38775
|
+
MessageIcon,
|
|
38776
|
+
{
|
|
38777
|
+
type,
|
|
38778
|
+
className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
38779
|
+
}
|
|
38780
|
+
), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React.createElement(
|
|
38781
|
+
"a",
|
|
38782
|
+
{
|
|
38783
|
+
href: link,
|
|
38784
|
+
target: "_blank",
|
|
38785
|
+
className: "flex-shrink-0 flex items-center gap-1 text-blue-600 underline decoration-blue-200 hover:text-blue-500 hover:decoration-blue-500 transition-all ease-out duration-150"
|
|
38786
|
+
},
|
|
38787
|
+
linkLabel,
|
|
38788
|
+
" ",
|
|
38789
|
+
/* @__PURE__ */ React.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
|
|
38790
|
+
))
|
|
38791
|
+
);
|
|
38792
|
+
};
|
|
38793
|
+
function cn(...inputs) {
|
|
38794
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
38795
|
+
}
|
|
38796
|
+
function DropdownMenu({
|
|
38797
|
+
...props
|
|
38798
|
+
}) {
|
|
38799
|
+
return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Root, { "data-slot": "dropdown-menu", ...props });
|
|
38800
|
+
}
|
|
38801
|
+
function DropdownMenuTrigger({
|
|
38802
|
+
...props
|
|
38803
|
+
}) {
|
|
38555
38804
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
38556
|
-
|
|
38805
|
+
DropdownMenuPrimitive__namespace.Trigger,
|
|
38557
38806
|
{
|
|
38558
|
-
|
|
38559
|
-
|
|
38560
|
-
className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
|
|
38561
|
-
...rest
|
|
38807
|
+
"data-slot": "dropdown-menu-trigger",
|
|
38808
|
+
...props
|
|
38562
38809
|
}
|
|
38563
38810
|
);
|
|
38564
|
-
}
|
|
38565
|
-
|
|
38811
|
+
}
|
|
38812
|
+
function DropdownMenuContent({
|
|
38813
|
+
className,
|
|
38814
|
+
sideOffset = 4,
|
|
38815
|
+
...props
|
|
38816
|
+
}) {
|
|
38817
|
+
return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
|
|
38818
|
+
DropdownMenuPrimitive__namespace.Content,
|
|
38819
|
+
{
|
|
38820
|
+
"data-slot": "dropdown-menu-content",
|
|
38821
|
+
sideOffset,
|
|
38822
|
+
className: cn(
|
|
38823
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-base max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
38824
|
+
className
|
|
38825
|
+
),
|
|
38826
|
+
...props
|
|
38827
|
+
}
|
|
38828
|
+
));
|
|
38829
|
+
}
|
|
38830
|
+
function DropdownMenuItem({
|
|
38831
|
+
className,
|
|
38832
|
+
inset,
|
|
38833
|
+
variant = "default",
|
|
38834
|
+
...props
|
|
38835
|
+
}) {
|
|
38566
38836
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
38567
|
-
|
|
38837
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
38568
38838
|
{
|
|
38569
|
-
|
|
38570
|
-
|
|
38571
|
-
|
|
38572
|
-
|
|
38839
|
+
"data-slot": "dropdown-menu-item",
|
|
38840
|
+
"data-inset": inset,
|
|
38841
|
+
"data-variant": variant,
|
|
38842
|
+
className: cn(
|
|
38843
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer text-gray-700 hover:text-blue-500",
|
|
38844
|
+
className
|
|
38845
|
+
),
|
|
38846
|
+
...props
|
|
38573
38847
|
}
|
|
38574
38848
|
);
|
|
38575
|
-
}
|
|
38849
|
+
}
|
|
38850
|
+
function DropdownMenuSeparator({
|
|
38851
|
+
className,
|
|
38852
|
+
...props
|
|
38853
|
+
}) {
|
|
38854
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
38855
|
+
DropdownMenuPrimitive__namespace.Separator,
|
|
38856
|
+
{
|
|
38857
|
+
"data-slot": "dropdown-menu-separator",
|
|
38858
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
38859
|
+
...props
|
|
38860
|
+
}
|
|
38861
|
+
);
|
|
38862
|
+
}
|
|
38863
|
+
const DropdownButton = React__namespace.forwardRef(
|
|
38864
|
+
({
|
|
38865
|
+
variant = "primary",
|
|
38866
|
+
size: size2 = "medium",
|
|
38867
|
+
busy,
|
|
38868
|
+
disabled,
|
|
38869
|
+
rounded = "full",
|
|
38870
|
+
children,
|
|
38871
|
+
className = "",
|
|
38872
|
+
onMainAction,
|
|
38873
|
+
items: items2,
|
|
38874
|
+
showSplitButton = true,
|
|
38875
|
+
...props
|
|
38876
|
+
}, ref) => {
|
|
38877
|
+
const [open, setOpen] = React__namespace.useState(false);
|
|
38878
|
+
if (!onMainAction || !showSplitButton) {
|
|
38879
|
+
return /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
|
|
38880
|
+
Button$1,
|
|
38881
|
+
{
|
|
38882
|
+
variant,
|
|
38883
|
+
size: size2,
|
|
38884
|
+
busy,
|
|
38885
|
+
disabled,
|
|
38886
|
+
rounded,
|
|
38887
|
+
className: cn$1("gap-2", className),
|
|
38888
|
+
...props
|
|
38889
|
+
},
|
|
38890
|
+
children,
|
|
38891
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
38892
|
+
lucideReact.ChevronDownIcon,
|
|
38893
|
+
{
|
|
38894
|
+
className: cn$1(
|
|
38895
|
+
"h-4 w-4 transition-transform duration-200",
|
|
38896
|
+
open && "rotate-180"
|
|
38897
|
+
)
|
|
38898
|
+
}
|
|
38899
|
+
)
|
|
38900
|
+
)), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React__namespace.createElement(
|
|
38901
|
+
DropdownMenuItem,
|
|
38902
|
+
{
|
|
38903
|
+
key: index,
|
|
38904
|
+
onClick: item.onClick,
|
|
38905
|
+
disabled: item.disabled,
|
|
38906
|
+
variant: item.variant
|
|
38907
|
+
},
|
|
38908
|
+
item.icon && item.icon,
|
|
38909
|
+
item.label
|
|
38910
|
+
))));
|
|
38911
|
+
}
|
|
38912
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React__namespace.createElement(
|
|
38913
|
+
Button$1,
|
|
38914
|
+
{
|
|
38915
|
+
variant,
|
|
38916
|
+
size: size2,
|
|
38917
|
+
busy,
|
|
38918
|
+
disabled,
|
|
38919
|
+
rounded: "left",
|
|
38920
|
+
onClick: onMainAction,
|
|
38921
|
+
className: "border-r-0 w-full",
|
|
38922
|
+
...props
|
|
38923
|
+
},
|
|
38924
|
+
children
|
|
38925
|
+
), /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React__namespace.createElement(
|
|
38926
|
+
Button$1,
|
|
38927
|
+
{
|
|
38928
|
+
variant,
|
|
38929
|
+
size: size2,
|
|
38930
|
+
busy,
|
|
38931
|
+
disabled,
|
|
38932
|
+
rounded: "right",
|
|
38933
|
+
className: "px-4 border-l",
|
|
38934
|
+
style: { borderColor: "#00000030" },
|
|
38935
|
+
"aria-label": "More options"
|
|
38936
|
+
},
|
|
38937
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
38938
|
+
lucideReact.ChevronDownIcon,
|
|
38939
|
+
{
|
|
38940
|
+
className: cn$1(
|
|
38941
|
+
"h-4 w-4 transition-transform duration-200 fill-none",
|
|
38942
|
+
open && "rotate-180"
|
|
38943
|
+
),
|
|
38944
|
+
style: { fill: "none" }
|
|
38945
|
+
}
|
|
38946
|
+
)
|
|
38947
|
+
)), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
|
|
38948
|
+
var _a2;
|
|
38949
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: index }, /* @__PURE__ */ React__namespace.createElement(
|
|
38950
|
+
DropdownMenuItem,
|
|
38951
|
+
{
|
|
38952
|
+
onClick: item.onClick,
|
|
38953
|
+
disabled: item.disabled,
|
|
38954
|
+
variant: item.variant
|
|
38955
|
+
},
|
|
38956
|
+
item.icon && item.icon,
|
|
38957
|
+
item.label
|
|
38958
|
+
), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React__namespace.createElement(DropdownMenuSeparator, null));
|
|
38959
|
+
}))));
|
|
38960
|
+
}
|
|
38961
|
+
);
|
|
38962
|
+
DropdownButton.displayName = "DropdownButton";
|
|
38963
|
+
const DragDropContext = ({
|
|
38964
|
+
onDragEnd,
|
|
38965
|
+
children
|
|
38966
|
+
}) => {
|
|
38967
|
+
const sensors = core$1.useSensors(
|
|
38968
|
+
core$1.useSensor(core$1.PointerSensor, {
|
|
38969
|
+
activationConstraint: {
|
|
38970
|
+
delay: 100,
|
|
38971
|
+
tolerance: 5
|
|
38972
|
+
}
|
|
38973
|
+
}),
|
|
38974
|
+
core$1.useSensor(core$1.KeyboardSensor, {
|
|
38975
|
+
coordinateGetter: sortable.sortableKeyboardCoordinates
|
|
38976
|
+
})
|
|
38977
|
+
);
|
|
38978
|
+
const handleDragEnd = (event) => {
|
|
38979
|
+
const { active, over } = event;
|
|
38980
|
+
if (!over || active.id === over.id) {
|
|
38981
|
+
return;
|
|
38982
|
+
}
|
|
38983
|
+
const activeIdStr = String(active.id);
|
|
38984
|
+
const overIdStr = String(over.id);
|
|
38985
|
+
const activeFieldName = activeIdStr.substring(
|
|
38986
|
+
0,
|
|
38987
|
+
activeIdStr.lastIndexOf(".")
|
|
38988
|
+
);
|
|
38989
|
+
const overFieldName = overIdStr.substring(0, overIdStr.lastIndexOf("."));
|
|
38990
|
+
const activeIndex = parseInt(
|
|
38991
|
+
activeIdStr.substring(activeIdStr.lastIndexOf(".") + 1)
|
|
38992
|
+
);
|
|
38993
|
+
const overIndex = parseInt(
|
|
38994
|
+
overIdStr.substring(overIdStr.lastIndexOf(".") + 1)
|
|
38995
|
+
);
|
|
38996
|
+
if (activeFieldName === overFieldName) {
|
|
38997
|
+
const result = {
|
|
38998
|
+
destination: {
|
|
38999
|
+
index: overIndex
|
|
39000
|
+
},
|
|
39001
|
+
source: {
|
|
39002
|
+
index: activeIndex
|
|
39003
|
+
},
|
|
39004
|
+
type: activeFieldName
|
|
39005
|
+
};
|
|
39006
|
+
onDragEnd(result);
|
|
39007
|
+
}
|
|
39008
|
+
};
|
|
39009
|
+
return /* @__PURE__ */ React.createElement(
|
|
39010
|
+
core$1.DndContext,
|
|
39011
|
+
{
|
|
39012
|
+
sensors,
|
|
39013
|
+
collisionDetection: core$1.closestCenter,
|
|
39014
|
+
onDragEnd: handleDragEnd
|
|
39015
|
+
},
|
|
39016
|
+
children
|
|
39017
|
+
);
|
|
39018
|
+
};
|
|
39019
|
+
const Droppable = ({
|
|
39020
|
+
droppableId,
|
|
39021
|
+
type,
|
|
39022
|
+
children
|
|
39023
|
+
}) => {
|
|
39024
|
+
const ref = React.useRef(null);
|
|
39025
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children({
|
|
39026
|
+
innerRef: ref,
|
|
39027
|
+
placeholder: null
|
|
39028
|
+
}));
|
|
39029
|
+
};
|
|
39030
|
+
const Draggable = ({
|
|
39031
|
+
draggableId,
|
|
39032
|
+
children
|
|
39033
|
+
}) => {
|
|
39034
|
+
const animateLayoutChanges = (args) => {
|
|
39035
|
+
const { isSorting, wasDragging } = args;
|
|
39036
|
+
if (wasDragging) {
|
|
39037
|
+
return false;
|
|
39038
|
+
}
|
|
39039
|
+
if (isSorting) {
|
|
39040
|
+
return sortable.defaultAnimateLayoutChanges(args);
|
|
39041
|
+
}
|
|
39042
|
+
return true;
|
|
39043
|
+
};
|
|
39044
|
+
const {
|
|
39045
|
+
attributes,
|
|
39046
|
+
listeners,
|
|
39047
|
+
setNodeRef,
|
|
39048
|
+
transform,
|
|
39049
|
+
transition,
|
|
39050
|
+
isDragging,
|
|
39051
|
+
setActivatorNodeRef
|
|
39052
|
+
} = sortable.useSortable({
|
|
39053
|
+
id: draggableId,
|
|
39054
|
+
animateLayoutChanges
|
|
39055
|
+
});
|
|
39056
|
+
const style = {
|
|
39057
|
+
transform: utilities.CSS.Transform.toString(transform),
|
|
39058
|
+
transition,
|
|
39059
|
+
...isDragging && { zIndex: 9999 }
|
|
39060
|
+
};
|
|
39061
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(
|
|
39062
|
+
{
|
|
39063
|
+
innerRef: { current: null },
|
|
39064
|
+
draggableProps: {
|
|
39065
|
+
ref: setNodeRef,
|
|
39066
|
+
style,
|
|
39067
|
+
...attributes
|
|
39068
|
+
},
|
|
39069
|
+
dragHandleProps: {
|
|
39070
|
+
ref: setActivatorNodeRef,
|
|
39071
|
+
...listeners
|
|
39072
|
+
}
|
|
39073
|
+
},
|
|
39074
|
+
{
|
|
39075
|
+
isDragging
|
|
39076
|
+
}
|
|
39077
|
+
));
|
|
39078
|
+
};
|
|
39079
|
+
const SortableProvider = ({
|
|
39080
|
+
items: items2,
|
|
39081
|
+
children
|
|
39082
|
+
}) => {
|
|
39083
|
+
return /* @__PURE__ */ React.createElement(sortable.SortableContext, { items: items2, strategy: sortable.verticalListSortingStrategy }, children);
|
|
39084
|
+
};
|
|
39085
|
+
function FaCircle(props) {
|
|
39086
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" }, "child": [] }] })(props);
|
|
39087
|
+
}
|
|
39088
|
+
function FaFile(props) {
|
|
39089
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 384 512" }, "child": [{ "tag": "path", "attr": { "d": "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z" }, "child": [] }] })(props);
|
|
39090
|
+
}
|
|
39091
|
+
function FaFolder(props) {
|
|
39092
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z" }, "child": [] }] })(props);
|
|
39093
|
+
}
|
|
39094
|
+
function FaLock(props) {
|
|
39095
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" }, "child": [] }] })(props);
|
|
39096
|
+
}
|
|
39097
|
+
function FaSpinner(props) {
|
|
39098
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" }, "child": [] }] })(props);
|
|
39099
|
+
}
|
|
39100
|
+
function FaUnlock(props) {
|
|
39101
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
|
|
39102
|
+
}
|
|
38576
39103
|
const Dismissible = ({
|
|
38577
39104
|
onDismiss,
|
|
38578
39105
|
escape: escape2,
|
|
@@ -38645,14 +39172,167 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38645
39172
|
}, [click, customDocument, escape2, disabled, onDismiss]);
|
|
38646
39173
|
return area;
|
|
38647
39174
|
}
|
|
38648
|
-
const {
|
|
38649
|
-
|
|
38650
|
-
|
|
38651
|
-
|
|
38652
|
-
|
|
38653
|
-
|
|
38654
|
-
|
|
38655
|
-
|
|
39175
|
+
const FormActionMenu = ({ actions, form }) => {
|
|
39176
|
+
const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
|
|
39177
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React__namespace.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React__namespace.createElement(
|
|
39178
|
+
Dismissible,
|
|
39179
|
+
{
|
|
39180
|
+
click: true,
|
|
39181
|
+
escape: true,
|
|
39182
|
+
disabled: !actionMenuVisibility,
|
|
39183
|
+
onDismiss: () => {
|
|
39184
|
+
setActionMenuVisibility((p2) => !p2);
|
|
39185
|
+
}
|
|
39186
|
+
},
|
|
39187
|
+
actions.map((Action, i2) => (
|
|
39188
|
+
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
39189
|
+
// Actions should just be componets
|
|
39190
|
+
/* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
|
|
39191
|
+
))
|
|
39192
|
+
)));
|
|
39193
|
+
};
|
|
39194
|
+
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39195
|
+
"button",
|
|
39196
|
+
{
|
|
39197
|
+
className: `h-16 w-10 self-stretch bg-transparent bg-center bg-[length:auto_18px] -mr-4 ml-2 outline-none cursor-pointer transition-opacity duration-100 ease-out flex justify-center items-center hover:bg-gray-50 hover:fill-gray-700 ${className}`,
|
|
39198
|
+
...props
|
|
39199
|
+
},
|
|
39200
|
+
/* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
|
|
39201
|
+
);
|
|
39202
|
+
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39203
|
+
"div",
|
|
39204
|
+
{
|
|
39205
|
+
className: `min-w-[192px] rounded-3xl border border-solid border-[#efefef] block absolute bottom-5 right-5 ${open ? "opacity-100" : "opacity-0"} transition-all duration-100 ease-out origin-bottom-right shadow-[0_2px_3px_rgba(0,0,0,0.05)] bg-white overflow-hidden z-10 ${className}`,
|
|
39206
|
+
style: {
|
|
39207
|
+
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
39208
|
+
pointerEvents: open ? "all" : "none",
|
|
39209
|
+
...style
|
|
39210
|
+
},
|
|
39211
|
+
...props
|
|
39212
|
+
}
|
|
39213
|
+
);
|
|
39214
|
+
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39215
|
+
"button",
|
|
39216
|
+
{
|
|
39217
|
+
className: `relative text-center text-[13px] px-3 h-10 font-normal w-full bg-none cursor-pointer outline-none border-0 transition-all duration-[150ms] ease-out hover:text-blue-500 hover:bg-gray50 [&:not(:last-child)]: border-b-[1px] border-solid border-b-[#edecf3] ${className}`,
|
|
39218
|
+
...props
|
|
39219
|
+
}
|
|
39220
|
+
);
|
|
39221
|
+
const FormPortalContext = React__namespace.createContext(() => {
|
|
39222
|
+
return null;
|
|
39223
|
+
});
|
|
39224
|
+
function useFormPortal() {
|
|
39225
|
+
return React__namespace.useContext(FormPortalContext);
|
|
39226
|
+
}
|
|
39227
|
+
const FormPortalProvider = ({
|
|
39228
|
+
children
|
|
39229
|
+
}) => {
|
|
39230
|
+
const wrapperRef = React__namespace.useRef(null);
|
|
39231
|
+
const zIndexRef = React__namespace.useRef(0);
|
|
39232
|
+
const FormPortal = React__namespace.useCallback(
|
|
39233
|
+
(props) => {
|
|
39234
|
+
if (!wrapperRef.current)
|
|
39235
|
+
return null;
|
|
39236
|
+
return ReactDOM.createPortal(
|
|
39237
|
+
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
39238
|
+
wrapperRef.current
|
|
39239
|
+
);
|
|
39240
|
+
},
|
|
39241
|
+
[wrapperRef, zIndexRef]
|
|
39242
|
+
);
|
|
39243
|
+
return /* @__PURE__ */ React__namespace.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React__namespace.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
|
|
39244
|
+
};
|
|
39245
|
+
const LoadingDots = ({
|
|
39246
|
+
dotSize = 8,
|
|
39247
|
+
color = "white"
|
|
39248
|
+
}) => {
|
|
39249
|
+
return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
|
|
39250
|
+
};
|
|
39251
|
+
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39252
|
+
"span",
|
|
39253
|
+
{
|
|
39254
|
+
className: "inline-block mr-1",
|
|
39255
|
+
style: {
|
|
39256
|
+
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
39257
|
+
animationDelay: `${delay}s`,
|
|
39258
|
+
background: color,
|
|
39259
|
+
width: dotSize,
|
|
39260
|
+
height: dotSize,
|
|
39261
|
+
borderRadius: dotSize
|
|
39262
|
+
}
|
|
39263
|
+
}
|
|
39264
|
+
);
|
|
39265
|
+
const ResetForm = ({
|
|
39266
|
+
pristine,
|
|
39267
|
+
reset: reset2,
|
|
39268
|
+
children,
|
|
39269
|
+
...props
|
|
39270
|
+
}) => {
|
|
39271
|
+
const [open, setOpen] = React__namespace.useState(false);
|
|
39272
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
39273
|
+
Button$1,
|
|
39274
|
+
{
|
|
39275
|
+
onClick: () => {
|
|
39276
|
+
setOpen((p2) => !p2);
|
|
39277
|
+
},
|
|
39278
|
+
disabled: pristine,
|
|
39279
|
+
...props
|
|
39280
|
+
},
|
|
39281
|
+
children
|
|
39282
|
+
), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
39283
|
+
};
|
|
39284
|
+
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
39285
|
+
return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(ModalPopup, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
39286
|
+
Button$1,
|
|
39287
|
+
{
|
|
39288
|
+
style: { flexGrow: 3 },
|
|
39289
|
+
variant: "primary",
|
|
39290
|
+
onClick: async () => {
|
|
39291
|
+
await reset2();
|
|
39292
|
+
close2();
|
|
39293
|
+
}
|
|
39294
|
+
},
|
|
39295
|
+
"Reset"
|
|
39296
|
+
))));
|
|
39297
|
+
};
|
|
39298
|
+
function AiFillWarning(props) {
|
|
39299
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
|
|
39300
|
+
}
|
|
39301
|
+
function AiOutlineLoading(props) {
|
|
39302
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }, "child": [] }] })(props);
|
|
39303
|
+
}
|
|
39304
|
+
const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded";
|
|
39305
|
+
const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
|
|
39306
|
+
const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
|
|
39307
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
39308
|
+
"input",
|
|
39309
|
+
{
|
|
39310
|
+
ref,
|
|
39311
|
+
type: "text",
|
|
39312
|
+
className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
|
|
39313
|
+
...rest
|
|
39314
|
+
}
|
|
39315
|
+
);
|
|
39316
|
+
});
|
|
39317
|
+
const TextArea = React__namespace.forwardRef(({ ...props }, ref) => {
|
|
39318
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
39319
|
+
"textarea",
|
|
39320
|
+
{
|
|
39321
|
+
...props,
|
|
39322
|
+
className: "shadow-inner text-base px-3 py-2 text-gray-600 resize-y focus:shadow-outline focus:border-blue-500 block w-full border border-gray-200 focus:text-gray-900 rounded",
|
|
39323
|
+
ref,
|
|
39324
|
+
style: { minHeight: "160px" }
|
|
39325
|
+
}
|
|
39326
|
+
);
|
|
39327
|
+
});
|
|
39328
|
+
const { get: getColor, to: toColor } = pkg__namespace;
|
|
39329
|
+
var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
|
|
39330
|
+
ColorFormat2["Hex"] = "hex";
|
|
39331
|
+
ColorFormat2["RGB"] = "rgb";
|
|
39332
|
+
return ColorFormat2;
|
|
39333
|
+
})(ColorFormat || {});
|
|
39334
|
+
const rgbToHex = function(color) {
|
|
39335
|
+
return "#" + ((1 << 24) + (color.r << 16) + (color.g << 8) + color.b).toString(16).slice(1);
|
|
38656
39336
|
};
|
|
38657
39337
|
function ParseColorStr(color) {
|
|
38658
39338
|
if (!color) {
|
|
@@ -38913,691 +39593,289 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38913
39593
|
className: `absolute rounded-3xl left-0.5 top-1/2 w-[22px] h-[22px] shadow border transition-all ease-out duration-150 ${checked ? "bg-blue-500 border-blue-600" : "bg-gray-250 border-gray-300"}`,
|
|
38914
39594
|
style: {
|
|
38915
39595
|
transform: `translate3d(${checked ? "20px" : "0"}, -50%, 0)`
|
|
38916
|
-
}
|
|
38917
|
-
}
|
|
38918
|
-
))
|
|
38919
|
-
)), labels && /* @__PURE__ */ React__namespace.createElement(
|
|
38920
|
-
"span",
|
|
38921
|
-
{
|
|
38922
|
-
className: `text-sm ${checked ? "text-blue-500 font-bold" : "text-gray-300"}`
|
|
38923
|
-
},
|
|
38924
|
-
labels.true
|
|
38925
|
-
));
|
|
38926
|
-
};
|
|
38927
|
-
const ToggleInput = ({ disabled, ...props }) => {
|
|
38928
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
38929
|
-
"input",
|
|
38930
|
-
{
|
|
38931
|
-
className: `absolute left-0 top-0 w-12 h-8 opacity-0 m-0 ${disabled ? `cursor-not-allowed pointer-events-none` : `cursor-pointer z-20`}`,
|
|
38932
|
-
...props
|
|
38933
|
-
}
|
|
38934
|
-
);
|
|
38935
|
-
};
|
|
38936
|
-
function MdCheckCircle(props) {
|
|
38937
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }, "child": [] }] })(props);
|
|
38938
|
-
}
|
|
38939
|
-
function MdInfo(props) {
|
|
38940
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }, "child": [] }] })(props);
|
|
38941
|
-
}
|
|
38942
|
-
function MdError(props) {
|
|
38943
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }, "child": [] }] })(props);
|
|
38944
|
-
}
|
|
38945
|
-
function MdWarning(props) {
|
|
38946
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }, "child": [] }] })(props);
|
|
38947
|
-
}
|
|
38948
|
-
function MdVpnKey(props) {
|
|
38949
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12.65 10A5.99 5.99 0 0 0 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6a5.99 5.99 0 0 0 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
|
|
38950
|
-
}
|
|
38951
|
-
function MdKeyboardArrowDown(props) {
|
|
38952
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" }, "child": [] }] })(props);
|
|
38953
|
-
}
|
|
38954
|
-
function MdArrowForward(props) {
|
|
38955
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }, "child": [] }] })(props);
|
|
38956
|
-
}
|
|
38957
|
-
function MdSyncProblem(props) {
|
|
38958
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M3 12c0 2.21.91 4.2 2.36 5.64L3 20h6v-6l-2.24 2.24A6.003 6.003 0 0 1 5 12a5.99 5.99 0 0 1 4-5.65V4.26C5.55 5.15 3 8.27 3 12zm8 5h2v-2h-2v2zM21 4h-6v6l2.24-2.24A6.003 6.003 0 0 1 19 12a5.99 5.99 0 0 1-4 5.65v2.09c3.45-.89 6-4.01 6-7.74 0-2.21-.91-4.2-2.36-5.64L21 4zm-10 9h2V7h-2v6z" }, "child": [] }] })(props);
|
|
38959
|
-
}
|
|
38960
|
-
function MdOutlineHelpOutline(props) {
|
|
38961
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" }, "child": [] }] })(props);
|
|
38962
|
-
}
|
|
38963
|
-
function MdOutlineSettings(props) {
|
|
38964
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.566.566 0 0 0-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
|
|
38965
|
-
}
|
|
38966
|
-
function MdOutlineClear(props) {
|
|
38967
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }, "child": [] }] })(props);
|
|
38968
|
-
}
|
|
38969
|
-
function MdOutlineCloud(props) {
|
|
38970
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0 1 22 15c0 1.65-1.35 3-3 3H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0 1 12 6m0-2C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96A7.49 7.49 0 0 0 12 4z" }, "child": [] }] })(props);
|
|
38971
|
-
}
|
|
38972
|
-
function MdOutlinePhotoLibrary(props) {
|
|
38973
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z" }, "child": [] }] })(props);
|
|
38974
|
-
}
|
|
38975
|
-
function MdOutlinePerson(props) {
|
|
38976
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }, "child": [] }] })(props);
|
|
38977
|
-
}
|
|
38978
|
-
const selectFieldClasses = "shadow appearance-none bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded";
|
|
38979
|
-
const Select = ({
|
|
38980
|
-
input,
|
|
38981
|
-
field,
|
|
38982
|
-
options,
|
|
38983
|
-
className = ""
|
|
38984
|
-
}) => {
|
|
38985
|
-
const selectOptions = options || field.options;
|
|
38986
|
-
const ref = React__namespace.useRef(null);
|
|
38987
|
-
React__namespace.useEffect(() => {
|
|
38988
|
-
if (ref.current && (field == null ? void 0 : field.experimental_focusIntent)) {
|
|
38989
|
-
ref.current.focus();
|
|
38990
|
-
}
|
|
38991
|
-
}, [field == null ? void 0 : field.experimental_focusIntent, ref]);
|
|
38992
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group w-full md:w-auto" }, /* @__PURE__ */ React__namespace.createElement(
|
|
38993
|
-
"select",
|
|
38994
|
-
{
|
|
38995
|
-
id: input.name,
|
|
38996
|
-
ref,
|
|
38997
|
-
value: input.value,
|
|
38998
|
-
onChange: input.onChange,
|
|
38999
|
-
className: `${selectFieldClasses} ${input.value ? "text-gray-700" : "text-gray-300"} } ${className}`,
|
|
39000
|
-
...input
|
|
39001
|
-
},
|
|
39002
|
-
selectOptions ? selectOptions.map(toProps$1).map(toComponent) : /* @__PURE__ */ React__namespace.createElement("option", null, input.value)
|
|
39003
|
-
), /* @__PURE__ */ React__namespace.createElement(MdKeyboardArrowDown, { className: "absolute top-1/2 right-2 w-6 h-auto -translate-y-1/2 text-gray-300 group-hover:text-blue-500 transition duration-150 ease-out pointer-events-none" }));
|
|
39004
|
-
};
|
|
39005
|
-
function toProps$1(option) {
|
|
39006
|
-
if (typeof option === "object")
|
|
39007
|
-
return option;
|
|
39008
|
-
return { value: option, label: option };
|
|
39009
|
-
}
|
|
39010
|
-
function toComponent(option) {
|
|
39011
|
-
return /* @__PURE__ */ React__namespace.createElement("option", { key: option.value, value: option.value }, option.label);
|
|
39012
|
-
}
|
|
39013
|
-
const RadioGroup = ({
|
|
39014
|
-
input,
|
|
39015
|
-
field,
|
|
39016
|
-
options
|
|
39017
|
-
}) => {
|
|
39018
|
-
const radioOptions = options || field.options;
|
|
39019
|
-
const radioRefs = {};
|
|
39020
|
-
const toProps2 = (option) => {
|
|
39021
|
-
if (typeof option === "object")
|
|
39022
|
-
return option;
|
|
39023
|
-
return { value: option, label: option };
|
|
39024
|
-
};
|
|
39025
|
-
const toComponent2 = (option) => {
|
|
39026
|
-
const optionId = `field-${field.name}-option-${option.value}`;
|
|
39027
|
-
const checked = option.value === input.value;
|
|
39028
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39029
|
-
"div",
|
|
39030
|
-
{
|
|
39031
|
-
key: option.value,
|
|
39032
|
-
ref: (ref) => {
|
|
39033
|
-
radioRefs[`radio_${option.value}`] = ref;
|
|
39034
|
-
}
|
|
39035
|
-
},
|
|
39036
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39037
|
-
"input",
|
|
39038
|
-
{
|
|
39039
|
-
className: "absolute w-0 h-0 opacity-0 cursor-pointer",
|
|
39040
|
-
type: "radio",
|
|
39041
|
-
id: optionId,
|
|
39042
|
-
name: input.name,
|
|
39043
|
-
value: option.value,
|
|
39044
|
-
onChange: (event) => {
|
|
39045
|
-
input.onChange(event.target.value);
|
|
39046
|
-
},
|
|
39047
|
-
checked
|
|
39048
|
-
}
|
|
39049
|
-
),
|
|
39050
|
-
/* @__PURE__ */ React__namespace.createElement(RadioOption, { htmlFor: optionId, checked }, option.label)
|
|
39051
|
-
);
|
|
39052
|
-
};
|
|
39053
|
-
return /* @__PURE__ */ React__namespace.createElement(RadioOptions, { id: input.name, direction: field.direction }, radioOptions ? radioOptions.map(toProps2).map(toComponent2) : input.value);
|
|
39054
|
-
};
|
|
39055
|
-
const RadioOptions = ({ direction: direction2, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39056
|
-
"div",
|
|
39057
|
-
{
|
|
39058
|
-
className: `flex w-full ${direction2 === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
|
|
39059
|
-
...props
|
|
39060
|
-
},
|
|
39061
|
-
children
|
|
39062
|
-
);
|
|
39063
|
-
const RadioOption = ({ checked, htmlFor, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39064
|
-
"label",
|
|
39065
|
-
{
|
|
39066
|
-
className: "cursor-pointer flex group items-center gap-2",
|
|
39067
|
-
htmlFor,
|
|
39068
|
-
...props
|
|
39069
|
-
},
|
|
39070
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39071
|
-
"span",
|
|
39072
|
-
{
|
|
39073
|
-
className: `relative h-[19px] w-[19px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
|
|
39074
|
-
},
|
|
39075
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39076
|
-
BiCheck,
|
|
39077
|
-
{
|
|
39078
|
-
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
|
|
39079
|
-
}
|
|
39080
|
-
)
|
|
39081
|
-
),
|
|
39082
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39083
|
-
"span",
|
|
39084
|
-
{
|
|
39085
|
-
className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
|
|
39086
|
-
},
|
|
39087
|
-
children
|
|
39088
|
-
)
|
|
39089
|
-
);
|
|
39090
|
-
const CheckboxGroup = ({
|
|
39091
|
-
input,
|
|
39092
|
-
field,
|
|
39093
|
-
options,
|
|
39094
|
-
disabled = false
|
|
39095
|
-
}) => {
|
|
39096
|
-
const checkboxOptions = options || field.options;
|
|
39097
|
-
const toProps2 = (option) => {
|
|
39098
|
-
if (typeof option === "object")
|
|
39099
|
-
return option;
|
|
39100
|
-
return { value: option, label: option };
|
|
39101
|
-
};
|
|
39102
|
-
const toComponent2 = (option) => {
|
|
39103
|
-
const optionId = `field-${field.name}-option-${option.value}`;
|
|
39104
|
-
const checked = input.value ? input.value.includes(option.value) : false;
|
|
39105
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { key: option.value }, /* @__PURE__ */ React__namespace.createElement(
|
|
39106
|
-
"input",
|
|
39107
|
-
{
|
|
39108
|
-
className: "absolute w-0 h-0 opacity-0 cursor-pointer",
|
|
39109
|
-
type: "checkbox",
|
|
39110
|
-
name: input.name,
|
|
39111
|
-
id: optionId,
|
|
39112
|
-
value: option.value,
|
|
39113
|
-
checked,
|
|
39114
|
-
disabled,
|
|
39115
|
-
onChange: (event) => {
|
|
39116
|
-
if (event.target.checked === true) {
|
|
39117
|
-
input.onChange([...input.value, event.target.value]);
|
|
39118
|
-
} else {
|
|
39119
|
-
input.onChange([
|
|
39120
|
-
...input.value.filter((v) => v !== event.target.value)
|
|
39121
|
-
]);
|
|
39122
|
-
}
|
|
39123
|
-
}
|
|
39124
|
-
}
|
|
39125
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
39126
|
-
"label",
|
|
39127
|
-
{
|
|
39128
|
-
className: "cursor-pointer flex group items-center gap-2",
|
|
39129
|
-
htmlFor: optionId
|
|
39130
|
-
},
|
|
39131
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39132
|
-
"span",
|
|
39133
|
-
{
|
|
39134
|
-
className: `relative h-[18px] w-[18px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
|
|
39135
|
-
},
|
|
39136
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39137
|
-
BiCheck,
|
|
39138
|
-
{
|
|
39139
|
-
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
|
|
39140
|
-
}
|
|
39141
|
-
)
|
|
39142
|
-
),
|
|
39143
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39144
|
-
"span",
|
|
39145
|
-
{
|
|
39146
|
-
className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
|
|
39147
|
-
},
|
|
39148
|
-
option.label
|
|
39149
|
-
)
|
|
39150
|
-
));
|
|
39151
|
-
};
|
|
39152
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39153
|
-
"div",
|
|
39154
|
-
{
|
|
39155
|
-
className: `flex w-full ${field.direction === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
|
|
39156
|
-
id: input.name
|
|
39157
|
-
},
|
|
39158
|
-
checkboxOptions == null ? void 0 : checkboxOptions.map(toProps2).map(toComponent2)
|
|
39159
|
-
);
|
|
39160
|
-
};
|
|
39161
|
-
const Input = ({ ...props }) => {
|
|
39162
|
-
return /* @__PURE__ */ React.createElement("input", { className: textFieldClasses, ...props });
|
|
39163
|
-
};
|
|
39164
|
-
const NumberInput = ({
|
|
39165
|
-
onChange,
|
|
39166
|
-
value,
|
|
39167
|
-
step
|
|
39168
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
39169
|
-
Input,
|
|
39170
|
-
{
|
|
39171
|
-
type: "number",
|
|
39172
|
-
step,
|
|
39173
|
-
value,
|
|
39174
|
-
onChange: (event) => {
|
|
39175
|
-
const inputValue = event.target.value;
|
|
39176
|
-
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
39177
|
-
if (onChange) {
|
|
39178
|
-
const syntheticEvent = {
|
|
39179
|
-
...event,
|
|
39180
|
-
target: {
|
|
39181
|
-
...event.target,
|
|
39182
|
-
value: newValue
|
|
39183
|
-
}
|
|
39184
|
-
};
|
|
39185
|
-
onChange(syntheticEvent);
|
|
39186
|
-
}
|
|
39187
|
-
}
|
|
39188
|
-
}
|
|
39189
|
-
);
|
|
39190
|
-
function cn$1(...inputs) {
|
|
39191
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
39192
|
-
}
|
|
39193
|
-
const Button$1 = ({
|
|
39194
|
-
variant = "secondary",
|
|
39195
|
-
as: Tag2 = "button",
|
|
39196
|
-
size: size2 = "medium",
|
|
39197
|
-
busy,
|
|
39198
|
-
disabled,
|
|
39199
|
-
rounded = "full",
|
|
39200
|
-
children,
|
|
39201
|
-
className = "",
|
|
39202
|
-
...props
|
|
39203
|
-
}) => {
|
|
39204
|
-
const baseClasses = "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out ";
|
|
39205
|
-
const variantClasses = {
|
|
39206
|
-
primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
|
|
39207
|
-
secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
|
|
39208
|
-
white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
|
|
39209
|
-
ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
|
|
39210
|
-
danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
|
|
39211
|
-
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
|
|
39212
|
-
custom: ""
|
|
39213
|
-
};
|
|
39214
|
-
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
39215
|
-
const stateClasses = {
|
|
39216
|
-
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
39217
|
-
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
39218
|
-
default: ``
|
|
39219
|
-
};
|
|
39220
|
-
const roundedClasses = {
|
|
39221
|
-
full: `rounded`,
|
|
39222
|
-
left: `rounded-l`,
|
|
39223
|
-
right: `rounded-r`,
|
|
39224
|
-
custom: "",
|
|
39225
|
-
none: ""
|
|
39226
|
-
};
|
|
39227
|
-
const sizeClasses = {
|
|
39228
|
-
small: `text-xs h-8 px-3`,
|
|
39229
|
-
medium: `text-sm h-10 px-8`,
|
|
39230
|
-
custom: ``
|
|
39231
|
-
};
|
|
39232
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39233
|
-
Tag2,
|
|
39234
|
-
{
|
|
39235
|
-
className: cn$1(
|
|
39236
|
-
baseClasses,
|
|
39237
|
-
variantClasses[variant],
|
|
39238
|
-
sizeClasses[size2],
|
|
39239
|
-
stateClasses[state],
|
|
39240
|
-
roundedClasses[rounded],
|
|
39241
|
-
className
|
|
39242
|
-
),
|
|
39243
|
-
...props
|
|
39244
|
-
},
|
|
39245
|
-
children
|
|
39246
|
-
);
|
|
39247
|
-
};
|
|
39248
|
-
const IconButton = ({
|
|
39249
|
-
variant = "secondary",
|
|
39250
|
-
size: size2 = "medium",
|
|
39251
|
-
busy,
|
|
39252
|
-
disabled,
|
|
39253
|
-
children,
|
|
39254
|
-
className,
|
|
39255
|
-
...props
|
|
39256
|
-
}) => {
|
|
39257
|
-
const baseClasses = "icon-parent inline-flex items-center border border-transparent text-sm font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out rounded-full";
|
|
39258
|
-
const variantClasses = {
|
|
39259
|
-
primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
|
|
39260
|
-
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
|
|
39261
|
-
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
|
|
39262
|
-
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
|
|
39263
|
-
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
|
|
39264
|
-
};
|
|
39265
|
-
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
39266
|
-
const stateClasses = {
|
|
39267
|
-
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
39268
|
-
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
39269
|
-
default: ``
|
|
39270
|
-
};
|
|
39271
|
-
const sizeClasses = {
|
|
39272
|
-
small: `h-7 w-7`,
|
|
39273
|
-
medium: `h-9 w-9`,
|
|
39274
|
-
custom: ``
|
|
39275
|
-
};
|
|
39276
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39277
|
-
"button",
|
|
39278
|
-
{
|
|
39279
|
-
className: cn$1(
|
|
39280
|
-
baseClasses,
|
|
39281
|
-
variantClasses[variant],
|
|
39282
|
-
sizeClasses[size2],
|
|
39283
|
-
stateClasses[state],
|
|
39284
|
-
className
|
|
39285
|
-
),
|
|
39286
|
-
...props
|
|
39287
|
-
},
|
|
39288
|
-
children
|
|
39289
|
-
);
|
|
39290
|
-
};
|
|
39291
|
-
function FontLoader() {
|
|
39292
|
-
React__namespace.useEffect(() => {
|
|
39293
|
-
const link = document.createElement("link");
|
|
39294
|
-
link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
|
|
39295
|
-
link.rel = "stylesheet";
|
|
39296
|
-
document.head.appendChild(link);
|
|
39297
|
-
return () => {
|
|
39298
|
-
document.head.removeChild(link);
|
|
39299
|
-
};
|
|
39300
|
-
}, []);
|
|
39301
|
-
return null;
|
|
39302
|
-
}
|
|
39303
|
-
function classNames(...classes) {
|
|
39304
|
-
return classes.filter(Boolean).join(" ");
|
|
39305
|
-
}
|
|
39306
|
-
const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
|
|
39307
|
-
const [open, setOpen] = React.useState(false);
|
|
39308
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(
|
|
39309
|
-
PopoverPrimitive__namespace.Trigger,
|
|
39310
|
-
{
|
|
39311
|
-
className: `cursor-pointer relative justify-center inline-flex items-center p-3 text-sm font-medium focus:outline-1 focus:outline-blue-200 pointer-events-auto ${open ? `text-blue-400` : `text-gray-300 hover:text-blue-500`} ${className}}`
|
|
39312
|
-
},
|
|
39313
|
-
/* @__PURE__ */ React.createElement(
|
|
39314
|
-
"svg",
|
|
39315
|
-
{
|
|
39316
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39317
|
-
className: "h-5 w-5",
|
|
39318
|
-
fill: "none",
|
|
39319
|
-
viewBox: "0 0 24 24",
|
|
39320
|
-
stroke: "currentColor"
|
|
39321
|
-
},
|
|
39322
|
-
/* @__PURE__ */ React.createElement(
|
|
39323
|
-
"path",
|
|
39324
|
-
{
|
|
39325
|
-
strokeLinecap: "round",
|
|
39326
|
-
strokeLinejoin: "round",
|
|
39327
|
-
strokeWidth: 2,
|
|
39328
|
-
d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
|
|
39329
|
-
}
|
|
39330
|
-
)
|
|
39331
|
-
)
|
|
39332
|
-
), /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
|
|
39333
|
-
return /* @__PURE__ */ React.createElement(
|
|
39334
|
-
"span",
|
|
39335
|
-
{
|
|
39336
|
-
"data-test": `${toolbarItem.name}OverflowButton`,
|
|
39337
|
-
key: toolbarItem.name,
|
|
39338
|
-
onMouseDown: (event) => {
|
|
39339
|
-
event.preventDefault();
|
|
39340
|
-
toolbarItem.onMouseDown(event);
|
|
39341
|
-
setOpen(false);
|
|
39342
|
-
},
|
|
39343
|
-
className: classNames(
|
|
39344
|
-
toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
|
|
39345
|
-
"hover:bg-gray-50 hover:text-blue-500 cursor-pointer pointer-events-auto px-4 py-2 text-sm w-full flex items-center whitespace-nowrap",
|
|
39346
|
-
toolbarItem.className ?? ""
|
|
39347
|
-
)
|
|
39348
|
-
},
|
|
39349
|
-
/* @__PURE__ */ React.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
|
|
39350
|
-
" ",
|
|
39351
|
-
toolbarItem.label
|
|
39352
|
-
);
|
|
39353
|
-
}))))));
|
|
39354
|
-
};
|
|
39355
|
-
function BsArrowRightShort(props) {
|
|
39356
|
-
return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8" }, "child": [] }] })(props);
|
|
39357
|
-
}
|
|
39358
|
-
function BsCheckCircleFill(props) {
|
|
39359
|
-
return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }, "child": [] }] })(props);
|
|
39360
|
-
}
|
|
39361
|
-
function BsExclamationOctagonFill(props) {
|
|
39362
|
-
return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2" }, "child": [] }] })(props);
|
|
39363
|
-
}
|
|
39364
|
-
const MessageIcon = ({
|
|
39365
|
-
type = "success",
|
|
39366
|
-
className = ""
|
|
39367
|
-
}) => {
|
|
39368
|
-
const icons = {
|
|
39369
|
-
success: BiCheckCircle,
|
|
39370
|
-
warning: BiError,
|
|
39371
|
-
error: BiError,
|
|
39372
|
-
info: BiInfoCircle
|
|
39373
|
-
};
|
|
39374
|
-
const Icon = icons[type];
|
|
39375
|
-
return /* @__PURE__ */ React.createElement(Icon, { className });
|
|
39376
|
-
};
|
|
39377
|
-
const Message = ({
|
|
39378
|
-
children,
|
|
39379
|
-
type = "success",
|
|
39380
|
-
size: size2 = "medium",
|
|
39381
|
-
className = "",
|
|
39382
|
-
link,
|
|
39383
|
-
linkLabel = "Learn More"
|
|
39384
|
-
}) => {
|
|
39385
|
-
const containerClasses = {
|
|
39386
|
-
success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
|
|
39387
|
-
warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
|
|
39388
|
-
error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
|
|
39389
|
-
info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
|
|
39390
|
-
};
|
|
39391
|
-
const textClasses = {
|
|
39392
|
-
success: "text-green-700",
|
|
39393
|
-
warning: "text-yellow-700",
|
|
39394
|
-
error: "text-red-700",
|
|
39395
|
-
info: "text-blue-700"
|
|
39396
|
-
};
|
|
39397
|
-
const iconClasses = {
|
|
39398
|
-
success: "text-green-400",
|
|
39399
|
-
warning: "text-yellow-400",
|
|
39400
|
-
error: "text-red-400",
|
|
39401
|
-
info: "text-blue-400"
|
|
39402
|
-
};
|
|
39403
|
-
const sizeClasses = {
|
|
39404
|
-
small: "px-3 py-1.5 text-xs",
|
|
39405
|
-
medium: "px-4 py-2.5 text-sm"
|
|
39406
|
-
};
|
|
39407
|
-
return /* @__PURE__ */ React.createElement(
|
|
39408
|
-
"div",
|
|
39409
|
-
{
|
|
39410
|
-
className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
|
|
39411
|
-
},
|
|
39412
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
|
|
39413
|
-
MessageIcon,
|
|
39414
|
-
{
|
|
39415
|
-
type,
|
|
39416
|
-
className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
39417
|
-
}
|
|
39418
|
-
), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React.createElement(
|
|
39419
|
-
"a",
|
|
39420
|
-
{
|
|
39421
|
-
href: link,
|
|
39422
|
-
target: "_blank",
|
|
39423
|
-
className: "flex-shrink-0 flex items-center gap-1 text-blue-600 underline decoration-blue-200 hover:text-blue-500 hover:decoration-blue-500 transition-all ease-out duration-150"
|
|
39424
|
-
},
|
|
39425
|
-
linkLabel,
|
|
39426
|
-
" ",
|
|
39427
|
-
/* @__PURE__ */ React.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
|
|
39428
|
-
))
|
|
39429
|
-
);
|
|
39430
|
-
};
|
|
39431
|
-
function cn(...inputs) {
|
|
39432
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
39433
|
-
}
|
|
39434
|
-
function DropdownMenu({
|
|
39435
|
-
...props
|
|
39436
|
-
}) {
|
|
39437
|
-
return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Root, { "data-slot": "dropdown-menu", ...props });
|
|
39438
|
-
}
|
|
39439
|
-
function DropdownMenuTrigger({
|
|
39440
|
-
...props
|
|
39441
|
-
}) {
|
|
39442
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39443
|
-
DropdownMenuPrimitive__namespace.Trigger,
|
|
39444
|
-
{
|
|
39445
|
-
"data-slot": "dropdown-menu-trigger",
|
|
39446
|
-
...props
|
|
39447
|
-
}
|
|
39448
|
-
);
|
|
39449
|
-
}
|
|
39450
|
-
function DropdownMenuContent({
|
|
39451
|
-
className,
|
|
39452
|
-
sideOffset = 4,
|
|
39453
|
-
...props
|
|
39454
|
-
}) {
|
|
39455
|
-
return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
|
|
39456
|
-
DropdownMenuPrimitive__namespace.Content,
|
|
39596
|
+
}
|
|
39597
|
+
}
|
|
39598
|
+
))
|
|
39599
|
+
)), labels && /* @__PURE__ */ React__namespace.createElement(
|
|
39600
|
+
"span",
|
|
39457
39601
|
{
|
|
39458
|
-
"
|
|
39459
|
-
|
|
39460
|
-
|
|
39461
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-base max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
39462
|
-
className
|
|
39463
|
-
),
|
|
39464
|
-
...props
|
|
39465
|
-
}
|
|
39602
|
+
className: `text-sm ${checked ? "text-blue-500 font-bold" : "text-gray-300"}`
|
|
39603
|
+
},
|
|
39604
|
+
labels.true
|
|
39466
39605
|
));
|
|
39467
|
-
}
|
|
39468
|
-
|
|
39469
|
-
className,
|
|
39470
|
-
inset,
|
|
39471
|
-
variant = "default",
|
|
39472
|
-
...props
|
|
39473
|
-
}) {
|
|
39606
|
+
};
|
|
39607
|
+
const ToggleInput = ({ disabled, ...props }) => {
|
|
39474
39608
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
39475
|
-
|
|
39609
|
+
"input",
|
|
39476
39610
|
{
|
|
39477
|
-
|
|
39478
|
-
"data-inset": inset,
|
|
39479
|
-
"data-variant": variant,
|
|
39480
|
-
className: cn(
|
|
39481
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer text-gray-700 hover:text-blue-500",
|
|
39482
|
-
className
|
|
39483
|
-
),
|
|
39611
|
+
className: `absolute left-0 top-0 w-12 h-8 opacity-0 m-0 ${disabled ? `cursor-not-allowed pointer-events-none` : `cursor-pointer z-20`}`,
|
|
39484
39612
|
...props
|
|
39485
39613
|
}
|
|
39486
39614
|
);
|
|
39615
|
+
};
|
|
39616
|
+
function MdCheckCircle(props) {
|
|
39617
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }, "child": [] }] })(props);
|
|
39487
39618
|
}
|
|
39488
|
-
function
|
|
39489
|
-
|
|
39490
|
-
|
|
39491
|
-
|
|
39492
|
-
return
|
|
39493
|
-
|
|
39494
|
-
|
|
39495
|
-
|
|
39496
|
-
|
|
39497
|
-
|
|
39619
|
+
function MdInfo(props) {
|
|
39620
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }, "child": [] }] })(props);
|
|
39621
|
+
}
|
|
39622
|
+
function MdError(props) {
|
|
39623
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }, "child": [] }] })(props);
|
|
39624
|
+
}
|
|
39625
|
+
function MdWarning(props) {
|
|
39626
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }, "child": [] }] })(props);
|
|
39627
|
+
}
|
|
39628
|
+
function MdVpnKey(props) {
|
|
39629
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12.65 10A5.99 5.99 0 0 0 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6a5.99 5.99 0 0 0 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
|
|
39630
|
+
}
|
|
39631
|
+
function MdAccessTime(props) {
|
|
39632
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" }, "child": [] }] })(props);
|
|
39633
|
+
}
|
|
39634
|
+
function MdKeyboardArrowDown(props) {
|
|
39635
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" }, "child": [] }] })(props);
|
|
39636
|
+
}
|
|
39637
|
+
function MdArrowForward(props) {
|
|
39638
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }, "child": [] }] })(props);
|
|
39639
|
+
}
|
|
39640
|
+
function MdSyncProblem(props) {
|
|
39641
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M3 12c0 2.21.91 4.2 2.36 5.64L3 20h6v-6l-2.24 2.24A6.003 6.003 0 0 1 5 12a5.99 5.99 0 0 1 4-5.65V4.26C5.55 5.15 3 8.27 3 12zm8 5h2v-2h-2v2zM21 4h-6v6l2.24-2.24A6.003 6.003 0 0 1 19 12a5.99 5.99 0 0 1-4 5.65v2.09c3.45-.89 6-4.01 6-7.74 0-2.21-.91-4.2-2.36-5.64L21 4zm-10 9h2V7h-2v6z" }, "child": [] }] })(props);
|
|
39642
|
+
}
|
|
39643
|
+
function MdWifiOff(props) {
|
|
39644
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 0 0-4.49-2.56l3.53 3.53.96-.97zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 0 0 5 13v.01L6.99 15a7.042 7.042 0 0 1 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 0 0-6 0z" }, "child": [] }] })(props);
|
|
39645
|
+
}
|
|
39646
|
+
function MdOutlineHelpOutline(props) {
|
|
39647
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" }, "child": [] }] })(props);
|
|
39648
|
+
}
|
|
39649
|
+
function MdOutlineSettings(props) {
|
|
39650
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.566.566 0 0 0-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
|
|
39651
|
+
}
|
|
39652
|
+
function MdOutlineClear(props) {
|
|
39653
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }, "child": [] }] })(props);
|
|
39654
|
+
}
|
|
39655
|
+
function MdOutlineDataSaverOff(props) {
|
|
39656
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M13 2.05v3.03c3.39.49 6 3.39 6 6.92 0 .9-.18 1.75-.48 2.54l2.6 1.53c.56-1.24.88-2.62.88-4.07 0-5.18-3.95-9.45-9-9.95zM12 19c-3.87 0-7-3.13-7-7 0-3.53 2.61-6.43 6-6.92V2.05c-5.06.5-9 4.76-9 9.95 0 5.52 4.47 10 9.99 10 3.31 0 6.24-1.61 8.06-4.09l-2.6-1.53A6.95 6.95 0 0 1 12 19z" }, "child": [] }] })(props);
|
|
39657
|
+
}
|
|
39658
|
+
function MdOutlineCloud(props) {
|
|
39659
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0 1 22 15c0 1.65-1.35 3-3 3H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0 1 12 6m0-2C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96A7.49 7.49 0 0 0 12 4z" }, "child": [] }] })(props);
|
|
39660
|
+
}
|
|
39661
|
+
function MdOutlinePhotoLibrary(props) {
|
|
39662
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z" }, "child": [] }] })(props);
|
|
39663
|
+
}
|
|
39664
|
+
function MdOutlinePerson(props) {
|
|
39665
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }, "child": [] }] })(props);
|
|
39666
|
+
}
|
|
39667
|
+
const selectFieldClasses = "shadow appearance-none h-full bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded";
|
|
39668
|
+
const Select = ({
|
|
39669
|
+
input,
|
|
39670
|
+
field,
|
|
39671
|
+
options,
|
|
39672
|
+
className = ""
|
|
39673
|
+
}) => {
|
|
39674
|
+
const selectOptions = options || field.options;
|
|
39675
|
+
const ref = React__namespace.useRef(null);
|
|
39676
|
+
React__namespace.useEffect(() => {
|
|
39677
|
+
if (ref.current && (field == null ? void 0 : field.experimental_focusIntent)) {
|
|
39678
|
+
ref.current.focus();
|
|
39498
39679
|
}
|
|
39499
|
-
);
|
|
39680
|
+
}, [field == null ? void 0 : field.experimental_focusIntent, ref]);
|
|
39681
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group w-full h-full md:w-auto" }, /* @__PURE__ */ React__namespace.createElement(
|
|
39682
|
+
"select",
|
|
39683
|
+
{
|
|
39684
|
+
id: input.name,
|
|
39685
|
+
ref,
|
|
39686
|
+
value: input.value,
|
|
39687
|
+
onChange: input.onChange,
|
|
39688
|
+
className: `${selectFieldClasses} ${input.value ? "text-gray-700" : "text-gray-300"} } ${className}`,
|
|
39689
|
+
...input
|
|
39690
|
+
},
|
|
39691
|
+
selectOptions ? selectOptions.map(toProps$1).map(toComponent) : /* @__PURE__ */ React__namespace.createElement("option", null, input.value)
|
|
39692
|
+
), /* @__PURE__ */ React__namespace.createElement(MdKeyboardArrowDown, { className: "absolute top-1/2 right-2 w-6 h-auto -translate-y-1/2 text-gray-300 group-hover:text-blue-500 transition duration-150 ease-out pointer-events-none" }));
|
|
39693
|
+
};
|
|
39694
|
+
function toProps$1(option) {
|
|
39695
|
+
if (typeof option === "object")
|
|
39696
|
+
return option;
|
|
39697
|
+
return { value: option, label: option };
|
|
39500
39698
|
}
|
|
39501
|
-
|
|
39502
|
-
({
|
|
39503
|
-
|
|
39504
|
-
|
|
39505
|
-
|
|
39506
|
-
|
|
39507
|
-
|
|
39508
|
-
|
|
39509
|
-
|
|
39510
|
-
|
|
39511
|
-
|
|
39512
|
-
|
|
39699
|
+
function toComponent(option) {
|
|
39700
|
+
return /* @__PURE__ */ React__namespace.createElement("option", { key: option.value, value: option.value }, option.label);
|
|
39701
|
+
}
|
|
39702
|
+
const RadioGroup = ({
|
|
39703
|
+
input,
|
|
39704
|
+
field,
|
|
39705
|
+
options
|
|
39706
|
+
}) => {
|
|
39707
|
+
const radioOptions = options || field.options;
|
|
39708
|
+
const radioRefs = {};
|
|
39709
|
+
const toProps2 = (option) => {
|
|
39710
|
+
if (typeof option === "object")
|
|
39711
|
+
return option;
|
|
39712
|
+
return { value: option, label: option };
|
|
39713
|
+
};
|
|
39714
|
+
const toComponent2 = (option) => {
|
|
39715
|
+
const optionId = `field-${field.name}-option-${option.value}`;
|
|
39716
|
+
const checked = option.value === input.value;
|
|
39717
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
39718
|
+
"div",
|
|
39719
|
+
{
|
|
39720
|
+
key: option.value,
|
|
39721
|
+
ref: (ref) => {
|
|
39722
|
+
radioRefs[`radio_${option.value}`] = ref;
|
|
39723
|
+
}
|
|
39724
|
+
},
|
|
39725
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
39726
|
+
"input",
|
|
39727
|
+
{
|
|
39728
|
+
className: "absolute w-0 h-0 opacity-0 cursor-pointer",
|
|
39729
|
+
type: "radio",
|
|
39730
|
+
id: optionId,
|
|
39731
|
+
name: input.name,
|
|
39732
|
+
value: option.value,
|
|
39733
|
+
onChange: (event) => {
|
|
39734
|
+
input.onChange(event.target.value);
|
|
39735
|
+
},
|
|
39736
|
+
checked
|
|
39737
|
+
}
|
|
39738
|
+
),
|
|
39739
|
+
/* @__PURE__ */ React__namespace.createElement(RadioOption, { htmlFor: optionId, checked }, option.label)
|
|
39740
|
+
);
|
|
39741
|
+
};
|
|
39742
|
+
return /* @__PURE__ */ React__namespace.createElement(RadioOptions, { id: input.name, direction: field.direction }, radioOptions ? radioOptions.map(toProps2).map(toComponent2) : input.value);
|
|
39743
|
+
};
|
|
39744
|
+
const RadioOptions = ({ direction: direction2, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39745
|
+
"div",
|
|
39746
|
+
{
|
|
39747
|
+
className: `flex w-full ${direction2 === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
|
|
39513
39748
|
...props
|
|
39514
|
-
},
|
|
39515
|
-
|
|
39516
|
-
|
|
39517
|
-
|
|
39518
|
-
|
|
39749
|
+
},
|
|
39750
|
+
children
|
|
39751
|
+
);
|
|
39752
|
+
const RadioOption = ({ checked, htmlFor, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39753
|
+
"label",
|
|
39754
|
+
{
|
|
39755
|
+
className: "cursor-pointer flex group items-center gap-2",
|
|
39756
|
+
htmlFor,
|
|
39757
|
+
...props
|
|
39758
|
+
},
|
|
39759
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
39760
|
+
"span",
|
|
39761
|
+
{
|
|
39762
|
+
className: `relative h-[19px] w-[19px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
|
|
39763
|
+
},
|
|
39764
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
39765
|
+
BiCheck,
|
|
39766
|
+
{
|
|
39767
|
+
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
|
|
39768
|
+
}
|
|
39769
|
+
)
|
|
39770
|
+
),
|
|
39771
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
39772
|
+
"span",
|
|
39773
|
+
{
|
|
39774
|
+
className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
|
|
39775
|
+
},
|
|
39776
|
+
children
|
|
39777
|
+
)
|
|
39778
|
+
);
|
|
39779
|
+
const CheckboxGroup = ({
|
|
39780
|
+
input,
|
|
39781
|
+
field,
|
|
39782
|
+
options,
|
|
39783
|
+
disabled = false
|
|
39784
|
+
}) => {
|
|
39785
|
+
const checkboxOptions = options || field.options;
|
|
39786
|
+
const toProps2 = (option) => {
|
|
39787
|
+
if (typeof option === "object")
|
|
39788
|
+
return option;
|
|
39789
|
+
return { value: option, label: option };
|
|
39790
|
+
};
|
|
39791
|
+
const toComponent2 = (option) => {
|
|
39792
|
+
const optionId = `field-${field.name}-option-${option.value}`;
|
|
39793
|
+
const checked = input.value ? input.value.includes(option.value) : false;
|
|
39794
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { key: option.value }, /* @__PURE__ */ React__namespace.createElement(
|
|
39795
|
+
"input",
|
|
39796
|
+
{
|
|
39797
|
+
className: "absolute w-0 h-0 opacity-0 cursor-pointer",
|
|
39798
|
+
type: "checkbox",
|
|
39799
|
+
name: input.name,
|
|
39800
|
+
id: optionId,
|
|
39801
|
+
value: option.value,
|
|
39802
|
+
checked,
|
|
39803
|
+
disabled,
|
|
39804
|
+
onChange: (event) => {
|
|
39805
|
+
if (event.target.checked === true) {
|
|
39806
|
+
input.onChange([...input.value, event.target.value]);
|
|
39807
|
+
} else {
|
|
39808
|
+
input.onChange([
|
|
39809
|
+
...input.value.filter((v) => v !== event.target.value)
|
|
39810
|
+
]);
|
|
39811
|
+
}
|
|
39812
|
+
}
|
|
39813
|
+
}
|
|
39814
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
39815
|
+
"label",
|
|
39816
|
+
{
|
|
39817
|
+
className: "cursor-pointer flex group items-center gap-2",
|
|
39818
|
+
htmlFor: optionId
|
|
39819
|
+
},
|
|
39820
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
39821
|
+
"span",
|
|
39519
39822
|
{
|
|
39520
|
-
|
|
39521
|
-
size: size2,
|
|
39522
|
-
busy,
|
|
39523
|
-
disabled,
|
|
39524
|
-
rounded,
|
|
39525
|
-
className: cn$1("gap-2", className),
|
|
39526
|
-
...props
|
|
39823
|
+
className: `relative h-[18px] w-[18px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
|
|
39527
39824
|
},
|
|
39528
|
-
children,
|
|
39529
39825
|
/* @__PURE__ */ React__namespace.createElement(
|
|
39530
|
-
|
|
39826
|
+
BiCheck,
|
|
39531
39827
|
{
|
|
39532
|
-
className:
|
|
39533
|
-
"h-4 w-4 transition-transform duration-200",
|
|
39534
|
-
open && "rotate-180"
|
|
39535
|
-
)
|
|
39828
|
+
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
|
|
39536
39829
|
}
|
|
39537
39830
|
)
|
|
39538
|
-
)
|
|
39539
|
-
DropdownMenuItem,
|
|
39540
|
-
{
|
|
39541
|
-
key: index,
|
|
39542
|
-
onClick: item.onClick,
|
|
39543
|
-
disabled: item.disabled,
|
|
39544
|
-
variant: item.variant
|
|
39545
|
-
},
|
|
39546
|
-
item.icon && item.icon,
|
|
39547
|
-
item.label
|
|
39548
|
-
))));
|
|
39549
|
-
}
|
|
39550
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React__namespace.createElement(
|
|
39551
|
-
Button$1,
|
|
39552
|
-
{
|
|
39553
|
-
variant,
|
|
39554
|
-
size: size2,
|
|
39555
|
-
busy,
|
|
39556
|
-
disabled,
|
|
39557
|
-
rounded: "left",
|
|
39558
|
-
onClick: onMainAction,
|
|
39559
|
-
className: "border-r-0 w-full",
|
|
39560
|
-
...props
|
|
39561
|
-
},
|
|
39562
|
-
children
|
|
39563
|
-
), /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React__namespace.createElement(
|
|
39564
|
-
Button$1,
|
|
39565
|
-
{
|
|
39566
|
-
variant,
|
|
39567
|
-
size: size2,
|
|
39568
|
-
busy,
|
|
39569
|
-
disabled,
|
|
39570
|
-
rounded: "right",
|
|
39571
|
-
className: "px-4 border-l",
|
|
39572
|
-
style: { borderColor: "#00000030" },
|
|
39573
|
-
"aria-label": "More options"
|
|
39574
|
-
},
|
|
39831
|
+
),
|
|
39575
39832
|
/* @__PURE__ */ React__namespace.createElement(
|
|
39576
|
-
|
|
39577
|
-
{
|
|
39578
|
-
className: cn$1(
|
|
39579
|
-
"h-4 w-4 transition-transform duration-200 fill-none",
|
|
39580
|
-
open && "rotate-180"
|
|
39581
|
-
),
|
|
39582
|
-
style: { fill: "none" }
|
|
39583
|
-
}
|
|
39584
|
-
)
|
|
39585
|
-
)), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
|
|
39586
|
-
var _a2;
|
|
39587
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: index }, /* @__PURE__ */ React__namespace.createElement(
|
|
39588
|
-
DropdownMenuItem,
|
|
39833
|
+
"span",
|
|
39589
39834
|
{
|
|
39590
|
-
|
|
39591
|
-
disabled: item.disabled,
|
|
39592
|
-
variant: item.variant
|
|
39835
|
+
className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
|
|
39593
39836
|
},
|
|
39594
|
-
|
|
39595
|
-
|
|
39596
|
-
|
|
39597
|
-
|
|
39837
|
+
option.label
|
|
39838
|
+
)
|
|
39839
|
+
));
|
|
39840
|
+
};
|
|
39841
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
39842
|
+
"div",
|
|
39843
|
+
{
|
|
39844
|
+
className: `flex w-full ${field.direction === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
|
|
39845
|
+
id: input.name
|
|
39846
|
+
},
|
|
39847
|
+
checkboxOptions == null ? void 0 : checkboxOptions.map(toProps2).map(toComponent2)
|
|
39848
|
+
);
|
|
39849
|
+
};
|
|
39850
|
+
const Input = ({ ...props }) => {
|
|
39851
|
+
return /* @__PURE__ */ React.createElement("input", { className: textFieldClasses, ...props });
|
|
39852
|
+
};
|
|
39853
|
+
const NumberInput = ({
|
|
39854
|
+
onChange,
|
|
39855
|
+
value,
|
|
39856
|
+
step
|
|
39857
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
39858
|
+
Input,
|
|
39859
|
+
{
|
|
39860
|
+
type: "number",
|
|
39861
|
+
step,
|
|
39862
|
+
value,
|
|
39863
|
+
onChange: (event) => {
|
|
39864
|
+
const inputValue = event.target.value;
|
|
39865
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
39866
|
+
if (onChange) {
|
|
39867
|
+
const syntheticEvent = {
|
|
39868
|
+
...event,
|
|
39869
|
+
target: {
|
|
39870
|
+
...event.target,
|
|
39871
|
+
value: newValue
|
|
39872
|
+
}
|
|
39873
|
+
};
|
|
39874
|
+
onChange(syntheticEvent);
|
|
39875
|
+
}
|
|
39876
|
+
}
|
|
39598
39877
|
}
|
|
39599
39878
|
);
|
|
39600
|
-
DropdownButton.displayName = "DropdownButton";
|
|
39601
39879
|
function useCMS() {
|
|
39602
39880
|
return useCMS$1();
|
|
39603
39881
|
}
|
|
@@ -40292,19 +40570,25 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40292
40570
|
/* @__PURE__ */ React.createElement(AddIcon, { className: "w-5/6 h-auto" })
|
|
40293
40571
|
)
|
|
40294
40572
|
},
|
|
40295
|
-
/* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
40296
|
-
|
|
40573
|
+
/* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React.createElement(EmptyList, null), /* @__PURE__ */ React.createElement(
|
|
40574
|
+
SortableProvider,
|
|
40297
40575
|
{
|
|
40298
|
-
|
|
40299
|
-
|
|
40300
|
-
|
|
40301
|
-
|
|
40302
|
-
|
|
40303
|
-
|
|
40304
|
-
|
|
40305
|
-
|
|
40306
|
-
|
|
40307
|
-
|
|
40576
|
+
items: items2.map((_, index2) => `${field.name}.${index2}`)
|
|
40577
|
+
},
|
|
40578
|
+
items2.map((item, index2) => /* @__PURE__ */ React.createElement(
|
|
40579
|
+
Item$2,
|
|
40580
|
+
{
|
|
40581
|
+
key: index2,
|
|
40582
|
+
tinaForm,
|
|
40583
|
+
field,
|
|
40584
|
+
item,
|
|
40585
|
+
index: index2,
|
|
40586
|
+
isMin,
|
|
40587
|
+
fixedLength,
|
|
40588
|
+
...itemProps(item)
|
|
40589
|
+
}
|
|
40590
|
+
))
|
|
40591
|
+
), provider.placeholder))))
|
|
40308
40592
|
);
|
|
40309
40593
|
};
|
|
40310
40594
|
const Item$2 = ({
|
|
@@ -40324,14 +40608,20 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40324
40608
|
const title = label || `${field.label || field.name} Item`;
|
|
40325
40609
|
const { dispatch: setHoveredField } = useEvent("field:hover");
|
|
40326
40610
|
const { dispatch: setFocusedField } = useEvent("field:focus");
|
|
40327
|
-
return /* @__PURE__ */ React.createElement(
|
|
40611
|
+
return /* @__PURE__ */ React.createElement(Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
40328
40612
|
ItemHeader,
|
|
40329
40613
|
{
|
|
40330
40614
|
provider,
|
|
40331
40615
|
isDragging: snapshot.isDragging,
|
|
40332
40616
|
...p2
|
|
40333
40617
|
},
|
|
40334
|
-
/* @__PURE__ */ React.createElement(
|
|
40618
|
+
/* @__PURE__ */ React.createElement(
|
|
40619
|
+
DragHandle,
|
|
40620
|
+
{
|
|
40621
|
+
isDragging: snapshot.isDragging,
|
|
40622
|
+
dragHandleProps: provider.dragHandleProps
|
|
40623
|
+
}
|
|
40624
|
+
),
|
|
40335
40625
|
/* @__PURE__ */ React.createElement(
|
|
40336
40626
|
ItemClickTarget,
|
|
40337
40627
|
{
|
|
@@ -40395,17 +40685,16 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40395
40685
|
provider,
|
|
40396
40686
|
...props
|
|
40397
40687
|
}) => {
|
|
40688
|
+
var _a2, _b;
|
|
40398
40689
|
return /* @__PURE__ */ React.createElement(
|
|
40399
40690
|
"div",
|
|
40400
40691
|
{
|
|
40401
|
-
ref: provider.
|
|
40692
|
+
ref: (_a2 = provider.draggableProps) == null ? void 0 : _a2.ref,
|
|
40402
40693
|
...provider.draggableProps,
|
|
40403
|
-
...provider.dragHandleProps,
|
|
40404
40694
|
...props,
|
|
40405
40695
|
className: `relative group cursor-pointer flex justify-between items-stretch bg-white border border-gray-100 -mb-px overflow-visible p-0 text-sm font-normal ${isDragging ? "rounded shadow text-blue-600" : "text-gray-600 first:rounded-t last:rounded-b"} ${props.className ?? ""}`,
|
|
40406
40696
|
style: {
|
|
40407
|
-
...provider.draggableProps.style ?? {},
|
|
40408
|
-
...provider.dragHandleProps.style ?? {},
|
|
40697
|
+
...((_b = provider.draggableProps) == null ? void 0 : _b.style) ?? {},
|
|
40409
40698
|
...props.style ?? {}
|
|
40410
40699
|
}
|
|
40411
40700
|
},
|
|
@@ -40423,10 +40712,14 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40423
40712
|
/* @__PURE__ */ React.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
40424
40713
|
);
|
|
40425
40714
|
};
|
|
40426
|
-
const DragHandle = ({
|
|
40715
|
+
const DragHandle = ({
|
|
40716
|
+
isDragging,
|
|
40717
|
+
dragHandleProps
|
|
40718
|
+
}) => {
|
|
40427
40719
|
return /* @__PURE__ */ React.createElement(
|
|
40428
40720
|
"div",
|
|
40429
40721
|
{
|
|
40722
|
+
...dragHandleProps,
|
|
40430
40723
|
className: `relative w-8 px-1 py-2.5 flex items-center justify-center hover:bg-gray-50 group cursor-[grab] ${isDragging ? `text-blue-500` : `text-gray-200 hover:text-gray-600`}`
|
|
40431
40724
|
},
|
|
40432
40725
|
isDragging ? /* @__PURE__ */ React.createElement(ReorderIcon, { className: "fill-current w-7 h-auto" }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DragIcon, { className: "fill-current w-7 h-auto group-hover:opacity-0 transition-opacity duration-150 ease-out" }), /* @__PURE__ */ React.createElement(ReorderIcon, { className: "fill-current w-7 h-auto absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-out" }))
|
|
@@ -40878,39 +41171,45 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40878
41171
|
}
|
|
40879
41172
|
))
|
|
40880
41173
|
},
|
|
40881
|
-
/* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement(
|
|
40882
|
-
|
|
40883
|
-
|
|
41174
|
+
/* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__namespace.createElement("div", { ref: provider.innerRef, className: "edit-page--list-parent" }, items2.length === 0 && /* @__PURE__ */ React__namespace.createElement(EmptyList, null), /* @__PURE__ */ React__namespace.createElement(
|
|
41175
|
+
SortableProvider,
|
|
41176
|
+
{
|
|
41177
|
+
items: items2.map((_, index2) => `${field.name}.${index2}`)
|
|
41178
|
+
},
|
|
41179
|
+
items2.map((block2, index2) => {
|
|
41180
|
+
const template = field.templates[block2._template];
|
|
41181
|
+
if (!template) {
|
|
41182
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
41183
|
+
InvalidBlockListItem,
|
|
41184
|
+
{
|
|
41185
|
+
key: index2,
|
|
41186
|
+
index: index2,
|
|
41187
|
+
field,
|
|
41188
|
+
tinaForm
|
|
41189
|
+
}
|
|
41190
|
+
);
|
|
41191
|
+
}
|
|
41192
|
+
const itemProps = (item) => {
|
|
41193
|
+
if (!template.itemProps)
|
|
41194
|
+
return {};
|
|
41195
|
+
return template.itemProps(item);
|
|
41196
|
+
};
|
|
40884
41197
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
40885
|
-
|
|
41198
|
+
BlockListItem,
|
|
40886
41199
|
{
|
|
40887
41200
|
key: index2,
|
|
41201
|
+
block: block2,
|
|
41202
|
+
template,
|
|
40888
41203
|
index: index2,
|
|
40889
41204
|
field,
|
|
40890
|
-
tinaForm
|
|
41205
|
+
tinaForm,
|
|
41206
|
+
isMin,
|
|
41207
|
+
fixedLength,
|
|
41208
|
+
...itemProps(block2)
|
|
40891
41209
|
}
|
|
40892
41210
|
);
|
|
40893
|
-
}
|
|
40894
|
-
|
|
40895
|
-
if (!template.itemProps)
|
|
40896
|
-
return {};
|
|
40897
|
-
return template.itemProps(item);
|
|
40898
|
-
};
|
|
40899
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
40900
|
-
BlockListItem,
|
|
40901
|
-
{
|
|
40902
|
-
key: index2,
|
|
40903
|
-
block: block2,
|
|
40904
|
-
template,
|
|
40905
|
-
index: index2,
|
|
40906
|
-
field,
|
|
40907
|
-
tinaForm,
|
|
40908
|
-
isMin,
|
|
40909
|
-
fixedLength,
|
|
40910
|
-
...itemProps(block2)
|
|
40911
|
-
}
|
|
40912
|
-
);
|
|
40913
|
-
}), provider.placeholder)))
|
|
41211
|
+
})
|
|
41212
|
+
), provider.placeholder)))
|
|
40914
41213
|
);
|
|
40915
41214
|
};
|
|
40916
41215
|
const BlockListItem = ({
|
|
@@ -40928,7 +41227,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40928
41227
|
}, [tinaForm, field, index]);
|
|
40929
41228
|
const { dispatch: setHoveredField } = useEvent("field:hover");
|
|
40930
41229
|
const { dispatch: setFocusedField } = useEvent("field:focus");
|
|
40931
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
41230
|
+
return /* @__PURE__ */ React__namespace.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React__namespace.createElement(
|
|
41231
|
+
DragHandle,
|
|
41232
|
+
{
|
|
41233
|
+
isDragging: snapshot.isDragging,
|
|
41234
|
+
dragHandleProps: provider.dragHandleProps
|
|
41235
|
+
}
|
|
41236
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
40932
41237
|
ItemClickTarget,
|
|
40933
41238
|
{
|
|
40934
41239
|
onClick: () => {
|
|
@@ -40969,7 +41274,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
40969
41274
|
const removeItem = React__namespace.useCallback(() => {
|
|
40970
41275
|
tinaForm.mutators.remove(field.name, index);
|
|
40971
41276
|
}, [tinaForm, field, index]);
|
|
40972
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
41277
|
+
return /* @__PURE__ */ React__namespace.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React__namespace.createElement(
|
|
41278
|
+
DragHandle,
|
|
41279
|
+
{
|
|
41280
|
+
isDragging: snapshot.isDragging,
|
|
41281
|
+
dragHandleProps: provider.dragHandleProps
|
|
41282
|
+
}
|
|
41283
|
+
), /* @__PURE__ */ React__namespace.createElement(ItemClickTarget, null, /* @__PURE__ */ React__namespace.createElement(GroupLabel, { error: true }, "Invalid Block")), /* @__PURE__ */ React__namespace.createElement(ItemDeleteButton, { onClick: removeItem })));
|
|
40973
41284
|
};
|
|
40974
41285
|
const BlocksField = Blocks;
|
|
40975
41286
|
const BlocksFieldPlugin = {
|
|
@@ -41036,19 +41347,25 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
41036
41347
|
tinaForm,
|
|
41037
41348
|
actions: (!fixedLength || fixedLength && !isMax) && /* @__PURE__ */ React__namespace.createElement(IconButton, { onClick: addItem, variant: "primary", size: "small" }, /* @__PURE__ */ React__namespace.createElement(AddIcon, { className: "w-5/6 h-auto" }))
|
|
41038
41349
|
},
|
|
41039
|
-
/* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(
|
|
41040
|
-
|
|
41350
|
+
/* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__namespace.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React__namespace.createElement(EmptyList, null), /* @__PURE__ */ React__namespace.createElement(
|
|
41351
|
+
SortableProvider,
|
|
41041
41352
|
{
|
|
41042
|
-
|
|
41043
|
-
|
|
41044
|
-
|
|
41045
|
-
|
|
41046
|
-
|
|
41047
|
-
|
|
41048
|
-
|
|
41049
|
-
|
|
41050
|
-
|
|
41051
|
-
|
|
41353
|
+
items: items2.map((_, index2) => `${field.name}.${index2}`)
|
|
41354
|
+
},
|
|
41355
|
+
items2.map((item, index2) => /* @__PURE__ */ React__namespace.createElement(
|
|
41356
|
+
Item$1,
|
|
41357
|
+
{
|
|
41358
|
+
key: index2,
|
|
41359
|
+
tinaForm,
|
|
41360
|
+
field,
|
|
41361
|
+
item,
|
|
41362
|
+
index: index2,
|
|
41363
|
+
isMin,
|
|
41364
|
+
fixedLength,
|
|
41365
|
+
...itemProps(item)
|
|
41366
|
+
}
|
|
41367
|
+
))
|
|
41368
|
+
), provider.placeholder))))
|
|
41052
41369
|
);
|
|
41053
41370
|
};
|
|
41054
41371
|
const Item$1 = ({
|
|
@@ -41074,7 +41391,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
41074
41391
|
name: `${field.name}.${index}`
|
|
41075
41392
|
}
|
|
41076
41393
|
];
|
|
41077
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
41394
|
+
return /* @__PURE__ */ React__namespace.createElement(Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging, ...p2 }, /* @__PURE__ */ React__namespace.createElement(
|
|
41395
|
+
DragHandle,
|
|
41396
|
+
{
|
|
41397
|
+
isDragging: snapshot.isDragging,
|
|
41398
|
+
dragHandleProps: provider.dragHandleProps
|
|
41399
|
+
}
|
|
41400
|
+
), /* @__PURE__ */ React__namespace.createElement(ItemClickTarget, null, /* @__PURE__ */ React__namespace.createElement(FieldsBuilder, { padding: false, form: tinaForm, fields })), (!fixedLength || fixedLength && !isMin) && /* @__PURE__ */ React__namespace.createElement(ItemDeleteButton, { disabled: isMin, onClick: removeItem })));
|
|
41078
41401
|
};
|
|
41079
41402
|
const ListField = List;
|
|
41080
41403
|
const ListFieldPlugin = {
|
|
@@ -42706,30 +43029,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
42706
43029
|
},
|
|
42707
43030
|
parse: parse$2
|
|
42708
43031
|
};
|
|
42709
|
-
function AiFillWarning(props) {
|
|
42710
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
|
|
42711
|
-
}
|
|
42712
|
-
function AiOutlineLoading(props) {
|
|
42713
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }, "child": [] }] })(props);
|
|
42714
|
-
}
|
|
42715
|
-
function FaCircle(props) {
|
|
42716
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" }, "child": [] }] })(props);
|
|
42717
|
-
}
|
|
42718
|
-
function FaFile(props) {
|
|
42719
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 384 512" }, "child": [{ "tag": "path", "attr": { "d": "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z" }, "child": [] }] })(props);
|
|
42720
|
-
}
|
|
42721
|
-
function FaFolder(props) {
|
|
42722
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z" }, "child": [] }] })(props);
|
|
42723
|
-
}
|
|
42724
|
-
function FaLock(props) {
|
|
42725
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" }, "child": [] }] })(props);
|
|
42726
|
-
}
|
|
42727
|
-
function FaSpinner(props) {
|
|
42728
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" }, "child": [] }] })(props);
|
|
42729
|
-
}
|
|
42730
|
-
function FaUnlock(props) {
|
|
42731
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
|
|
42732
|
-
}
|
|
42733
43032
|
function GrCircleQuestion(props) {
|
|
42734
43033
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
|
|
42735
43034
|
}
|
|
@@ -42981,6 +43280,38 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
42981
43280
|
" Create Branch"
|
|
42982
43281
|
)));
|
|
42983
43282
|
};
|
|
43283
|
+
const Badge = ({
|
|
43284
|
+
children,
|
|
43285
|
+
calloutStyle = "warning",
|
|
43286
|
+
className = "",
|
|
43287
|
+
displayIcon = true,
|
|
43288
|
+
...props
|
|
43289
|
+
}) => {
|
|
43290
|
+
const commonAlertStyles = "text-xs px-2 py-0.5 flex items-center rounded-md border";
|
|
43291
|
+
const styles = {
|
|
43292
|
+
warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
|
|
43293
|
+
info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
|
|
43294
|
+
success: `text-green-600 bg-green-100/50 border-green-600/20`,
|
|
43295
|
+
error: `text-red-700 bg-red-100/50 border-red-700/20`
|
|
43296
|
+
};
|
|
43297
|
+
const icon = {
|
|
43298
|
+
warning: /* @__PURE__ */ React__namespace.createElement(MdAccessTime, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-amber-600" }),
|
|
43299
|
+
info: /* @__PURE__ */ React__namespace.createElement(MdOutlineDataSaverOff, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-blue-600" }),
|
|
43300
|
+
success: /* @__PURE__ */ React__namespace.createElement(MdCheckCircle, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-green-600" }),
|
|
43301
|
+
error: /* @__PURE__ */ React__namespace.createElement(MdWifiOff, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-red-700" })
|
|
43302
|
+
};
|
|
43303
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
43304
|
+
"div",
|
|
43305
|
+
{
|
|
43306
|
+
className: cn$1(commonAlertStyles, styles[calloutStyle], className),
|
|
43307
|
+
...props
|
|
43308
|
+
},
|
|
43309
|
+
displayIcon && icon[calloutStyle],
|
|
43310
|
+
" ",
|
|
43311
|
+
children
|
|
43312
|
+
);
|
|
43313
|
+
};
|
|
43314
|
+
const tableHeadingStyle = "px-3 py-3 text-left text-xs font-bold text-gray-700 tracking-wider";
|
|
42984
43315
|
function formatBranchName(str) {
|
|
42985
43316
|
const pattern = /[^/\w-]+/g;
|
|
42986
43317
|
const formattedStr = str.replace(pattern, "-");
|
|
@@ -43224,7 +43555,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43224
43555
|
filter2
|
|
43225
43556
|
).sort(sortBranchListFn(sortValue));
|
|
43226
43557
|
const previewFunction = (_d = (_c = (_b = (_a2 = cms.api.tina.schema) == null ? void 0 : _a2.config) == null ? void 0 : _b.config) == null ? void 0 : _c.ui) == null ? void 0 : _d.previewUrl;
|
|
43227
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-
|
|
43558
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-stretch space-x-4" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(
|
|
43228
43559
|
"label",
|
|
43229
43560
|
{
|
|
43230
43561
|
htmlFor: "search",
|
|
@@ -43247,7 +43578,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43247
43578
|
className: "outline-none focus:outline-none bg-transparent border-0 p-0 m-0 absolute right-2.5 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 transition-all ease-out duration-150"
|
|
43248
43579
|
},
|
|
43249
43580
|
/* @__PURE__ */ React__namespace.createElement(MdOutlineClear, { className: "w-5 h-auto text-gray-600" })
|
|
43250
|
-
))), /* @__PURE__ */ React__namespace.createElement("div",
|
|
43581
|
+
))), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React__namespace.createElement(
|
|
43251
43582
|
"label",
|
|
43252
43583
|
{
|
|
43253
43584
|
htmlFor: "branch-type",
|
|
@@ -43275,7 +43606,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43275
43606
|
}
|
|
43276
43607
|
]
|
|
43277
43608
|
}
|
|
43278
|
-
))), filteredBranchList.length === 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "block relative text-gray-300 italic py-1" }, "No branches to display"), filteredBranchList.length > 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-[192px] max-h-[24rem] overflow-y-auto
|
|
43609
|
+
))), filteredBranchList.length === 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "block relative text-gray-300 italic py-1" }, "No branches to display"), filteredBranchList.length > 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-[192px] max-h-[24rem] overflow-y-auto w-full h-full rounded-lg shadow-inner bg-white border border-gray-200" }, /* @__PURE__ */ React__namespace.createElement("table", { className: "w-full" }, /* @__PURE__ */ React__namespace.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-200" }, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", { className: tableHeadingStyle }, "Branch Name"), /* @__PURE__ */ React__namespace.createElement("th", { className: tableHeadingStyle }, "Last Updated"), /* @__PURE__ */ React__namespace.createElement("th", null), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, filteredBranchList.map((branch) => /* @__PURE__ */ React__namespace.createElement(
|
|
43279
43610
|
BranchItem,
|
|
43280
43611
|
{
|
|
43281
43612
|
key: branch.name,
|
|
@@ -43286,7 +43617,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43286
43617
|
previewFunction,
|
|
43287
43618
|
cms
|
|
43288
43619
|
}
|
|
43289
|
-
))));
|
|
43620
|
+
))))));
|
|
43290
43621
|
};
|
|
43291
43622
|
const BranchItem = ({
|
|
43292
43623
|
branch,
|
|
@@ -43322,15 +43653,15 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43322
43653
|
const isCurrentBranch = branch.name === currentBranch;
|
|
43323
43654
|
const indexingStatus = (_a2 = branch == null ? void 0 : branch.indexStatus) == null ? void 0 : _a2.status;
|
|
43324
43655
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
43325
|
-
"
|
|
43656
|
+
"tr",
|
|
43326
43657
|
{
|
|
43327
|
-
className: `
|
|
43658
|
+
className: `text-base border-l-0 border-t-0 border-r-0 outline-none transition-all ease-out duration-150 ${indexingStatus !== "complete" ? "bg-gray-50 text-gray-400" : isCurrentBranch ? "bg-blue-50 text-blue-800 border-b-0" : "border-b-2 border-gray-50"}`
|
|
43328
43659
|
},
|
|
43329
|
-
/* @__PURE__ */ React__namespace.createElement("
|
|
43330
|
-
/* @__PURE__ */ React__namespace.createElement("
|
|
43660
|
+
/* @__PURE__ */ React__namespace.createElement("td", { className: "pl-3 pr-3 py-1.5 min-w-0" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1" }, branch.protected && /* @__PURE__ */ React__namespace.createElement(BiLock, { className: "w-5 h-auto opacity-70 text-blue-500 flex-shrink-0" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight truncate" }, branch.name)), indexingStatus !== "complete" && /* @__PURE__ */ React__namespace.createElement("div", { className: "w-fit mt-1" }, /* @__PURE__ */ React__namespace.createElement(IndexStatus, { indexingStatus: branch.indexStatus.status })))),
|
|
43661
|
+
/* @__PURE__ */ React__namespace.createElement("td", { className: "px-3 py-1.5 min-w-0" }, creatingPR ? /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold text-blue-600" }, "Creating PR"), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight text-blue-500" }, "Please wait...")), /* @__PURE__ */ React__namespace.createElement(FaSpinner, { className: "w-3 h-auto animate-spin text-blue-500" })) : /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight whitespace-nowrap" }, dateFns.formatDistanceToNow(new Date(branch.indexStatus.timestamp), {
|
|
43331
43662
|
addSuffix: true
|
|
43332
|
-
})))
|
|
43333
|
-
/* @__PURE__ */ React__namespace.createElement("
|
|
43663
|
+
}))),
|
|
43664
|
+
/* @__PURE__ */ React__namespace.createElement("td", { className: "px-3 py-1.5 text-left" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(
|
|
43334
43665
|
Button$1,
|
|
43335
43666
|
{
|
|
43336
43667
|
variant: "white",
|
|
@@ -43338,12 +43669,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43338
43669
|
onClick: () => {
|
|
43339
43670
|
onChange(branch.name);
|
|
43340
43671
|
},
|
|
43341
|
-
className: "
|
|
43672
|
+
className: "cursor-pointer text-sm h-9 px-4 flex items-center gap-1"
|
|
43342
43673
|
},
|
|
43343
43674
|
/* @__PURE__ */ React__namespace.createElement(BiPencil, { className: "h-4 w-auto text-blue-500 opacity-70 -mt-px" }),
|
|
43344
43675
|
" ",
|
|
43345
43676
|
"Select"
|
|
43346
|
-
), /* @__PURE__ */ React__namespace.createElement("
|
|
43677
|
+
), indexingStatus === "complete" && isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(Badge, { calloutStyle: "info", className: "w-fit", displayIcon: false }, /* @__PURE__ */ React__namespace.createElement("span", null, "Selected"))),
|
|
43678
|
+
/* @__PURE__ */ React__namespace.createElement("td", { className: "px-3 py-1.5 text-right" }, /* @__PURE__ */ React__namespace.createElement(
|
|
43347
43679
|
OverflowMenu$1,
|
|
43348
43680
|
{
|
|
43349
43681
|
toolbarItems: [
|
|
@@ -43374,7 +43706,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43374
43706
|
}
|
|
43375
43707
|
].filter(Boolean)
|
|
43376
43708
|
}
|
|
43377
|
-
))
|
|
43709
|
+
))
|
|
43378
43710
|
);
|
|
43379
43711
|
};
|
|
43380
43712
|
const IndexStatus = ({ indexingStatus }) => {
|
|
@@ -45430,7 +45762,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
45430
45762
|
className = "",
|
|
45431
45763
|
...props
|
|
45432
45764
|
}) => {
|
|
45433
|
-
const commonAlertStyles = "
|
|
45765
|
+
const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
|
|
45434
45766
|
const styles = {
|
|
45435
45767
|
warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
|
|
45436
45768
|
info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
|
|
@@ -46202,7 +46534,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
46202
46534
|
requiredArgs(1, arguments);
|
|
46203
46535
|
return formatDistance(dirtyDate, Date.now(), options);
|
|
46204
46536
|
}
|
|
46205
|
-
const version$1 = "2.9.
|
|
46537
|
+
const version$1 = "2.9.5";
|
|
46206
46538
|
const VersionInfo = () => {
|
|
46207
46539
|
var _a2, _b, _c, _d, _e, _f;
|
|
46208
46540
|
const cms = useCMS();
|
|
@@ -47842,7 +48174,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47842
48174
|
if (!alerts.all.length) {
|
|
47843
48175
|
return null;
|
|
47844
48176
|
}
|
|
47845
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "fixed
|
|
48177
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "fixed top-0 left-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
|
|
47846
48178
|
return alert.level !== "error";
|
|
47847
48179
|
}).map((alert) => {
|
|
47848
48180
|
return /* @__PURE__ */ React.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React.createElement(MdInfo, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React.createElement(MdCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React.createElement(MdWarning, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, parseUrlsInText(alert.message.toString())), /* @__PURE__ */ React.createElement(
|
|
@@ -47886,10 +48218,10 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47886
48218
|
...props
|
|
47887
48219
|
}) => {
|
|
47888
48220
|
const colorClasses = {
|
|
47889
|
-
info: "bg-
|
|
47890
|
-
success: "bg-
|
|
47891
|
-
warn: "bg-
|
|
47892
|
-
error: "bg-
|
|
48221
|
+
info: "bg-white border-blue-500 text-blue-600 fill-blue-500",
|
|
48222
|
+
success: "bg-white border-green-500 text-green-600 fill-green-500",
|
|
48223
|
+
warn: "bg-white border-yellow-500 text-yellow-600 fill-yellow-500",
|
|
48224
|
+
error: "bg-white border-red-500 text-red-600 fill-red-500"
|
|
47893
48225
|
};
|
|
47894
48226
|
const borderClasses = {
|
|
47895
48227
|
info: "border-blue-200",
|
|
@@ -47912,7 +48244,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47912
48244
|
/* @__PURE__ */ React.createElement(
|
|
47913
48245
|
"div",
|
|
47914
48246
|
{
|
|
47915
|
-
className: `flex items-center gap-1.5
|
|
48247
|
+
className: `flex items-center gap-1.5 w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
|
|
47916
48248
|
...props
|
|
47917
48249
|
}
|
|
47918
48250
|
)
|
|
@@ -47924,7 +48256,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47924
48256
|
className: "border-none bg-transparent p-0 outline-none flex items-center",
|
|
47925
48257
|
...styleProps
|
|
47926
48258
|
},
|
|
47927
|
-
/* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
|
|
48259
|
+
/* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0 text-gray-700" })
|
|
47928
48260
|
);
|
|
47929
48261
|
function CursorPaginator({
|
|
47930
48262
|
navigateNext,
|
|
@@ -48194,6 +48526,18 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
48194
48526
|
), open && /* @__PURE__ */ React__namespace.createElement(BranchModal, { close: () => setOpen(false) }));
|
|
48195
48527
|
};
|
|
48196
48528
|
const BranchPreviewButton = (props) => {
|
|
48529
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
48530
|
+
const cms = useCMS();
|
|
48531
|
+
const branchingEnabled = cms.flags.get("branch-switcher");
|
|
48532
|
+
if (!branchingEnabled) {
|
|
48533
|
+
return null;
|
|
48534
|
+
}
|
|
48535
|
+
const previewFunction = (_f = (_e = (_d = (_c = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.schema) == null ? void 0 : _c.config) == null ? void 0 : _d.config) == null ? void 0 : _e.ui) == null ? void 0 : _f.previewUrl;
|
|
48536
|
+
const branch = (_h = (_g = cms.api) == null ? void 0 : _g.tina) == null ? void 0 : _h.branch;
|
|
48537
|
+
const previewUrl = typeof previewFunction === "function" ? (_i = previewFunction({ branch })) == null ? void 0 : _i.url : null;
|
|
48538
|
+
if (!previewUrl) {
|
|
48539
|
+
return null;
|
|
48540
|
+
}
|
|
48197
48541
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
48198
48542
|
"button",
|
|
48199
48543
|
{
|
|
@@ -48209,6 +48553,18 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
48209
48553
|
/* @__PURE__ */ React__namespace.createElement(BiLinkExternal, { className: "h-5 w-auto" })
|
|
48210
48554
|
);
|
|
48211
48555
|
};
|
|
48556
|
+
const EDITORIAL_WORKFLOW_STATUS = {
|
|
48557
|
+
QUEUED: "queued",
|
|
48558
|
+
PROCESSING: "processing",
|
|
48559
|
+
SETTING_UP: "setting_up",
|
|
48560
|
+
CREATING_BRANCH: "creating_branch",
|
|
48561
|
+
INDEXING: "indexing",
|
|
48562
|
+
CONTENT_GENERATION: "content_generation",
|
|
48563
|
+
CREATING_PR: "creating_pr",
|
|
48564
|
+
COMPLETE: "complete",
|
|
48565
|
+
ERROR: "error",
|
|
48566
|
+
TIMEOUT: "timeout"
|
|
48567
|
+
};
|
|
48212
48568
|
const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
48213
48569
|
const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
|
|
48214
48570
|
const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
@@ -63320,7 +63676,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63320
63676
|
const schemaFromCloud = await this.api.getSchema();
|
|
63321
63677
|
const schema1 = schemaFromCloud;
|
|
63322
63678
|
const schema2 = graphql$1.buildSchema(graphql$1.print(localSchema));
|
|
63323
|
-
const diffOutput = await core$
|
|
63679
|
+
const diffOutput = await core$2.diff(schema1, schema2);
|
|
63324
63680
|
if (diffOutput.length > 0) {
|
|
63325
63681
|
return false;
|
|
63326
63682
|
} else {
|
|
@@ -63622,367 +63978,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63622
63978
|
);
|
|
63623
63979
|
}
|
|
63624
63980
|
}
|
|
63625
|
-
const ProgressBar = ({
|
|
63626
|
-
progress,
|
|
63627
|
-
className = "",
|
|
63628
|
-
color = "blue"
|
|
63629
|
-
}) => {
|
|
63630
|
-
const clampedProgress = Math.min(Math.max(progress, 0), 100);
|
|
63631
|
-
const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
|
|
63632
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ React__namespace.createElement(
|
|
63633
|
-
"div",
|
|
63634
|
-
{
|
|
63635
|
-
className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
|
|
63636
|
-
style: { width: `${clampedProgress}%` }
|
|
63637
|
-
}
|
|
63638
|
-
)));
|
|
63639
|
-
};
|
|
63640
|
-
const EDITORIAL_WORKFLOW_STATUS = {
|
|
63641
|
-
QUEUED: "queued",
|
|
63642
|
-
PROCESSING: "processing",
|
|
63643
|
-
SETTING_UP: "setting_up",
|
|
63644
|
-
CREATING_BRANCH: "creating_branch",
|
|
63645
|
-
INDEXING: "indexing",
|
|
63646
|
-
CONTENT_GENERATION: "content_generation",
|
|
63647
|
-
CREATING_PR: "creating_pr",
|
|
63648
|
-
COMPLETE: "complete",
|
|
63649
|
-
ERROR: "error",
|
|
63650
|
-
TIMEOUT: "timeout"
|
|
63651
|
-
};
|
|
63652
|
-
const FormActionMenu = ({ actions, form }) => {
|
|
63653
|
-
const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
|
|
63654
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React__namespace.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React__namespace.createElement(
|
|
63655
|
-
Dismissible,
|
|
63656
|
-
{
|
|
63657
|
-
click: true,
|
|
63658
|
-
escape: true,
|
|
63659
|
-
disabled: !actionMenuVisibility,
|
|
63660
|
-
onDismiss: () => {
|
|
63661
|
-
setActionMenuVisibility((p2) => !p2);
|
|
63662
|
-
}
|
|
63663
|
-
},
|
|
63664
|
-
actions.map((Action, i2) => (
|
|
63665
|
-
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
63666
|
-
// Actions should just be componets
|
|
63667
|
-
/* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
|
|
63668
|
-
))
|
|
63669
|
-
)));
|
|
63670
|
-
};
|
|
63671
|
-
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63672
|
-
"button",
|
|
63673
|
-
{
|
|
63674
|
-
className: `h-16 w-10 self-stretch bg-transparent bg-center bg-[length:auto_18px] -mr-4 ml-2 outline-none cursor-pointer transition-opacity duration-100 ease-out flex justify-center items-center hover:bg-gray-50 hover:fill-gray-700 ${className}`,
|
|
63675
|
-
...props
|
|
63676
|
-
},
|
|
63677
|
-
/* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
|
|
63678
|
-
);
|
|
63679
|
-
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63680
|
-
"div",
|
|
63681
|
-
{
|
|
63682
|
-
className: `min-w-[192px] rounded-3xl border border-solid border-[#efefef] block absolute bottom-5 right-5 ${open ? "opacity-100" : "opacity-0"} transition-all duration-100 ease-out origin-bottom-right shadow-[0_2px_3px_rgba(0,0,0,0.05)] bg-white overflow-hidden z-10 ${className}`,
|
|
63683
|
-
style: {
|
|
63684
|
-
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
63685
|
-
pointerEvents: open ? "all" : "none",
|
|
63686
|
-
...style
|
|
63687
|
-
},
|
|
63688
|
-
...props
|
|
63689
|
-
}
|
|
63690
|
-
);
|
|
63691
|
-
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63692
|
-
"button",
|
|
63693
|
-
{
|
|
63694
|
-
className: `relative text-center text-[13px] px-3 h-10 font-normal w-full bg-none cursor-pointer outline-none border-0 transition-all duration-[150ms] ease-out hover:text-blue-500 hover:bg-gray50 [&:not(:last-child)]: border-b-[1px] border-solid border-b-[#edecf3] ${className}`,
|
|
63695
|
-
...props
|
|
63696
|
-
}
|
|
63697
|
-
);
|
|
63698
|
-
const FormPortalContext = React__namespace.createContext(() => {
|
|
63699
|
-
return null;
|
|
63700
|
-
});
|
|
63701
|
-
function useFormPortal() {
|
|
63702
|
-
return React__namespace.useContext(FormPortalContext);
|
|
63703
|
-
}
|
|
63704
|
-
const FormPortalProvider = ({
|
|
63705
|
-
children
|
|
63706
|
-
}) => {
|
|
63707
|
-
const wrapperRef = React__namespace.useRef(null);
|
|
63708
|
-
const zIndexRef = React__namespace.useRef(0);
|
|
63709
|
-
const FormPortal = React__namespace.useCallback(
|
|
63710
|
-
(props) => {
|
|
63711
|
-
if (!wrapperRef.current)
|
|
63712
|
-
return null;
|
|
63713
|
-
return ReactDOM.createPortal(
|
|
63714
|
-
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
63715
|
-
wrapperRef.current
|
|
63716
|
-
);
|
|
63717
|
-
},
|
|
63718
|
-
[wrapperRef, zIndexRef]
|
|
63719
|
-
);
|
|
63720
|
-
return /* @__PURE__ */ React__namespace.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React__namespace.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
|
|
63721
|
-
};
|
|
63722
|
-
const LoadingDots = ({
|
|
63723
|
-
dotSize = 8,
|
|
63724
|
-
color = "white"
|
|
63725
|
-
}) => {
|
|
63726
|
-
return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
|
|
63727
|
-
};
|
|
63728
|
-
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63729
|
-
"span",
|
|
63730
|
-
{
|
|
63731
|
-
className: "inline-block mr-1",
|
|
63732
|
-
style: {
|
|
63733
|
-
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
63734
|
-
animationDelay: `${delay}s`,
|
|
63735
|
-
background: color,
|
|
63736
|
-
width: dotSize,
|
|
63737
|
-
height: dotSize,
|
|
63738
|
-
borderRadius: dotSize
|
|
63739
|
-
}
|
|
63740
|
-
}
|
|
63741
|
-
);
|
|
63742
|
-
const ResetForm = ({
|
|
63743
|
-
pristine,
|
|
63744
|
-
reset: reset2,
|
|
63745
|
-
children,
|
|
63746
|
-
...props
|
|
63747
|
-
}) => {
|
|
63748
|
-
const [open, setOpen] = React__namespace.useState(false);
|
|
63749
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
63750
|
-
Button$1,
|
|
63751
|
-
{
|
|
63752
|
-
onClick: () => {
|
|
63753
|
-
setOpen((p2) => !p2);
|
|
63754
|
-
},
|
|
63755
|
-
disabled: pristine,
|
|
63756
|
-
...props
|
|
63757
|
-
},
|
|
63758
|
-
children
|
|
63759
|
-
), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
63760
|
-
};
|
|
63761
|
-
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
63762
|
-
return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(ModalPopup, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
63763
|
-
Button$1,
|
|
63764
|
-
{
|
|
63765
|
-
style: { flexGrow: 3 },
|
|
63766
|
-
variant: "primary",
|
|
63767
|
-
onClick: async () => {
|
|
63768
|
-
await reset2();
|
|
63769
|
-
close2();
|
|
63770
|
-
}
|
|
63771
|
-
},
|
|
63772
|
-
"Reset"
|
|
63773
|
-
))));
|
|
63774
|
-
};
|
|
63775
|
-
const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
63776
|
-
"div",
|
|
63777
|
-
{
|
|
63778
|
-
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
63779
|
-
style: {
|
|
63780
|
-
animationName: "fade-in",
|
|
63781
|
-
animationDelay: "300ms",
|
|
63782
|
-
animationTimingFunction: "ease-out",
|
|
63783
|
-
animationIterationCount: 1,
|
|
63784
|
-
animationFillMode: "both",
|
|
63785
|
-
animationDuration: "150ms"
|
|
63786
|
-
}
|
|
63787
|
-
},
|
|
63788
|
-
/* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
63789
|
-
/* @__PURE__ */ React__namespace.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
|
|
63790
|
-
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
63791
|
-
"a",
|
|
63792
|
-
{
|
|
63793
|
-
className: "text-center rounded-3xl border border-solid border-gray-100 shadow-[0_2px_3px_rgba(0,0,0,0.12)] font-normal cursor-pointer text-[12px] transition-all duration-100 ease-out bg-white text-gray-700 py-3 pr-5 pl-14 relative no-underline inline-block hover:text-blue-500",
|
|
63794
|
-
href: "https://tinacms.org/docs/fields",
|
|
63795
|
-
target: "_blank",
|
|
63796
|
-
rel: "noopener noreferrer"
|
|
63797
|
-
},
|
|
63798
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
63799
|
-
Emoji,
|
|
63800
|
-
{
|
|
63801
|
-
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
63802
|
-
style: { fontSize: 24 }
|
|
63803
|
-
},
|
|
63804
|
-
"📖"
|
|
63805
|
-
),
|
|
63806
|
-
" ",
|
|
63807
|
-
"Field Setup Guide"
|
|
63808
|
-
))
|
|
63809
|
-
);
|
|
63810
|
-
const FormKeyBindings = ({ onSubmit }) => {
|
|
63811
|
-
React.useEffect(() => {
|
|
63812
|
-
const handleKeyDown = (e3) => {
|
|
63813
|
-
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
63814
|
-
e3.preventDefault();
|
|
63815
|
-
onSubmit();
|
|
63816
|
-
}
|
|
63817
|
-
};
|
|
63818
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
63819
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
63820
|
-
}, [onSubmit]);
|
|
63821
|
-
return null;
|
|
63822
|
-
};
|
|
63823
|
-
const FormBuilder = ({
|
|
63824
|
-
form,
|
|
63825
|
-
onPristineChange,
|
|
63826
|
-
...rest
|
|
63827
|
-
}) => {
|
|
63828
|
-
const cms = useCMS$1();
|
|
63829
|
-
const hideFooter = !!rest.hideFooter;
|
|
63830
|
-
const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
|
|
63831
|
-
const tinaForm = form.tinaForm;
|
|
63832
|
-
const finalForm2 = form.tinaForm.finalForm;
|
|
63833
|
-
React__namespace.useEffect(() => {
|
|
63834
|
-
var _a2;
|
|
63835
|
-
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
63836
|
-
tinaForm.path
|
|
63837
|
-
);
|
|
63838
|
-
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
63839
|
-
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
63840
|
-
} else {
|
|
63841
|
-
tinaForm.beforeSubmit = void 0;
|
|
63842
|
-
}
|
|
63843
|
-
}, [tinaForm.path]);
|
|
63844
|
-
const moveArrayItem = React__namespace.useCallback(
|
|
63845
|
-
(result) => {
|
|
63846
|
-
if (!result.destination || !finalForm2)
|
|
63847
|
-
return;
|
|
63848
|
-
const name = result.type;
|
|
63849
|
-
finalForm2.mutators.move(
|
|
63850
|
-
name,
|
|
63851
|
-
result.source.index,
|
|
63852
|
-
result.destination.index
|
|
63853
|
-
);
|
|
63854
|
-
},
|
|
63855
|
-
[tinaForm]
|
|
63856
|
-
);
|
|
63857
|
-
React__namespace.useEffect(() => {
|
|
63858
|
-
const unsubscribe = finalForm2.subscribe(
|
|
63859
|
-
({ pristine }) => {
|
|
63860
|
-
if (onPristineChange) {
|
|
63861
|
-
onPristineChange(pristine);
|
|
63862
|
-
}
|
|
63863
|
-
},
|
|
63864
|
-
{ pristine: true }
|
|
63865
|
-
);
|
|
63866
|
-
return () => {
|
|
63867
|
-
unsubscribe();
|
|
63868
|
-
};
|
|
63869
|
-
}, [finalForm2]);
|
|
63870
|
-
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
63871
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
63872
|
-
reactFinalForm.Form,
|
|
63873
|
-
{
|
|
63874
|
-
key: tinaForm.id,
|
|
63875
|
-
form: tinaForm.finalForm,
|
|
63876
|
-
onSubmit: tinaForm.onSubmit
|
|
63877
|
-
},
|
|
63878
|
-
({
|
|
63879
|
-
handleSubmit,
|
|
63880
|
-
pristine,
|
|
63881
|
-
invalid,
|
|
63882
|
-
submitting,
|
|
63883
|
-
dirtySinceLastSubmit,
|
|
63884
|
-
hasValidationErrors
|
|
63885
|
-
}) => {
|
|
63886
|
-
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
63887
|
-
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
63888
|
-
const safeSubmit = async () => {
|
|
63889
|
-
if (canSubmit) {
|
|
63890
|
-
await handleSubmit();
|
|
63891
|
-
}
|
|
63892
|
-
};
|
|
63893
|
-
const safeHandleSubmit = async () => {
|
|
63894
|
-
if (usingProtectedBranch) {
|
|
63895
|
-
setCreateBranchModalOpen(true);
|
|
63896
|
-
} else {
|
|
63897
|
-
safeSubmit();
|
|
63898
|
-
}
|
|
63899
|
-
};
|
|
63900
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
|
|
63901
|
-
CreateBranchModal,
|
|
63902
|
-
{
|
|
63903
|
-
safeSubmit,
|
|
63904
|
-
crudType: tinaForm.crudType,
|
|
63905
|
-
path: tinaForm.path,
|
|
63906
|
-
values: tinaForm.values,
|
|
63907
|
-
close: () => setCreateBranchModalOpen(false)
|
|
63908
|
-
}
|
|
63909
|
-
), /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React__namespace.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React__namespace.createElement(FormPortalProvider, null, /* @__PURE__ */ React__namespace.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React__namespace.createElement(
|
|
63910
|
-
FieldsBuilder,
|
|
63911
|
-
{
|
|
63912
|
-
form: tinaForm,
|
|
63913
|
-
activeFieldName: form.activeFieldName,
|
|
63914
|
-
fields: fieldGroup.fields
|
|
63915
|
-
}
|
|
63916
|
-
) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-6 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
|
|
63917
|
-
ResetForm,
|
|
63918
|
-
{
|
|
63919
|
-
pristine,
|
|
63920
|
-
reset: async () => {
|
|
63921
|
-
finalForm2.reset();
|
|
63922
|
-
await tinaForm.reset();
|
|
63923
|
-
}
|
|
63924
|
-
},
|
|
63925
|
-
tinaForm.buttons.reset
|
|
63926
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
63927
|
-
Button$1,
|
|
63928
|
-
{
|
|
63929
|
-
onClick: safeHandleSubmit,
|
|
63930
|
-
disabled: !canSubmit,
|
|
63931
|
-
busy: submitting,
|
|
63932
|
-
variant: "primary"
|
|
63933
|
-
},
|
|
63934
|
-
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
63935
|
-
!submitting && tinaForm.buttons.save
|
|
63936
|
-
), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
|
|
63937
|
-
FormActionMenu,
|
|
63938
|
-
{
|
|
63939
|
-
form: tinaForm,
|
|
63940
|
-
actions: tinaForm.actions
|
|
63941
|
-
}
|
|
63942
|
-
)))));
|
|
63943
|
-
}
|
|
63944
|
-
);
|
|
63945
|
-
};
|
|
63946
|
-
const FormStatus = ({ pristine }) => {
|
|
63947
|
-
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
63948
|
-
return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
63949
|
-
};
|
|
63950
|
-
const FormWrapper = ({
|
|
63951
|
-
id: id2,
|
|
63952
|
-
children
|
|
63953
|
-
}) => {
|
|
63954
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
63955
|
-
"div",
|
|
63956
|
-
{
|
|
63957
|
-
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
63958
|
-
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
63959
|
-
},
|
|
63960
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
|
|
63961
|
-
);
|
|
63962
|
-
};
|
|
63963
|
-
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63964
|
-
"span",
|
|
63965
|
-
{
|
|
63966
|
-
className: `text-[40px] leading-none inline-block ${className}`,
|
|
63967
|
-
...props
|
|
63968
|
-
}
|
|
63969
|
-
);
|
|
63970
|
-
const CreateBranchModel = ({
|
|
63971
|
-
close: close2,
|
|
63972
|
-
safeSubmit,
|
|
63973
|
-
relativePath: relativePath2,
|
|
63974
|
-
values,
|
|
63975
|
-
crudType
|
|
63976
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
63977
|
-
CreateBranchModal,
|
|
63978
|
-
{
|
|
63979
|
-
close: close2,
|
|
63980
|
-
safeSubmit,
|
|
63981
|
-
path: relativePath2,
|
|
63982
|
-
values,
|
|
63983
|
-
crudType
|
|
63984
|
-
}
|
|
63985
|
-
);
|
|
63986
63981
|
const pathRelativeToCollection = (collectionPath, fullPath) => {
|
|
63987
63982
|
const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
|
|
63988
63983
|
const normalizedFullPath = fullPath.replace(/\\/g, "/");
|
|
@@ -64011,7 +64006,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64011
64006
|
const [isExecuting, setIsExecuting] = React__namespace.useState(false);
|
|
64012
64007
|
const [errorMessage, setErrorMessage] = React__namespace.useState("");
|
|
64013
64008
|
const [currentStep, setCurrentStep] = React__namespace.useState(0);
|
|
64014
|
-
const [statusMessage, setStatusMessage] = React__namespace.useState("");
|
|
64015
64009
|
const [elapsedTime, setElapsedTime] = React__namespace.useState(0);
|
|
64016
64010
|
React__namespace.useEffect(() => {
|
|
64017
64011
|
let interval;
|
|
@@ -64055,7 +64049,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64055
64049
|
setDisabled(true);
|
|
64056
64050
|
setIsExecuting(true);
|
|
64057
64051
|
setCurrentStep(1);
|
|
64058
|
-
setStatusMessage("Initializing workflow...");
|
|
64059
64052
|
let graphql2 = "";
|
|
64060
64053
|
if (crudType === "create") {
|
|
64061
64054
|
graphql2 = CREATE_DOCUMENT_GQL;
|
|
@@ -64080,8 +64073,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64080
64073
|
}
|
|
64081
64074
|
},
|
|
64082
64075
|
onStatusUpdate: (status) => {
|
|
64083
|
-
const message = status.message || `Status: ${status.status}`;
|
|
64084
|
-
setStatusMessage(message);
|
|
64085
64076
|
switch (status.status) {
|
|
64086
64077
|
case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
|
|
64087
64078
|
case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
|
|
@@ -64118,9 +64109,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64118
64109
|
}
|
|
64119
64110
|
};
|
|
64120
64111
|
const renderProgressIndicator = () => {
|
|
64121
|
-
|
|
64122
|
-
const progressPercentage = (currentStep - 1) / steps.length * 100;
|
|
64123
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "py-6" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-between mb-4 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React__namespace.createElement(
|
|
64112
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-between my-8 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React__namespace.createElement(
|
|
64124
64113
|
"div",
|
|
64125
64114
|
{
|
|
64126
64115
|
className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
|
|
@@ -64129,7 +64118,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64129
64118
|
), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React__namespace.createElement(
|
|
64130
64119
|
"div",
|
|
64131
64120
|
{
|
|
64132
|
-
className: "absolute top-5 h-0.5 bg-
|
|
64121
|
+
className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
|
|
64133
64122
|
style: {
|
|
64134
64123
|
left: "50px",
|
|
64135
64124
|
width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
|
|
@@ -64157,7 +64146,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64157
64146
|
/* @__PURE__ */ React__namespace.createElement(
|
|
64158
64147
|
"div",
|
|
64159
64148
|
{
|
|
64160
|
-
className: `w-10 h-10 rounded-full flex items-center justify-center font-medium mb-3 border-2 transition-all duration-300 ${isCompleted ? "bg-green-500 border-green-500 text-white" : isActive ? "bg-
|
|
64149
|
+
className: `w-10 h-10 rounded-full flex items-center justify-center font-medium mb-3 border-2 transition-all duration-300 select-none ${isCompleted ? "bg-green-500 border-green-500 text-white" : isActive ? "bg-tina-orange border-tina-orange text-white" : "bg-white border-gray-200 text-gray-400"}`
|
|
64161
64150
|
},
|
|
64162
64151
|
isCompleted ? /* @__PURE__ */ React__namespace.createElement(
|
|
64163
64152
|
"svg",
|
|
@@ -64178,7 +64167,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64178
64167
|
),
|
|
64179
64168
|
/* @__PURE__ */ React__namespace.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-semibold leading-tight" }, step.name), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
|
|
64180
64169
|
);
|
|
64181
|
-
})), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between
|
|
64170
|
+
})), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 min "), isExecuting && currentStep > 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React__namespace.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React__namespace.createElement(
|
|
64182
64171
|
"path",
|
|
64183
64172
|
{
|
|
64184
64173
|
fillRule: "evenodd",
|
|
@@ -64186,28 +64175,14 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64186
64175
|
clipRule: "evenodd"
|
|
64187
64176
|
}
|
|
64188
64177
|
)), formatTime(elapsedTime))), /* @__PURE__ */ React__namespace.createElement(
|
|
64189
|
-
|
|
64190
|
-
{
|
|
64191
|
-
progress: progressPercentage,
|
|
64192
|
-
className: "mb-4",
|
|
64193
|
-
color: currentStep > steps.length ? "green" : "blue"
|
|
64194
|
-
}
|
|
64195
|
-
), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React__namespace.createElement(
|
|
64196
|
-
"svg",
|
|
64178
|
+
"a",
|
|
64197
64179
|
{
|
|
64198
|
-
className: "
|
|
64199
|
-
|
|
64200
|
-
|
|
64180
|
+
className: "underline text-tina-orange-dark font-medium text-xs",
|
|
64181
|
+
href: "https://tina.io/docs/tinacloud/editorial-workflow",
|
|
64182
|
+
target: "_blank"
|
|
64201
64183
|
},
|
|
64202
|
-
|
|
64203
|
-
|
|
64204
|
-
{
|
|
64205
|
-
fillRule: "evenodd",
|
|
64206
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
64207
|
-
clipRule: "evenodd"
|
|
64208
|
-
}
|
|
64209
|
-
)
|
|
64210
|
-
) : /* @__PURE__ */ React__namespace.createElement(AiOutlineLoading, { className: "text-blue-500 animate-spin" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm font-medium text-gray-700" }, statusMessage || `${(_a2 = steps[currentStep - 1]) == null ? void 0 : _a2.name}...`)), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-left" }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 minutes")));
|
|
64184
|
+
"Learn more about Editorial Workflow"
|
|
64185
|
+
));
|
|
64211
64186
|
};
|
|
64212
64187
|
const renderStateContent = () => {
|
|
64213
64188
|
if (isExecuting) {
|
|
@@ -64230,14 +64205,13 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64230
64205
|
value: newBranchName,
|
|
64231
64206
|
onChange: (e3) => {
|
|
64232
64207
|
setErrorMessage("");
|
|
64233
|
-
setStatusMessage("");
|
|
64234
64208
|
setNewBranchName(e3.target.value);
|
|
64235
64209
|
}
|
|
64236
64210
|
}
|
|
64237
64211
|
));
|
|
64238
64212
|
}
|
|
64239
64213
|
};
|
|
64240
|
-
return /* @__PURE__ */ React__namespace.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" },
|
|
64214
|
+
return /* @__PURE__ */ React__namespace.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, "Save changes to new branch"))), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React__namespace.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React__namespace.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
64241
64215
|
DropdownButton,
|
|
64242
64216
|
{
|
|
64243
64217
|
variant: "primary",
|
|
@@ -64281,6 +64255,217 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64281
64255
|
}
|
|
64282
64256
|
)));
|
|
64283
64257
|
};
|
|
64258
|
+
const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
64259
|
+
"div",
|
|
64260
|
+
{
|
|
64261
|
+
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
64262
|
+
style: {
|
|
64263
|
+
animationName: "fade-in",
|
|
64264
|
+
animationDelay: "300ms",
|
|
64265
|
+
animationTimingFunction: "ease-out",
|
|
64266
|
+
animationIterationCount: 1,
|
|
64267
|
+
animationFillMode: "both",
|
|
64268
|
+
animationDuration: "150ms"
|
|
64269
|
+
}
|
|
64270
|
+
},
|
|
64271
|
+
/* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
64272
|
+
/* @__PURE__ */ React__namespace.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
|
|
64273
|
+
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
64274
|
+
"a",
|
|
64275
|
+
{
|
|
64276
|
+
className: "text-center rounded-3xl border border-solid border-gray-100 shadow-[0_2px_3px_rgba(0,0,0,0.12)] font-normal cursor-pointer text-[12px] transition-all duration-100 ease-out bg-white text-gray-700 py-3 pr-5 pl-14 relative no-underline inline-block hover:text-blue-500",
|
|
64277
|
+
href: "https://tinacms.org/docs/fields",
|
|
64278
|
+
target: "_blank",
|
|
64279
|
+
rel: "noopener noreferrer"
|
|
64280
|
+
},
|
|
64281
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
64282
|
+
Emoji,
|
|
64283
|
+
{
|
|
64284
|
+
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
64285
|
+
style: { fontSize: 24 }
|
|
64286
|
+
},
|
|
64287
|
+
"📖"
|
|
64288
|
+
),
|
|
64289
|
+
" ",
|
|
64290
|
+
"Field Setup Guide"
|
|
64291
|
+
))
|
|
64292
|
+
);
|
|
64293
|
+
const FormKeyBindings = ({ onSubmit }) => {
|
|
64294
|
+
React.useEffect(() => {
|
|
64295
|
+
const handleKeyDown = (e3) => {
|
|
64296
|
+
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
64297
|
+
e3.preventDefault();
|
|
64298
|
+
onSubmit();
|
|
64299
|
+
}
|
|
64300
|
+
};
|
|
64301
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
64302
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
64303
|
+
}, [onSubmit]);
|
|
64304
|
+
return null;
|
|
64305
|
+
};
|
|
64306
|
+
const FormBuilder = ({
|
|
64307
|
+
form,
|
|
64308
|
+
onPristineChange,
|
|
64309
|
+
...rest
|
|
64310
|
+
}) => {
|
|
64311
|
+
const cms = useCMS$1();
|
|
64312
|
+
const hideFooter = !!rest.hideFooter;
|
|
64313
|
+
const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
|
|
64314
|
+
const tinaForm = form.tinaForm;
|
|
64315
|
+
const finalForm2 = form.tinaForm.finalForm;
|
|
64316
|
+
React__namespace.useEffect(() => {
|
|
64317
|
+
var _a2;
|
|
64318
|
+
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
64319
|
+
tinaForm.path
|
|
64320
|
+
);
|
|
64321
|
+
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
64322
|
+
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
64323
|
+
} else {
|
|
64324
|
+
tinaForm.beforeSubmit = void 0;
|
|
64325
|
+
}
|
|
64326
|
+
}, [tinaForm.path]);
|
|
64327
|
+
const moveArrayItem = React__namespace.useCallback(
|
|
64328
|
+
(result) => {
|
|
64329
|
+
if (!result.destination || !finalForm2)
|
|
64330
|
+
return;
|
|
64331
|
+
const name = result.type;
|
|
64332
|
+
finalForm2.mutators.move(
|
|
64333
|
+
name,
|
|
64334
|
+
result.source.index,
|
|
64335
|
+
result.destination.index
|
|
64336
|
+
);
|
|
64337
|
+
},
|
|
64338
|
+
[tinaForm]
|
|
64339
|
+
);
|
|
64340
|
+
React__namespace.useEffect(() => {
|
|
64341
|
+
const unsubscribe = finalForm2.subscribe(
|
|
64342
|
+
({ pristine }) => {
|
|
64343
|
+
if (onPristineChange) {
|
|
64344
|
+
onPristineChange(pristine);
|
|
64345
|
+
}
|
|
64346
|
+
},
|
|
64347
|
+
{ pristine: true }
|
|
64348
|
+
);
|
|
64349
|
+
return () => {
|
|
64350
|
+
unsubscribe();
|
|
64351
|
+
};
|
|
64352
|
+
}, [finalForm2]);
|
|
64353
|
+
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
64354
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
64355
|
+
reactFinalForm.Form,
|
|
64356
|
+
{
|
|
64357
|
+
key: tinaForm.id,
|
|
64358
|
+
form: tinaForm.finalForm,
|
|
64359
|
+
onSubmit: tinaForm.onSubmit
|
|
64360
|
+
},
|
|
64361
|
+
({
|
|
64362
|
+
handleSubmit,
|
|
64363
|
+
pristine,
|
|
64364
|
+
invalid,
|
|
64365
|
+
submitting,
|
|
64366
|
+
dirtySinceLastSubmit,
|
|
64367
|
+
hasValidationErrors
|
|
64368
|
+
}) => {
|
|
64369
|
+
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
64370
|
+
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
64371
|
+
const safeSubmit = async () => {
|
|
64372
|
+
if (canSubmit) {
|
|
64373
|
+
await handleSubmit();
|
|
64374
|
+
}
|
|
64375
|
+
};
|
|
64376
|
+
const safeHandleSubmit = async () => {
|
|
64377
|
+
if (usingProtectedBranch) {
|
|
64378
|
+
setCreateBranchModalOpen(true);
|
|
64379
|
+
} else {
|
|
64380
|
+
safeSubmit();
|
|
64381
|
+
}
|
|
64382
|
+
};
|
|
64383
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
|
|
64384
|
+
CreateBranchModal,
|
|
64385
|
+
{
|
|
64386
|
+
safeSubmit,
|
|
64387
|
+
crudType: tinaForm.crudType,
|
|
64388
|
+
path: tinaForm.path,
|
|
64389
|
+
values: tinaForm.values,
|
|
64390
|
+
close: () => setCreateBranchModalOpen(false)
|
|
64391
|
+
}
|
|
64392
|
+
), /* @__PURE__ */ React__namespace.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React__namespace.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React__namespace.createElement(FormPortalProvider, null, /* @__PURE__ */ React__namespace.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React__namespace.createElement(
|
|
64393
|
+
FieldsBuilder,
|
|
64394
|
+
{
|
|
64395
|
+
form: tinaForm,
|
|
64396
|
+
activeFieldName: form.activeFieldName,
|
|
64397
|
+
fields: fieldGroup.fields
|
|
64398
|
+
}
|
|
64399
|
+
) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-6 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
|
|
64400
|
+
ResetForm,
|
|
64401
|
+
{
|
|
64402
|
+
pristine,
|
|
64403
|
+
reset: async () => {
|
|
64404
|
+
finalForm2.reset();
|
|
64405
|
+
await tinaForm.reset();
|
|
64406
|
+
}
|
|
64407
|
+
},
|
|
64408
|
+
tinaForm.buttons.reset
|
|
64409
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
64410
|
+
Button$1,
|
|
64411
|
+
{
|
|
64412
|
+
onClick: safeHandleSubmit,
|
|
64413
|
+
disabled: !canSubmit,
|
|
64414
|
+
busy: submitting,
|
|
64415
|
+
variant: "primary"
|
|
64416
|
+
},
|
|
64417
|
+
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
64418
|
+
!submitting && tinaForm.buttons.save
|
|
64419
|
+
), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
|
|
64420
|
+
FormActionMenu,
|
|
64421
|
+
{
|
|
64422
|
+
form: tinaForm,
|
|
64423
|
+
actions: tinaForm.actions
|
|
64424
|
+
}
|
|
64425
|
+
)))));
|
|
64426
|
+
}
|
|
64427
|
+
);
|
|
64428
|
+
};
|
|
64429
|
+
const FormStatus = ({ pristine }) => {
|
|
64430
|
+
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
64431
|
+
return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
64432
|
+
};
|
|
64433
|
+
const FormWrapper = ({
|
|
64434
|
+
id: id2,
|
|
64435
|
+
children
|
|
64436
|
+
}) => {
|
|
64437
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
64438
|
+
"div",
|
|
64439
|
+
{
|
|
64440
|
+
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
64441
|
+
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
64442
|
+
},
|
|
64443
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
|
|
64444
|
+
);
|
|
64445
|
+
};
|
|
64446
|
+
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
64447
|
+
"span",
|
|
64448
|
+
{
|
|
64449
|
+
className: `text-[40px] leading-none inline-block ${className}`,
|
|
64450
|
+
...props
|
|
64451
|
+
}
|
|
64452
|
+
);
|
|
64453
|
+
const CreateBranchModel = ({
|
|
64454
|
+
close: close2,
|
|
64455
|
+
safeSubmit,
|
|
64456
|
+
relativePath: relativePath2,
|
|
64457
|
+
values,
|
|
64458
|
+
crudType
|
|
64459
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
64460
|
+
CreateBranchModal,
|
|
64461
|
+
{
|
|
64462
|
+
close: close2,
|
|
64463
|
+
safeSubmit,
|
|
64464
|
+
path: relativePath2,
|
|
64465
|
+
values,
|
|
64466
|
+
crudType
|
|
64467
|
+
}
|
|
64468
|
+
);
|
|
64284
64469
|
const NestedForm = (props) => {
|
|
64285
64470
|
const FormPortal = useFormPortal();
|
|
64286
64471
|
const id2 = React.useMemo(() => uuid(), [props.id, props.initialValues]);
|
|
@@ -65615,9 +65800,9 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
65615
65800
|
ai: "w-full px-0 text-base md:text-sm",
|
|
65616
65801
|
aiChat: "max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm",
|
|
65617
65802
|
comment: cn$2.cn("rounded-none border-none bg-transparent text-sm"),
|
|
65618
|
-
default: "size-full px-
|
|
65619
|
-
demo: "size-full px-
|
|
65620
|
-
fullWidth: "size-full px-
|
|
65803
|
+
default: "size-full px-2 sm:px-4 pt-2 text-base",
|
|
65804
|
+
demo: "size-full px-2 sm:px-4 pt-2 text-base h-[650px]",
|
|
65805
|
+
fullWidth: "size-full px-2 sm:px-4 pt-4 pb-72 text-base",
|
|
65621
65806
|
none: "",
|
|
65622
65807
|
select: "px-3 py-2 text-base data-readonly:w-fit"
|
|
65623
65808
|
}
|
|
@@ -120635,7 +120820,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120635
120820
|
headerClassName,
|
|
120636
120821
|
children
|
|
120637
120822
|
}) => {
|
|
120638
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, /* @__PURE__ */ React.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React.createElement(
|
|
120823
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, /* @__PURE__ */ React.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React.createElement(LocalWarning, null), /* @__PURE__ */ React.createElement(BranchButton, null), /* @__PURE__ */ React.createElement(BranchPreviewButton, null))), children);
|
|
120639
120824
|
};
|
|
120640
120825
|
const PageHeader = ({
|
|
120641
120826
|
children
|
|
@@ -120703,7 +120888,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120703
120888
|
folder,
|
|
120704
120889
|
collectionName
|
|
120705
120890
|
}) => {
|
|
120706
|
-
return /* @__PURE__ */ React.createElement(react$1.Menu, { as: "div", className: "relative inline-block text-left" }, () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(react$1.MenuButton, { className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out shadow text-white bg-
|
|
120891
|
+
return /* @__PURE__ */ React.createElement(react$1.Menu, { as: "div", className: "relative inline-block text-left w-full md:w-auto" }, () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(react$1.MenuButton, { className: "w-full md:w-auto icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark text-sm h-10 px-6" }, "Create New ", /* @__PURE__ */ React.createElement(BiPlus, { className: "w-5 h-full ml-1 opacity-70" }))), /* @__PURE__ */ React.createElement(
|
|
120707
120892
|
react$1.Transition,
|
|
120708
120893
|
{
|
|
120709
120894
|
enter: "transition ease-out duration-100",
|
|
@@ -120831,6 +121016,9 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120831
121016
|
booleanEquals: null
|
|
120832
121017
|
}));
|
|
120833
121018
|
}, [collectionName]);
|
|
121019
|
+
const tableRowStyle = "hover:bg-gray-50/50 border-b-2 border-gray-50 transition-colors duration-300";
|
|
121020
|
+
const tableHeadingCellStyle = "px-3 py-3 text-left text-xs font-bold text-gray-700 tracking-wider";
|
|
121021
|
+
const tableHeadingStyle2 = "bg-gray-100 border-b-2 border-gray-200";
|
|
120834
121022
|
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
120835
121023
|
return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(
|
|
120836
121024
|
GetCollection,
|
|
@@ -120860,7 +121048,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120860
121048
|
search
|
|
120861
121049
|
},
|
|
120862
121050
|
(collection, _loading, reFetchCollection, collectionExtra) => {
|
|
120863
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
121051
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
120864
121052
|
const documents = collection.documents.edges;
|
|
120865
121053
|
const admin = cms.api.admin;
|
|
120866
121054
|
const pageInfo = collection.documents.pageInfo;
|
|
@@ -120995,6 +121183,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120995
121183
|
return { ...vars2, folderName };
|
|
120996
121184
|
});
|
|
120997
121185
|
},
|
|
121186
|
+
validationRegex: (_m = (_l = (_k = cms.api.tina) == null ? void 0 : _k.schema.config.config.ui) == null ? void 0 : _l.regexValidation) == null ? void 0 : _m.folderNameRegex,
|
|
120998
121187
|
createFunc: async () => {
|
|
120999
121188
|
try {
|
|
121000
121189
|
admin.createFolder(
|
|
@@ -121027,7 +121216,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121027
121216
|
},
|
|
121028
121217
|
close: () => setFolderModalOpen(false)
|
|
121029
121218
|
}
|
|
121030
|
-
), /* @__PURE__ */ React.createElement(PageHeader, null, /* @__PURE__ */ React.createElement("div", { className: "w-full" }, /* @__PURE__ */ React.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4
|
|
121219
|
+
), /* @__PURE__ */ React.createElement(PageHeader, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, !search && /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
|
|
121031
121220
|
"label",
|
|
121032
121221
|
{
|
|
121033
121222
|
htmlFor: "sort",
|
|
@@ -121099,7 +121288,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121099
121288
|
className: "underline hover:text-blue-700 transition-all duration-150"
|
|
121100
121289
|
},
|
|
121101
121290
|
"Read the docs"
|
|
121102
|
-
))))), allowCreate && /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-2 md:gap-0 pt-4 lg:pt-0" }, allowCreateNestedFolder && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(Tooltip, null, /* @__PURE__ */ React.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
121291
|
+
))))), allowCreate && /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-2 md:gap-0 pt-4 lg:pt-0" }, allowCreateNestedFolder && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(Tooltip, null, /* @__PURE__ */ React.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
121103
121292
|
reactRouterDom.Link,
|
|
121104
121293
|
{
|
|
121105
121294
|
onMouseDown: (evt) => {
|
|
@@ -121117,7 +121306,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121117
121306
|
},
|
|
121118
121307
|
to: "/collections/new-folder",
|
|
121119
121308
|
className: cn$1(
|
|
121120
|
-
"icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-gray-500
|
|
121309
|
+
"icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-gray-500 bg-white hover:bg-gray-50 border border-gray-100 focus:ring-white focus:ring-blue-500 w-full md:w-auto text-sm h-10 px-6 mr-4",
|
|
121121
121310
|
collection.templates && "opacity-50 pointer-events-none cursor-not-allowed"
|
|
121122
121311
|
),
|
|
121123
121312
|
"aria-disabled": !!collection.templates,
|
|
@@ -121125,7 +121314,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121125
121314
|
},
|
|
121126
121315
|
/* @__PURE__ */ React.createElement(FaFolder, { className: "mr-2" }),
|
|
121127
121316
|
"Add Folder"
|
|
121128
|
-
))
|
|
121317
|
+
)), collection.templates && /* @__PURE__ */ React.createElement(
|
|
121129
121318
|
TooltipContent,
|
|
121130
121319
|
{
|
|
121131
121320
|
side: "top",
|
|
@@ -121166,175 +121355,225 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121166
121355
|
templates: collection.templates,
|
|
121167
121356
|
folder
|
|
121168
121357
|
}
|
|
121169
|
-
))))), /* @__PURE__ */ React.createElement(PageBody, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-x-auto shadow-md rounded-md" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React.createElement("table", { className: "table-auto shadow bg-white border
|
|
121170
|
-
|
|
121171
|
-
|
|
121172
|
-
folder,
|
|
121173
|
-
navigate,
|
|
121174
|
-
collectionName
|
|
121175
|
-
}
|
|
121176
|
-
))) : null, documents.length > 0 && documents.map((document2) => {
|
|
121177
|
-
var _a3;
|
|
121178
|
-
if (document2.node.__typename === "Folder") {
|
|
121179
|
-
return /* @__PURE__ */ React.createElement(
|
|
121180
|
-
"tr",
|
|
121181
|
-
{
|
|
121182
|
-
key: `folder-${document2.node.path}`
|
|
121183
|
-
},
|
|
121184
|
-
/* @__PURE__ */ React.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React.createElement(
|
|
121185
|
-
"a",
|
|
121186
|
-
{
|
|
121187
|
-
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
|
|
121188
|
-
onClick: () => {
|
|
121189
|
-
navigate(
|
|
121190
|
-
`/${[
|
|
121191
|
-
"collections",
|
|
121192
|
-
collectionName,
|
|
121193
|
-
document2.node.path
|
|
121194
|
-
].join("/")}`,
|
|
121195
|
-
{ replace: true }
|
|
121196
|
-
);
|
|
121197
|
-
}
|
|
121198
|
-
},
|
|
121199
|
-
/* @__PURE__ */ React.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
121200
|
-
/* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React.createElement("span", null, document2.node.name)))
|
|
121201
|
-
)),
|
|
121202
|
-
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3", colSpan: 4 }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Path"), /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, document2.node.path.substring(2).split("/").map((node2) => {
|
|
121203
|
-
return /* @__PURE__ */ React.createElement("span", { key: node2 }, /* @__PURE__ */ React.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "pr-0.5" }, node2));
|
|
121204
|
-
})))
|
|
121205
|
-
);
|
|
121206
|
-
}
|
|
121207
|
-
const hasTitle = Boolean(
|
|
121208
|
-
document2.node._sys.title
|
|
121358
|
+
))))), /* @__PURE__ */ React.createElement(PageBody, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-x-auto shadow-md rounded-md" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React.createElement("table", { className: "table-auto shadow bg-white border border-gray-200 w-full max-w-full rounded-lg" }, (() => {
|
|
121359
|
+
const hasAnyDocuments = documents.some(
|
|
121360
|
+
(doc) => doc.node.__typename !== "Folder"
|
|
121209
121361
|
);
|
|
121210
|
-
const
|
|
121211
|
-
|
|
121212
|
-
|
|
121362
|
+
const hasAnyFolders = documents.some(
|
|
121363
|
+
(doc) => doc.node.__typename === "Folder"
|
|
121364
|
+
);
|
|
121365
|
+
const hasAnyTitles = documents.some(
|
|
121366
|
+
(doc) => {
|
|
121367
|
+
var _a3;
|
|
121368
|
+
return doc.node.__typename !== "Folder" && Boolean((_a3 = doc.node._sys) == null ? void 0 : _a3.title);
|
|
121369
|
+
}
|
|
121370
|
+
);
|
|
121371
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, hasAnyDocuments && /* @__PURE__ */ React.createElement("thead", { className: tableHeadingStyle2 }, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
|
|
121372
|
+
"th",
|
|
121213
121373
|
{
|
|
121214
|
-
className:
|
|
121215
|
-
|
|
121374
|
+
className: tableHeadingCellStyle,
|
|
121375
|
+
colSpan: hasAnyTitles ? 1 : 2
|
|
121216
121376
|
},
|
|
121217
|
-
|
|
121218
|
-
|
|
121219
|
-
|
|
121220
|
-
|
|
121221
|
-
|
|
121222
|
-
|
|
121223
|
-
|
|
121224
|
-
|
|
121377
|
+
hasAnyTitles ? "Title" : "Filename"
|
|
121378
|
+
), hasAnyTitles && /* @__PURE__ */ React.createElement(
|
|
121379
|
+
"th",
|
|
121380
|
+
{
|
|
121381
|
+
className: tableHeadingCellStyle
|
|
121382
|
+
},
|
|
121383
|
+
"Filename"
|
|
121384
|
+
), /* @__PURE__ */ React.createElement("th", { className: tableHeadingCellStyle }, "Extension"), /* @__PURE__ */ React.createElement("th", { className: tableHeadingCellStyle }, "Template"), /* @__PURE__ */ React.createElement("th", null))), !hasAnyDocuments && hasAnyFolders && /* @__PURE__ */ React.createElement("thead", { className: tableHeadingStyle2 }, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("th", { className: tableHeadingCellStyle }, "Name"), /* @__PURE__ */ React.createElement(
|
|
121385
|
+
"th",
|
|
121386
|
+
{
|
|
121387
|
+
className: tableHeadingCellStyle,
|
|
121388
|
+
colSpan: 4
|
|
121389
|
+
},
|
|
121390
|
+
"Path"
|
|
121391
|
+
))), /* @__PURE__ */ React.createElement("tbody", null, folder.name && !search ? /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React.createElement(
|
|
121392
|
+
Breadcrumb,
|
|
121393
|
+
{
|
|
121394
|
+
folder,
|
|
121395
|
+
navigate,
|
|
121396
|
+
collectionName
|
|
121397
|
+
}
|
|
121398
|
+
))) : null, documents.length > 0 && documents.map((document2) => {
|
|
121399
|
+
var _a3;
|
|
121400
|
+
if (document2.node.__typename === "Folder") {
|
|
121401
|
+
return /* @__PURE__ */ React.createElement(
|
|
121402
|
+
"tr",
|
|
121225
121403
|
{
|
|
121226
|
-
className:
|
|
121227
|
-
|
|
121228
|
-
handleNavigate(
|
|
121229
|
-
navigate,
|
|
121230
|
-
cms,
|
|
121231
|
-
collection,
|
|
121232
|
-
collectionDefinition,
|
|
121233
|
-
document2.node
|
|
121234
|
-
);
|
|
121235
|
-
}
|
|
121404
|
+
className: tableRowStyle,
|
|
121405
|
+
key: `folder-${document2.node.path}`
|
|
121236
121406
|
},
|
|
121237
|
-
/* @__PURE__ */ React.createElement(
|
|
121238
|
-
|
|
121239
|
-
)
|
|
121240
|
-
),
|
|
121241
|
-
hasTitle && /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Filename"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, document2.node._sys.filename))),
|
|
121242
|
-
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Extension"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
|
|
121243
|
-
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Template"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
|
|
121244
|
-
/* @__PURE__ */ React.createElement("td", { className: "w-0" }, /* @__PURE__ */ React.createElement(
|
|
121245
|
-
OverflowMenu$1,
|
|
121246
|
-
{
|
|
121247
|
-
toolbarItems: [
|
|
121407
|
+
/* @__PURE__ */ React.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React.createElement(
|
|
121408
|
+
"a",
|
|
121248
121409
|
{
|
|
121249
|
-
|
|
121250
|
-
|
|
121251
|
-
Icon: /* @__PURE__ */ React.createElement(BiEdit, { size: "1.3rem" }),
|
|
121252
|
-
onMouseDown: () => {
|
|
121253
|
-
const pathToDoc = document2.node._sys.breadcrumbs;
|
|
121254
|
-
if (folder.fullyQualifiedName) {
|
|
121255
|
-
pathToDoc.unshift("~");
|
|
121256
|
-
}
|
|
121410
|
+
className: "text-blue-600 flex items-center gap-3 cursor-pointer truncate",
|
|
121411
|
+
onClick: () => {
|
|
121257
121412
|
navigate(
|
|
121258
121413
|
`/${[
|
|
121259
121414
|
"collections",
|
|
121260
|
-
"edit",
|
|
121261
121415
|
collectionName,
|
|
121262
|
-
|
|
121416
|
+
document2.node.path
|
|
121263
121417
|
].join("/")}`,
|
|
121264
121418
|
{ replace: true }
|
|
121265
121419
|
);
|
|
121266
121420
|
}
|
|
121267
121421
|
},
|
|
121268
|
-
|
|
121269
|
-
|
|
121270
|
-
|
|
121271
|
-
|
|
121272
|
-
|
|
121273
|
-
|
|
121274
|
-
|
|
121275
|
-
|
|
121276
|
-
}
|
|
121277
|
-
navigate(
|
|
121278
|
-
`/${[
|
|
121279
|
-
"collections",
|
|
121280
|
-
"duplicate",
|
|
121281
|
-
collectionName,
|
|
121282
|
-
...pathToDoc
|
|
121283
|
-
].join("/")}`,
|
|
121284
|
-
{ replace: true }
|
|
121285
|
-
);
|
|
121286
|
-
}
|
|
121422
|
+
/* @__PURE__ */ React.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
121423
|
+
/* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block truncate" }, /* @__PURE__ */ React.createElement("span", null, document2.node.name)))
|
|
121424
|
+
)),
|
|
121425
|
+
/* @__PURE__ */ React.createElement(
|
|
121426
|
+
"td",
|
|
121427
|
+
{
|
|
121428
|
+
className: "px-3 py-3",
|
|
121429
|
+
colSpan: 4
|
|
121287
121430
|
},
|
|
121288
|
-
|
|
121289
|
-
|
|
121290
|
-
|
|
121291
|
-
|
|
121292
|
-
|
|
121293
|
-
|
|
121294
|
-
|
|
121295
|
-
|
|
121296
|
-
|
|
121297
|
-
|
|
121298
|
-
|
|
121299
|
-
|
|
121300
|
-
|
|
121301
|
-
|
|
121302
|
-
|
|
121303
|
-
|
|
121304
|
-
|
|
121431
|
+
/* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-400 truncate" }, document2.node.path.substring(2).split("/").map((node2) => {
|
|
121432
|
+
return /* @__PURE__ */ React.createElement("span", { key: node2 }, /* @__PURE__ */ React.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "pr-0.5" }, node2));
|
|
121433
|
+
}))
|
|
121434
|
+
)
|
|
121435
|
+
);
|
|
121436
|
+
}
|
|
121437
|
+
const hasTitle = Boolean(
|
|
121438
|
+
document2.node._sys.title
|
|
121439
|
+
);
|
|
121440
|
+
const subfolders = document2.node._sys.breadcrumbs.slice(0, -1).join("/");
|
|
121441
|
+
return /* @__PURE__ */ React.createElement(
|
|
121442
|
+
"tr",
|
|
121443
|
+
{
|
|
121444
|
+
className: tableRowStyle,
|
|
121445
|
+
key: `document-${document2.node._sys.relativePath}`
|
|
121446
|
+
},
|
|
121447
|
+
/* @__PURE__ */ React.createElement(
|
|
121448
|
+
"td",
|
|
121449
|
+
{
|
|
121450
|
+
className: "pl-5 pr-3 py-3",
|
|
121451
|
+
colSpan: hasTitle ? 1 : 2
|
|
121452
|
+
},
|
|
121453
|
+
/* @__PURE__ */ React.createElement(
|
|
121454
|
+
"a",
|
|
121455
|
+
{
|
|
121456
|
+
className: "text-blue-600 flex items-center gap-3 cursor-pointer truncate",
|
|
121457
|
+
onClick: () => {
|
|
121458
|
+
handleNavigate(
|
|
121459
|
+
navigate,
|
|
121460
|
+
cms,
|
|
121461
|
+
collection,
|
|
121462
|
+
collectionDefinition,
|
|
121463
|
+
document2.node
|
|
121464
|
+
);
|
|
121305
121465
|
}
|
|
121306
121466
|
},
|
|
121307
|
-
|
|
121308
|
-
|
|
121309
|
-
|
|
121310
|
-
|
|
121311
|
-
|
|
121312
|
-
|
|
121313
|
-
|
|
121314
|
-
|
|
121467
|
+
/* @__PURE__ */ React.createElement(BiFile, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
121468
|
+
/* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block truncate mb-1" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, hasTitle ? (_a3 = document2.node._sys) == null ? void 0 : _a3.title : document2.node._sys.filename)), /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400" }, document2.node._sys.path))
|
|
121469
|
+
)
|
|
121470
|
+
),
|
|
121471
|
+
hasTitle && /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, document2.node._sys.filename))),
|
|
121472
|
+
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
|
|
121473
|
+
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
|
|
121474
|
+
/* @__PURE__ */ React.createElement("td", { className: "w-0" }, /* @__PURE__ */ React.createElement(
|
|
121475
|
+
OverflowMenu$1,
|
|
121476
|
+
{
|
|
121477
|
+
toolbarItems: [
|
|
121478
|
+
{
|
|
121479
|
+
name: "edit",
|
|
121480
|
+
label: "Edit in Admin",
|
|
121481
|
+
Icon: /* @__PURE__ */ React.createElement(BiEdit, { size: "1.3rem" }),
|
|
121482
|
+
onMouseDown: () => {
|
|
121483
|
+
const pathToDoc = document2.node._sys.breadcrumbs;
|
|
121484
|
+
if (folder.fullyQualifiedName) {
|
|
121485
|
+
pathToDoc.unshift(
|
|
121486
|
+
"~"
|
|
121487
|
+
);
|
|
121488
|
+
}
|
|
121489
|
+
navigate(
|
|
121490
|
+
`/${[
|
|
121491
|
+
"collections",
|
|
121492
|
+
"edit",
|
|
121493
|
+
collectionName,
|
|
121494
|
+
...pathToDoc
|
|
121495
|
+
].join("/")}`,
|
|
121496
|
+
{ replace: true }
|
|
121497
|
+
);
|
|
121498
|
+
}
|
|
121499
|
+
},
|
|
121500
|
+
allowCreate && {
|
|
121501
|
+
name: "duplicate",
|
|
121502
|
+
label: "Duplicate",
|
|
121503
|
+
Icon: /* @__PURE__ */ React.createElement(BiCopy, { size: "1.3rem" }),
|
|
121504
|
+
onMouseDown: () => {
|
|
121505
|
+
const pathToDoc = document2.node._sys.breadcrumbs;
|
|
121506
|
+
if (folder.fullyQualifiedName) {
|
|
121507
|
+
pathToDoc.unshift(
|
|
121508
|
+
"~"
|
|
121509
|
+
);
|
|
121510
|
+
}
|
|
121511
|
+
navigate(
|
|
121512
|
+
`/${[
|
|
121513
|
+
"collections",
|
|
121514
|
+
"duplicate",
|
|
121515
|
+
collectionName,
|
|
121516
|
+
...pathToDoc
|
|
121517
|
+
].join("/")}`,
|
|
121518
|
+
{ replace: true }
|
|
121519
|
+
);
|
|
121520
|
+
}
|
|
121521
|
+
},
|
|
121522
|
+
allowDelete && {
|
|
121523
|
+
name: "rename",
|
|
121524
|
+
label: "Rename",
|
|
121525
|
+
Icon: /* @__PURE__ */ React.createElement(BiRename, { size: "1.3rem" }),
|
|
121526
|
+
onMouseDown: () => {
|
|
121527
|
+
setVars((old) => ({
|
|
121528
|
+
...old,
|
|
121529
|
+
collection: collectionName,
|
|
121530
|
+
relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
|
|
121531
|
+
"/"
|
|
121532
|
+
),
|
|
121533
|
+
relativePath: document2.node._sys.breadcrumbs.join(
|
|
121534
|
+
"/"
|
|
121535
|
+
) + document2.node._sys.extension,
|
|
121536
|
+
newRelativePath: ""
|
|
121537
|
+
}));
|
|
121538
|
+
setRenameModalOpen(
|
|
121539
|
+
true
|
|
121540
|
+
);
|
|
121541
|
+
}
|
|
121542
|
+
},
|
|
121543
|
+
allowDelete && {
|
|
121544
|
+
name: "delete",
|
|
121545
|
+
label: "Delete",
|
|
121546
|
+
Icon: /* @__PURE__ */ React.createElement(
|
|
121547
|
+
BiTrash,
|
|
121548
|
+
{
|
|
121549
|
+
size: "1.3rem",
|
|
121550
|
+
className: "text-red-500"
|
|
121551
|
+
}
|
|
121552
|
+
),
|
|
121553
|
+
className: "text-red-500",
|
|
121554
|
+
onMouseDown: () => {
|
|
121555
|
+
setVars((old) => ({
|
|
121556
|
+
...old,
|
|
121557
|
+
collection: collectionName,
|
|
121558
|
+
relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
|
|
121559
|
+
"/"
|
|
121560
|
+
),
|
|
121561
|
+
relativePath: document2.node._sys.breadcrumbs.join(
|
|
121562
|
+
"/"
|
|
121563
|
+
) + document2.node._sys.extension,
|
|
121564
|
+
newRelativePath: ""
|
|
121565
|
+
}));
|
|
121566
|
+
setDeleteModalOpen(
|
|
121567
|
+
true
|
|
121568
|
+
);
|
|
121315
121569
|
}
|
|
121316
|
-
),
|
|
121317
|
-
className: "text-red-500",
|
|
121318
|
-
onMouseDown: () => {
|
|
121319
|
-
setVars((old) => ({
|
|
121320
|
-
...old,
|
|
121321
|
-
collection: collectionName,
|
|
121322
|
-
relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
|
|
121323
|
-
"/"
|
|
121324
|
-
),
|
|
121325
|
-
relativePath: document2.node._sys.breadcrumbs.join(
|
|
121326
|
-
"/"
|
|
121327
|
-
) + document2.node._sys.extension,
|
|
121328
|
-
newRelativePath: ""
|
|
121329
|
-
}));
|
|
121330
|
-
setDeleteModalOpen(true);
|
|
121331
121570
|
}
|
|
121332
|
-
|
|
121333
|
-
|
|
121334
|
-
|
|
121335
|
-
)
|
|
121336
|
-
);
|
|
121337
|
-
})))), documents.length === 0 && /* @__PURE__ */ React.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React.createElement(
|
|
121571
|
+
].filter(Boolean)
|
|
121572
|
+
}
|
|
121573
|
+
))
|
|
121574
|
+
);
|
|
121575
|
+
})));
|
|
121576
|
+
})())), documents.length === 0 && /* @__PURE__ */ React.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React.createElement(
|
|
121338
121577
|
CursorPaginator,
|
|
121339
121578
|
{
|
|
121340
121579
|
variant: "white",
|
|
@@ -121494,20 +121733,47 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121494
121733
|
close: close2,
|
|
121495
121734
|
createFunc,
|
|
121496
121735
|
folderName,
|
|
121497
|
-
setFolderName
|
|
121736
|
+
setFolderName,
|
|
121737
|
+
validationRegex
|
|
121498
121738
|
}) => {
|
|
121739
|
+
const [isFolderNameValid, setIsFolderNameValid] = React.useState(false);
|
|
121740
|
+
const [isInteracted, setIsInteracted] = React.useState(false);
|
|
121741
|
+
React.useEffect(() => {
|
|
121742
|
+
validateFolderName(folderName);
|
|
121743
|
+
}, [folderName]);
|
|
121744
|
+
const validateFolderName = (name) => {
|
|
121745
|
+
if (!validationRegex || !name.trim()) {
|
|
121746
|
+
setIsFolderNameValid(!!name.trim());
|
|
121747
|
+
return !!name.trim();
|
|
121748
|
+
}
|
|
121749
|
+
try {
|
|
121750
|
+
const regex = new RegExp(validationRegex);
|
|
121751
|
+
const valid = regex.test(name);
|
|
121752
|
+
setIsFolderNameValid(valid);
|
|
121753
|
+
return valid;
|
|
121754
|
+
} catch (error2) {
|
|
121755
|
+
setIsFolderNameValid(false);
|
|
121756
|
+
return false;
|
|
121757
|
+
}
|
|
121758
|
+
};
|
|
121499
121759
|
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Create Folder"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
121500
121760
|
BaseTextField,
|
|
121501
121761
|
{
|
|
121502
121762
|
placeholder: "Enter the name of the new folder",
|
|
121503
121763
|
value: folderName,
|
|
121504
|
-
|
|
121764
|
+
className: `mb-4 ${!isFolderNameValid && isInteracted ? "border-red-500" : ""}`,
|
|
121765
|
+
onChange: (event) => {
|
|
121766
|
+
setFolderName(event.target.value);
|
|
121767
|
+
setIsInteracted(true);
|
|
121768
|
+
validateFolderName(event.target.value);
|
|
121769
|
+
}
|
|
121505
121770
|
}
|
|
121506
|
-
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
121771
|
+
), !isFolderNameValid && isInteracted && /* @__PURE__ */ React.createElement("p", { className: "text-red-500 text-sm pl-1" }, "Folder name is not valid – please enter a valid folder name."))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
121507
121772
|
Button$1,
|
|
121508
121773
|
{
|
|
121509
121774
|
style: { flexGrow: 3 },
|
|
121510
121775
|
variant: "primary",
|
|
121776
|
+
disabled: !isFolderNameValid,
|
|
121511
121777
|
onClick: async () => {
|
|
121512
121778
|
await createFunc();
|
|
121513
121779
|
close2();
|