tinacms 2.9.3 → 2.9.4
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 +1098 -1080
- package/dist/index.mjs +1029 -1009
- package/dist/toolkit/components/ui/sonner.d.ts +12 -0
- 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/package.json +6 -4
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, pkg$1, pkg,
|
|
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("react-beautiful-dnd"), 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("dompurify"), require("sonner"), 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", "react-beautiful-dnd", "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", "dompurify", "sonner", "@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, reactBeautifulDnd, pkg$1, pkg, graphql$1, core$1, dropzone, cmdk$1, react$1, plateTrailingBlock, plateFloating, plateBlockQuote, plateNodeId, plateLink, plateAutoformat, get$5, moment, dateFns, DOMPurify, sonner, 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,270 @@ 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
|
+
function FaCircle(props) {
|
|
38964
|
+
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);
|
|
38965
|
+
}
|
|
38966
|
+
function FaFile(props) {
|
|
38967
|
+
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);
|
|
38968
|
+
}
|
|
38969
|
+
function FaFolder(props) {
|
|
38970
|
+
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);
|
|
38971
|
+
}
|
|
38972
|
+
function FaLock(props) {
|
|
38973
|
+
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);
|
|
38974
|
+
}
|
|
38975
|
+
function FaSpinner(props) {
|
|
38976
|
+
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);
|
|
38977
|
+
}
|
|
38978
|
+
function FaUnlock(props) {
|
|
38979
|
+
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);
|
|
38980
|
+
}
|
|
38576
38981
|
const Dismissible = ({
|
|
38577
38982
|
onDismiss,
|
|
38578
38983
|
escape: escape2,
|
|
@@ -38645,64 +39050,217 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38645
39050
|
}, [click, customDocument, escape2, disabled, onDismiss]);
|
|
38646
39051
|
return area;
|
|
38647
39052
|
}
|
|
38648
|
-
const {
|
|
38649
|
-
|
|
38650
|
-
|
|
38651
|
-
|
|
38652
|
-
|
|
38653
|
-
|
|
38654
|
-
|
|
38655
|
-
|
|
38656
|
-
|
|
38657
|
-
|
|
38658
|
-
|
|
38659
|
-
return null;
|
|
38660
|
-
}
|
|
38661
|
-
const colorDescriptor = getColor(color);
|
|
38662
|
-
if (!colorDescriptor)
|
|
38663
|
-
return null;
|
|
38664
|
-
const colorVals = colorDescriptor.value;
|
|
38665
|
-
return { r: colorVals[0], g: colorVals[1], b: colorVals[2], a: colorVals[3] };
|
|
38666
|
-
}
|
|
38667
|
-
const ColorFormatter = {
|
|
38668
|
-
[
|
|
38669
|
-
"rgb"
|
|
38670
|
-
/* RGB */
|
|
38671
|
-
]: {
|
|
38672
|
-
getLabel(color) {
|
|
38673
|
-
return `R${color.r} G${color.g} B${color.b}`;
|
|
38674
|
-
},
|
|
38675
|
-
getValue(color) {
|
|
38676
|
-
const colorVals = [color.r, color.g, color.b, color.a];
|
|
38677
|
-
return toColor.rgb(colorVals);
|
|
38678
|
-
},
|
|
38679
|
-
parse: ParseColorStr
|
|
38680
|
-
},
|
|
38681
|
-
[
|
|
38682
|
-
"hex"
|
|
38683
|
-
/* Hex */
|
|
38684
|
-
]: {
|
|
38685
|
-
getLabel(color) {
|
|
38686
|
-
return rgbToHex(color);
|
|
38687
|
-
},
|
|
38688
|
-
getValue(color) {
|
|
38689
|
-
const colorVals = [color.r, color.g, color.b, color.a];
|
|
38690
|
-
return toColor.hex(colorVals);
|
|
39053
|
+
const FormActionMenu = ({ actions, form }) => {
|
|
39054
|
+
const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
|
|
39055
|
+
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(
|
|
39056
|
+
Dismissible,
|
|
39057
|
+
{
|
|
39058
|
+
click: true,
|
|
39059
|
+
escape: true,
|
|
39060
|
+
disabled: !actionMenuVisibility,
|
|
39061
|
+
onDismiss: () => {
|
|
39062
|
+
setActionMenuVisibility((p2) => !p2);
|
|
39063
|
+
}
|
|
38691
39064
|
},
|
|
38692
|
-
|
|
38693
|
-
|
|
38694
|
-
|
|
38695
|
-
|
|
38696
|
-
|
|
38697
|
-
|
|
39065
|
+
actions.map((Action, i2) => (
|
|
39066
|
+
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
39067
|
+
// Actions should just be componets
|
|
39068
|
+
/* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
|
|
39069
|
+
))
|
|
39070
|
+
)));
|
|
38698
39071
|
};
|
|
38699
|
-
const
|
|
38700
|
-
|
|
38701
|
-
|
|
38702
|
-
|
|
38703
|
-
|
|
38704
|
-
|
|
38705
|
-
|
|
39072
|
+
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39073
|
+
"button",
|
|
39074
|
+
{
|
|
39075
|
+
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}`,
|
|
39076
|
+
...props
|
|
39077
|
+
},
|
|
39078
|
+
/* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
|
|
39079
|
+
);
|
|
39080
|
+
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39081
|
+
"div",
|
|
39082
|
+
{
|
|
39083
|
+
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}`,
|
|
39084
|
+
style: {
|
|
39085
|
+
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
39086
|
+
pointerEvents: open ? "all" : "none",
|
|
39087
|
+
...style
|
|
39088
|
+
},
|
|
39089
|
+
...props
|
|
39090
|
+
}
|
|
39091
|
+
);
|
|
39092
|
+
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39093
|
+
"button",
|
|
39094
|
+
{
|
|
39095
|
+
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}`,
|
|
39096
|
+
...props
|
|
39097
|
+
}
|
|
39098
|
+
);
|
|
39099
|
+
const FormPortalContext = React__namespace.createContext(() => {
|
|
39100
|
+
return null;
|
|
39101
|
+
});
|
|
39102
|
+
function useFormPortal() {
|
|
39103
|
+
return React__namespace.useContext(FormPortalContext);
|
|
39104
|
+
}
|
|
39105
|
+
const FormPortalProvider = ({
|
|
39106
|
+
children
|
|
39107
|
+
}) => {
|
|
39108
|
+
const wrapperRef = React__namespace.useRef(null);
|
|
39109
|
+
const zIndexRef = React__namespace.useRef(0);
|
|
39110
|
+
const FormPortal = React__namespace.useCallback(
|
|
39111
|
+
(props) => {
|
|
39112
|
+
if (!wrapperRef.current)
|
|
39113
|
+
return null;
|
|
39114
|
+
return ReactDOM.createPortal(
|
|
39115
|
+
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
39116
|
+
wrapperRef.current
|
|
39117
|
+
);
|
|
39118
|
+
},
|
|
39119
|
+
[wrapperRef, zIndexRef]
|
|
39120
|
+
);
|
|
39121
|
+
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));
|
|
39122
|
+
};
|
|
39123
|
+
const LoadingDots = ({
|
|
39124
|
+
dotSize = 8,
|
|
39125
|
+
color = "white"
|
|
39126
|
+
}) => {
|
|
39127
|
+
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 }));
|
|
39128
|
+
};
|
|
39129
|
+
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
|
|
39130
|
+
"span",
|
|
39131
|
+
{
|
|
39132
|
+
className: "inline-block mr-1",
|
|
39133
|
+
style: {
|
|
39134
|
+
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
39135
|
+
animationDelay: `${delay}s`,
|
|
39136
|
+
background: color,
|
|
39137
|
+
width: dotSize,
|
|
39138
|
+
height: dotSize,
|
|
39139
|
+
borderRadius: dotSize
|
|
39140
|
+
}
|
|
39141
|
+
}
|
|
39142
|
+
);
|
|
39143
|
+
const ResetForm = ({
|
|
39144
|
+
pristine,
|
|
39145
|
+
reset: reset2,
|
|
39146
|
+
children,
|
|
39147
|
+
...props
|
|
39148
|
+
}) => {
|
|
39149
|
+
const [open, setOpen] = React__namespace.useState(false);
|
|
39150
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
39151
|
+
Button$1,
|
|
39152
|
+
{
|
|
39153
|
+
onClick: () => {
|
|
39154
|
+
setOpen((p2) => !p2);
|
|
39155
|
+
},
|
|
39156
|
+
disabled: pristine,
|
|
39157
|
+
...props
|
|
39158
|
+
},
|
|
39159
|
+
children
|
|
39160
|
+
), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
39161
|
+
};
|
|
39162
|
+
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
39163
|
+
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(
|
|
39164
|
+
Button$1,
|
|
39165
|
+
{
|
|
39166
|
+
style: { flexGrow: 3 },
|
|
39167
|
+
variant: "primary",
|
|
39168
|
+
onClick: async () => {
|
|
39169
|
+
await reset2();
|
|
39170
|
+
close2();
|
|
39171
|
+
}
|
|
39172
|
+
},
|
|
39173
|
+
"Reset"
|
|
39174
|
+
))));
|
|
39175
|
+
};
|
|
39176
|
+
function AiFillWarning(props) {
|
|
39177
|
+
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);
|
|
39178
|
+
}
|
|
39179
|
+
function AiOutlineLoading(props) {
|
|
39180
|
+
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);
|
|
39181
|
+
}
|
|
39182
|
+
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";
|
|
39183
|
+
const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
|
|
39184
|
+
const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
|
|
39185
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
39186
|
+
"input",
|
|
39187
|
+
{
|
|
39188
|
+
ref,
|
|
39189
|
+
type: "text",
|
|
39190
|
+
className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
|
|
39191
|
+
...rest
|
|
39192
|
+
}
|
|
39193
|
+
);
|
|
39194
|
+
});
|
|
39195
|
+
const TextArea = React__namespace.forwardRef(({ ...props }, ref) => {
|
|
39196
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
39197
|
+
"textarea",
|
|
39198
|
+
{
|
|
39199
|
+
...props,
|
|
39200
|
+
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",
|
|
39201
|
+
ref,
|
|
39202
|
+
style: { minHeight: "160px" }
|
|
39203
|
+
}
|
|
39204
|
+
);
|
|
39205
|
+
});
|
|
39206
|
+
const { get: getColor, to: toColor } = pkg__namespace;
|
|
39207
|
+
var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
|
|
39208
|
+
ColorFormat2["Hex"] = "hex";
|
|
39209
|
+
ColorFormat2["RGB"] = "rgb";
|
|
39210
|
+
return ColorFormat2;
|
|
39211
|
+
})(ColorFormat || {});
|
|
39212
|
+
const rgbToHex = function(color) {
|
|
39213
|
+
return "#" + ((1 << 24) + (color.r << 16) + (color.g << 8) + color.b).toString(16).slice(1);
|
|
39214
|
+
};
|
|
39215
|
+
function ParseColorStr(color) {
|
|
39216
|
+
if (!color) {
|
|
39217
|
+
return null;
|
|
39218
|
+
}
|
|
39219
|
+
const colorDescriptor = getColor(color);
|
|
39220
|
+
if (!colorDescriptor)
|
|
39221
|
+
return null;
|
|
39222
|
+
const colorVals = colorDescriptor.value;
|
|
39223
|
+
return { r: colorVals[0], g: colorVals[1], b: colorVals[2], a: colorVals[3] };
|
|
39224
|
+
}
|
|
39225
|
+
const ColorFormatter = {
|
|
39226
|
+
[
|
|
39227
|
+
"rgb"
|
|
39228
|
+
/* RGB */
|
|
39229
|
+
]: {
|
|
39230
|
+
getLabel(color) {
|
|
39231
|
+
return `R${color.r} G${color.g} B${color.b}`;
|
|
39232
|
+
},
|
|
39233
|
+
getValue(color) {
|
|
39234
|
+
const colorVals = [color.r, color.g, color.b, color.a];
|
|
39235
|
+
return toColor.rgb(colorVals);
|
|
39236
|
+
},
|
|
39237
|
+
parse: ParseColorStr
|
|
39238
|
+
},
|
|
39239
|
+
[
|
|
39240
|
+
"hex"
|
|
39241
|
+
/* Hex */
|
|
39242
|
+
]: {
|
|
39243
|
+
getLabel(color) {
|
|
39244
|
+
return rgbToHex(color);
|
|
39245
|
+
},
|
|
39246
|
+
getValue(color) {
|
|
39247
|
+
const colorVals = [color.r, color.g, color.b, color.a];
|
|
39248
|
+
return toColor.hex(colorVals);
|
|
39249
|
+
},
|
|
39250
|
+
parse: ParseColorStr
|
|
39251
|
+
}
|
|
39252
|
+
};
|
|
39253
|
+
const { SketchPicker, BlockPicker } = pkg__namespace$1;
|
|
39254
|
+
const GetTextColorForBackground = function(backgroundColor) {
|
|
39255
|
+
return !backgroundColor || backgroundColor.r * 0.299 + backgroundColor.g * 0.587 + backgroundColor.b * 0.114 > 186 ? "#000000" : "#ffffff";
|
|
39256
|
+
};
|
|
39257
|
+
const Swatch = ({
|
|
39258
|
+
colorRGBA,
|
|
39259
|
+
colorFormat,
|
|
39260
|
+
unselectable,
|
|
39261
|
+
...props
|
|
39262
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
39263
|
+
"div",
|
|
38706
39264
|
{
|
|
38707
39265
|
className: "bg-gray-100 rounded-3xl shadow-[0_2px_3px_rgba(0,0,0,0.12)] cursor-pointer w-full m-0",
|
|
38708
39266
|
...props
|
|
@@ -39187,546 +39745,135 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
39187
39745
|
}
|
|
39188
39746
|
}
|
|
39189
39747
|
);
|
|
39190
|
-
function
|
|
39191
|
-
return
|
|
39748
|
+
function useCMS() {
|
|
39749
|
+
return useCMS$1();
|
|
39192
39750
|
}
|
|
39193
|
-
const
|
|
39194
|
-
|
|
39195
|
-
|
|
39196
|
-
|
|
39197
|
-
|
|
39198
|
-
|
|
39199
|
-
|
|
39200
|
-
|
|
39201
|
-
|
|
39202
|
-
|
|
39203
|
-
|
|
39204
|
-
|
|
39205
|
-
|
|
39206
|
-
|
|
39207
|
-
|
|
39208
|
-
|
|
39209
|
-
|
|
39210
|
-
|
|
39211
|
-
|
|
39212
|
-
|
|
39213
|
-
|
|
39214
|
-
|
|
39215
|
-
|
|
39216
|
-
|
|
39217
|
-
|
|
39218
|
-
|
|
39219
|
-
|
|
39220
|
-
|
|
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
|
|
39751
|
+
const supportedFileTypes = [
|
|
39752
|
+
"text/*",
|
|
39753
|
+
"application/pdf",
|
|
39754
|
+
"application/octet-stream",
|
|
39755
|
+
"application/json",
|
|
39756
|
+
"application/ld+json",
|
|
39757
|
+
"application/vnd.ms-excel",
|
|
39758
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
39759
|
+
"application/msword",
|
|
39760
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
39761
|
+
"application/postscript",
|
|
39762
|
+
"model/fbx",
|
|
39763
|
+
"model/gltf+json",
|
|
39764
|
+
"model/ply",
|
|
39765
|
+
"model/u3d+mesh",
|
|
39766
|
+
"model/vnd.usdz+zip",
|
|
39767
|
+
"application/x-indesign",
|
|
39768
|
+
"application/vnd.apple.mpegurl",
|
|
39769
|
+
"application/dash+xml",
|
|
39770
|
+
"application/mxf",
|
|
39771
|
+
"image/*",
|
|
39772
|
+
"video/*"
|
|
39773
|
+
];
|
|
39774
|
+
const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
|
|
39775
|
+
const dropzoneAcceptFromString = (str) => {
|
|
39776
|
+
return Object.assign(
|
|
39777
|
+
{},
|
|
39778
|
+
...(str || DEFAULT_MEDIA_UPLOAD_TYPES).split(",").map((x) => ({ [x]: [] }))
|
|
39246
39779
|
);
|
|
39247
39780
|
};
|
|
39248
|
-
const
|
|
39249
|
-
|
|
39250
|
-
|
|
39251
|
-
|
|
39252
|
-
|
|
39253
|
-
|
|
39254
|
-
|
|
39255
|
-
|
|
39256
|
-
|
|
39257
|
-
|
|
39258
|
-
|
|
39259
|
-
|
|
39260
|
-
|
|
39261
|
-
|
|
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
|
-
};
|
|
39781
|
+
const isImage = (filename) => {
|
|
39782
|
+
return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
|
|
39783
|
+
};
|
|
39784
|
+
const isVideo = (filename) => {
|
|
39785
|
+
return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
|
|
39786
|
+
};
|
|
39787
|
+
const absoluteImgURL = (str) => {
|
|
39788
|
+
if (str.startsWith("http"))
|
|
39789
|
+
return str;
|
|
39790
|
+
return `${window.location.origin}${str}`;
|
|
39791
|
+
};
|
|
39792
|
+
const { useDropzone: useDropzone$1 } = dropzone__namespace;
|
|
39793
|
+
const StyledImage = ({ src }) => {
|
|
39794
|
+
const isSvg = /\.svg$/.test(src);
|
|
39276
39795
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
39277
|
-
"
|
|
39796
|
+
"img",
|
|
39278
39797
|
{
|
|
39279
|
-
|
|
39280
|
-
|
|
39281
|
-
|
|
39282
|
-
sizeClasses[size2],
|
|
39283
|
-
stateClasses[state],
|
|
39284
|
-
className
|
|
39285
|
-
),
|
|
39286
|
-
...props
|
|
39287
|
-
},
|
|
39288
|
-
children
|
|
39798
|
+
src,
|
|
39799
|
+
className: `block max-w-full rounded shadow overflow-hidden max-h-48 lg:max-h-64 h-auto object-contain transition-opacity duration-100 ease-out m-0 bg-gray-200 bg-auto bg-center bg-no-repeat ${isSvg ? "min-w-[12rem]" : ""}`
|
|
39800
|
+
}
|
|
39289
39801
|
);
|
|
39290
39802
|
};
|
|
39291
|
-
|
|
39292
|
-
React__namespace.
|
|
39293
|
-
|
|
39294
|
-
|
|
39295
|
-
|
|
39296
|
-
|
|
39297
|
-
|
|
39298
|
-
|
|
39299
|
-
|
|
39300
|
-
|
|
39301
|
-
|
|
39302
|
-
|
|
39303
|
-
|
|
39304
|
-
|
|
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,
|
|
39803
|
+
const StyledFile = ({ src }) => {
|
|
39804
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-full w-full flex-1 flex justify-start items-center gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-12 h-12 bg-white shadow border border-gray-100 rounded flex justify-center flex-none" }, /* @__PURE__ */ React__namespace.createElement(BiFileBlank, { className: "w-3/5 h-full fill-gray-300" })), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-base text-left flex-1 text-gray-500 w-full break-words truncate" }, src));
|
|
39805
|
+
};
|
|
39806
|
+
const ImageUpload = React__namespace.forwardRef(({ onDrop, onClear, onClick, value, src, loading }, ref) => {
|
|
39807
|
+
const cms = useCMS();
|
|
39808
|
+
const { getRootProps, getInputProps } = useDropzone$1({
|
|
39809
|
+
accept: dropzoneAcceptFromString(
|
|
39810
|
+
cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
|
|
39811
|
+
),
|
|
39812
|
+
onDrop,
|
|
39813
|
+
noClick: !!onClick
|
|
39814
|
+
});
|
|
39815
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full max-w-full", ...getRootProps() }, /* @__PURE__ */ React__namespace.createElement("input", { ...getInputProps() }), value ? loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement(
|
|
39816
|
+
"div",
|
|
39310
39817
|
{
|
|
39311
|
-
className: `
|
|
39818
|
+
className: `relative w-full max-w-full flex justify-start ${isImage(src) ? `items-start gap-3` : `items-center gap-2`}`
|
|
39312
39819
|
},
|
|
39313
|
-
/* @__PURE__ */
|
|
39314
|
-
"
|
|
39820
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
39821
|
+
"button",
|
|
39315
39822
|
{
|
|
39316
|
-
|
|
39317
|
-
|
|
39318
|
-
|
|
39319
|
-
viewBox: "0 0 24 24",
|
|
39320
|
-
stroke: "currentColor"
|
|
39823
|
+
className: "flex-shrink min-w-0 focus-within:shadow-outline focus-within:border-blue-500 rounded outline-none overflow-visible cursor-pointer border-none hover:opacity-60 transition ease-out duration-100",
|
|
39824
|
+
onClick,
|
|
39825
|
+
ref
|
|
39321
39826
|
},
|
|
39322
|
-
/* @__PURE__ */
|
|
39323
|
-
|
|
39324
|
-
|
|
39325
|
-
|
|
39326
|
-
|
|
39327
|
-
|
|
39328
|
-
|
|
39827
|
+
isImage(src) ? /* @__PURE__ */ React__namespace.createElement(StyledImage, { src }) : /* @__PURE__ */ React__namespace.createElement(StyledFile, { src })
|
|
39828
|
+
),
|
|
39829
|
+
onClear && /* @__PURE__ */ React__namespace.createElement(
|
|
39830
|
+
DeleteImageButton,
|
|
39831
|
+
{
|
|
39832
|
+
onClick: (e3) => {
|
|
39833
|
+
e3.stopPropagation();
|
|
39834
|
+
onClear();
|
|
39329
39835
|
}
|
|
39330
|
-
|
|
39836
|
+
}
|
|
39331
39837
|
)
|
|
39332
|
-
)
|
|
39333
|
-
|
|
39334
|
-
|
|
39335
|
-
|
|
39336
|
-
|
|
39337
|
-
|
|
39338
|
-
|
|
39339
|
-
|
|
39340
|
-
|
|
39341
|
-
|
|
39342
|
-
|
|
39343
|
-
|
|
39344
|
-
|
|
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
|
-
}))))));
|
|
39838
|
+
) : /* @__PURE__ */ React__namespace.createElement(
|
|
39839
|
+
"button",
|
|
39840
|
+
{
|
|
39841
|
+
className: "outline-none relative hover:opacity-60 w-full",
|
|
39842
|
+
onClick
|
|
39843
|
+
},
|
|
39844
|
+
loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement("div", { className: "text-center rounded-[5px] bg-gray-100 text-gray-300 leading-[1.35] py-3 text-[15px] font-normal transition-all ease-out duration-100 hover:opacity-60" }, "Drag 'n' drop a file here,", /* @__PURE__ */ React__namespace.createElement("br", null), "or click to select a file")
|
|
39845
|
+
));
|
|
39846
|
+
});
|
|
39847
|
+
const DeleteImageButton = ({
|
|
39848
|
+
onClick
|
|
39849
|
+
}) => {
|
|
39850
|
+
return /* @__PURE__ */ React__namespace.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React__namespace.createElement(TrashIcon, { className: "w-7 h-auto caret-transparent" }));
|
|
39354
39851
|
};
|
|
39355
|
-
|
|
39356
|
-
|
|
39852
|
+
const ImageLoadingIndicator = () => /* @__PURE__ */ React__namespace.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React__namespace.createElement(LoadingDots, null));
|
|
39853
|
+
function IoMdArrowDropdown(props) {
|
|
39854
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
|
|
39357
39855
|
}
|
|
39358
|
-
function
|
|
39359
|
-
return GenIcon({ "tag": "svg", "attr": { "
|
|
39856
|
+
function IoMdArrowDropup(props) {
|
|
39857
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
|
|
39360
39858
|
}
|
|
39361
|
-
function
|
|
39362
|
-
return GenIcon({ "tag": "svg", "attr": { "
|
|
39859
|
+
function IoMdClose(props) {
|
|
39860
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z" }, "child": [] }] })(props);
|
|
39363
39861
|
}
|
|
39364
|
-
|
|
39365
|
-
|
|
39366
|
-
|
|
39367
|
-
|
|
39368
|
-
|
|
39369
|
-
|
|
39370
|
-
|
|
39371
|
-
|
|
39372
|
-
|
|
39373
|
-
|
|
39374
|
-
|
|
39375
|
-
|
|
39376
|
-
|
|
39377
|
-
|
|
39378
|
-
|
|
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,
|
|
39457
|
-
{
|
|
39458
|
-
"data-slot": "dropdown-menu-content",
|
|
39459
|
-
sideOffset,
|
|
39460
|
-
className: cn(
|
|
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
|
-
}
|
|
39466
|
-
));
|
|
39467
|
-
}
|
|
39468
|
-
function DropdownMenuItem({
|
|
39469
|
-
className,
|
|
39470
|
-
inset,
|
|
39471
|
-
variant = "default",
|
|
39472
|
-
...props
|
|
39473
|
-
}) {
|
|
39474
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39475
|
-
DropdownMenuPrimitive__namespace.Item,
|
|
39476
|
-
{
|
|
39477
|
-
"data-slot": "dropdown-menu-item",
|
|
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
|
-
),
|
|
39484
|
-
...props
|
|
39485
|
-
}
|
|
39486
|
-
);
|
|
39487
|
-
}
|
|
39488
|
-
function DropdownMenuSeparator({
|
|
39489
|
-
className,
|
|
39490
|
-
...props
|
|
39491
|
-
}) {
|
|
39492
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39493
|
-
DropdownMenuPrimitive__namespace.Separator,
|
|
39494
|
-
{
|
|
39495
|
-
"data-slot": "dropdown-menu-separator",
|
|
39496
|
-
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
39497
|
-
...props
|
|
39498
|
-
}
|
|
39499
|
-
);
|
|
39500
|
-
}
|
|
39501
|
-
const DropdownButton = React__namespace.forwardRef(
|
|
39502
|
-
({
|
|
39503
|
-
variant = "primary",
|
|
39504
|
-
size: size2 = "medium",
|
|
39505
|
-
busy,
|
|
39506
|
-
disabled,
|
|
39507
|
-
rounded = "full",
|
|
39508
|
-
children,
|
|
39509
|
-
className = "",
|
|
39510
|
-
onMainAction,
|
|
39511
|
-
items: items2,
|
|
39512
|
-
showSplitButton = true,
|
|
39513
|
-
...props
|
|
39514
|
-
}, ref) => {
|
|
39515
|
-
const [open, setOpen] = React__namespace.useState(false);
|
|
39516
|
-
if (!onMainAction || !showSplitButton) {
|
|
39517
|
-
return /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
|
|
39518
|
-
Button$1,
|
|
39519
|
-
{
|
|
39520
|
-
variant,
|
|
39521
|
-
size: size2,
|
|
39522
|
-
busy,
|
|
39523
|
-
disabled,
|
|
39524
|
-
rounded,
|
|
39525
|
-
className: cn$1("gap-2", className),
|
|
39526
|
-
...props
|
|
39527
|
-
},
|
|
39528
|
-
children,
|
|
39529
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39530
|
-
lucideReact.ChevronDownIcon,
|
|
39531
|
-
{
|
|
39532
|
-
className: cn$1(
|
|
39533
|
-
"h-4 w-4 transition-transform duration-200",
|
|
39534
|
-
open && "rotate-180"
|
|
39535
|
-
)
|
|
39536
|
-
}
|
|
39537
|
-
)
|
|
39538
|
-
)), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React__namespace.createElement(
|
|
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
|
-
},
|
|
39575
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39576
|
-
lucideReact.ChevronDownIcon,
|
|
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,
|
|
39589
|
-
{
|
|
39590
|
-
onClick: item.onClick,
|
|
39591
|
-
disabled: item.disabled,
|
|
39592
|
-
variant: item.variant
|
|
39593
|
-
},
|
|
39594
|
-
item.icon && item.icon,
|
|
39595
|
-
item.label
|
|
39596
|
-
), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React__namespace.createElement(DropdownMenuSeparator, null));
|
|
39597
|
-
}))));
|
|
39598
|
-
}
|
|
39599
|
-
);
|
|
39600
|
-
DropdownButton.displayName = "DropdownButton";
|
|
39601
|
-
function useCMS() {
|
|
39602
|
-
return useCMS$1();
|
|
39603
|
-
}
|
|
39604
|
-
const supportedFileTypes = [
|
|
39605
|
-
"text/*",
|
|
39606
|
-
"application/pdf",
|
|
39607
|
-
"application/octet-stream",
|
|
39608
|
-
"application/json",
|
|
39609
|
-
"application/ld+json",
|
|
39610
|
-
"application/vnd.ms-excel",
|
|
39611
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
39612
|
-
"application/msword",
|
|
39613
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
39614
|
-
"application/postscript",
|
|
39615
|
-
"model/fbx",
|
|
39616
|
-
"model/gltf+json",
|
|
39617
|
-
"model/ply",
|
|
39618
|
-
"model/u3d+mesh",
|
|
39619
|
-
"model/vnd.usdz+zip",
|
|
39620
|
-
"application/x-indesign",
|
|
39621
|
-
"application/vnd.apple.mpegurl",
|
|
39622
|
-
"application/dash+xml",
|
|
39623
|
-
"application/mxf",
|
|
39624
|
-
"image/*",
|
|
39625
|
-
"video/*"
|
|
39626
|
-
];
|
|
39627
|
-
const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
|
|
39628
|
-
const dropzoneAcceptFromString = (str) => {
|
|
39629
|
-
return Object.assign(
|
|
39630
|
-
{},
|
|
39631
|
-
...(str || DEFAULT_MEDIA_UPLOAD_TYPES).split(",").map((x) => ({ [x]: [] }))
|
|
39632
|
-
);
|
|
39633
|
-
};
|
|
39634
|
-
const isImage = (filename) => {
|
|
39635
|
-
return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
|
|
39636
|
-
};
|
|
39637
|
-
const isVideo = (filename) => {
|
|
39638
|
-
return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
|
|
39639
|
-
};
|
|
39640
|
-
const absoluteImgURL = (str) => {
|
|
39641
|
-
if (str.startsWith("http"))
|
|
39642
|
-
return str;
|
|
39643
|
-
return `${window.location.origin}${str}`;
|
|
39644
|
-
};
|
|
39645
|
-
const { useDropzone: useDropzone$1 } = dropzone__namespace;
|
|
39646
|
-
const StyledImage = ({ src }) => {
|
|
39647
|
-
const isSvg = /\.svg$/.test(src);
|
|
39648
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39649
|
-
"img",
|
|
39650
|
-
{
|
|
39651
|
-
src,
|
|
39652
|
-
className: `block max-w-full rounded shadow overflow-hidden max-h-48 lg:max-h-64 h-auto object-contain transition-opacity duration-100 ease-out m-0 bg-gray-200 bg-auto bg-center bg-no-repeat ${isSvg ? "min-w-[12rem]" : ""}`
|
|
39653
|
-
}
|
|
39654
|
-
);
|
|
39655
|
-
};
|
|
39656
|
-
const StyledFile = ({ src }) => {
|
|
39657
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-full w-full flex-1 flex justify-start items-center gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-12 h-12 bg-white shadow border border-gray-100 rounded flex justify-center flex-none" }, /* @__PURE__ */ React__namespace.createElement(BiFileBlank, { className: "w-3/5 h-full fill-gray-300" })), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-base text-left flex-1 text-gray-500 w-full break-words truncate" }, src));
|
|
39658
|
-
};
|
|
39659
|
-
const ImageUpload = React__namespace.forwardRef(({ onDrop, onClear, onClick, value, src, loading }, ref) => {
|
|
39660
|
-
const cms = useCMS();
|
|
39661
|
-
const { getRootProps, getInputProps } = useDropzone$1({
|
|
39662
|
-
accept: dropzoneAcceptFromString(
|
|
39663
|
-
cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
|
|
39664
|
-
),
|
|
39665
|
-
onDrop,
|
|
39666
|
-
noClick: !!onClick
|
|
39667
|
-
});
|
|
39668
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full max-w-full", ...getRootProps() }, /* @__PURE__ */ React__namespace.createElement("input", { ...getInputProps() }), value ? loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement(
|
|
39669
|
-
"div",
|
|
39670
|
-
{
|
|
39671
|
-
className: `relative w-full max-w-full flex justify-start ${isImage(src) ? `items-start gap-3` : `items-center gap-2`}`
|
|
39672
|
-
},
|
|
39673
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
39674
|
-
"button",
|
|
39675
|
-
{
|
|
39676
|
-
className: "flex-shrink min-w-0 focus-within:shadow-outline focus-within:border-blue-500 rounded outline-none overflow-visible cursor-pointer border-none hover:opacity-60 transition ease-out duration-100",
|
|
39677
|
-
onClick,
|
|
39678
|
-
ref
|
|
39679
|
-
},
|
|
39680
|
-
isImage(src) ? /* @__PURE__ */ React__namespace.createElement(StyledImage, { src }) : /* @__PURE__ */ React__namespace.createElement(StyledFile, { src })
|
|
39681
|
-
),
|
|
39682
|
-
onClear && /* @__PURE__ */ React__namespace.createElement(
|
|
39683
|
-
DeleteImageButton,
|
|
39684
|
-
{
|
|
39685
|
-
onClick: (e3) => {
|
|
39686
|
-
e3.stopPropagation();
|
|
39687
|
-
onClear();
|
|
39688
|
-
}
|
|
39689
|
-
}
|
|
39690
|
-
)
|
|
39691
|
-
) : /* @__PURE__ */ React__namespace.createElement(
|
|
39692
|
-
"button",
|
|
39693
|
-
{
|
|
39694
|
-
className: "outline-none relative hover:opacity-60 w-full",
|
|
39695
|
-
onClick
|
|
39696
|
-
},
|
|
39697
|
-
loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement("div", { className: "text-center rounded-[5px] bg-gray-100 text-gray-300 leading-[1.35] py-3 text-[15px] font-normal transition-all ease-out duration-100 hover:opacity-60" }, "Drag 'n' drop a file here,", /* @__PURE__ */ React__namespace.createElement("br", null), "or click to select a file")
|
|
39698
|
-
));
|
|
39699
|
-
});
|
|
39700
|
-
const DeleteImageButton = ({
|
|
39701
|
-
onClick
|
|
39702
|
-
}) => {
|
|
39703
|
-
return /* @__PURE__ */ React__namespace.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React__namespace.createElement(TrashIcon, { className: "w-7 h-auto caret-transparent" }));
|
|
39704
|
-
};
|
|
39705
|
-
const ImageLoadingIndicator = () => /* @__PURE__ */ React__namespace.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React__namespace.createElement(LoadingDots, null));
|
|
39706
|
-
function IoMdArrowDropdown(props) {
|
|
39707
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
|
|
39708
|
-
}
|
|
39709
|
-
function IoMdArrowDropup(props) {
|
|
39710
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
|
|
39711
|
-
}
|
|
39712
|
-
function IoMdClose(props) {
|
|
39713
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z" }, "child": [] }] })(props);
|
|
39714
|
-
}
|
|
39715
|
-
function IoMdRefresh(props) {
|
|
39716
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 388c-72.597 0-132-59.405-132-132 0-72.601 59.403-132 132-132 36.3 0 69.299 15.4 92.406 39.601L278 234h154V80l-51.698 51.702C348.406 99.798 304.406 80 256 80c-96.797 0-176 79.203-176 176s78.094 176 176 176c81.045 0 148.287-54.134 169.401-128H378.85c-18.745 49.561-67.138 84-122.85 84z" }, "child": [] }] })(props);
|
|
39717
|
-
}
|
|
39718
|
-
const buttonVariants = classVarianceAuthority.cva(
|
|
39719
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
39720
|
-
{
|
|
39721
|
-
variants: {
|
|
39722
|
-
variant: {
|
|
39723
|
-
outline: "border border-gray-200 bg-white hover:bg-white hover:text-accent-foreground"
|
|
39724
|
-
},
|
|
39725
|
-
size: {
|
|
39726
|
-
default: "h-10 px-4 py-2",
|
|
39727
|
-
sm: "h-9 rounded px-3",
|
|
39728
|
-
lg: "h-11 rounded px-8",
|
|
39729
|
-
icon: "h-10 w-10"
|
|
39862
|
+
function IoMdRefresh(props) {
|
|
39863
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 388c-72.597 0-132-59.405-132-132 0-72.601 59.403-132 132-132 36.3 0 69.299 15.4 92.406 39.601L278 234h154V80l-51.698 51.702C348.406 99.798 304.406 80 256 80c-96.797 0-176 79.203-176 176s78.094 176 176 176c81.045 0 148.287-54.134 169.401-128H378.85c-18.745 49.561-67.138 84-122.85 84z" }, "child": [] }] })(props);
|
|
39864
|
+
}
|
|
39865
|
+
const buttonVariants = classVarianceAuthority.cva(
|
|
39866
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
39867
|
+
{
|
|
39868
|
+
variants: {
|
|
39869
|
+
variant: {
|
|
39870
|
+
outline: "border border-gray-200 bg-white hover:bg-white hover:text-accent-foreground"
|
|
39871
|
+
},
|
|
39872
|
+
size: {
|
|
39873
|
+
default: "h-10 px-4 py-2",
|
|
39874
|
+
sm: "h-9 rounded px-3",
|
|
39875
|
+
lg: "h-11 rounded px-8",
|
|
39876
|
+
icon: "h-10 w-10"
|
|
39730
39877
|
}
|
|
39731
39878
|
},
|
|
39732
39879
|
defaultVariants: {
|
|
@@ -42706,30 +42853,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
42706
42853
|
},
|
|
42707
42854
|
parse: parse$2
|
|
42708
42855
|
};
|
|
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
42856
|
function GrCircleQuestion(props) {
|
|
42734
42857
|
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
42858
|
}
|
|
@@ -43445,6 +43568,93 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43445
43568
|
};
|
|
43446
43569
|
}
|
|
43447
43570
|
}
|
|
43571
|
+
const isSafeHref = (href) => {
|
|
43572
|
+
return /^https?:\/\//.test(href) && !/^javascript:/i.test(href) && !/^data:/i.test(href) && !/^vbscript:/i.test(href);
|
|
43573
|
+
};
|
|
43574
|
+
const parseUrlsInText$1 = (text) => {
|
|
43575
|
+
const urlRegex = /(https?:\/\/[^\s]+|www\.[^\s]+)/g;
|
|
43576
|
+
const parts = text.split(urlRegex);
|
|
43577
|
+
return parts.map((part, index) => {
|
|
43578
|
+
if (part.match(urlRegex)) {
|
|
43579
|
+
let href = part.startsWith("http") ? part : `https://${part}`;
|
|
43580
|
+
href = DOMPurify.sanitize(href, {
|
|
43581
|
+
ALLOWED_URI_REGEXP: /^https?:\/\/.*/i
|
|
43582
|
+
});
|
|
43583
|
+
if (isSafeHref(href)) {
|
|
43584
|
+
const safeText2 = DOMPurify.sanitize(part, {
|
|
43585
|
+
ALLOWED_TAGS: [],
|
|
43586
|
+
ALLOWED_ATTR: []
|
|
43587
|
+
});
|
|
43588
|
+
return /* @__PURE__ */ React.createElement(
|
|
43589
|
+
"a",
|
|
43590
|
+
{
|
|
43591
|
+
key: index,
|
|
43592
|
+
href,
|
|
43593
|
+
target: "_blank",
|
|
43594
|
+
rel: "noopener noreferrer",
|
|
43595
|
+
className: "underline hover:opacity-80",
|
|
43596
|
+
onClick: (e3) => e3.stopPropagation()
|
|
43597
|
+
},
|
|
43598
|
+
safeText2
|
|
43599
|
+
);
|
|
43600
|
+
} else {
|
|
43601
|
+
const safeText2 = DOMPurify.sanitize(part, {
|
|
43602
|
+
ALLOWED_TAGS: [],
|
|
43603
|
+
ALLOWED_ATTR: []
|
|
43604
|
+
});
|
|
43605
|
+
return /* @__PURE__ */ React.createElement("span", { key: index }, safeText2);
|
|
43606
|
+
}
|
|
43607
|
+
}
|
|
43608
|
+
const safeText = DOMPurify.sanitize(part, {
|
|
43609
|
+
ALLOWED_TAGS: [],
|
|
43610
|
+
ALLOWED_ATTR: []
|
|
43611
|
+
});
|
|
43612
|
+
return safeText;
|
|
43613
|
+
});
|
|
43614
|
+
};
|
|
43615
|
+
const toast = {
|
|
43616
|
+
success: (message, options) => {
|
|
43617
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43618
|
+
return sonner.toast.success(content, options);
|
|
43619
|
+
},
|
|
43620
|
+
error: (message, options) => {
|
|
43621
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43622
|
+
return sonner.toast.error(content, options);
|
|
43623
|
+
},
|
|
43624
|
+
warning: (message, options) => {
|
|
43625
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43626
|
+
return sonner.toast.warning(content, options);
|
|
43627
|
+
},
|
|
43628
|
+
info: (message, options) => {
|
|
43629
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43630
|
+
return sonner.toast.info(content, options);
|
|
43631
|
+
},
|
|
43632
|
+
dismiss: sonner.toast.dismiss
|
|
43633
|
+
};
|
|
43634
|
+
const Toaster = ({ ...props }) => {
|
|
43635
|
+
return /* @__PURE__ */ React.createElement(
|
|
43636
|
+
sonner.Toaster,
|
|
43637
|
+
{
|
|
43638
|
+
className: "toaster group",
|
|
43639
|
+
position: "top-left",
|
|
43640
|
+
closeButton: true,
|
|
43641
|
+
toastOptions: {
|
|
43642
|
+
classNames: {
|
|
43643
|
+
toast: "group toast group-[.toaster]:bg-white group-[.toaster]:shadow-lg",
|
|
43644
|
+
description: "group-[.toast]:text-gray-700",
|
|
43645
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
43646
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
43647
|
+
closeButton: "group-[.toast]:bg-white group-[.toast]:text-current group-[.toast]:border-0",
|
|
43648
|
+
success: "group-[.toaster]:border-green-500 [&_[data-icon]]:text-green-500 [&_[data-content]]:text-gray-700",
|
|
43649
|
+
error: "group-[.toaster]:border-red-500 [&_[data-icon]]:text-red-500 [&_[data-content]]:text-gray-700",
|
|
43650
|
+
warning: "group-[.toaster]:border-yellow-500 [&_[data-icon]]:text-yellow-500 [&_[data-content]]:text-gray-700",
|
|
43651
|
+
info: "group-[.toaster]:border-blue-500 [&_[data-icon]]:text-blue-500 [&_[data-content]]:text-gray-700"
|
|
43652
|
+
}
|
|
43653
|
+
},
|
|
43654
|
+
...props
|
|
43655
|
+
}
|
|
43656
|
+
);
|
|
43657
|
+
};
|
|
43448
43658
|
let Alerts$1 = class Alerts {
|
|
43449
43659
|
constructor(events2, map2 = {}) {
|
|
43450
43660
|
this.events = events2;
|
|
@@ -43472,20 +43682,43 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43472
43682
|
};
|
|
43473
43683
|
}
|
|
43474
43684
|
add(level, message, timeout = 8e3) {
|
|
43685
|
+
let id2;
|
|
43686
|
+
const toastMessage = typeof message === "string" ? message : React.createElement(message);
|
|
43687
|
+
switch (level) {
|
|
43688
|
+
case "success":
|
|
43689
|
+
id2 = toast.success(toastMessage, {
|
|
43690
|
+
duration: timeout
|
|
43691
|
+
});
|
|
43692
|
+
break;
|
|
43693
|
+
case "error":
|
|
43694
|
+
id2 = `${message}|${Date.now()}`;
|
|
43695
|
+
break;
|
|
43696
|
+
case "warn":
|
|
43697
|
+
id2 = toast.warning(toastMessage, {
|
|
43698
|
+
duration: timeout
|
|
43699
|
+
});
|
|
43700
|
+
break;
|
|
43701
|
+
case "info":
|
|
43702
|
+
default:
|
|
43703
|
+
id2 = toast.info(toastMessage, {
|
|
43704
|
+
duration: timeout
|
|
43705
|
+
});
|
|
43706
|
+
break;
|
|
43707
|
+
}
|
|
43475
43708
|
const alert = {
|
|
43476
43709
|
level,
|
|
43477
43710
|
message,
|
|
43478
43711
|
timeout,
|
|
43479
|
-
id:
|
|
43712
|
+
id: String(id2)
|
|
43480
43713
|
};
|
|
43481
43714
|
this.alerts.set(alert.id, alert);
|
|
43482
43715
|
this.events.dispatch({ type: "alerts:add", alert });
|
|
43483
|
-
let timeoutId = null;
|
|
43484
43716
|
const dismiss = () => {
|
|
43485
|
-
|
|
43717
|
+
if (level !== "error") {
|
|
43718
|
+
toast.dismiss(id2);
|
|
43719
|
+
}
|
|
43486
43720
|
this.dismiss(alert);
|
|
43487
43721
|
};
|
|
43488
|
-
timeoutId = level !== "error" ? setTimeout(dismiss, alert.timeout) : null;
|
|
43489
43722
|
return dismiss;
|
|
43490
43723
|
}
|
|
43491
43724
|
dismiss(alert) {
|
|
@@ -45430,7 +45663,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
45430
45663
|
className = "",
|
|
45431
45664
|
...props
|
|
45432
45665
|
}) => {
|
|
45433
|
-
const commonAlertStyles = "
|
|
45666
|
+
const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
|
|
45434
45667
|
const styles = {
|
|
45435
45668
|
warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
|
|
45436
45669
|
info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
|
|
@@ -46202,7 +46435,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
46202
46435
|
requiredArgs(1, arguments);
|
|
46203
46436
|
return formatDistance(dirtyDate, Date.now(), options);
|
|
46204
46437
|
}
|
|
46205
|
-
const version$1 = "2.9.
|
|
46438
|
+
const version$1 = "2.9.4";
|
|
46206
46439
|
const VersionInfo = () => {
|
|
46207
46440
|
var _a2, _b, _c, _d, _e, _f;
|
|
46208
46441
|
const cms = useCMS();
|
|
@@ -47839,21 +48072,10 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47839
48072
|
};
|
|
47840
48073
|
function Alerts({ alerts }) {
|
|
47841
48074
|
useSubscribable(alerts);
|
|
47842
|
-
if (
|
|
48075
|
+
if (alerts.all.length === 0) {
|
|
47843
48076
|
return null;
|
|
47844
48077
|
}
|
|
47845
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
47846
|
-
return alert.level !== "error";
|
|
47847
|
-
}).map((alert) => {
|
|
47848
|
-
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(
|
|
47849
|
-
CloseAlert,
|
|
47850
|
-
{
|
|
47851
|
-
onClick: () => {
|
|
47852
|
-
alerts.dismiss(alert);
|
|
47853
|
-
}
|
|
47854
|
-
}
|
|
47855
|
-
));
|
|
47856
|
-
})), alerts.all.filter((alert) => {
|
|
48078
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Toaster, null), alerts.all.filter((alert) => {
|
|
47857
48079
|
return alert.level === "error";
|
|
47858
48080
|
}).map((alert) => {
|
|
47859
48081
|
const AlertMessage = typeof alert.message === "string" ? () => {
|
|
@@ -47881,51 +48103,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47881
48103
|
))));
|
|
47882
48104
|
}));
|
|
47883
48105
|
}
|
|
47884
|
-
const Alert = ({
|
|
47885
|
-
level,
|
|
47886
|
-
...props
|
|
47887
|
-
}) => {
|
|
47888
|
-
const colorClasses = {
|
|
47889
|
-
info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
|
|
47890
|
-
success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
|
|
47891
|
-
warn: "bg-yellow-100 border-yellow-500 text-yellow-600 fill-yellow-500",
|
|
47892
|
-
error: "bg-red-100 border-red-500 text-red-600 fill-red-500"
|
|
47893
|
-
};
|
|
47894
|
-
const borderClasses = {
|
|
47895
|
-
info: "border-blue-200",
|
|
47896
|
-
success: "border-green-200",
|
|
47897
|
-
warn: "border-yellow-200",
|
|
47898
|
-
error: "border-red-200"
|
|
47899
|
-
};
|
|
47900
|
-
return /* @__PURE__ */ React.createElement(
|
|
47901
|
-
"div",
|
|
47902
|
-
{
|
|
47903
|
-
className: `rounded shadow-lg font-normal cursor-pointer pointer-events-all text-sm transition-all duration-100 ease-out mb-4 max-w-full ${colorClasses[level]}}`,
|
|
47904
|
-
style: {
|
|
47905
|
-
animationName: "fly-in-up, fade-in",
|
|
47906
|
-
animationTimingFunction: "ease-out",
|
|
47907
|
-
animationIterationCount: 1,
|
|
47908
|
-
animationFillMode: "both",
|
|
47909
|
-
animationDuration: "150ms"
|
|
47910
|
-
}
|
|
47911
|
-
},
|
|
47912
|
-
/* @__PURE__ */ React.createElement(
|
|
47913
|
-
"div",
|
|
47914
|
-
{
|
|
47915
|
-
className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
|
|
47916
|
-
...props
|
|
47917
|
-
}
|
|
47918
|
-
)
|
|
47919
|
-
);
|
|
47920
|
-
};
|
|
47921
|
-
const CloseAlert = ({ ...styleProps }) => /* @__PURE__ */ React.createElement(
|
|
47922
|
-
"button",
|
|
47923
|
-
{
|
|
47924
|
-
className: "border-none bg-transparent p-0 outline-none flex items-center",
|
|
47925
|
-
...styleProps
|
|
47926
|
-
},
|
|
47927
|
-
/* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
|
|
47928
|
-
);
|
|
47929
48106
|
function CursorPaginator({
|
|
47930
48107
|
navigateNext,
|
|
47931
48108
|
navigatePrev,
|
|
@@ -48221,6 +48398,18 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
48221
48398
|
/* @__PURE__ */ React__namespace.createElement(BiLinkExternal, { className: "h-5 w-auto" })
|
|
48222
48399
|
);
|
|
48223
48400
|
};
|
|
48401
|
+
const EDITORIAL_WORKFLOW_STATUS = {
|
|
48402
|
+
QUEUED: "queued",
|
|
48403
|
+
PROCESSING: "processing",
|
|
48404
|
+
SETTING_UP: "setting_up",
|
|
48405
|
+
CREATING_BRANCH: "creating_branch",
|
|
48406
|
+
INDEXING: "indexing",
|
|
48407
|
+
CONTENT_GENERATION: "content_generation",
|
|
48408
|
+
CREATING_PR: "creating_pr",
|
|
48409
|
+
COMPLETE: "complete",
|
|
48410
|
+
ERROR: "error",
|
|
48411
|
+
TIMEOUT: "timeout"
|
|
48412
|
+
};
|
|
48224
48413
|
const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
48225
48414
|
const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
|
|
48226
48415
|
const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
@@ -63634,367 +63823,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63634
63823
|
);
|
|
63635
63824
|
}
|
|
63636
63825
|
}
|
|
63637
|
-
const ProgressBar = ({
|
|
63638
|
-
progress,
|
|
63639
|
-
className = "",
|
|
63640
|
-
color = "blue"
|
|
63641
|
-
}) => {
|
|
63642
|
-
const clampedProgress = Math.min(Math.max(progress, 0), 100);
|
|
63643
|
-
const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
|
|
63644
|
-
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(
|
|
63645
|
-
"div",
|
|
63646
|
-
{
|
|
63647
|
-
className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
|
|
63648
|
-
style: { width: `${clampedProgress}%` }
|
|
63649
|
-
}
|
|
63650
|
-
)));
|
|
63651
|
-
};
|
|
63652
|
-
const EDITORIAL_WORKFLOW_STATUS = {
|
|
63653
|
-
QUEUED: "queued",
|
|
63654
|
-
PROCESSING: "processing",
|
|
63655
|
-
SETTING_UP: "setting_up",
|
|
63656
|
-
CREATING_BRANCH: "creating_branch",
|
|
63657
|
-
INDEXING: "indexing",
|
|
63658
|
-
CONTENT_GENERATION: "content_generation",
|
|
63659
|
-
CREATING_PR: "creating_pr",
|
|
63660
|
-
COMPLETE: "complete",
|
|
63661
|
-
ERROR: "error",
|
|
63662
|
-
TIMEOUT: "timeout"
|
|
63663
|
-
};
|
|
63664
|
-
const FormActionMenu = ({ actions, form }) => {
|
|
63665
|
-
const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
|
|
63666
|
-
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(
|
|
63667
|
-
Dismissible,
|
|
63668
|
-
{
|
|
63669
|
-
click: true,
|
|
63670
|
-
escape: true,
|
|
63671
|
-
disabled: !actionMenuVisibility,
|
|
63672
|
-
onDismiss: () => {
|
|
63673
|
-
setActionMenuVisibility((p2) => !p2);
|
|
63674
|
-
}
|
|
63675
|
-
},
|
|
63676
|
-
actions.map((Action, i2) => (
|
|
63677
|
-
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
63678
|
-
// Actions should just be componets
|
|
63679
|
-
/* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
|
|
63680
|
-
))
|
|
63681
|
-
)));
|
|
63682
|
-
};
|
|
63683
|
-
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63684
|
-
"button",
|
|
63685
|
-
{
|
|
63686
|
-
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}`,
|
|
63687
|
-
...props
|
|
63688
|
-
},
|
|
63689
|
-
/* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
|
|
63690
|
-
);
|
|
63691
|
-
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63692
|
-
"div",
|
|
63693
|
-
{
|
|
63694
|
-
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}`,
|
|
63695
|
-
style: {
|
|
63696
|
-
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
63697
|
-
pointerEvents: open ? "all" : "none",
|
|
63698
|
-
...style
|
|
63699
|
-
},
|
|
63700
|
-
...props
|
|
63701
|
-
}
|
|
63702
|
-
);
|
|
63703
|
-
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63704
|
-
"button",
|
|
63705
|
-
{
|
|
63706
|
-
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}`,
|
|
63707
|
-
...props
|
|
63708
|
-
}
|
|
63709
|
-
);
|
|
63710
|
-
const FormPortalContext = React__namespace.createContext(() => {
|
|
63711
|
-
return null;
|
|
63712
|
-
});
|
|
63713
|
-
function useFormPortal() {
|
|
63714
|
-
return React__namespace.useContext(FormPortalContext);
|
|
63715
|
-
}
|
|
63716
|
-
const FormPortalProvider = ({
|
|
63717
|
-
children
|
|
63718
|
-
}) => {
|
|
63719
|
-
const wrapperRef = React__namespace.useRef(null);
|
|
63720
|
-
const zIndexRef = React__namespace.useRef(0);
|
|
63721
|
-
const FormPortal = React__namespace.useCallback(
|
|
63722
|
-
(props) => {
|
|
63723
|
-
if (!wrapperRef.current)
|
|
63724
|
-
return null;
|
|
63725
|
-
return ReactDOM.createPortal(
|
|
63726
|
-
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
63727
|
-
wrapperRef.current
|
|
63728
|
-
);
|
|
63729
|
-
},
|
|
63730
|
-
[wrapperRef, zIndexRef]
|
|
63731
|
-
);
|
|
63732
|
-
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));
|
|
63733
|
-
};
|
|
63734
|
-
const LoadingDots = ({
|
|
63735
|
-
dotSize = 8,
|
|
63736
|
-
color = "white"
|
|
63737
|
-
}) => {
|
|
63738
|
-
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 }));
|
|
63739
|
-
};
|
|
63740
|
-
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63741
|
-
"span",
|
|
63742
|
-
{
|
|
63743
|
-
className: "inline-block mr-1",
|
|
63744
|
-
style: {
|
|
63745
|
-
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
63746
|
-
animationDelay: `${delay}s`,
|
|
63747
|
-
background: color,
|
|
63748
|
-
width: dotSize,
|
|
63749
|
-
height: dotSize,
|
|
63750
|
-
borderRadius: dotSize
|
|
63751
|
-
}
|
|
63752
|
-
}
|
|
63753
|
-
);
|
|
63754
|
-
const ResetForm = ({
|
|
63755
|
-
pristine,
|
|
63756
|
-
reset: reset2,
|
|
63757
|
-
children,
|
|
63758
|
-
...props
|
|
63759
|
-
}) => {
|
|
63760
|
-
const [open, setOpen] = React__namespace.useState(false);
|
|
63761
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
63762
|
-
Button$1,
|
|
63763
|
-
{
|
|
63764
|
-
onClick: () => {
|
|
63765
|
-
setOpen((p2) => !p2);
|
|
63766
|
-
},
|
|
63767
|
-
disabled: pristine,
|
|
63768
|
-
...props
|
|
63769
|
-
},
|
|
63770
|
-
children
|
|
63771
|
-
), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
63772
|
-
};
|
|
63773
|
-
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
63774
|
-
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(
|
|
63775
|
-
Button$1,
|
|
63776
|
-
{
|
|
63777
|
-
style: { flexGrow: 3 },
|
|
63778
|
-
variant: "primary",
|
|
63779
|
-
onClick: async () => {
|
|
63780
|
-
await reset2();
|
|
63781
|
-
close2();
|
|
63782
|
-
}
|
|
63783
|
-
},
|
|
63784
|
-
"Reset"
|
|
63785
|
-
))));
|
|
63786
|
-
};
|
|
63787
|
-
const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
63788
|
-
"div",
|
|
63789
|
-
{
|
|
63790
|
-
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
63791
|
-
style: {
|
|
63792
|
-
animationName: "fade-in",
|
|
63793
|
-
animationDelay: "300ms",
|
|
63794
|
-
animationTimingFunction: "ease-out",
|
|
63795
|
-
animationIterationCount: 1,
|
|
63796
|
-
animationFillMode: "both",
|
|
63797
|
-
animationDuration: "150ms"
|
|
63798
|
-
}
|
|
63799
|
-
},
|
|
63800
|
-
/* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
63801
|
-
/* @__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."),
|
|
63802
|
-
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
63803
|
-
"a",
|
|
63804
|
-
{
|
|
63805
|
-
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",
|
|
63806
|
-
href: "https://tinacms.org/docs/fields",
|
|
63807
|
-
target: "_blank",
|
|
63808
|
-
rel: "noopener noreferrer"
|
|
63809
|
-
},
|
|
63810
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
63811
|
-
Emoji,
|
|
63812
|
-
{
|
|
63813
|
-
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
63814
|
-
style: { fontSize: 24 }
|
|
63815
|
-
},
|
|
63816
|
-
"📖"
|
|
63817
|
-
),
|
|
63818
|
-
" ",
|
|
63819
|
-
"Field Setup Guide"
|
|
63820
|
-
))
|
|
63821
|
-
);
|
|
63822
|
-
const FormKeyBindings = ({ onSubmit }) => {
|
|
63823
|
-
React.useEffect(() => {
|
|
63824
|
-
const handleKeyDown = (e3) => {
|
|
63825
|
-
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
63826
|
-
e3.preventDefault();
|
|
63827
|
-
onSubmit();
|
|
63828
|
-
}
|
|
63829
|
-
};
|
|
63830
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
63831
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
63832
|
-
}, [onSubmit]);
|
|
63833
|
-
return null;
|
|
63834
|
-
};
|
|
63835
|
-
const FormBuilder = ({
|
|
63836
|
-
form,
|
|
63837
|
-
onPristineChange,
|
|
63838
|
-
...rest
|
|
63839
|
-
}) => {
|
|
63840
|
-
const cms = useCMS$1();
|
|
63841
|
-
const hideFooter = !!rest.hideFooter;
|
|
63842
|
-
const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
|
|
63843
|
-
const tinaForm = form.tinaForm;
|
|
63844
|
-
const finalForm2 = form.tinaForm.finalForm;
|
|
63845
|
-
React__namespace.useEffect(() => {
|
|
63846
|
-
var _a2;
|
|
63847
|
-
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
63848
|
-
tinaForm.path
|
|
63849
|
-
);
|
|
63850
|
-
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
63851
|
-
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
63852
|
-
} else {
|
|
63853
|
-
tinaForm.beforeSubmit = void 0;
|
|
63854
|
-
}
|
|
63855
|
-
}, [tinaForm.path]);
|
|
63856
|
-
const moveArrayItem = React__namespace.useCallback(
|
|
63857
|
-
(result) => {
|
|
63858
|
-
if (!result.destination || !finalForm2)
|
|
63859
|
-
return;
|
|
63860
|
-
const name = result.type;
|
|
63861
|
-
finalForm2.mutators.move(
|
|
63862
|
-
name,
|
|
63863
|
-
result.source.index,
|
|
63864
|
-
result.destination.index
|
|
63865
|
-
);
|
|
63866
|
-
},
|
|
63867
|
-
[tinaForm]
|
|
63868
|
-
);
|
|
63869
|
-
React__namespace.useEffect(() => {
|
|
63870
|
-
const unsubscribe = finalForm2.subscribe(
|
|
63871
|
-
({ pristine }) => {
|
|
63872
|
-
if (onPristineChange) {
|
|
63873
|
-
onPristineChange(pristine);
|
|
63874
|
-
}
|
|
63875
|
-
},
|
|
63876
|
-
{ pristine: true }
|
|
63877
|
-
);
|
|
63878
|
-
return () => {
|
|
63879
|
-
unsubscribe();
|
|
63880
|
-
};
|
|
63881
|
-
}, [finalForm2]);
|
|
63882
|
-
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
63883
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
63884
|
-
reactFinalForm.Form,
|
|
63885
|
-
{
|
|
63886
|
-
key: tinaForm.id,
|
|
63887
|
-
form: tinaForm.finalForm,
|
|
63888
|
-
onSubmit: tinaForm.onSubmit
|
|
63889
|
-
},
|
|
63890
|
-
({
|
|
63891
|
-
handleSubmit,
|
|
63892
|
-
pristine,
|
|
63893
|
-
invalid,
|
|
63894
|
-
submitting,
|
|
63895
|
-
dirtySinceLastSubmit,
|
|
63896
|
-
hasValidationErrors
|
|
63897
|
-
}) => {
|
|
63898
|
-
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
63899
|
-
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
63900
|
-
const safeSubmit = async () => {
|
|
63901
|
-
if (canSubmit) {
|
|
63902
|
-
await handleSubmit();
|
|
63903
|
-
}
|
|
63904
|
-
};
|
|
63905
|
-
const safeHandleSubmit = async () => {
|
|
63906
|
-
if (usingProtectedBranch) {
|
|
63907
|
-
setCreateBranchModalOpen(true);
|
|
63908
|
-
} else {
|
|
63909
|
-
safeSubmit();
|
|
63910
|
-
}
|
|
63911
|
-
};
|
|
63912
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
|
|
63913
|
-
CreateBranchModal,
|
|
63914
|
-
{
|
|
63915
|
-
safeSubmit,
|
|
63916
|
-
crudType: tinaForm.crudType,
|
|
63917
|
-
path: tinaForm.path,
|
|
63918
|
-
values: tinaForm.values,
|
|
63919
|
-
close: () => setCreateBranchModalOpen(false)
|
|
63920
|
-
}
|
|
63921
|
-
), /* @__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(
|
|
63922
|
-
FieldsBuilder,
|
|
63923
|
-
{
|
|
63924
|
-
form: tinaForm,
|
|
63925
|
-
activeFieldName: form.activeFieldName,
|
|
63926
|
-
fields: fieldGroup.fields
|
|
63927
|
-
}
|
|
63928
|
-
) : /* @__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(
|
|
63929
|
-
ResetForm,
|
|
63930
|
-
{
|
|
63931
|
-
pristine,
|
|
63932
|
-
reset: async () => {
|
|
63933
|
-
finalForm2.reset();
|
|
63934
|
-
await tinaForm.reset();
|
|
63935
|
-
}
|
|
63936
|
-
},
|
|
63937
|
-
tinaForm.buttons.reset
|
|
63938
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
63939
|
-
Button$1,
|
|
63940
|
-
{
|
|
63941
|
-
onClick: safeHandleSubmit,
|
|
63942
|
-
disabled: !canSubmit,
|
|
63943
|
-
busy: submitting,
|
|
63944
|
-
variant: "primary"
|
|
63945
|
-
},
|
|
63946
|
-
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
63947
|
-
!submitting && tinaForm.buttons.save
|
|
63948
|
-
), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
|
|
63949
|
-
FormActionMenu,
|
|
63950
|
-
{
|
|
63951
|
-
form: tinaForm,
|
|
63952
|
-
actions: tinaForm.actions
|
|
63953
|
-
}
|
|
63954
|
-
)))));
|
|
63955
|
-
}
|
|
63956
|
-
);
|
|
63957
|
-
};
|
|
63958
|
-
const FormStatus = ({ pristine }) => {
|
|
63959
|
-
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
63960
|
-
return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
63961
|
-
};
|
|
63962
|
-
const FormWrapper = ({
|
|
63963
|
-
id: id2,
|
|
63964
|
-
children
|
|
63965
|
-
}) => {
|
|
63966
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
63967
|
-
"div",
|
|
63968
|
-
{
|
|
63969
|
-
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
63970
|
-
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
63971
|
-
},
|
|
63972
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
|
|
63973
|
-
);
|
|
63974
|
-
};
|
|
63975
|
-
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63976
|
-
"span",
|
|
63977
|
-
{
|
|
63978
|
-
className: `text-[40px] leading-none inline-block ${className}`,
|
|
63979
|
-
...props
|
|
63980
|
-
}
|
|
63981
|
-
);
|
|
63982
|
-
const CreateBranchModel = ({
|
|
63983
|
-
close: close2,
|
|
63984
|
-
safeSubmit,
|
|
63985
|
-
relativePath: relativePath2,
|
|
63986
|
-
values,
|
|
63987
|
-
crudType
|
|
63988
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
63989
|
-
CreateBranchModal,
|
|
63990
|
-
{
|
|
63991
|
-
close: close2,
|
|
63992
|
-
safeSubmit,
|
|
63993
|
-
path: relativePath2,
|
|
63994
|
-
values,
|
|
63995
|
-
crudType
|
|
63996
|
-
}
|
|
63997
|
-
);
|
|
63998
63826
|
const pathRelativeToCollection = (collectionPath, fullPath) => {
|
|
63999
63827
|
const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
|
|
64000
63828
|
const normalizedFullPath = fullPath.replace(/\\/g, "/");
|
|
@@ -64023,7 +63851,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64023
63851
|
const [isExecuting, setIsExecuting] = React__namespace.useState(false);
|
|
64024
63852
|
const [errorMessage, setErrorMessage] = React__namespace.useState("");
|
|
64025
63853
|
const [currentStep, setCurrentStep] = React__namespace.useState(0);
|
|
64026
|
-
const [statusMessage, setStatusMessage] = React__namespace.useState("");
|
|
64027
63854
|
const [elapsedTime, setElapsedTime] = React__namespace.useState(0);
|
|
64028
63855
|
React__namespace.useEffect(() => {
|
|
64029
63856
|
let interval;
|
|
@@ -64067,7 +63894,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64067
63894
|
setDisabled(true);
|
|
64068
63895
|
setIsExecuting(true);
|
|
64069
63896
|
setCurrentStep(1);
|
|
64070
|
-
setStatusMessage("Initializing workflow...");
|
|
64071
63897
|
let graphql2 = "";
|
|
64072
63898
|
if (crudType === "create") {
|
|
64073
63899
|
graphql2 = CREATE_DOCUMENT_GQL;
|
|
@@ -64092,8 +63918,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64092
63918
|
}
|
|
64093
63919
|
},
|
|
64094
63920
|
onStatusUpdate: (status) => {
|
|
64095
|
-
const message = status.message || `Status: ${status.status}`;
|
|
64096
|
-
setStatusMessage(message);
|
|
64097
63921
|
switch (status.status) {
|
|
64098
63922
|
case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
|
|
64099
63923
|
case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
|
|
@@ -64130,9 +63954,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64130
63954
|
}
|
|
64131
63955
|
};
|
|
64132
63956
|
const renderProgressIndicator = () => {
|
|
64133
|
-
|
|
64134
|
-
const progressPercentage = (currentStep - 1) / steps.length * 100;
|
|
64135
|
-
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(
|
|
63957
|
+
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(
|
|
64136
63958
|
"div",
|
|
64137
63959
|
{
|
|
64138
63960
|
className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
|
|
@@ -64141,7 +63963,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64141
63963
|
), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React__namespace.createElement(
|
|
64142
63964
|
"div",
|
|
64143
63965
|
{
|
|
64144
|
-
className: "absolute top-5 h-0.5 bg-
|
|
63966
|
+
className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
|
|
64145
63967
|
style: {
|
|
64146
63968
|
left: "50px",
|
|
64147
63969
|
width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
|
|
@@ -64169,7 +63991,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64169
63991
|
/* @__PURE__ */ React__namespace.createElement(
|
|
64170
63992
|
"div",
|
|
64171
63993
|
{
|
|
64172
|
-
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-
|
|
63994
|
+
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"}`
|
|
64173
63995
|
},
|
|
64174
63996
|
isCompleted ? /* @__PURE__ */ React__namespace.createElement(
|
|
64175
63997
|
"svg",
|
|
@@ -64190,7 +64012,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64190
64012
|
),
|
|
64191
64013
|
/* @__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))
|
|
64192
64014
|
);
|
|
64193
|
-
})), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between
|
|
64015
|
+
})), /* @__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(
|
|
64194
64016
|
"path",
|
|
64195
64017
|
{
|
|
64196
64018
|
fillRule: "evenodd",
|
|
@@ -64198,34 +64020,20 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64198
64020
|
clipRule: "evenodd"
|
|
64199
64021
|
}
|
|
64200
64022
|
)), formatTime(elapsedTime))), /* @__PURE__ */ React__namespace.createElement(
|
|
64201
|
-
|
|
64202
|
-
{
|
|
64203
|
-
progress: progressPercentage,
|
|
64204
|
-
className: "mb-4",
|
|
64205
|
-
color: currentStep > steps.length ? "green" : "blue"
|
|
64206
|
-
}
|
|
64207
|
-
), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React__namespace.createElement(
|
|
64208
|
-
"svg",
|
|
64023
|
+
"a",
|
|
64209
64024
|
{
|
|
64210
|
-
className: "
|
|
64211
|
-
|
|
64212
|
-
|
|
64025
|
+
className: "underline text-tina-orange-dark font-medium text-xs",
|
|
64026
|
+
href: "https://tina.io/docs/tinacloud/editorial-workflow",
|
|
64027
|
+
target: "_blank"
|
|
64213
64028
|
},
|
|
64214
|
-
|
|
64215
|
-
|
|
64216
|
-
{
|
|
64217
|
-
fillRule: "evenodd",
|
|
64218
|
-
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",
|
|
64219
|
-
clipRule: "evenodd"
|
|
64220
|
-
}
|
|
64221
|
-
)
|
|
64222
|
-
) : /* @__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")));
|
|
64029
|
+
"Learn more about Editorial Workflow"
|
|
64030
|
+
));
|
|
64223
64031
|
};
|
|
64224
64032
|
const renderStateContent = () => {
|
|
64225
64033
|
if (isExecuting) {
|
|
64226
64034
|
return renderProgressIndicator();
|
|
64227
64035
|
} else {
|
|
64228
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1 text-red-700 py-2 px-3 mb-4 bg-red-50 border border-red-200 rounded" }, /* @__PURE__ */ React__namespace.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React__namespace.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-gray-700 mb-4 max-w-sm" }, "To make changes, create a copy then get it approved and merged for it to go live.", " ", /* @__PURE__ */ React__namespace.createElement(
|
|
64036
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1 text-red-700 py-2 px-3 mb-4 bg-red-50 border border-red-200 rounded" }, /* @__PURE__ */ React__namespace.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React__namespace.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-gray-700 mb-4 max-w-sm" }, "To make changes, you need to create a copy then get it approved and merged for it to go live.", /* @__PURE__ */ React__namespace.createElement("br", null), /* @__PURE__ */ React__namespace.createElement("br", null), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-gray-500" }, "Learn more about "), /* @__PURE__ */ React__namespace.createElement(
|
|
64229
64037
|
"a",
|
|
64230
64038
|
{
|
|
64231
64039
|
className: "underline text-tina-orange-dark font-medium",
|
|
@@ -64233,7 +64041,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64233
64041
|
target: "_blank"
|
|
64234
64042
|
},
|
|
64235
64043
|
"Editorial Workflow"
|
|
64236
|
-
)), /* @__PURE__ */ React__namespace.createElement(
|
|
64044
|
+
), "."), /* @__PURE__ */ React__namespace.createElement(
|
|
64237
64045
|
PrefixedTextField,
|
|
64238
64046
|
{
|
|
64239
64047
|
name: "new-branch-name",
|
|
@@ -64242,7 +64050,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64242
64050
|
value: newBranchName,
|
|
64243
64051
|
onChange: (e3) => {
|
|
64244
64052
|
setErrorMessage("");
|
|
64245
|
-
setStatusMessage("");
|
|
64246
64053
|
setNewBranchName(e3.target.value);
|
|
64247
64054
|
}
|
|
64248
64055
|
}
|
|
@@ -64293,6 +64100,217 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64293
64100
|
}
|
|
64294
64101
|
)));
|
|
64295
64102
|
};
|
|
64103
|
+
const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
64104
|
+
"div",
|
|
64105
|
+
{
|
|
64106
|
+
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
64107
|
+
style: {
|
|
64108
|
+
animationName: "fade-in",
|
|
64109
|
+
animationDelay: "300ms",
|
|
64110
|
+
animationTimingFunction: "ease-out",
|
|
64111
|
+
animationIterationCount: 1,
|
|
64112
|
+
animationFillMode: "both",
|
|
64113
|
+
animationDuration: "150ms"
|
|
64114
|
+
}
|
|
64115
|
+
},
|
|
64116
|
+
/* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
64117
|
+
/* @__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."),
|
|
64118
|
+
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
64119
|
+
"a",
|
|
64120
|
+
{
|
|
64121
|
+
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",
|
|
64122
|
+
href: "https://tinacms.org/docs/fields",
|
|
64123
|
+
target: "_blank",
|
|
64124
|
+
rel: "noopener noreferrer"
|
|
64125
|
+
},
|
|
64126
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
64127
|
+
Emoji,
|
|
64128
|
+
{
|
|
64129
|
+
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
64130
|
+
style: { fontSize: 24 }
|
|
64131
|
+
},
|
|
64132
|
+
"📖"
|
|
64133
|
+
),
|
|
64134
|
+
" ",
|
|
64135
|
+
"Field Setup Guide"
|
|
64136
|
+
))
|
|
64137
|
+
);
|
|
64138
|
+
const FormKeyBindings = ({ onSubmit }) => {
|
|
64139
|
+
React.useEffect(() => {
|
|
64140
|
+
const handleKeyDown = (e3) => {
|
|
64141
|
+
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
64142
|
+
e3.preventDefault();
|
|
64143
|
+
onSubmit();
|
|
64144
|
+
}
|
|
64145
|
+
};
|
|
64146
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
64147
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
64148
|
+
}, [onSubmit]);
|
|
64149
|
+
return null;
|
|
64150
|
+
};
|
|
64151
|
+
const FormBuilder = ({
|
|
64152
|
+
form,
|
|
64153
|
+
onPristineChange,
|
|
64154
|
+
...rest
|
|
64155
|
+
}) => {
|
|
64156
|
+
const cms = useCMS$1();
|
|
64157
|
+
const hideFooter = !!rest.hideFooter;
|
|
64158
|
+
const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
|
|
64159
|
+
const tinaForm = form.tinaForm;
|
|
64160
|
+
const finalForm2 = form.tinaForm.finalForm;
|
|
64161
|
+
React__namespace.useEffect(() => {
|
|
64162
|
+
var _a2;
|
|
64163
|
+
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
64164
|
+
tinaForm.path
|
|
64165
|
+
);
|
|
64166
|
+
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
64167
|
+
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
64168
|
+
} else {
|
|
64169
|
+
tinaForm.beforeSubmit = void 0;
|
|
64170
|
+
}
|
|
64171
|
+
}, [tinaForm.path]);
|
|
64172
|
+
const moveArrayItem = React__namespace.useCallback(
|
|
64173
|
+
(result) => {
|
|
64174
|
+
if (!result.destination || !finalForm2)
|
|
64175
|
+
return;
|
|
64176
|
+
const name = result.type;
|
|
64177
|
+
finalForm2.mutators.move(
|
|
64178
|
+
name,
|
|
64179
|
+
result.source.index,
|
|
64180
|
+
result.destination.index
|
|
64181
|
+
);
|
|
64182
|
+
},
|
|
64183
|
+
[tinaForm]
|
|
64184
|
+
);
|
|
64185
|
+
React__namespace.useEffect(() => {
|
|
64186
|
+
const unsubscribe = finalForm2.subscribe(
|
|
64187
|
+
({ pristine }) => {
|
|
64188
|
+
if (onPristineChange) {
|
|
64189
|
+
onPristineChange(pristine);
|
|
64190
|
+
}
|
|
64191
|
+
},
|
|
64192
|
+
{ pristine: true }
|
|
64193
|
+
);
|
|
64194
|
+
return () => {
|
|
64195
|
+
unsubscribe();
|
|
64196
|
+
};
|
|
64197
|
+
}, [finalForm2]);
|
|
64198
|
+
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
64199
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
64200
|
+
reactFinalForm.Form,
|
|
64201
|
+
{
|
|
64202
|
+
key: tinaForm.id,
|
|
64203
|
+
form: tinaForm.finalForm,
|
|
64204
|
+
onSubmit: tinaForm.onSubmit
|
|
64205
|
+
},
|
|
64206
|
+
({
|
|
64207
|
+
handleSubmit,
|
|
64208
|
+
pristine,
|
|
64209
|
+
invalid,
|
|
64210
|
+
submitting,
|
|
64211
|
+
dirtySinceLastSubmit,
|
|
64212
|
+
hasValidationErrors
|
|
64213
|
+
}) => {
|
|
64214
|
+
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
64215
|
+
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
64216
|
+
const safeSubmit = async () => {
|
|
64217
|
+
if (canSubmit) {
|
|
64218
|
+
await handleSubmit();
|
|
64219
|
+
}
|
|
64220
|
+
};
|
|
64221
|
+
const safeHandleSubmit = async () => {
|
|
64222
|
+
if (usingProtectedBranch) {
|
|
64223
|
+
setCreateBranchModalOpen(true);
|
|
64224
|
+
} else {
|
|
64225
|
+
safeSubmit();
|
|
64226
|
+
}
|
|
64227
|
+
};
|
|
64228
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
|
|
64229
|
+
CreateBranchModal,
|
|
64230
|
+
{
|
|
64231
|
+
safeSubmit,
|
|
64232
|
+
crudType: tinaForm.crudType,
|
|
64233
|
+
path: tinaForm.path,
|
|
64234
|
+
values: tinaForm.values,
|
|
64235
|
+
close: () => setCreateBranchModalOpen(false)
|
|
64236
|
+
}
|
|
64237
|
+
), /* @__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(
|
|
64238
|
+
FieldsBuilder,
|
|
64239
|
+
{
|
|
64240
|
+
form: tinaForm,
|
|
64241
|
+
activeFieldName: form.activeFieldName,
|
|
64242
|
+
fields: fieldGroup.fields
|
|
64243
|
+
}
|
|
64244
|
+
) : /* @__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(
|
|
64245
|
+
ResetForm,
|
|
64246
|
+
{
|
|
64247
|
+
pristine,
|
|
64248
|
+
reset: async () => {
|
|
64249
|
+
finalForm2.reset();
|
|
64250
|
+
await tinaForm.reset();
|
|
64251
|
+
}
|
|
64252
|
+
},
|
|
64253
|
+
tinaForm.buttons.reset
|
|
64254
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
64255
|
+
Button$1,
|
|
64256
|
+
{
|
|
64257
|
+
onClick: safeHandleSubmit,
|
|
64258
|
+
disabled: !canSubmit,
|
|
64259
|
+
busy: submitting,
|
|
64260
|
+
variant: "primary"
|
|
64261
|
+
},
|
|
64262
|
+
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
64263
|
+
!submitting && tinaForm.buttons.save
|
|
64264
|
+
), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
|
|
64265
|
+
FormActionMenu,
|
|
64266
|
+
{
|
|
64267
|
+
form: tinaForm,
|
|
64268
|
+
actions: tinaForm.actions
|
|
64269
|
+
}
|
|
64270
|
+
)))));
|
|
64271
|
+
}
|
|
64272
|
+
);
|
|
64273
|
+
};
|
|
64274
|
+
const FormStatus = ({ pristine }) => {
|
|
64275
|
+
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
64276
|
+
return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
64277
|
+
};
|
|
64278
|
+
const FormWrapper = ({
|
|
64279
|
+
id: id2,
|
|
64280
|
+
children
|
|
64281
|
+
}) => {
|
|
64282
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
64283
|
+
"div",
|
|
64284
|
+
{
|
|
64285
|
+
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
64286
|
+
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
64287
|
+
},
|
|
64288
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
|
|
64289
|
+
);
|
|
64290
|
+
};
|
|
64291
|
+
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
64292
|
+
"span",
|
|
64293
|
+
{
|
|
64294
|
+
className: `text-[40px] leading-none inline-block ${className}`,
|
|
64295
|
+
...props
|
|
64296
|
+
}
|
|
64297
|
+
);
|
|
64298
|
+
const CreateBranchModel = ({
|
|
64299
|
+
close: close2,
|
|
64300
|
+
safeSubmit,
|
|
64301
|
+
relativePath: relativePath2,
|
|
64302
|
+
values,
|
|
64303
|
+
crudType
|
|
64304
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
64305
|
+
CreateBranchModal,
|
|
64306
|
+
{
|
|
64307
|
+
close: close2,
|
|
64308
|
+
safeSubmit,
|
|
64309
|
+
path: relativePath2,
|
|
64310
|
+
values,
|
|
64311
|
+
crudType
|
|
64312
|
+
}
|
|
64313
|
+
);
|
|
64296
64314
|
const NestedForm = (props) => {
|
|
64297
64315
|
const FormPortal = useFormPortal();
|
|
64298
64316
|
const id2 = React.useMemo(() => uuid(), [props.id, props.initialValues]);
|
|
@@ -121039,7 +121057,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
121039
121057
|
},
|
|
121040
121058
|
close: () => setFolderModalOpen(false)
|
|
121041
121059
|
}
|
|
121042
|
-
), /* @__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 items-baseline" }, (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(
|
|
121060
|
+
), /* @__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 items-baseline" }, (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(
|
|
121043
121061
|
"label",
|
|
121044
121062
|
{
|
|
121045
121063
|
htmlFor: "sort",
|