tinacms 2.9.1 → 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 +1072 -868
- package/dist/index.mjs +1075 -869
- package/dist/toolkit/components/ui/sonner.d.ts +12 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +18 -18
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
- package/dist/toolkit/form-builder/form-builder.d.ts +0 -11
- package/dist/toolkit/form-builder/index.d.ts +1 -0
- package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
- package/dist/toolkit/icons/index.d.ts +1 -0
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +3 -1
- package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
- package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
- package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
- package/dist/toolkit/styles/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) {
|
|
@@ -73,8 +73,14 @@ var __publicField = (obj, key, value) => {
|
|
|
73
73
|
portalNode
|
|
74
74
|
);
|
|
75
75
|
};
|
|
76
|
-
const ModalActions = ({ children }) => {
|
|
77
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
76
|
+
const ModalActions = ({ align = "between", children }) => {
|
|
77
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: `w-full flex flex-wrap-reverse justify-${align} gap-4 items-center px-5 pb-5 rounded-b-md`
|
|
81
|
+
},
|
|
82
|
+
children
|
|
83
|
+
);
|
|
78
84
|
};
|
|
79
85
|
const ModalBody = ({ className = "", padded = false, ...props }) => /* @__PURE__ */ React.createElement(
|
|
80
86
|
"div",
|
|
@@ -689,12 +695,84 @@ var __publicField = (obj, key, value) => {
|
|
|
689
695
|
},
|
|
690
696
|
/* @__PURE__ */ React__namespace.createElement("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-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" })
|
|
691
697
|
);
|
|
698
|
+
const TinaExtendedIcon = ({ ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
699
|
+
"svg",
|
|
700
|
+
{
|
|
701
|
+
viewBox: "0 0 1020 254",
|
|
702
|
+
fill: "currentColor",
|
|
703
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
704
|
+
...props
|
|
705
|
+
},
|
|
706
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
707
|
+
"path",
|
|
708
|
+
{
|
|
709
|
+
d: "M115.685 110.921C132.719 98.699 135.293 42.2913 140.63 20.6271C145.968 -1.03697 168.043 0.0618098 168.043 0.0618098C168.043 0.0618098 162.312 10.0353 164.649 17.478C166.987 24.9207 183 31.5735 183 31.5735L179.546 40.6787C179.546 40.6787 172.334 39.7562 168.043 48.3408C156.833 70.7637 176.368 136.236 176.368 136.236C176.368 136.236 145.007 180.759 145.007 214.282C145.007 235.763 155.174 253.765 155.174 253.765H140.907C140.907 253.765 119.978 228.858 115.685 216.41C111.393 203.962 113.109 191.515 113.109 191.515C113.109 191.515 90.3595 190.227 70.1863 191.515C50.0132 192.802 36.5597 210.144 34.1316 219.844C31.7036 229.544 30.6978 253.765 30.6978 253.765H19.4169C12.5507 232.576 7.09751 224.982 10.0558 214.282C18.2501 184.647 16.6405 167.839 14.7433 160.352C12.846 152.866 0 146.331 0 146.331C6.29266 133.511 16.4152 127.265 40.3455 126.708C67.9751 126.066 98.6519 123.142 115.685 110.921Z",
|
|
710
|
+
fill: "#EC4815"
|
|
711
|
+
}
|
|
712
|
+
),
|
|
713
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
714
|
+
"path",
|
|
715
|
+
{
|
|
716
|
+
d: "M44.113 213.041C44.113 213.041 47.0281 240.018 62.5148 253.765H75.7865C62.5148 238.73 61.0676 199.54 61.0676 199.54C54.3171 201.738 44.9715 209.607 44.113 213.041Z",
|
|
717
|
+
fill: "#EC4815"
|
|
718
|
+
}
|
|
719
|
+
),
|
|
720
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
721
|
+
"path",
|
|
722
|
+
{
|
|
723
|
+
d: "M290 124V153.6H261.6V195.6C261.6 205 265 208.6 277.2 208.6C281.4 208.6 286.6 208.2 291.6 207.8V237C286.2 238.2 277.4 239.6 266.4 239.6C231.6 239.6 225.2 219.6 225.2 204.2V153.6H207.2V124H225.2V106.2L259.6 90.4H261.6V124H290Z",
|
|
724
|
+
fill: "#EC4815"
|
|
725
|
+
}
|
|
726
|
+
),
|
|
727
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
728
|
+
"path",
|
|
729
|
+
{
|
|
730
|
+
d: "M320.581 81.2H359.781V110.4H320.581V81.2ZM302.781 153.6V124H359.581V236H323.181V153.6H302.781Z",
|
|
731
|
+
fill: "#EC4815"
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
735
|
+
"path",
|
|
736
|
+
{
|
|
737
|
+
d: "M420.022 138.8H423.622C427.222 127.6 435.022 120 457.022 120C480.022 120 497.422 131.2 497.422 158.4V236H461.022V169.2C461.022 157 454.222 151.4 443.022 151.4C430.422 151.4 423.422 157.6 423.422 172.8V236H387.022V124H420.022V138.8Z",
|
|
738
|
+
fill: "#EC4815"
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
742
|
+
"path",
|
|
743
|
+
{
|
|
744
|
+
d: "M592.605 219H590.605C584.805 229.8 571.005 238.8 554.005 238.8C529.005 238.8 516.205 226.4 516.205 207C516.205 187.8 527.605 176.6 548.805 173.2L580.405 168.2C587.405 167 589.205 163.2 589.205 159.8V157.6C589.205 152.6 585.605 146.4 573.605 146.4C563.405 146.4 557.405 151 556.805 158.8H522.005C523.405 136.2 538.805 120 572.005 120C606.805 120 624.005 134 624.005 156.4V206.8H636.605V236H592.605V219ZM589.205 192.4V183H587.205C585.205 185.2 582.405 186.8 578.005 187.8L563.205 191.4C556.605 193 553.405 196.8 553.405 203C553.405 210.4 558.205 214.2 567.805 214.2C582.005 214.2 589.205 204.4 589.205 192.4Z",
|
|
745
|
+
fill: "#EC4815"
|
|
746
|
+
}
|
|
747
|
+
),
|
|
748
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
749
|
+
"path",
|
|
750
|
+
{
|
|
751
|
+
d: "M726.356 200H747.356C743.756 227.8 728.556 240 700.956 240C666.356 240 650.756 219.6 650.756 180C650.756 145.8 662.756 120 700.956 120C732.956 120 743.556 137.2 746.356 160H725.156C723.156 145.4 716.156 136.6 700.956 136.6C680.956 136.6 671.356 149.8 671.356 180C671.356 208 679.356 223 700.956 223C715.956 223 724.156 214.6 726.356 200Z",
|
|
752
|
+
fill: "#EC4815"
|
|
753
|
+
}
|
|
754
|
+
),
|
|
755
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
756
|
+
"path",
|
|
757
|
+
{
|
|
758
|
+
d: "M846.18 139.6H848.18C851.78 128 860.38 120 874.38 120C892.98 120 900.58 132.4 900.58 158.4V236H880.58V161.6C880.58 148 877.78 138.8 865.78 138.8C854.18 138.8 847.78 148.8 847.78 167.4V236H828.18V161.6C828.18 148.2 824.98 138.8 813.58 138.8C799.78 138.8 795.18 149.8 795.18 169.2V236H775.18V124H793.98V139.6H796.38C800.58 127.2 807.78 120 821.98 120C835.38 120 842.78 126.8 846.18 139.6Z",
|
|
759
|
+
fill: "#EC4815"
|
|
760
|
+
}
|
|
761
|
+
),
|
|
762
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
763
|
+
"path",
|
|
764
|
+
{
|
|
765
|
+
d: "M1018.2 155H996.6C995.2 143.4 989.2 135.6 973.6 135.6C961.6 135.6 951 140.6 951 151.8C951 159.4 954.8 164.6 965.8 167.2L988.4 172.4C1009 177 1020 188 1020 205.2C1020 224.8 1007 240 975.6 240C947.8 240 931 229.6 927 205H950C953.2 219.2 961.6 224.4 976 224.4C988 224.4 999.2 220 999.2 207.2C999.2 199.6 994.4 193.8 982 190.8L955.6 184.6C940.4 181 930.6 171.2 930.6 154C930.6 134 945.8 120 974 120C1006 120 1016.4 137.8 1018.2 155Z",
|
|
766
|
+
fill: "#EC4815"
|
|
767
|
+
}
|
|
768
|
+
)
|
|
769
|
+
);
|
|
692
770
|
const ModalHeader = ({ children, close: close2 }) => {
|
|
693
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "h-14 flex items-center
|
|
771
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "h-14 flex items-center px-5 border-b border-gray-200 m-0" }, /* @__PURE__ */ React__namespace.createElement(TinaIcon, { className: "w-10 h-auto -ml-1 mr-1 my-1 fill-tina-orange" }), /* @__PURE__ */ React__namespace.createElement(ModalTitle, null, children), close2 && /* @__PURE__ */ React__namespace.createElement(
|
|
694
772
|
"div",
|
|
695
773
|
{
|
|
696
774
|
onClick: close2,
|
|
697
|
-
className: "flex items-center fill-gray-400 cursor-pointer transition-colors duration-100 ease-out hover:fill-gray-700"
|
|
775
|
+
className: "ml-auto flex justify-self-end items-center fill-gray-400 cursor-pointer transition-colors duration-100 ease-out hover:fill-gray-700"
|
|
698
776
|
},
|
|
699
777
|
/* @__PURE__ */ React__namespace.createElement(CloseIcon, { className: "w-6 h-auto" })
|
|
700
778
|
));
|
|
@@ -36954,7 +37032,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
36954
37032
|
dropdownMenuLabelVariants,
|
|
36955
37033
|
["inset"]
|
|
36956
37034
|
);
|
|
36957
|
-
const DropdownMenuSeparator = cn$2.withCn(
|
|
37035
|
+
const DropdownMenuSeparator$1 = cn$2.withCn(
|
|
36958
37036
|
DropdownMenuPrimitive__namespace.Separator,
|
|
36959
37037
|
"-mx-1 my-1 h-px bg-muted"
|
|
36960
37038
|
);
|
|
@@ -38230,6 +38308,171 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38230
38308
|
Component: PropTypes.any.isRequired,
|
|
38231
38309
|
children: PropTypes.any
|
|
38232
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
|
+
};
|
|
38233
38476
|
var DefaultContext = {
|
|
38234
38477
|
color: void 0,
|
|
38235
38478
|
size: void 0,
|
|
@@ -38471,30 +38714,270 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38471
38714
|
function BiX(props) {
|
|
38472
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);
|
|
38473
38716
|
}
|
|
38474
|
-
|
|
38475
|
-
|
|
38476
|
-
|
|
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
|
+
}) {
|
|
38477
38804
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
38478
|
-
|
|
38805
|
+
DropdownMenuPrimitive__namespace.Trigger,
|
|
38479
38806
|
{
|
|
38480
|
-
|
|
38481
|
-
|
|
38482
|
-
className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
|
|
38483
|
-
...rest
|
|
38807
|
+
"data-slot": "dropdown-menu-trigger",
|
|
38808
|
+
...props
|
|
38484
38809
|
}
|
|
38485
38810
|
);
|
|
38486
|
-
}
|
|
38487
|
-
|
|
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
|
+
}) {
|
|
38488
38836
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
38489
|
-
|
|
38837
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
38490
38838
|
{
|
|
38491
|
-
|
|
38492
|
-
|
|
38493
|
-
|
|
38494
|
-
|
|
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
|
|
38495
38847
|
}
|
|
38496
38848
|
);
|
|
38497
|
-
}
|
|
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
|
+
}
|
|
38498
38981
|
const Dismissible = ({
|
|
38499
38982
|
onDismiss,
|
|
38500
38983
|
escape: escape2,
|
|
@@ -38567,6 +39050,159 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38567
39050
|
}, [click, customDocument, escape2, disabled, onDismiss]);
|
|
38568
39051
|
return area;
|
|
38569
39052
|
}
|
|
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
|
+
}
|
|
39064
|
+
},
|
|
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
|
+
)));
|
|
39071
|
+
};
|
|
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
|
+
});
|
|
38570
39206
|
const { get: getColor, to: toColor } = pkg__namespace;
|
|
38571
39207
|
var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
|
|
38572
39208
|
ColorFormat2["Hex"] = "hex";
|
|
@@ -38888,9 +39524,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
38888
39524
|
function MdOutlineClear(props) {
|
|
38889
39525
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }, "child": [] }] })(props);
|
|
38890
39526
|
}
|
|
38891
|
-
function MdOutlineSaveAlt(props) {
|
|
38892
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z" }, "child": [] }] })(props);
|
|
38893
|
-
}
|
|
38894
39527
|
function MdOutlineCloud(props) {
|
|
38895
39528
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0 1 22 15c0 1.65-1.35 3-3 3H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0 1 12 6m0-2C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96A7.49 7.49 0 0 0 12 4z" }, "child": [] }] })(props);
|
|
38896
39529
|
}
|
|
@@ -39112,247 +39745,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
39112
39745
|
}
|
|
39113
39746
|
}
|
|
39114
39747
|
);
|
|
39115
|
-
function cn$1(...inputs) {
|
|
39116
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
39117
|
-
}
|
|
39118
|
-
const Button$1 = ({
|
|
39119
|
-
variant = "secondary",
|
|
39120
|
-
as: Tag2 = "button",
|
|
39121
|
-
size: size2 = "medium",
|
|
39122
|
-
busy,
|
|
39123
|
-
disabled,
|
|
39124
|
-
rounded = "full",
|
|
39125
|
-
children,
|
|
39126
|
-
className = "",
|
|
39127
|
-
...props
|
|
39128
|
-
}) => {
|
|
39129
|
-
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 ";
|
|
39130
|
-
const variantClasses = {
|
|
39131
|
-
primary: `shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 border-0`,
|
|
39132
|
-
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-100`,
|
|
39133
|
-
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-100`,
|
|
39134
|
-
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
|
|
39135
|
-
danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
|
|
39136
|
-
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
|
|
39137
|
-
custom: ""
|
|
39138
|
-
};
|
|
39139
|
-
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
39140
|
-
const stateClasses = {
|
|
39141
|
-
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
39142
|
-
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
39143
|
-
default: ``
|
|
39144
|
-
};
|
|
39145
|
-
const roundedClasses = {
|
|
39146
|
-
full: `rounded`,
|
|
39147
|
-
left: `rounded-l`,
|
|
39148
|
-
right: `rounded-r`,
|
|
39149
|
-
custom: "",
|
|
39150
|
-
none: ""
|
|
39151
|
-
};
|
|
39152
|
-
const sizeClasses = {
|
|
39153
|
-
small: `text-xs h-8 px-3`,
|
|
39154
|
-
medium: `text-sm h-10 px-8`,
|
|
39155
|
-
custom: ``
|
|
39156
|
-
};
|
|
39157
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39158
|
-
Tag2,
|
|
39159
|
-
{
|
|
39160
|
-
className: cn$1(
|
|
39161
|
-
baseClasses,
|
|
39162
|
-
variantClasses[variant],
|
|
39163
|
-
sizeClasses[size2],
|
|
39164
|
-
stateClasses[state],
|
|
39165
|
-
roundedClasses[rounded],
|
|
39166
|
-
className
|
|
39167
|
-
),
|
|
39168
|
-
...props
|
|
39169
|
-
},
|
|
39170
|
-
children
|
|
39171
|
-
);
|
|
39172
|
-
};
|
|
39173
|
-
const IconButton = ({
|
|
39174
|
-
variant = "secondary",
|
|
39175
|
-
size: size2 = "medium",
|
|
39176
|
-
busy,
|
|
39177
|
-
disabled,
|
|
39178
|
-
children,
|
|
39179
|
-
className,
|
|
39180
|
-
...props
|
|
39181
|
-
}) => {
|
|
39182
|
-
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";
|
|
39183
|
-
const variantClasses = {
|
|
39184
|
-
primary: `shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500`,
|
|
39185
|
-
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
|
|
39186
|
-
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
|
|
39187
|
-
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
|
|
39188
|
-
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
|
|
39189
|
-
};
|
|
39190
|
-
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
39191
|
-
const stateClasses = {
|
|
39192
|
-
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
39193
|
-
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
39194
|
-
default: ``
|
|
39195
|
-
};
|
|
39196
|
-
const sizeClasses = {
|
|
39197
|
-
small: `h-7 w-7`,
|
|
39198
|
-
medium: `h-9 w-9`,
|
|
39199
|
-
custom: ``
|
|
39200
|
-
};
|
|
39201
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
39202
|
-
"button",
|
|
39203
|
-
{
|
|
39204
|
-
className: cn$1(
|
|
39205
|
-
baseClasses,
|
|
39206
|
-
variantClasses[variant],
|
|
39207
|
-
sizeClasses[size2],
|
|
39208
|
-
stateClasses[state],
|
|
39209
|
-
className
|
|
39210
|
-
),
|
|
39211
|
-
...props
|
|
39212
|
-
},
|
|
39213
|
-
children
|
|
39214
|
-
);
|
|
39215
|
-
};
|
|
39216
|
-
function FontLoader() {
|
|
39217
|
-
React__namespace.useEffect(() => {
|
|
39218
|
-
const link = document.createElement("link");
|
|
39219
|
-
link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
|
|
39220
|
-
link.rel = "stylesheet";
|
|
39221
|
-
document.head.appendChild(link);
|
|
39222
|
-
return () => {
|
|
39223
|
-
document.head.removeChild(link);
|
|
39224
|
-
};
|
|
39225
|
-
}, []);
|
|
39226
|
-
return null;
|
|
39227
|
-
}
|
|
39228
|
-
function classNames(...classes) {
|
|
39229
|
-
return classes.filter(Boolean).join(" ");
|
|
39230
|
-
}
|
|
39231
|
-
const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
|
|
39232
|
-
const [open, setOpen] = React.useState(false);
|
|
39233
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(
|
|
39234
|
-
PopoverPrimitive__namespace.Trigger,
|
|
39235
|
-
{
|
|
39236
|
-
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}}`
|
|
39237
|
-
},
|
|
39238
|
-
/* @__PURE__ */ React.createElement(
|
|
39239
|
-
"svg",
|
|
39240
|
-
{
|
|
39241
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39242
|
-
className: "h-5 w-5",
|
|
39243
|
-
fill: "none",
|
|
39244
|
-
viewBox: "0 0 24 24",
|
|
39245
|
-
stroke: "currentColor"
|
|
39246
|
-
},
|
|
39247
|
-
/* @__PURE__ */ React.createElement(
|
|
39248
|
-
"path",
|
|
39249
|
-
{
|
|
39250
|
-
strokeLinecap: "round",
|
|
39251
|
-
strokeLinejoin: "round",
|
|
39252
|
-
strokeWidth: 2,
|
|
39253
|
-
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"
|
|
39254
|
-
}
|
|
39255
|
-
)
|
|
39256
|
-
)
|
|
39257
|
-
), /* @__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) => {
|
|
39258
|
-
return /* @__PURE__ */ React.createElement(
|
|
39259
|
-
"span",
|
|
39260
|
-
{
|
|
39261
|
-
"data-test": `${toolbarItem.name}OverflowButton`,
|
|
39262
|
-
key: toolbarItem.name,
|
|
39263
|
-
onMouseDown: (event) => {
|
|
39264
|
-
event.preventDefault();
|
|
39265
|
-
toolbarItem.onMouseDown(event);
|
|
39266
|
-
setOpen(false);
|
|
39267
|
-
},
|
|
39268
|
-
className: classNames(
|
|
39269
|
-
toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
|
|
39270
|
-
"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",
|
|
39271
|
-
toolbarItem.className ?? ""
|
|
39272
|
-
)
|
|
39273
|
-
},
|
|
39274
|
-
/* @__PURE__ */ React.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
|
|
39275
|
-
" ",
|
|
39276
|
-
toolbarItem.label
|
|
39277
|
-
);
|
|
39278
|
-
}))))));
|
|
39279
|
-
};
|
|
39280
|
-
function BsArrowRightShort(props) {
|
|
39281
|
-
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);
|
|
39282
|
-
}
|
|
39283
|
-
function BsCheckCircleFill(props) {
|
|
39284
|
-
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);
|
|
39285
|
-
}
|
|
39286
|
-
function BsExclamationOctagonFill(props) {
|
|
39287
|
-
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);
|
|
39288
|
-
}
|
|
39289
|
-
const MessageIcon = ({
|
|
39290
|
-
type = "success",
|
|
39291
|
-
className = ""
|
|
39292
|
-
}) => {
|
|
39293
|
-
const icons = {
|
|
39294
|
-
success: BiCheckCircle,
|
|
39295
|
-
warning: BiError,
|
|
39296
|
-
error: BiError,
|
|
39297
|
-
info: BiInfoCircle
|
|
39298
|
-
};
|
|
39299
|
-
const Icon = icons[type];
|
|
39300
|
-
return /* @__PURE__ */ React.createElement(Icon, { className });
|
|
39301
|
-
};
|
|
39302
|
-
const Message = ({
|
|
39303
|
-
children,
|
|
39304
|
-
type = "success",
|
|
39305
|
-
size: size2 = "medium",
|
|
39306
|
-
className = "",
|
|
39307
|
-
link,
|
|
39308
|
-
linkLabel = "Learn More"
|
|
39309
|
-
}) => {
|
|
39310
|
-
const containerClasses = {
|
|
39311
|
-
success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
|
|
39312
|
-
warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
|
|
39313
|
-
error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
|
|
39314
|
-
info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
|
|
39315
|
-
};
|
|
39316
|
-
const textClasses = {
|
|
39317
|
-
success: "text-green-700",
|
|
39318
|
-
warning: "text-yellow-700",
|
|
39319
|
-
error: "text-red-700",
|
|
39320
|
-
info: "text-blue-700"
|
|
39321
|
-
};
|
|
39322
|
-
const iconClasses = {
|
|
39323
|
-
success: "text-green-400",
|
|
39324
|
-
warning: "text-yellow-400",
|
|
39325
|
-
error: "text-red-400",
|
|
39326
|
-
info: "text-blue-400"
|
|
39327
|
-
};
|
|
39328
|
-
const sizeClasses = {
|
|
39329
|
-
small: "px-3 py-1.5 text-xs",
|
|
39330
|
-
medium: "px-4 py-2.5 text-sm"
|
|
39331
|
-
};
|
|
39332
|
-
return /* @__PURE__ */ React.createElement(
|
|
39333
|
-
"div",
|
|
39334
|
-
{
|
|
39335
|
-
className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
|
|
39336
|
-
},
|
|
39337
|
-
/* @__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(
|
|
39338
|
-
MessageIcon,
|
|
39339
|
-
{
|
|
39340
|
-
type,
|
|
39341
|
-
className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
39342
|
-
}
|
|
39343
|
-
), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React.createElement(
|
|
39344
|
-
"a",
|
|
39345
|
-
{
|
|
39346
|
-
href: link,
|
|
39347
|
-
target: "_blank",
|
|
39348
|
-
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"
|
|
39349
|
-
},
|
|
39350
|
-
linkLabel,
|
|
39351
|
-
" ",
|
|
39352
|
-
/* @__PURE__ */ React.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
|
|
39353
|
-
))
|
|
39354
|
-
);
|
|
39355
|
-
};
|
|
39356
39748
|
function useCMS() {
|
|
39357
39749
|
return useCMS$1();
|
|
39358
39750
|
}
|
|
@@ -42461,30 +42853,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
42461
42853
|
},
|
|
42462
42854
|
parse: parse$2
|
|
42463
42855
|
};
|
|
42464
|
-
function AiFillWarning(props) {
|
|
42465
|
-
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);
|
|
42466
|
-
}
|
|
42467
|
-
function AiOutlineLoading(props) {
|
|
42468
|
-
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);
|
|
42469
|
-
}
|
|
42470
|
-
function FaCircle(props) {
|
|
42471
|
-
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);
|
|
42472
|
-
}
|
|
42473
|
-
function FaFile(props) {
|
|
42474
|
-
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);
|
|
42475
|
-
}
|
|
42476
|
-
function FaFolder(props) {
|
|
42477
|
-
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);
|
|
42478
|
-
}
|
|
42479
|
-
function FaLock(props) {
|
|
42480
|
-
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);
|
|
42481
|
-
}
|
|
42482
|
-
function FaSpinner(props) {
|
|
42483
|
-
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);
|
|
42484
|
-
}
|
|
42485
|
-
function FaUnlock(props) {
|
|
42486
|
-
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);
|
|
42487
|
-
}
|
|
42488
42856
|
function GrCircleQuestion(props) {
|
|
42489
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);
|
|
42490
42858
|
}
|
|
@@ -43200,6 +43568,93 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43200
43568
|
};
|
|
43201
43569
|
}
|
|
43202
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
|
+
};
|
|
43203
43658
|
let Alerts$1 = class Alerts {
|
|
43204
43659
|
constructor(events2, map2 = {}) {
|
|
43205
43660
|
this.events = events2;
|
|
@@ -43226,21 +43681,44 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
43226
43681
|
...eventsToAlerts
|
|
43227
43682
|
};
|
|
43228
43683
|
}
|
|
43229
|
-
add(level, message, timeout =
|
|
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
|
+
}
|
|
43230
43708
|
const alert = {
|
|
43231
43709
|
level,
|
|
43232
43710
|
message,
|
|
43233
43711
|
timeout,
|
|
43234
|
-
id:
|
|
43712
|
+
id: String(id2)
|
|
43235
43713
|
};
|
|
43236
43714
|
this.alerts.set(alert.id, alert);
|
|
43237
43715
|
this.events.dispatch({ type: "alerts:add", alert });
|
|
43238
|
-
let timeoutId = null;
|
|
43239
43716
|
const dismiss = () => {
|
|
43240
|
-
|
|
43717
|
+
if (level !== "error") {
|
|
43718
|
+
toast.dismiss(id2);
|
|
43719
|
+
}
|
|
43241
43720
|
this.dismiss(alert);
|
|
43242
43721
|
};
|
|
43243
|
-
timeoutId = level !== "error" ? setTimeout(dismiss, alert.timeout) : null;
|
|
43244
43722
|
return dismiss;
|
|
43245
43723
|
}
|
|
43246
43724
|
dismiss(alert) {
|
|
@@ -44277,9 +44755,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
44277
44755
|
)
|
|
44278
44756
|
), description && /* @__PURE__ */ React.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
|
|
44279
44757
|
};
|
|
44280
|
-
function cn(...inputs) {
|
|
44281
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
44282
|
-
}
|
|
44283
44758
|
const checkerboardStyle = {
|
|
44284
44759
|
backgroundImage: "linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%)",
|
|
44285
44760
|
backgroundSize: "12px 12px",
|
|
@@ -45188,7 +45663,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
45188
45663
|
className = "",
|
|
45189
45664
|
...props
|
|
45190
45665
|
}) => {
|
|
45191
|
-
const commonAlertStyles = "
|
|
45666
|
+
const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
|
|
45192
45667
|
const styles = {
|
|
45193
45668
|
warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
|
|
45194
45669
|
info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
|
|
@@ -45212,14 +45687,14 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
45212
45687
|
children
|
|
45213
45688
|
);
|
|
45214
45689
|
};
|
|
45215
|
-
const LocalWarning = () => {
|
|
45690
|
+
const LocalWarning = ({ className = "" }) => {
|
|
45216
45691
|
var _a2, _b;
|
|
45217
45692
|
const cms = useCMS$1();
|
|
45218
45693
|
const isLocalMode = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isLocalMode;
|
|
45219
45694
|
if (!isLocalMode) {
|
|
45220
45695
|
return null;
|
|
45221
45696
|
}
|
|
45222
|
-
return /* @__PURE__ */ React__namespace.createElement(Callout, { calloutStyle: "warning", className: "w-fit" }, /* @__PURE__ */ React__namespace.createElement("a", { href: "https://tina.io/docs/r/what-is-tinacloud/", target: "_blank" }, "You are in local mode"));
|
|
45697
|
+
return /* @__PURE__ */ React__namespace.createElement(Callout, { calloutStyle: "warning", className: cn("w-fit", className) }, /* @__PURE__ */ React__namespace.createElement("a", { href: "https://tina.io/docs/r/what-is-tinacloud/", target: "_blank" }, "You are in local mode"));
|
|
45223
45698
|
};
|
|
45224
45699
|
const BillingWarning = () => {
|
|
45225
45700
|
var _a2;
|
|
@@ -45960,7 +46435,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
45960
46435
|
requiredArgs(1, arguments);
|
|
45961
46436
|
return formatDistance(dirtyDate, Date.now(), options);
|
|
45962
46437
|
}
|
|
45963
|
-
const version$1 = "2.9.
|
|
46438
|
+
const version$1 = "2.9.4";
|
|
45964
46439
|
const VersionInfo = () => {
|
|
45965
46440
|
var _a2, _b, _c, _d, _e, _f;
|
|
45966
46441
|
const cms = useCMS();
|
|
@@ -46196,7 +46671,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
46196
46671
|
toggleMenu();
|
|
46197
46672
|
}
|
|
46198
46673
|
},
|
|
46199
|
-
/* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-
|
|
46674
|
+
/* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-8 w-auto text-gray-600" })
|
|
46200
46675
|
)), /* @__PURE__ */ React__namespace.createElement(
|
|
46201
46676
|
"div",
|
|
46202
46677
|
{
|
|
@@ -46217,8 +46692,8 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
46217
46692
|
toggleMenu();
|
|
46218
46693
|
}
|
|
46219
46694
|
},
|
|
46220
|
-
/* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-
|
|
46221
|
-
), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-left inline-flex items-center text-xl tracking-wide text-gray-800/80 flex-1 gap-1" }, /* @__PURE__ */ React__namespace.createElement(
|
|
46695
|
+
/* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-8 w-auto text-gray-600" })
|
|
46696
|
+
), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-left inline-flex items-center text-xl tracking-wide text-gray-800/80 flex-1 gap-1" }, /* @__PURE__ */ React__namespace.createElement(TinaExtendedIcon, { className: "h-8 w-auto fill-orange-500" }))),
|
|
46222
46697
|
children,
|
|
46223
46698
|
/* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col px-6 flex-1 overflow-auto" }, showCollections && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("h4", { className: "flex space-x-1 justify-items-start uppercase font-sans font-bold text-sm mb-3 mt-8 text-gray-700" }, /* @__PURE__ */ React__namespace.createElement("span", null, "Collections"), isLocalMode && /* @__PURE__ */ React__namespace.createElement("span", { className: "flex items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
46224
46699
|
"a",
|
|
@@ -46468,60 +46943,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
46468
46943
|
/* @__PURE__ */ React__namespace.createElement("span", { className: "sr-only" }, "More")
|
|
46469
46944
|
);
|
|
46470
46945
|
}
|
|
46471
|
-
function DropdownMenu({
|
|
46472
|
-
...props
|
|
46473
|
-
}) {
|
|
46474
|
-
return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Root, { "data-slot": "dropdown-menu", ...props });
|
|
46475
|
-
}
|
|
46476
|
-
function DropdownMenuTrigger({
|
|
46477
|
-
...props
|
|
46478
|
-
}) {
|
|
46479
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
46480
|
-
DropdownMenuPrimitive__namespace.Trigger,
|
|
46481
|
-
{
|
|
46482
|
-
"data-slot": "dropdown-menu-trigger",
|
|
46483
|
-
...props
|
|
46484
|
-
}
|
|
46485
|
-
);
|
|
46486
|
-
}
|
|
46487
|
-
function DropdownMenuContent({
|
|
46488
|
-
className,
|
|
46489
|
-
sideOffset = 4,
|
|
46490
|
-
...props
|
|
46491
|
-
}) {
|
|
46492
|
-
return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
|
|
46493
|
-
DropdownMenuPrimitive__namespace.Content,
|
|
46494
|
-
{
|
|
46495
|
-
"data-slot": "dropdown-menu-content",
|
|
46496
|
-
sideOffset,
|
|
46497
|
-
className: cn(
|
|
46498
|
-
"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",
|
|
46499
|
-
className
|
|
46500
|
-
),
|
|
46501
|
-
...props
|
|
46502
|
-
}
|
|
46503
|
-
));
|
|
46504
|
-
}
|
|
46505
|
-
function DropdownMenuItem({
|
|
46506
|
-
className,
|
|
46507
|
-
inset,
|
|
46508
|
-
variant = "default",
|
|
46509
|
-
...props
|
|
46510
|
-
}) {
|
|
46511
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
46512
|
-
DropdownMenuPrimitive__namespace.Item,
|
|
46513
|
-
{
|
|
46514
|
-
"data-slot": "dropdown-menu-item",
|
|
46515
|
-
"data-inset": inset,
|
|
46516
|
-
"data-variant": variant,
|
|
46517
|
-
className: cn(
|
|
46518
|
-
"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",
|
|
46519
|
-
className
|
|
46520
|
-
),
|
|
46521
|
-
...props
|
|
46522
|
-
}
|
|
46523
|
-
);
|
|
46524
|
-
}
|
|
46525
46946
|
const Item = ({
|
|
46526
46947
|
item,
|
|
46527
46948
|
depth,
|
|
@@ -46790,7 +47211,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
46790
47211
|
DropdownMenuItem,
|
|
46791
47212
|
{
|
|
46792
47213
|
key: breadcrumb.formId,
|
|
46793
|
-
className: "cursor-pointer text-gray-700 hover:text-blue-500",
|
|
46794
47214
|
onClick: (e3) => {
|
|
46795
47215
|
e3.preventDefault();
|
|
46796
47216
|
goBack(breadcrumb.formId, breadcrumb.formName);
|
|
@@ -47118,7 +47538,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47118
47538
|
};
|
|
47119
47539
|
const SidebarHeader = ({ isLocalMode }) => {
|
|
47120
47540
|
const { toggleSidebarOpen, toggleMenu } = React__namespace.useContext(SidebarContext);
|
|
47121
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "p-2 flex-grow-0 w-full" }, !isLocalMode && /* @__PURE__ */ React__namespace.createElement(BillingWarning, null), /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full flex justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(
|
|
47541
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "p-2 flex-grow-0 w-full" }, !isLocalMode && /* @__PURE__ */ React__namespace.createElement(BillingWarning, null), /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full flex justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex overflow-hidden py-1" }, /* @__PURE__ */ React__namespace.createElement(
|
|
47122
47542
|
"button",
|
|
47123
47543
|
{
|
|
47124
47544
|
className: "p-2 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded",
|
|
@@ -47126,8 +47546,8 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47126
47546
|
title: "Open navigation menu",
|
|
47127
47547
|
"aria-label": "Open navigation menu"
|
|
47128
47548
|
},
|
|
47129
|
-
/* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-
|
|
47130
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
47549
|
+
/* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-8 w-auto text-gray-600" })
|
|
47550
|
+
), /* @__PURE__ */ React__namespace.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500 mr-2" }), /* @__PURE__ */ React__namespace.createElement(BranchButton, { className: "overflow-hidden mr-2" }), /* @__PURE__ */ React__namespace.createElement(LocalWarning, { className: "px-4" })), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(BranchPreviewButton, null), /* @__PURE__ */ React__namespace.createElement(
|
|
47131
47551
|
"button",
|
|
47132
47552
|
{
|
|
47133
47553
|
type: "button",
|
|
@@ -47652,21 +48072,10 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47652
48072
|
};
|
|
47653
48073
|
function Alerts({ alerts }) {
|
|
47654
48074
|
useSubscribable(alerts);
|
|
47655
|
-
if (
|
|
48075
|
+
if (alerts.all.length === 0) {
|
|
47656
48076
|
return null;
|
|
47657
48077
|
}
|
|
47658
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
47659
|
-
return alert.level !== "error";
|
|
47660
|
-
}).map((alert) => {
|
|
47661
|
-
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(
|
|
47662
|
-
CloseAlert,
|
|
47663
|
-
{
|
|
47664
|
-
onClick: () => {
|
|
47665
|
-
alerts.dismiss(alert);
|
|
47666
|
-
}
|
|
47667
|
-
}
|
|
47668
|
-
));
|
|
47669
|
-
})), alerts.all.filter((alert) => {
|
|
48078
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Toaster, null), alerts.all.filter((alert) => {
|
|
47670
48079
|
return alert.level === "error";
|
|
47671
48080
|
}).map((alert) => {
|
|
47672
48081
|
const AlertMessage = typeof alert.message === "string" ? () => {
|
|
@@ -47694,51 +48103,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47694
48103
|
))));
|
|
47695
48104
|
}));
|
|
47696
48105
|
}
|
|
47697
|
-
const Alert = ({
|
|
47698
|
-
level,
|
|
47699
|
-
...props
|
|
47700
|
-
}) => {
|
|
47701
|
-
const colorClasses = {
|
|
47702
|
-
info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
|
|
47703
|
-
success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
|
|
47704
|
-
warn: "bg-yellow-100 border-yellow-500 text-yellow-600 fill-yellow-500",
|
|
47705
|
-
error: "bg-red-100 border-red-500 text-red-600 fill-red-500"
|
|
47706
|
-
};
|
|
47707
|
-
const borderClasses = {
|
|
47708
|
-
info: "border-blue-200",
|
|
47709
|
-
success: "border-green-200",
|
|
47710
|
-
warn: "border-yellow-200",
|
|
47711
|
-
error: "border-red-200"
|
|
47712
|
-
};
|
|
47713
|
-
return /* @__PURE__ */ React.createElement(
|
|
47714
|
-
"div",
|
|
47715
|
-
{
|
|
47716
|
-
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]}}`,
|
|
47717
|
-
style: {
|
|
47718
|
-
animationName: "fly-in-up, fade-in",
|
|
47719
|
-
animationTimingFunction: "ease-out",
|
|
47720
|
-
animationIterationCount: 1,
|
|
47721
|
-
animationFillMode: "both",
|
|
47722
|
-
animationDuration: "150ms"
|
|
47723
|
-
}
|
|
47724
|
-
},
|
|
47725
|
-
/* @__PURE__ */ React.createElement(
|
|
47726
|
-
"div",
|
|
47727
|
-
{
|
|
47728
|
-
className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
|
|
47729
|
-
...props
|
|
47730
|
-
}
|
|
47731
|
-
)
|
|
47732
|
-
);
|
|
47733
|
-
};
|
|
47734
|
-
const CloseAlert = ({ ...styleProps }) => /* @__PURE__ */ React.createElement(
|
|
47735
|
-
"button",
|
|
47736
|
-
{
|
|
47737
|
-
className: "border-none bg-transparent p-0 outline-none flex items-center",
|
|
47738
|
-
...styleProps
|
|
47739
|
-
},
|
|
47740
|
-
/* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
|
|
47741
|
-
);
|
|
47742
48106
|
function CursorPaginator({
|
|
47743
48107
|
navigateNext,
|
|
47744
48108
|
navigatePrev,
|
|
@@ -47974,10 +48338,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47974
48338
|
}
|
|
47975
48339
|
))));
|
|
47976
48340
|
};
|
|
47977
|
-
const
|
|
47978
|
-
return branchName.replace(/^tina\//, "");
|
|
47979
|
-
};
|
|
47980
|
-
const BranchButton = () => {
|
|
48341
|
+
const BranchButton = ({ className = "" }) => {
|
|
47981
48342
|
const [open, setOpen] = React__namespace.useState(false);
|
|
47982
48343
|
const { currentBranch } = useBranchData();
|
|
47983
48344
|
const cms = useCMS();
|
|
@@ -47987,22 +48348,19 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
47987
48348
|
}
|
|
47988
48349
|
const isProtected = cms.api.tina.usingProtectedBranch();
|
|
47989
48350
|
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
47990
|
-
|
|
48351
|
+
Button$1,
|
|
47991
48352
|
{
|
|
48353
|
+
variant: "secondary",
|
|
48354
|
+
size: "custom",
|
|
47992
48355
|
className: cn(
|
|
47993
|
-
|
|
47994
|
-
|
|
47995
|
-
isProtected ? "text-white hover:text-blue-50 bg-blue-500 hover:bg-blue-400 border-0" : "text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-100"
|
|
48356
|
+
"pointer-events-auto px-3 py-3 flex shrink gap-1 items-center justify-between",
|
|
48357
|
+
className
|
|
47996
48358
|
),
|
|
47997
|
-
onClick: () => setOpen(true)
|
|
48359
|
+
onClick: () => setOpen(true),
|
|
48360
|
+
title: currentBranch
|
|
47998
48361
|
},
|
|
47999
|
-
isProtected ? /* @__PURE__ */ React__namespace.createElement(BiLockAlt, { className: "flex-shrink-0 h-
|
|
48000
|
-
|
|
48001
|
-
{
|
|
48002
|
-
className: `flex-shrink-0 h-4 w-auto opacity-70 text-zinc-400`
|
|
48003
|
-
}
|
|
48004
|
-
),
|
|
48005
|
-
/* @__PURE__ */ React__namespace.createElement("span", { className: "truncate max-w-full -mr-1" }, trimPrefix(currentBranch)),
|
|
48362
|
+
isProtected ? /* @__PURE__ */ React__namespace.createElement(BiLockAlt, { className: "flex-shrink-0 h-6 w-auto opacity-70" }) : /* @__PURE__ */ React__namespace.createElement(BiGitBranch, { className: "flex-shrink-0 h-6 w-auto opacity-70 text-zinc-400" }),
|
|
48363
|
+
/* @__PURE__ */ React__namespace.createElement("span", { className: "truncate max-w-full -mr-1" }, currentBranch),
|
|
48006
48364
|
/* @__PURE__ */ React__namespace.createElement(
|
|
48007
48365
|
BiChevronDown,
|
|
48008
48366
|
{
|
|
@@ -48032,7 +48390,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
48032
48390
|
className: "p-2 text-gray-500 hover:text-blue-500 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded",
|
|
48033
48391
|
...props,
|
|
48034
48392
|
onClick: () => {
|
|
48035
|
-
window.open(
|
|
48393
|
+
window.open("", "_blank");
|
|
48036
48394
|
},
|
|
48037
48395
|
title: "Preview site in new tab"
|
|
48038
48396
|
},
|
|
@@ -48040,6 +48398,18 @@ Please wrap them with useCallback or configure the deps array correctly.`
|
|
|
48040
48398
|
/* @__PURE__ */ React__namespace.createElement(BiLinkExternal, { className: "h-5 w-auto" })
|
|
48041
48399
|
);
|
|
48042
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
|
+
};
|
|
48043
48413
|
const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
48044
48414
|
const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
|
|
48045
48415
|
const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
@@ -63453,367 +63823,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63453
63823
|
);
|
|
63454
63824
|
}
|
|
63455
63825
|
}
|
|
63456
|
-
const ProgressBar = ({
|
|
63457
|
-
progress,
|
|
63458
|
-
className = "",
|
|
63459
|
-
color = "blue"
|
|
63460
|
-
}) => {
|
|
63461
|
-
const clampedProgress = Math.min(Math.max(progress, 0), 100);
|
|
63462
|
-
const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
|
|
63463
|
-
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(
|
|
63464
|
-
"div",
|
|
63465
|
-
{
|
|
63466
|
-
className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
|
|
63467
|
-
style: { width: `${clampedProgress}%` }
|
|
63468
|
-
}
|
|
63469
|
-
)));
|
|
63470
|
-
};
|
|
63471
|
-
const EDITORIAL_WORKFLOW_STATUS = {
|
|
63472
|
-
QUEUED: "queued",
|
|
63473
|
-
PROCESSING: "processing",
|
|
63474
|
-
SETTING_UP: "setting_up",
|
|
63475
|
-
CREATING_BRANCH: "creating_branch",
|
|
63476
|
-
INDEXING: "indexing",
|
|
63477
|
-
CONTENT_GENERATION: "content_generation",
|
|
63478
|
-
CREATING_PR: "creating_pr",
|
|
63479
|
-
COMPLETE: "complete",
|
|
63480
|
-
ERROR: "error",
|
|
63481
|
-
TIMEOUT: "timeout"
|
|
63482
|
-
};
|
|
63483
|
-
const FormActionMenu = ({ actions, form }) => {
|
|
63484
|
-
const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
|
|
63485
|
-
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(
|
|
63486
|
-
Dismissible,
|
|
63487
|
-
{
|
|
63488
|
-
click: true,
|
|
63489
|
-
escape: true,
|
|
63490
|
-
disabled: !actionMenuVisibility,
|
|
63491
|
-
onDismiss: () => {
|
|
63492
|
-
setActionMenuVisibility((p2) => !p2);
|
|
63493
|
-
}
|
|
63494
|
-
},
|
|
63495
|
-
actions.map((Action, i2) => (
|
|
63496
|
-
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
63497
|
-
// Actions should just be componets
|
|
63498
|
-
/* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
|
|
63499
|
-
))
|
|
63500
|
-
)));
|
|
63501
|
-
};
|
|
63502
|
-
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63503
|
-
"button",
|
|
63504
|
-
{
|
|
63505
|
-
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}`,
|
|
63506
|
-
...props
|
|
63507
|
-
},
|
|
63508
|
-
/* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
|
|
63509
|
-
);
|
|
63510
|
-
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63511
|
-
"div",
|
|
63512
|
-
{
|
|
63513
|
-
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}`,
|
|
63514
|
-
style: {
|
|
63515
|
-
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
63516
|
-
pointerEvents: open ? "all" : "none",
|
|
63517
|
-
...style
|
|
63518
|
-
},
|
|
63519
|
-
...props
|
|
63520
|
-
}
|
|
63521
|
-
);
|
|
63522
|
-
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63523
|
-
"button",
|
|
63524
|
-
{
|
|
63525
|
-
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}`,
|
|
63526
|
-
...props
|
|
63527
|
-
}
|
|
63528
|
-
);
|
|
63529
|
-
const FormPortalContext = React__namespace.createContext(() => {
|
|
63530
|
-
return null;
|
|
63531
|
-
});
|
|
63532
|
-
function useFormPortal() {
|
|
63533
|
-
return React__namespace.useContext(FormPortalContext);
|
|
63534
|
-
}
|
|
63535
|
-
const FormPortalProvider = ({
|
|
63536
|
-
children
|
|
63537
|
-
}) => {
|
|
63538
|
-
const wrapperRef = React__namespace.useRef(null);
|
|
63539
|
-
const zIndexRef = React__namespace.useRef(0);
|
|
63540
|
-
const FormPortal = React__namespace.useCallback(
|
|
63541
|
-
(props) => {
|
|
63542
|
-
if (!wrapperRef.current)
|
|
63543
|
-
return null;
|
|
63544
|
-
return ReactDOM.createPortal(
|
|
63545
|
-
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
63546
|
-
wrapperRef.current
|
|
63547
|
-
);
|
|
63548
|
-
},
|
|
63549
|
-
[wrapperRef, zIndexRef]
|
|
63550
|
-
);
|
|
63551
|
-
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));
|
|
63552
|
-
};
|
|
63553
|
-
const LoadingDots = ({
|
|
63554
|
-
dotSize = 8,
|
|
63555
|
-
color = "white"
|
|
63556
|
-
}) => {
|
|
63557
|
-
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 }));
|
|
63558
|
-
};
|
|
63559
|
-
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63560
|
-
"span",
|
|
63561
|
-
{
|
|
63562
|
-
className: "inline-block mr-1",
|
|
63563
|
-
style: {
|
|
63564
|
-
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
63565
|
-
animationDelay: `${delay}s`,
|
|
63566
|
-
background: color,
|
|
63567
|
-
width: dotSize,
|
|
63568
|
-
height: dotSize,
|
|
63569
|
-
borderRadius: dotSize
|
|
63570
|
-
}
|
|
63571
|
-
}
|
|
63572
|
-
);
|
|
63573
|
-
const ResetForm = ({
|
|
63574
|
-
pristine,
|
|
63575
|
-
reset: reset2,
|
|
63576
|
-
children,
|
|
63577
|
-
...props
|
|
63578
|
-
}) => {
|
|
63579
|
-
const [open, setOpen] = React__namespace.useState(false);
|
|
63580
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
63581
|
-
Button$1,
|
|
63582
|
-
{
|
|
63583
|
-
onClick: () => {
|
|
63584
|
-
setOpen((p2) => !p2);
|
|
63585
|
-
},
|
|
63586
|
-
disabled: pristine,
|
|
63587
|
-
...props
|
|
63588
|
-
},
|
|
63589
|
-
children
|
|
63590
|
-
), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
63591
|
-
};
|
|
63592
|
-
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
63593
|
-
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(
|
|
63594
|
-
Button$1,
|
|
63595
|
-
{
|
|
63596
|
-
style: { flexGrow: 3 },
|
|
63597
|
-
variant: "primary",
|
|
63598
|
-
onClick: async () => {
|
|
63599
|
-
await reset2();
|
|
63600
|
-
close2();
|
|
63601
|
-
}
|
|
63602
|
-
},
|
|
63603
|
-
"Reset"
|
|
63604
|
-
))));
|
|
63605
|
-
};
|
|
63606
|
-
const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
63607
|
-
"div",
|
|
63608
|
-
{
|
|
63609
|
-
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
63610
|
-
style: {
|
|
63611
|
-
animationName: "fade-in",
|
|
63612
|
-
animationDelay: "300ms",
|
|
63613
|
-
animationTimingFunction: "ease-out",
|
|
63614
|
-
animationIterationCount: 1,
|
|
63615
|
-
animationFillMode: "both",
|
|
63616
|
-
animationDuration: "150ms"
|
|
63617
|
-
}
|
|
63618
|
-
},
|
|
63619
|
-
/* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
63620
|
-
/* @__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."),
|
|
63621
|
-
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
63622
|
-
"a",
|
|
63623
|
-
{
|
|
63624
|
-
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",
|
|
63625
|
-
href: "https://tinacms.org/docs/fields",
|
|
63626
|
-
target: "_blank",
|
|
63627
|
-
rel: "noopener noreferrer"
|
|
63628
|
-
},
|
|
63629
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
63630
|
-
Emoji,
|
|
63631
|
-
{
|
|
63632
|
-
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
63633
|
-
style: { fontSize: 24 }
|
|
63634
|
-
},
|
|
63635
|
-
"📖"
|
|
63636
|
-
),
|
|
63637
|
-
" ",
|
|
63638
|
-
"Field Setup Guide"
|
|
63639
|
-
))
|
|
63640
|
-
);
|
|
63641
|
-
const FormKeyBindings = ({ onSubmit }) => {
|
|
63642
|
-
React.useEffect(() => {
|
|
63643
|
-
const handleKeyDown = (e3) => {
|
|
63644
|
-
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
63645
|
-
e3.preventDefault();
|
|
63646
|
-
onSubmit();
|
|
63647
|
-
}
|
|
63648
|
-
};
|
|
63649
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
63650
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
63651
|
-
}, [onSubmit]);
|
|
63652
|
-
return null;
|
|
63653
|
-
};
|
|
63654
|
-
const FormBuilder = ({
|
|
63655
|
-
form,
|
|
63656
|
-
onPristineChange,
|
|
63657
|
-
...rest
|
|
63658
|
-
}) => {
|
|
63659
|
-
const cms = useCMS$1();
|
|
63660
|
-
const hideFooter = !!rest.hideFooter;
|
|
63661
|
-
const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
|
|
63662
|
-
const tinaForm = form.tinaForm;
|
|
63663
|
-
const finalForm2 = form.tinaForm.finalForm;
|
|
63664
|
-
React__namespace.useEffect(() => {
|
|
63665
|
-
var _a2;
|
|
63666
|
-
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
63667
|
-
tinaForm.path
|
|
63668
|
-
);
|
|
63669
|
-
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
63670
|
-
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
63671
|
-
} else {
|
|
63672
|
-
tinaForm.beforeSubmit = void 0;
|
|
63673
|
-
}
|
|
63674
|
-
}, [tinaForm.path]);
|
|
63675
|
-
const moveArrayItem = React__namespace.useCallback(
|
|
63676
|
-
(result) => {
|
|
63677
|
-
if (!result.destination || !finalForm2)
|
|
63678
|
-
return;
|
|
63679
|
-
const name = result.type;
|
|
63680
|
-
finalForm2.mutators.move(
|
|
63681
|
-
name,
|
|
63682
|
-
result.source.index,
|
|
63683
|
-
result.destination.index
|
|
63684
|
-
);
|
|
63685
|
-
},
|
|
63686
|
-
[tinaForm]
|
|
63687
|
-
);
|
|
63688
|
-
React__namespace.useEffect(() => {
|
|
63689
|
-
const unsubscribe = finalForm2.subscribe(
|
|
63690
|
-
({ pristine }) => {
|
|
63691
|
-
if (onPristineChange) {
|
|
63692
|
-
onPristineChange(pristine);
|
|
63693
|
-
}
|
|
63694
|
-
},
|
|
63695
|
-
{ pristine: true }
|
|
63696
|
-
);
|
|
63697
|
-
return () => {
|
|
63698
|
-
unsubscribe();
|
|
63699
|
-
};
|
|
63700
|
-
}, [finalForm2]);
|
|
63701
|
-
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
63702
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
63703
|
-
reactFinalForm.Form,
|
|
63704
|
-
{
|
|
63705
|
-
key: tinaForm.id,
|
|
63706
|
-
form: tinaForm.finalForm,
|
|
63707
|
-
onSubmit: tinaForm.onSubmit
|
|
63708
|
-
},
|
|
63709
|
-
({
|
|
63710
|
-
handleSubmit,
|
|
63711
|
-
pristine,
|
|
63712
|
-
invalid,
|
|
63713
|
-
submitting,
|
|
63714
|
-
dirtySinceLastSubmit,
|
|
63715
|
-
hasValidationErrors
|
|
63716
|
-
}) => {
|
|
63717
|
-
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
63718
|
-
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
63719
|
-
const safeSubmit = async () => {
|
|
63720
|
-
if (canSubmit) {
|
|
63721
|
-
await handleSubmit();
|
|
63722
|
-
}
|
|
63723
|
-
};
|
|
63724
|
-
const safeHandleSubmit = async () => {
|
|
63725
|
-
if (usingProtectedBranch) {
|
|
63726
|
-
setCreateBranchModalOpen(true);
|
|
63727
|
-
} else {
|
|
63728
|
-
safeSubmit();
|
|
63729
|
-
}
|
|
63730
|
-
};
|
|
63731
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
|
|
63732
|
-
CreateBranchModal,
|
|
63733
|
-
{
|
|
63734
|
-
safeSubmit,
|
|
63735
|
-
crudType: tinaForm.crudType,
|
|
63736
|
-
path: tinaForm.path,
|
|
63737
|
-
values: tinaForm.values,
|
|
63738
|
-
close: () => setCreateBranchModalOpen(false)
|
|
63739
|
-
}
|
|
63740
|
-
), /* @__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(
|
|
63741
|
-
FieldsBuilder,
|
|
63742
|
-
{
|
|
63743
|
-
form: tinaForm,
|
|
63744
|
-
activeFieldName: form.activeFieldName,
|
|
63745
|
-
fields: fieldGroup.fields
|
|
63746
|
-
}
|
|
63747
|
-
) : /* @__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(
|
|
63748
|
-
ResetForm,
|
|
63749
|
-
{
|
|
63750
|
-
pristine,
|
|
63751
|
-
reset: async () => {
|
|
63752
|
-
finalForm2.reset();
|
|
63753
|
-
await tinaForm.reset();
|
|
63754
|
-
}
|
|
63755
|
-
},
|
|
63756
|
-
tinaForm.buttons.reset
|
|
63757
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
63758
|
-
Button$1,
|
|
63759
|
-
{
|
|
63760
|
-
onClick: safeHandleSubmit,
|
|
63761
|
-
disabled: !canSubmit,
|
|
63762
|
-
busy: submitting,
|
|
63763
|
-
variant: "primary"
|
|
63764
|
-
},
|
|
63765
|
-
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
63766
|
-
!submitting && tinaForm.buttons.save
|
|
63767
|
-
), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
|
|
63768
|
-
FormActionMenu,
|
|
63769
|
-
{
|
|
63770
|
-
form: tinaForm,
|
|
63771
|
-
actions: tinaForm.actions
|
|
63772
|
-
}
|
|
63773
|
-
)))));
|
|
63774
|
-
}
|
|
63775
|
-
);
|
|
63776
|
-
};
|
|
63777
|
-
const FormStatus = ({ pristine }) => {
|
|
63778
|
-
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
63779
|
-
return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
63780
|
-
};
|
|
63781
|
-
const FormWrapper = ({
|
|
63782
|
-
id: id2,
|
|
63783
|
-
children
|
|
63784
|
-
}) => {
|
|
63785
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
63786
|
-
"div",
|
|
63787
|
-
{
|
|
63788
|
-
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
63789
|
-
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
63790
|
-
},
|
|
63791
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
|
|
63792
|
-
);
|
|
63793
|
-
};
|
|
63794
|
-
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
63795
|
-
"span",
|
|
63796
|
-
{
|
|
63797
|
-
className: `text-[40px] leading-none inline-block ${className}`,
|
|
63798
|
-
...props
|
|
63799
|
-
}
|
|
63800
|
-
);
|
|
63801
|
-
const CreateBranchModel = ({
|
|
63802
|
-
close: close2,
|
|
63803
|
-
safeSubmit,
|
|
63804
|
-
relativePath: relativePath2,
|
|
63805
|
-
values,
|
|
63806
|
-
crudType
|
|
63807
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
63808
|
-
CreateBranchModal,
|
|
63809
|
-
{
|
|
63810
|
-
close: close2,
|
|
63811
|
-
safeSubmit,
|
|
63812
|
-
path: relativePath2,
|
|
63813
|
-
values,
|
|
63814
|
-
crudType
|
|
63815
|
-
}
|
|
63816
|
-
);
|
|
63817
63826
|
const pathRelativeToCollection = (collectionPath, fullPath) => {
|
|
63818
63827
|
const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
|
|
63819
63828
|
const normalizedFullPath = fullPath.replace(/\\/g, "/");
|
|
@@ -63842,7 +63851,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63842
63851
|
const [isExecuting, setIsExecuting] = React__namespace.useState(false);
|
|
63843
63852
|
const [errorMessage, setErrorMessage] = React__namespace.useState("");
|
|
63844
63853
|
const [currentStep, setCurrentStep] = React__namespace.useState(0);
|
|
63845
|
-
const [statusMessage, setStatusMessage] = React__namespace.useState("");
|
|
63846
63854
|
const [elapsedTime, setElapsedTime] = React__namespace.useState(0);
|
|
63847
63855
|
React__namespace.useEffect(() => {
|
|
63848
63856
|
let interval;
|
|
@@ -63886,7 +63894,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63886
63894
|
setDisabled(true);
|
|
63887
63895
|
setIsExecuting(true);
|
|
63888
63896
|
setCurrentStep(1);
|
|
63889
|
-
setStatusMessage("Initializing workflow...");
|
|
63890
63897
|
let graphql2 = "";
|
|
63891
63898
|
if (crudType === "create") {
|
|
63892
63899
|
graphql2 = CREATE_DOCUMENT_GQL;
|
|
@@ -63911,8 +63918,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63911
63918
|
}
|
|
63912
63919
|
},
|
|
63913
63920
|
onStatusUpdate: (status) => {
|
|
63914
|
-
const message = status.message || `Status: ${status.status}`;
|
|
63915
|
-
setStatusMessage(message);
|
|
63916
63921
|
switch (status.status) {
|
|
63917
63922
|
case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
|
|
63918
63923
|
case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
|
|
@@ -63949,9 +63954,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63949
63954
|
}
|
|
63950
63955
|
};
|
|
63951
63956
|
const renderProgressIndicator = () => {
|
|
63952
|
-
|
|
63953
|
-
const progressPercentage = (currentStep - 1) / steps.length * 100;
|
|
63954
|
-
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(
|
|
63955
63958
|
"div",
|
|
63956
63959
|
{
|
|
63957
63960
|
className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
|
|
@@ -63960,7 +63963,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63960
63963
|
), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React__namespace.createElement(
|
|
63961
63964
|
"div",
|
|
63962
63965
|
{
|
|
63963
|
-
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",
|
|
63964
63967
|
style: {
|
|
63965
63968
|
left: "50px",
|
|
63966
63969
|
width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
|
|
@@ -63988,7 +63991,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
63988
63991
|
/* @__PURE__ */ React__namespace.createElement(
|
|
63989
63992
|
"div",
|
|
63990
63993
|
{
|
|
63991
|
-
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"}`
|
|
63992
63995
|
},
|
|
63993
63996
|
isCompleted ? /* @__PURE__ */ React__namespace.createElement(
|
|
63994
63997
|
"svg",
|
|
@@ -64007,15 +64010,9 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64007
64010
|
)
|
|
64008
64011
|
) : isActive ? /* @__PURE__ */ React__namespace.createElement(AiOutlineLoading, { className: "animate-spin text-lg" }) : stepNumber
|
|
64009
64012
|
),
|
|
64010
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React__namespace.createElement(
|
|
64011
|
-
"div",
|
|
64012
|
-
{
|
|
64013
|
-
className: `text-sm font-semibold leading-tight ${isActive ? "text-blue-600" : isCompleted ? "text-green-600" : "text-gray-400"}`
|
|
64014
|
-
},
|
|
64015
|
-
step.name
|
|
64016
|
-
), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
|
|
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))
|
|
64017
64014
|
);
|
|
64018
|
-
})), /* @__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(
|
|
64019
64016
|
"path",
|
|
64020
64017
|
{
|
|
64021
64018
|
fillRule: "evenodd",
|
|
@@ -64023,37 +64020,23 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64023
64020
|
clipRule: "evenodd"
|
|
64024
64021
|
}
|
|
64025
64022
|
)), formatTime(elapsedTime))), /* @__PURE__ */ React__namespace.createElement(
|
|
64026
|
-
|
|
64027
|
-
{
|
|
64028
|
-
progress: progressPercentage,
|
|
64029
|
-
className: "mb-4",
|
|
64030
|
-
color: currentStep > steps.length ? "green" : "blue"
|
|
64031
|
-
}
|
|
64032
|
-
), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React__namespace.createElement(
|
|
64033
|
-
"svg",
|
|
64023
|
+
"a",
|
|
64034
64024
|
{
|
|
64035
|
-
className: "
|
|
64036
|
-
|
|
64037
|
-
|
|
64025
|
+
className: "underline text-tina-orange-dark font-medium text-xs",
|
|
64026
|
+
href: "https://tina.io/docs/tinacloud/editorial-workflow",
|
|
64027
|
+
target: "_blank"
|
|
64038
64028
|
},
|
|
64039
|
-
|
|
64040
|
-
|
|
64041
|
-
{
|
|
64042
|
-
fillRule: "evenodd",
|
|
64043
|
-
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",
|
|
64044
|
-
clipRule: "evenodd"
|
|
64045
|
-
}
|
|
64046
|
-
)
|
|
64047
|
-
) : /* @__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
|
+
));
|
|
64048
64031
|
};
|
|
64049
64032
|
const renderStateContent = () => {
|
|
64050
64033
|
if (isExecuting) {
|
|
64051
64034
|
return renderProgressIndicator();
|
|
64052
64035
|
} else {
|
|
64053
|
-
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.
|
|
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(
|
|
64054
64037
|
"a",
|
|
64055
64038
|
{
|
|
64056
|
-
className: "underline
|
|
64039
|
+
className: "underline text-tina-orange-dark font-medium",
|
|
64057
64040
|
href: "https://tina.io/docs/tinacloud/editorial-workflow",
|
|
64058
64041
|
target: "_blank"
|
|
64059
64042
|
},
|
|
@@ -64061,54 +64044,273 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
64061
64044
|
), "."), /* @__PURE__ */ React__namespace.createElement(
|
|
64062
64045
|
PrefixedTextField,
|
|
64063
64046
|
{
|
|
64047
|
+
name: "new-branch-name",
|
|
64048
|
+
label: "Branch Name",
|
|
64064
64049
|
placeholder: "e.g. {{PAGE-NAME}}-updates",
|
|
64065
64050
|
value: newBranchName,
|
|
64066
64051
|
onChange: (e3) => {
|
|
64067
64052
|
setErrorMessage("");
|
|
64068
|
-
setStatusMessage("");
|
|
64069
64053
|
setNewBranchName(e3.target.value);
|
|
64070
64054
|
}
|
|
64071
64055
|
}
|
|
64072
64056
|
));
|
|
64073
64057
|
}
|
|
64074
64058
|
};
|
|
64075
|
-
return /* @__PURE__ */ React__namespace.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" },
|
|
64076
|
-
|
|
64059
|
+
return /* @__PURE__ */ React__namespace.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, "Save changes to new branch"))), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React__namespace.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React__namespace.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
64060
|
+
DropdownButton,
|
|
64077
64061
|
{
|
|
64078
64062
|
variant: "primary",
|
|
64079
|
-
|
|
64063
|
+
align: "start",
|
|
64064
|
+
className: "w-full sm:w-auto",
|
|
64080
64065
|
disabled: newBranchName === "" || disabled,
|
|
64081
|
-
|
|
64082
|
-
|
|
64083
|
-
"Continue"
|
|
64084
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
64085
|
-
OverflowMenu$1,
|
|
64086
|
-
{
|
|
64087
|
-
className: "-ml-2",
|
|
64088
|
-
toolbarItems: [
|
|
64066
|
+
onMainAction: executeEditorialWorkflow,
|
|
64067
|
+
items: [
|
|
64089
64068
|
{
|
|
64090
|
-
name: "override",
|
|
64091
64069
|
label: "Save to Protected Branch",
|
|
64092
|
-
|
|
64093
|
-
onMouseDown: () => {
|
|
64070
|
+
onClick: () => {
|
|
64094
64071
|
close2();
|
|
64095
64072
|
safeSubmit();
|
|
64096
|
-
}
|
|
64073
|
+
},
|
|
64074
|
+
icon: /* @__PURE__ */ React__namespace.createElement(lucideReact.TriangleAlert, { className: "w-4 h-4" })
|
|
64097
64075
|
}
|
|
64098
64076
|
]
|
|
64099
|
-
}
|
|
64077
|
+
},
|
|
64078
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
64079
|
+
lucideReact.GitBranchIcon,
|
|
64080
|
+
{
|
|
64081
|
+
className: "w-4 h-4 mr-1",
|
|
64082
|
+
style: { fill: "none" }
|
|
64083
|
+
}
|
|
64084
|
+
),
|
|
64085
|
+
"Save to a new branch"
|
|
64100
64086
|
))));
|
|
64101
64087
|
};
|
|
64102
|
-
const PrefixedTextField = ({
|
|
64103
|
-
|
|
64088
|
+
const PrefixedTextField = ({
|
|
64089
|
+
label = null,
|
|
64090
|
+
prefix = "tina/",
|
|
64091
|
+
...props
|
|
64092
|
+
}) => {
|
|
64093
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, label && /* @__PURE__ */ React__namespace.createElement(FieldLabel, { name: props.name }, label), /* @__PURE__ */ React__namespace.createElement("div", { className: "border border-gray-200 focus-within:border-blue-200 bg-gray-100 focus-within:bg-blue-100 rounded shadow-sm focus-within:shadow-outline overflow-hidden flex items-stretch divide-x divide-gray-200 focus-within:divide-blue-100 w-full transition-all ease-out duration-150" }, /* @__PURE__ */ React__namespace.createElement("span", { className: "pl-3 pr-2 py-2 text-base text-tina-orange-dark bg-tina-orange-light" }, prefix), /* @__PURE__ */ React__namespace.createElement(
|
|
64104
64094
|
"input",
|
|
64105
64095
|
{
|
|
64096
|
+
id: props.name,
|
|
64106
64097
|
type: "text",
|
|
64107
64098
|
className: "shadow-inner focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 flex-1 bg-white focus:text-gray-900",
|
|
64108
64099
|
...props
|
|
64109
64100
|
}
|
|
64110
|
-
));
|
|
64101
|
+
)));
|
|
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;
|
|
64111
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
|
+
);
|
|
64112
64314
|
const NestedForm = (props) => {
|
|
64113
64315
|
const FormPortal = useFormPortal();
|
|
64114
64316
|
const id2 = React.useMemo(() => uuid(), [props.id, props.initialValues]);
|
|
@@ -65443,9 +65645,9 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
|
|
|
65443
65645
|
ai: "w-full px-0 text-base md:text-sm",
|
|
65444
65646
|
aiChat: "max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm",
|
|
65445
65647
|
comment: cn$2.cn("rounded-none border-none bg-transparent text-sm"),
|
|
65446
|
-
default: "size-full px-
|
|
65447
|
-
demo: "size-full px-
|
|
65448
|
-
fullWidth: "size-full px-
|
|
65648
|
+
default: "size-full px-2 sm:px-4 pt-2 text-base",
|
|
65649
|
+
demo: "size-full px-2 sm:px-4 pt-2 text-base h-[650px]",
|
|
65650
|
+
fullWidth: "size-full px-2 sm:px-4 pt-4 pb-72 text-base",
|
|
65449
65651
|
none: "",
|
|
65450
65652
|
select: "px-3 py-2 text-base data-readonly:w-fit"
|
|
65451
65653
|
}
|
|
@@ -65877,7 +66079,7 @@ flowchart TD
|
|
|
65877
66079
|
className: "w-full p-2 border border-gray-300 rounded",
|
|
65878
66080
|
onChange: filterChange
|
|
65879
66081
|
}
|
|
65880
|
-
), /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null), filteredTemplates.map((template) => /* @__PURE__ */ React.createElement(
|
|
66082
|
+
), /* @__PURE__ */ React.createElement(DropdownMenuSeparator$1, null), filteredTemplates.map((template) => /* @__PURE__ */ React.createElement(
|
|
65881
66083
|
DropdownMenuItem$1,
|
|
65882
66084
|
{
|
|
65883
66085
|
key: template.name,
|
|
@@ -119249,7 +119451,7 @@ mutation addPendingDocumentMutation(
|
|
|
119249
119451
|
}
|
|
119250
119452
|
}
|
|
119251
119453
|
function ModalBuilder(modalProps) {
|
|
119252
|
-
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, null,
|
|
119454
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, null, modalProps.title), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, modalProps.message && (typeof modalProps.message === "string" ? /* @__PURE__ */ React.createElement("p", null, modalProps.message) : modalProps.message), modalProps.error && /* @__PURE__ */ React.createElement(ErrorLabel, null, modalProps.error), modalProps.children), /* @__PURE__ */ React.createElement(ModalActions, null, modalProps.actions.map((action) => /* @__PURE__ */ React.createElement(AsyncButton, { key: action.name, ...action })))));
|
|
119253
119455
|
}
|
|
119254
119456
|
const ErrorLabel = ({ style = {}, ...props }) => /* @__PURE__ */ React.createElement("p", { style: { ...style, color: "var(--tina-color-error)" }, ...props });
|
|
119255
119457
|
const AsyncButton = ({ name, primary, action }) => {
|
|
@@ -120463,7 +120665,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120463
120665
|
headerClassName,
|
|
120464
120666
|
children
|
|
120465
120667
|
}) => {
|
|
120466
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, /* @__PURE__ */ React.createElement("div", { className: `py-2
|
|
120668
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, /* @__PURE__ */ React.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React.createElement(LocalWarning, null), /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React.createElement(BranchButton, null), /* @__PURE__ */ React.createElement(BranchPreviewButton, null))), children);
|
|
120467
120669
|
};
|
|
120468
120670
|
const PageHeader = ({
|
|
120469
120671
|
children
|
|
@@ -120855,7 +121057,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120855
121057
|
},
|
|
120856
121058
|
close: () => setFolderModalOpen(false)
|
|
120857
121059
|
}
|
|
120858
|
-
), /* @__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(
|
|
120859
121061
|
"label",
|
|
120860
121062
|
{
|
|
120861
121063
|
htmlFor: "sort",
|
|
@@ -120945,7 +121147,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120945
121147
|
},
|
|
120946
121148
|
to: "/collections/new-folder",
|
|
120947
121149
|
className: cn$1(
|
|
120948
|
-
"icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-
|
|
121150
|
+
"icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100 focus:ring-white focus:ring-tina-orange-dark w-full md:w-auto text-sm h-10 px-6 mr-4",
|
|
120949
121151
|
collection.templates && "opacity-50 pointer-events-none cursor-not-allowed"
|
|
120950
121152
|
),
|
|
120951
121153
|
"aria-disabled": !!collection.templates,
|
|
@@ -120983,7 +121185,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
120983
121185
|
"new",
|
|
120984
121186
|
collectionName
|
|
120985
121187
|
].join("/")}`,
|
|
120986
|
-
className: "inline-flex items-center font-medium focus:outline-none focus:ring-
|
|
121188
|
+
className: "inline-flex items-center font-medium focus:ring-2 focus:outline-none focus:ring-tina-orange-dark focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-white bg-tina-orange-dark hover:bg-tina-orange w-full md:w-auto text-sm h-10 px-6"
|
|
120987
121189
|
},
|
|
120988
121190
|
/* @__PURE__ */ React.createElement(FaFile, { className: "mr-2" }),
|
|
120989
121191
|
"Add File"
|
|
@@ -122558,6 +122760,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
122558
122760
|
exports2.Dismissible = Dismissible;
|
|
122559
122761
|
exports2.DragHandle = DragHandle;
|
|
122560
122762
|
exports2.DragIcon = DragIcon;
|
|
122763
|
+
exports2.DropdownButton = DropdownButton;
|
|
122561
122764
|
exports2.DummyMediaStore = DummyMediaStore;
|
|
122562
122765
|
exports2.DuplicateIcon = DuplicateIcon;
|
|
122563
122766
|
exports2.EditIcon = EditIcon;
|
|
@@ -122686,6 +122889,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
122686
122889
|
exports2.TinaCloudAuthProvider = TinaCloudAuthProvider;
|
|
122687
122890
|
exports2.TinaCloudAuthWall = TinaCloudAuthWall;
|
|
122688
122891
|
exports2.TinaCloudProvider = TinaCloudProvider;
|
|
122892
|
+
exports2.TinaExtendedIcon = TinaExtendedIcon;
|
|
122689
122893
|
exports2.TinaField = TinaField;
|
|
122690
122894
|
exports2.TinaForm = TinaForm;
|
|
122691
122895
|
exports2.TinaIcon = TinaIcon;
|