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.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { isHotkey } from "is-hotkey";
|
|
|
15
15
|
import clsx$1, { clsx } from "clsx";
|
|
16
16
|
import { Slot } from "@radix-ui/react-slot";
|
|
17
17
|
import { isLangSupported, formatCodeBlock, insertEmptyCodeBlock, unwrapCodeBlock, isCodeBlockEmpty, isSelectionAtCodeBlockStart } from "@udecode/plate-code-block";
|
|
18
|
-
import { X, Search, ChevronDown, Check, AlertTriangle, BracesIcon, Plus, AlignCenter as AlignCenter$1, AlignJustify, AlignLeft as AlignLeft$1, AlignRight as AlignRight$1, PaintBucket, Quote, ChevronRight, ChevronsUpDown, FileCode, Baseline, RectangleVertical, Combine, Ungroup, MessageSquare, MessageSquarePlus, Trash, GripVertical, Edit2, Smile, ExternalLink, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Indent, Keyboard, WrapText, Minus, MoreHorizontal, Outdent, Pilcrow, RotateCcw, RectangleHorizontal, Settings, Strikethrough, Subscript, Superscript, Table, Text as Text$2, Underline, Link2Off, Eye, SeparatorHorizontal, Moon, SunMedium, Twitter, PaintBucketIcon, CombineIcon, SquareSplitHorizontalIcon, Grid2X2Icon, Trash2Icon, ArrowUp, ArrowDown, XIcon, ArrowLeft, ArrowRight, EraserIcon, LoaderCircle, TriangleAlert, EllipsisVertical, List as List$1, ListOrdered, Grid3x3Icon, Link, Unlink } from "lucide-react";
|
|
18
|
+
import { X, Search, ChevronDown, Check, AlertTriangle, BracesIcon, Plus, AlignCenter as AlignCenter$1, AlignJustify, AlignLeft as AlignLeft$1, AlignRight as AlignRight$1, PaintBucket, Quote, ChevronRight, ChevronsUpDown, FileCode, Baseline, RectangleVertical, Combine, Ungroup, MessageSquare, MessageSquarePlus, Trash, GripVertical, Edit2, Smile, ExternalLink, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Indent, Keyboard, WrapText, Minus, MoreHorizontal, Outdent, Pilcrow, RotateCcw, RectangleHorizontal, Settings, Strikethrough, Subscript, Superscript, Table, Text as Text$2, Underline, Link2Off, Eye, SeparatorHorizontal, Moon, SunMedium, Twitter, PaintBucketIcon, CombineIcon, SquareSplitHorizontalIcon, Grid2X2Icon, Trash2Icon, ArrowUp, ArrowDown, XIcon, ArrowLeft, ArrowRight, EraserIcon, ChevronDownIcon as ChevronDownIcon$1, LoaderCircle, TriangleAlert, EllipsisVertical, GitBranchIcon, List as List$1, ListOrdered, Grid3x3Icon, Link, Unlink } from "lucide-react";
|
|
19
19
|
import mermaid from "mermaid";
|
|
20
20
|
import { cva } from "class-variance-authority";
|
|
21
21
|
import { Command as Command$2 } from "cmdk";
|
|
@@ -39,10 +39,10 @@ import arrayMutators from "final-form-arrays";
|
|
|
39
39
|
import setFieldData from "final-form-set-field-data";
|
|
40
40
|
import { Field, Form as Form$1 } from "react-final-form";
|
|
41
41
|
import PropTypes from "prop-types";
|
|
42
|
-
import * as pkg$1 from "react-color";
|
|
43
|
-
import * as pkg from "color-string";
|
|
44
42
|
import { twMerge } from "tailwind-merge";
|
|
45
43
|
import { Droppable, Draggable, DragDropContext } from "react-beautiful-dnd";
|
|
44
|
+
import * as pkg$1 from "react-color";
|
|
45
|
+
import * as pkg from "color-string";
|
|
46
46
|
import { buildSchema, print, getIntrospectionQuery, buildClientSchema, parse as parse$4 } from "graphql";
|
|
47
47
|
import { diff as diff$1 } from "@graphql-inspector/core";
|
|
48
48
|
import * as dropzone from "react-dropzone";
|
|
@@ -57,6 +57,8 @@ import { autoformatSmartQuotes, autoformatPunctuation, autoformatLegal, autoform
|
|
|
57
57
|
import get$5 from "lodash.get";
|
|
58
58
|
import moment from "moment";
|
|
59
59
|
import { formatDistanceToNow as formatDistanceToNow$1 } from "date-fns";
|
|
60
|
+
import DOMPurify from "dompurify";
|
|
61
|
+
import { toast as toast$1, Toaster as Toaster$1 } from "sonner";
|
|
60
62
|
import { TinaSchema, addNamespaceToSchema, parseURL, resolveForm, normalizePath, canonicalPath, validateSchema } from "@tinacms/schema-tools";
|
|
61
63
|
import { NAMER, resolveField } from "@tinacms/schema-tools";
|
|
62
64
|
import gql from "graphql-tag";
|
|
@@ -100,8 +102,14 @@ const Modal = (props) => {
|
|
|
100
102
|
portalNode
|
|
101
103
|
);
|
|
102
104
|
};
|
|
103
|
-
const ModalActions = ({ children }) => {
|
|
104
|
-
return /* @__PURE__ */ React.createElement(
|
|
105
|
+
const ModalActions = ({ align = "between", children }) => {
|
|
106
|
+
return /* @__PURE__ */ React.createElement(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: `w-full flex flex-wrap-reverse justify-${align} gap-4 items-center px-5 pb-5 rounded-b-md`
|
|
110
|
+
},
|
|
111
|
+
children
|
|
112
|
+
);
|
|
105
113
|
};
|
|
106
114
|
const ModalBody = ({ className = "", padded = false, ...props }) => /* @__PURE__ */ React__default.createElement(
|
|
107
115
|
"div",
|
|
@@ -716,12 +724,84 @@ const CircleCheck = ({ ...props }) => /* @__PURE__ */ React.createElement(
|
|
|
716
724
|
},
|
|
717
725
|
/* @__PURE__ */ React.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" })
|
|
718
726
|
);
|
|
727
|
+
const TinaExtendedIcon = ({ ...props }) => /* @__PURE__ */ React.createElement(
|
|
728
|
+
"svg",
|
|
729
|
+
{
|
|
730
|
+
viewBox: "0 0 1020 254",
|
|
731
|
+
fill: "currentColor",
|
|
732
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
733
|
+
...props
|
|
734
|
+
},
|
|
735
|
+
/* @__PURE__ */ React.createElement(
|
|
736
|
+
"path",
|
|
737
|
+
{
|
|
738
|
+
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",
|
|
739
|
+
fill: "#EC4815"
|
|
740
|
+
}
|
|
741
|
+
),
|
|
742
|
+
/* @__PURE__ */ React.createElement(
|
|
743
|
+
"path",
|
|
744
|
+
{
|
|
745
|
+
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",
|
|
746
|
+
fill: "#EC4815"
|
|
747
|
+
}
|
|
748
|
+
),
|
|
749
|
+
/* @__PURE__ */ React.createElement(
|
|
750
|
+
"path",
|
|
751
|
+
{
|
|
752
|
+
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",
|
|
753
|
+
fill: "#EC4815"
|
|
754
|
+
}
|
|
755
|
+
),
|
|
756
|
+
/* @__PURE__ */ React.createElement(
|
|
757
|
+
"path",
|
|
758
|
+
{
|
|
759
|
+
d: "M320.581 81.2H359.781V110.4H320.581V81.2ZM302.781 153.6V124H359.581V236H323.181V153.6H302.781Z",
|
|
760
|
+
fill: "#EC4815"
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
/* @__PURE__ */ React.createElement(
|
|
764
|
+
"path",
|
|
765
|
+
{
|
|
766
|
+
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",
|
|
767
|
+
fill: "#EC4815"
|
|
768
|
+
}
|
|
769
|
+
),
|
|
770
|
+
/* @__PURE__ */ React.createElement(
|
|
771
|
+
"path",
|
|
772
|
+
{
|
|
773
|
+
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",
|
|
774
|
+
fill: "#EC4815"
|
|
775
|
+
}
|
|
776
|
+
),
|
|
777
|
+
/* @__PURE__ */ React.createElement(
|
|
778
|
+
"path",
|
|
779
|
+
{
|
|
780
|
+
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",
|
|
781
|
+
fill: "#EC4815"
|
|
782
|
+
}
|
|
783
|
+
),
|
|
784
|
+
/* @__PURE__ */ React.createElement(
|
|
785
|
+
"path",
|
|
786
|
+
{
|
|
787
|
+
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",
|
|
788
|
+
fill: "#EC4815"
|
|
789
|
+
}
|
|
790
|
+
),
|
|
791
|
+
/* @__PURE__ */ React.createElement(
|
|
792
|
+
"path",
|
|
793
|
+
{
|
|
794
|
+
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",
|
|
795
|
+
fill: "#EC4815"
|
|
796
|
+
}
|
|
797
|
+
)
|
|
798
|
+
);
|
|
719
799
|
const ModalHeader = ({ children, close: close2 }) => {
|
|
720
|
-
return /* @__PURE__ */ React.createElement("div", { className: "h-14 flex items-center
|
|
800
|
+
return /* @__PURE__ */ React.createElement("div", { className: "h-14 flex items-center px-5 border-b border-gray-200 m-0" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "w-10 h-auto -ml-1 mr-1 my-1 fill-tina-orange" }), /* @__PURE__ */ React.createElement(ModalTitle, null, children), close2 && /* @__PURE__ */ React.createElement(
|
|
721
801
|
"div",
|
|
722
802
|
{
|
|
723
803
|
onClick: close2,
|
|
724
|
-
className: "flex items-center fill-gray-400 cursor-pointer transition-colors duration-100 ease-out hover:fill-gray-700"
|
|
804
|
+
className: "ml-auto flex justify-self-end items-center fill-gray-400 cursor-pointer transition-colors duration-100 ease-out hover:fill-gray-700"
|
|
725
805
|
},
|
|
726
806
|
/* @__PURE__ */ React.createElement(CloseIcon, { className: "w-6 h-auto" })
|
|
727
807
|
));
|
|
@@ -36981,7 +37061,7 @@ const DropdownMenuLabel = withVariants(
|
|
|
36981
37061
|
dropdownMenuLabelVariants,
|
|
36982
37062
|
["inset"]
|
|
36983
37063
|
);
|
|
36984
|
-
const DropdownMenuSeparator = withCn(
|
|
37064
|
+
const DropdownMenuSeparator$1 = withCn(
|
|
36985
37065
|
DropdownMenuPrimitive.Separator,
|
|
36986
37066
|
"-mx-1 my-1 h-px bg-muted"
|
|
36987
37067
|
);
|
|
@@ -38257,6 +38337,171 @@ TinaField.propTypes = {
|
|
|
38257
38337
|
Component: PropTypes.any.isRequired,
|
|
38258
38338
|
children: PropTypes.any
|
|
38259
38339
|
};
|
|
38340
|
+
function cn$1(...inputs) {
|
|
38341
|
+
return twMerge(clsx(inputs));
|
|
38342
|
+
}
|
|
38343
|
+
const Button$1 = ({
|
|
38344
|
+
variant = "secondary",
|
|
38345
|
+
as: Tag2 = "button",
|
|
38346
|
+
size: size2 = "medium",
|
|
38347
|
+
busy,
|
|
38348
|
+
disabled,
|
|
38349
|
+
rounded = "full",
|
|
38350
|
+
children,
|
|
38351
|
+
className = "",
|
|
38352
|
+
...props
|
|
38353
|
+
}) => {
|
|
38354
|
+
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 ";
|
|
38355
|
+
const variantClasses = {
|
|
38356
|
+
primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
|
|
38357
|
+
secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
|
|
38358
|
+
white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
|
|
38359
|
+
ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
|
|
38360
|
+
danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
|
|
38361
|
+
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
|
|
38362
|
+
custom: ""
|
|
38363
|
+
};
|
|
38364
|
+
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
38365
|
+
const stateClasses = {
|
|
38366
|
+
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
38367
|
+
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
38368
|
+
default: ``
|
|
38369
|
+
};
|
|
38370
|
+
const roundedClasses = {
|
|
38371
|
+
full: `rounded`,
|
|
38372
|
+
left: `rounded-l`,
|
|
38373
|
+
right: `rounded-r`,
|
|
38374
|
+
custom: "",
|
|
38375
|
+
none: ""
|
|
38376
|
+
};
|
|
38377
|
+
const sizeClasses = {
|
|
38378
|
+
small: `text-xs h-8 px-3`,
|
|
38379
|
+
medium: `text-sm h-10 px-8`,
|
|
38380
|
+
custom: ``
|
|
38381
|
+
};
|
|
38382
|
+
return /* @__PURE__ */ React.createElement(
|
|
38383
|
+
Tag2,
|
|
38384
|
+
{
|
|
38385
|
+
className: cn$1(
|
|
38386
|
+
baseClasses,
|
|
38387
|
+
variantClasses[variant],
|
|
38388
|
+
sizeClasses[size2],
|
|
38389
|
+
stateClasses[state],
|
|
38390
|
+
roundedClasses[rounded],
|
|
38391
|
+
className
|
|
38392
|
+
),
|
|
38393
|
+
...props
|
|
38394
|
+
},
|
|
38395
|
+
children
|
|
38396
|
+
);
|
|
38397
|
+
};
|
|
38398
|
+
const IconButton = ({
|
|
38399
|
+
variant = "secondary",
|
|
38400
|
+
size: size2 = "medium",
|
|
38401
|
+
busy,
|
|
38402
|
+
disabled,
|
|
38403
|
+
children,
|
|
38404
|
+
className,
|
|
38405
|
+
...props
|
|
38406
|
+
}) => {
|
|
38407
|
+
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";
|
|
38408
|
+
const variantClasses = {
|
|
38409
|
+
primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
|
|
38410
|
+
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
|
|
38411
|
+
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
|
|
38412
|
+
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
|
|
38413
|
+
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
|
|
38414
|
+
};
|
|
38415
|
+
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
38416
|
+
const stateClasses = {
|
|
38417
|
+
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
38418
|
+
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
38419
|
+
default: ``
|
|
38420
|
+
};
|
|
38421
|
+
const sizeClasses = {
|
|
38422
|
+
small: `h-7 w-7`,
|
|
38423
|
+
medium: `h-9 w-9`,
|
|
38424
|
+
custom: ``
|
|
38425
|
+
};
|
|
38426
|
+
return /* @__PURE__ */ React.createElement(
|
|
38427
|
+
"button",
|
|
38428
|
+
{
|
|
38429
|
+
className: cn$1(
|
|
38430
|
+
baseClasses,
|
|
38431
|
+
variantClasses[variant],
|
|
38432
|
+
sizeClasses[size2],
|
|
38433
|
+
stateClasses[state],
|
|
38434
|
+
className
|
|
38435
|
+
),
|
|
38436
|
+
...props
|
|
38437
|
+
},
|
|
38438
|
+
children
|
|
38439
|
+
);
|
|
38440
|
+
};
|
|
38441
|
+
function FontLoader() {
|
|
38442
|
+
React.useEffect(() => {
|
|
38443
|
+
const link = document.createElement("link");
|
|
38444
|
+
link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
|
|
38445
|
+
link.rel = "stylesheet";
|
|
38446
|
+
document.head.appendChild(link);
|
|
38447
|
+
return () => {
|
|
38448
|
+
document.head.removeChild(link);
|
|
38449
|
+
};
|
|
38450
|
+
}, []);
|
|
38451
|
+
return null;
|
|
38452
|
+
}
|
|
38453
|
+
function classNames(...classes) {
|
|
38454
|
+
return classes.filter(Boolean).join(" ");
|
|
38455
|
+
}
|
|
38456
|
+
const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
|
|
38457
|
+
const [open, setOpen] = useState(false);
|
|
38458
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(
|
|
38459
|
+
PopoverPrimitive.Trigger,
|
|
38460
|
+
{
|
|
38461
|
+
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}}`
|
|
38462
|
+
},
|
|
38463
|
+
/* @__PURE__ */ React__default.createElement(
|
|
38464
|
+
"svg",
|
|
38465
|
+
{
|
|
38466
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38467
|
+
className: "h-5 w-5",
|
|
38468
|
+
fill: "none",
|
|
38469
|
+
viewBox: "0 0 24 24",
|
|
38470
|
+
stroke: "currentColor"
|
|
38471
|
+
},
|
|
38472
|
+
/* @__PURE__ */ React__default.createElement(
|
|
38473
|
+
"path",
|
|
38474
|
+
{
|
|
38475
|
+
strokeLinecap: "round",
|
|
38476
|
+
strokeLinejoin: "round",
|
|
38477
|
+
strokeWidth: 2,
|
|
38478
|
+
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"
|
|
38479
|
+
}
|
|
38480
|
+
)
|
|
38481
|
+
)
|
|
38482
|
+
), /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React__default.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
|
|
38483
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
38484
|
+
"span",
|
|
38485
|
+
{
|
|
38486
|
+
"data-test": `${toolbarItem.name}OverflowButton`,
|
|
38487
|
+
key: toolbarItem.name,
|
|
38488
|
+
onMouseDown: (event) => {
|
|
38489
|
+
event.preventDefault();
|
|
38490
|
+
toolbarItem.onMouseDown(event);
|
|
38491
|
+
setOpen(false);
|
|
38492
|
+
},
|
|
38493
|
+
className: classNames(
|
|
38494
|
+
toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
|
|
38495
|
+
"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",
|
|
38496
|
+
toolbarItem.className ?? ""
|
|
38497
|
+
)
|
|
38498
|
+
},
|
|
38499
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
|
|
38500
|
+
" ",
|
|
38501
|
+
toolbarItem.label
|
|
38502
|
+
);
|
|
38503
|
+
}))))));
|
|
38504
|
+
};
|
|
38260
38505
|
var DefaultContext = {
|
|
38261
38506
|
color: void 0,
|
|
38262
38507
|
size: void 0,
|
|
@@ -38498,30 +38743,270 @@ function BiTrash(props) {
|
|
|
38498
38743
|
function BiX(props) {
|
|
38499
38744
|
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);
|
|
38500
38745
|
}
|
|
38501
|
-
|
|
38502
|
-
|
|
38503
|
-
|
|
38746
|
+
function BsArrowRightShort(props) {
|
|
38747
|
+
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);
|
|
38748
|
+
}
|
|
38749
|
+
function BsCheckCircleFill(props) {
|
|
38750
|
+
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);
|
|
38751
|
+
}
|
|
38752
|
+
function BsExclamationOctagonFill(props) {
|
|
38753
|
+
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);
|
|
38754
|
+
}
|
|
38755
|
+
const MessageIcon = ({
|
|
38756
|
+
type = "success",
|
|
38757
|
+
className = ""
|
|
38758
|
+
}) => {
|
|
38759
|
+
const icons = {
|
|
38760
|
+
success: BiCheckCircle,
|
|
38761
|
+
warning: BiError,
|
|
38762
|
+
error: BiError,
|
|
38763
|
+
info: BiInfoCircle
|
|
38764
|
+
};
|
|
38765
|
+
const Icon = icons[type];
|
|
38766
|
+
return /* @__PURE__ */ React__default.createElement(Icon, { className });
|
|
38767
|
+
};
|
|
38768
|
+
const Message = ({
|
|
38769
|
+
children,
|
|
38770
|
+
type = "success",
|
|
38771
|
+
size: size2 = "medium",
|
|
38772
|
+
className = "",
|
|
38773
|
+
link,
|
|
38774
|
+
linkLabel = "Learn More"
|
|
38775
|
+
}) => {
|
|
38776
|
+
const containerClasses = {
|
|
38777
|
+
success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
|
|
38778
|
+
warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
|
|
38779
|
+
error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
|
|
38780
|
+
info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
|
|
38781
|
+
};
|
|
38782
|
+
const textClasses = {
|
|
38783
|
+
success: "text-green-700",
|
|
38784
|
+
warning: "text-yellow-700",
|
|
38785
|
+
error: "text-red-700",
|
|
38786
|
+
info: "text-blue-700"
|
|
38787
|
+
};
|
|
38788
|
+
const iconClasses = {
|
|
38789
|
+
success: "text-green-400",
|
|
38790
|
+
warning: "text-yellow-400",
|
|
38791
|
+
error: "text-red-400",
|
|
38792
|
+
info: "text-blue-400"
|
|
38793
|
+
};
|
|
38794
|
+
const sizeClasses = {
|
|
38795
|
+
small: "px-3 py-1.5 text-xs",
|
|
38796
|
+
medium: "px-4 py-2.5 text-sm"
|
|
38797
|
+
};
|
|
38798
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
38799
|
+
"div",
|
|
38800
|
+
{
|
|
38801
|
+
className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
|
|
38802
|
+
},
|
|
38803
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
|
|
38804
|
+
MessageIcon,
|
|
38805
|
+
{
|
|
38806
|
+
type,
|
|
38807
|
+
className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
38808
|
+
}
|
|
38809
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
|
|
38810
|
+
"a",
|
|
38811
|
+
{
|
|
38812
|
+
href: link,
|
|
38813
|
+
target: "_blank",
|
|
38814
|
+
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"
|
|
38815
|
+
},
|
|
38816
|
+
linkLabel,
|
|
38817
|
+
" ",
|
|
38818
|
+
/* @__PURE__ */ React__default.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
|
|
38819
|
+
))
|
|
38820
|
+
);
|
|
38821
|
+
};
|
|
38822
|
+
function cn(...inputs) {
|
|
38823
|
+
return twMerge(clsx(inputs));
|
|
38824
|
+
}
|
|
38825
|
+
function DropdownMenu({
|
|
38826
|
+
...props
|
|
38827
|
+
}) {
|
|
38828
|
+
return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
38829
|
+
}
|
|
38830
|
+
function DropdownMenuTrigger({
|
|
38831
|
+
...props
|
|
38832
|
+
}) {
|
|
38504
38833
|
return /* @__PURE__ */ React.createElement(
|
|
38505
|
-
|
|
38834
|
+
DropdownMenuPrimitive.Trigger,
|
|
38506
38835
|
{
|
|
38507
|
-
|
|
38508
|
-
|
|
38509
|
-
className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
|
|
38510
|
-
...rest
|
|
38836
|
+
"data-slot": "dropdown-menu-trigger",
|
|
38837
|
+
...props
|
|
38511
38838
|
}
|
|
38512
38839
|
);
|
|
38513
|
-
}
|
|
38514
|
-
|
|
38840
|
+
}
|
|
38841
|
+
function DropdownMenuContent({
|
|
38842
|
+
className,
|
|
38843
|
+
sideOffset = 4,
|
|
38844
|
+
...props
|
|
38845
|
+
}) {
|
|
38846
|
+
return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
|
|
38847
|
+
DropdownMenuPrimitive.Content,
|
|
38848
|
+
{
|
|
38849
|
+
"data-slot": "dropdown-menu-content",
|
|
38850
|
+
sideOffset,
|
|
38851
|
+
className: cn(
|
|
38852
|
+
"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",
|
|
38853
|
+
className
|
|
38854
|
+
),
|
|
38855
|
+
...props
|
|
38856
|
+
}
|
|
38857
|
+
));
|
|
38858
|
+
}
|
|
38859
|
+
function DropdownMenuItem({
|
|
38860
|
+
className,
|
|
38861
|
+
inset,
|
|
38862
|
+
variant = "default",
|
|
38863
|
+
...props
|
|
38864
|
+
}) {
|
|
38515
38865
|
return /* @__PURE__ */ React.createElement(
|
|
38516
|
-
|
|
38866
|
+
DropdownMenuPrimitive.Item,
|
|
38517
38867
|
{
|
|
38518
|
-
|
|
38519
|
-
|
|
38520
|
-
|
|
38521
|
-
|
|
38868
|
+
"data-slot": "dropdown-menu-item",
|
|
38869
|
+
"data-inset": inset,
|
|
38870
|
+
"data-variant": variant,
|
|
38871
|
+
className: cn(
|
|
38872
|
+
"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",
|
|
38873
|
+
className
|
|
38874
|
+
),
|
|
38875
|
+
...props
|
|
38522
38876
|
}
|
|
38523
38877
|
);
|
|
38524
|
-
}
|
|
38878
|
+
}
|
|
38879
|
+
function DropdownMenuSeparator({
|
|
38880
|
+
className,
|
|
38881
|
+
...props
|
|
38882
|
+
}) {
|
|
38883
|
+
return /* @__PURE__ */ React.createElement(
|
|
38884
|
+
DropdownMenuPrimitive.Separator,
|
|
38885
|
+
{
|
|
38886
|
+
"data-slot": "dropdown-menu-separator",
|
|
38887
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
38888
|
+
...props
|
|
38889
|
+
}
|
|
38890
|
+
);
|
|
38891
|
+
}
|
|
38892
|
+
const DropdownButton = React.forwardRef(
|
|
38893
|
+
({
|
|
38894
|
+
variant = "primary",
|
|
38895
|
+
size: size2 = "medium",
|
|
38896
|
+
busy,
|
|
38897
|
+
disabled,
|
|
38898
|
+
rounded = "full",
|
|
38899
|
+
children,
|
|
38900
|
+
className = "",
|
|
38901
|
+
onMainAction,
|
|
38902
|
+
items: items2,
|
|
38903
|
+
showSplitButton = true,
|
|
38904
|
+
...props
|
|
38905
|
+
}, ref) => {
|
|
38906
|
+
const [open, setOpen] = React.useState(false);
|
|
38907
|
+
if (!onMainAction || !showSplitButton) {
|
|
38908
|
+
return /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
38909
|
+
Button$1,
|
|
38910
|
+
{
|
|
38911
|
+
variant,
|
|
38912
|
+
size: size2,
|
|
38913
|
+
busy,
|
|
38914
|
+
disabled,
|
|
38915
|
+
rounded,
|
|
38916
|
+
className: cn$1("gap-2", className),
|
|
38917
|
+
...props
|
|
38918
|
+
},
|
|
38919
|
+
children,
|
|
38920
|
+
/* @__PURE__ */ React.createElement(
|
|
38921
|
+
ChevronDownIcon$1,
|
|
38922
|
+
{
|
|
38923
|
+
className: cn$1(
|
|
38924
|
+
"h-4 w-4 transition-transform duration-200",
|
|
38925
|
+
open && "rotate-180"
|
|
38926
|
+
)
|
|
38927
|
+
}
|
|
38928
|
+
)
|
|
38929
|
+
)), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
38930
|
+
DropdownMenuItem,
|
|
38931
|
+
{
|
|
38932
|
+
key: index,
|
|
38933
|
+
onClick: item.onClick,
|
|
38934
|
+
disabled: item.disabled,
|
|
38935
|
+
variant: item.variant
|
|
38936
|
+
},
|
|
38937
|
+
item.icon && item.icon,
|
|
38938
|
+
item.label
|
|
38939
|
+
))));
|
|
38940
|
+
}
|
|
38941
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React.createElement(
|
|
38942
|
+
Button$1,
|
|
38943
|
+
{
|
|
38944
|
+
variant,
|
|
38945
|
+
size: size2,
|
|
38946
|
+
busy,
|
|
38947
|
+
disabled,
|
|
38948
|
+
rounded: "left",
|
|
38949
|
+
onClick: onMainAction,
|
|
38950
|
+
className: "border-r-0 w-full",
|
|
38951
|
+
...props
|
|
38952
|
+
},
|
|
38953
|
+
children
|
|
38954
|
+
), /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React.createElement(
|
|
38955
|
+
Button$1,
|
|
38956
|
+
{
|
|
38957
|
+
variant,
|
|
38958
|
+
size: size2,
|
|
38959
|
+
busy,
|
|
38960
|
+
disabled,
|
|
38961
|
+
rounded: "right",
|
|
38962
|
+
className: "px-4 border-l",
|
|
38963
|
+
style: { borderColor: "#00000030" },
|
|
38964
|
+
"aria-label": "More options"
|
|
38965
|
+
},
|
|
38966
|
+
/* @__PURE__ */ React.createElement(
|
|
38967
|
+
ChevronDownIcon$1,
|
|
38968
|
+
{
|
|
38969
|
+
className: cn$1(
|
|
38970
|
+
"h-4 w-4 transition-transform duration-200 fill-none",
|
|
38971
|
+
open && "rotate-180"
|
|
38972
|
+
),
|
|
38973
|
+
style: { fill: "none" }
|
|
38974
|
+
}
|
|
38975
|
+
)
|
|
38976
|
+
)), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
|
|
38977
|
+
var _a2;
|
|
38978
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, /* @__PURE__ */ React.createElement(
|
|
38979
|
+
DropdownMenuItem,
|
|
38980
|
+
{
|
|
38981
|
+
onClick: item.onClick,
|
|
38982
|
+
disabled: item.disabled,
|
|
38983
|
+
variant: item.variant
|
|
38984
|
+
},
|
|
38985
|
+
item.icon && item.icon,
|
|
38986
|
+
item.label
|
|
38987
|
+
), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null));
|
|
38988
|
+
}))));
|
|
38989
|
+
}
|
|
38990
|
+
);
|
|
38991
|
+
DropdownButton.displayName = "DropdownButton";
|
|
38992
|
+
function FaCircle(props) {
|
|
38993
|
+
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);
|
|
38994
|
+
}
|
|
38995
|
+
function FaFile(props) {
|
|
38996
|
+
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);
|
|
38997
|
+
}
|
|
38998
|
+
function FaFolder(props) {
|
|
38999
|
+
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);
|
|
39000
|
+
}
|
|
39001
|
+
function FaLock(props) {
|
|
39002
|
+
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);
|
|
39003
|
+
}
|
|
39004
|
+
function FaSpinner(props) {
|
|
39005
|
+
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);
|
|
39006
|
+
}
|
|
39007
|
+
function FaUnlock(props) {
|
|
39008
|
+
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);
|
|
39009
|
+
}
|
|
38525
39010
|
const Dismissible = ({
|
|
38526
39011
|
onDismiss,
|
|
38527
39012
|
escape: escape2,
|
|
@@ -38594,6 +39079,159 @@ function useDismissible({
|
|
|
38594
39079
|
}, [click, customDocument, escape2, disabled, onDismiss]);
|
|
38595
39080
|
return area;
|
|
38596
39081
|
}
|
|
39082
|
+
const FormActionMenu = ({ actions, form }) => {
|
|
39083
|
+
const [actionMenuVisibility, setActionMenuVisibility] = useState(false);
|
|
39084
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React.createElement(
|
|
39085
|
+
Dismissible,
|
|
39086
|
+
{
|
|
39087
|
+
click: true,
|
|
39088
|
+
escape: true,
|
|
39089
|
+
disabled: !actionMenuVisibility,
|
|
39090
|
+
onDismiss: () => {
|
|
39091
|
+
setActionMenuVisibility((p2) => !p2);
|
|
39092
|
+
}
|
|
39093
|
+
},
|
|
39094
|
+
actions.map((Action, i2) => (
|
|
39095
|
+
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
39096
|
+
// Actions should just be componets
|
|
39097
|
+
/* @__PURE__ */ React.createElement(Action, { form, key: i2 })
|
|
39098
|
+
))
|
|
39099
|
+
)));
|
|
39100
|
+
};
|
|
39101
|
+
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
39102
|
+
"button",
|
|
39103
|
+
{
|
|
39104
|
+
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}`,
|
|
39105
|
+
...props
|
|
39106
|
+
},
|
|
39107
|
+
/* @__PURE__ */ React.createElement(EllipsisVerticalIcon, null)
|
|
39108
|
+
);
|
|
39109
|
+
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React.createElement(
|
|
39110
|
+
"div",
|
|
39111
|
+
{
|
|
39112
|
+
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}`,
|
|
39113
|
+
style: {
|
|
39114
|
+
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
39115
|
+
pointerEvents: open ? "all" : "none",
|
|
39116
|
+
...style
|
|
39117
|
+
},
|
|
39118
|
+
...props
|
|
39119
|
+
}
|
|
39120
|
+
);
|
|
39121
|
+
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
39122
|
+
"button",
|
|
39123
|
+
{
|
|
39124
|
+
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}`,
|
|
39125
|
+
...props
|
|
39126
|
+
}
|
|
39127
|
+
);
|
|
39128
|
+
const FormPortalContext = React.createContext(() => {
|
|
39129
|
+
return null;
|
|
39130
|
+
});
|
|
39131
|
+
function useFormPortal() {
|
|
39132
|
+
return React.useContext(FormPortalContext);
|
|
39133
|
+
}
|
|
39134
|
+
const FormPortalProvider = ({
|
|
39135
|
+
children
|
|
39136
|
+
}) => {
|
|
39137
|
+
const wrapperRef = React.useRef(null);
|
|
39138
|
+
const zIndexRef = React.useRef(0);
|
|
39139
|
+
const FormPortal = React.useCallback(
|
|
39140
|
+
(props) => {
|
|
39141
|
+
if (!wrapperRef.current)
|
|
39142
|
+
return null;
|
|
39143
|
+
return createPortal(
|
|
39144
|
+
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
39145
|
+
wrapperRef.current
|
|
39146
|
+
);
|
|
39147
|
+
},
|
|
39148
|
+
[wrapperRef, zIndexRef]
|
|
39149
|
+
);
|
|
39150
|
+
return /* @__PURE__ */ React.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
|
|
39151
|
+
};
|
|
39152
|
+
const LoadingDots = ({
|
|
39153
|
+
dotSize = 8,
|
|
39154
|
+
color = "white"
|
|
39155
|
+
}) => {
|
|
39156
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
|
|
39157
|
+
};
|
|
39158
|
+
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React.createElement(
|
|
39159
|
+
"span",
|
|
39160
|
+
{
|
|
39161
|
+
className: "inline-block mr-1",
|
|
39162
|
+
style: {
|
|
39163
|
+
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
39164
|
+
animationDelay: `${delay}s`,
|
|
39165
|
+
background: color,
|
|
39166
|
+
width: dotSize,
|
|
39167
|
+
height: dotSize,
|
|
39168
|
+
borderRadius: dotSize
|
|
39169
|
+
}
|
|
39170
|
+
}
|
|
39171
|
+
);
|
|
39172
|
+
const ResetForm = ({
|
|
39173
|
+
pristine,
|
|
39174
|
+
reset: reset2,
|
|
39175
|
+
children,
|
|
39176
|
+
...props
|
|
39177
|
+
}) => {
|
|
39178
|
+
const [open, setOpen] = React.useState(false);
|
|
39179
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
39180
|
+
Button$1,
|
|
39181
|
+
{
|
|
39182
|
+
onClick: () => {
|
|
39183
|
+
setOpen((p2) => !p2);
|
|
39184
|
+
},
|
|
39185
|
+
disabled: pristine,
|
|
39186
|
+
...props
|
|
39187
|
+
},
|
|
39188
|
+
children
|
|
39189
|
+
), open && /* @__PURE__ */ React.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
39190
|
+
};
|
|
39191
|
+
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
39192
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
39193
|
+
Button$1,
|
|
39194
|
+
{
|
|
39195
|
+
style: { flexGrow: 3 },
|
|
39196
|
+
variant: "primary",
|
|
39197
|
+
onClick: async () => {
|
|
39198
|
+
await reset2();
|
|
39199
|
+
close2();
|
|
39200
|
+
}
|
|
39201
|
+
},
|
|
39202
|
+
"Reset"
|
|
39203
|
+
))));
|
|
39204
|
+
};
|
|
39205
|
+
function AiFillWarning(props) {
|
|
39206
|
+
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);
|
|
39207
|
+
}
|
|
39208
|
+
function AiOutlineLoading(props) {
|
|
39209
|
+
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);
|
|
39210
|
+
}
|
|
39211
|
+
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";
|
|
39212
|
+
const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
|
|
39213
|
+
const BaseTextField = React.forwardRef(({ className, disabled, ...rest }, ref) => {
|
|
39214
|
+
return /* @__PURE__ */ React.createElement(
|
|
39215
|
+
"input",
|
|
39216
|
+
{
|
|
39217
|
+
ref,
|
|
39218
|
+
type: "text",
|
|
39219
|
+
className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
|
|
39220
|
+
...rest
|
|
39221
|
+
}
|
|
39222
|
+
);
|
|
39223
|
+
});
|
|
39224
|
+
const TextArea = React.forwardRef(({ ...props }, ref) => {
|
|
39225
|
+
return /* @__PURE__ */ React.createElement(
|
|
39226
|
+
"textarea",
|
|
39227
|
+
{
|
|
39228
|
+
...props,
|
|
39229
|
+
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",
|
|
39230
|
+
ref,
|
|
39231
|
+
style: { minHeight: "160px" }
|
|
39232
|
+
}
|
|
39233
|
+
);
|
|
39234
|
+
});
|
|
38597
39235
|
const { get: getColor, to: toColor } = pkg;
|
|
38598
39236
|
var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
|
|
38599
39237
|
ColorFormat2["Hex"] = "hex";
|
|
@@ -38915,9 +39553,6 @@ function MdOutlineSettings(props) {
|
|
|
38915
39553
|
function MdOutlineClear(props) {
|
|
38916
39554
|
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);
|
|
38917
39555
|
}
|
|
38918
|
-
function MdOutlineSaveAlt(props) {
|
|
38919
|
-
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);
|
|
38920
|
-
}
|
|
38921
39556
|
function MdOutlineCloud(props) {
|
|
38922
39557
|
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);
|
|
38923
39558
|
}
|
|
@@ -39139,247 +39774,6 @@ const NumberInput = ({
|
|
|
39139
39774
|
}
|
|
39140
39775
|
}
|
|
39141
39776
|
);
|
|
39142
|
-
function cn$1(...inputs) {
|
|
39143
|
-
return twMerge(clsx(inputs));
|
|
39144
|
-
}
|
|
39145
|
-
const Button$1 = ({
|
|
39146
|
-
variant = "secondary",
|
|
39147
|
-
as: Tag2 = "button",
|
|
39148
|
-
size: size2 = "medium",
|
|
39149
|
-
busy,
|
|
39150
|
-
disabled,
|
|
39151
|
-
rounded = "full",
|
|
39152
|
-
children,
|
|
39153
|
-
className = "",
|
|
39154
|
-
...props
|
|
39155
|
-
}) => {
|
|
39156
|
-
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 ";
|
|
39157
|
-
const variantClasses = {
|
|
39158
|
-
primary: `shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 border-0`,
|
|
39159
|
-
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-100`,
|
|
39160
|
-
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-100`,
|
|
39161
|
-
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
|
|
39162
|
-
danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
|
|
39163
|
-
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
|
|
39164
|
-
custom: ""
|
|
39165
|
-
};
|
|
39166
|
-
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
39167
|
-
const stateClasses = {
|
|
39168
|
-
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
39169
|
-
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
39170
|
-
default: ``
|
|
39171
|
-
};
|
|
39172
|
-
const roundedClasses = {
|
|
39173
|
-
full: `rounded`,
|
|
39174
|
-
left: `rounded-l`,
|
|
39175
|
-
right: `rounded-r`,
|
|
39176
|
-
custom: "",
|
|
39177
|
-
none: ""
|
|
39178
|
-
};
|
|
39179
|
-
const sizeClasses = {
|
|
39180
|
-
small: `text-xs h-8 px-3`,
|
|
39181
|
-
medium: `text-sm h-10 px-8`,
|
|
39182
|
-
custom: ``
|
|
39183
|
-
};
|
|
39184
|
-
return /* @__PURE__ */ React.createElement(
|
|
39185
|
-
Tag2,
|
|
39186
|
-
{
|
|
39187
|
-
className: cn$1(
|
|
39188
|
-
baseClasses,
|
|
39189
|
-
variantClasses[variant],
|
|
39190
|
-
sizeClasses[size2],
|
|
39191
|
-
stateClasses[state],
|
|
39192
|
-
roundedClasses[rounded],
|
|
39193
|
-
className
|
|
39194
|
-
),
|
|
39195
|
-
...props
|
|
39196
|
-
},
|
|
39197
|
-
children
|
|
39198
|
-
);
|
|
39199
|
-
};
|
|
39200
|
-
const IconButton = ({
|
|
39201
|
-
variant = "secondary",
|
|
39202
|
-
size: size2 = "medium",
|
|
39203
|
-
busy,
|
|
39204
|
-
disabled,
|
|
39205
|
-
children,
|
|
39206
|
-
className,
|
|
39207
|
-
...props
|
|
39208
|
-
}) => {
|
|
39209
|
-
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";
|
|
39210
|
-
const variantClasses = {
|
|
39211
|
-
primary: `shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500`,
|
|
39212
|
-
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
|
|
39213
|
-
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
|
|
39214
|
-
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
|
|
39215
|
-
accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
|
|
39216
|
-
};
|
|
39217
|
-
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
39218
|
-
const stateClasses = {
|
|
39219
|
-
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
39220
|
-
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
39221
|
-
default: ``
|
|
39222
|
-
};
|
|
39223
|
-
const sizeClasses = {
|
|
39224
|
-
small: `h-7 w-7`,
|
|
39225
|
-
medium: `h-9 w-9`,
|
|
39226
|
-
custom: ``
|
|
39227
|
-
};
|
|
39228
|
-
return /* @__PURE__ */ React.createElement(
|
|
39229
|
-
"button",
|
|
39230
|
-
{
|
|
39231
|
-
className: cn$1(
|
|
39232
|
-
baseClasses,
|
|
39233
|
-
variantClasses[variant],
|
|
39234
|
-
sizeClasses[size2],
|
|
39235
|
-
stateClasses[state],
|
|
39236
|
-
className
|
|
39237
|
-
),
|
|
39238
|
-
...props
|
|
39239
|
-
},
|
|
39240
|
-
children
|
|
39241
|
-
);
|
|
39242
|
-
};
|
|
39243
|
-
function FontLoader() {
|
|
39244
|
-
React.useEffect(() => {
|
|
39245
|
-
const link = document.createElement("link");
|
|
39246
|
-
link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
|
|
39247
|
-
link.rel = "stylesheet";
|
|
39248
|
-
document.head.appendChild(link);
|
|
39249
|
-
return () => {
|
|
39250
|
-
document.head.removeChild(link);
|
|
39251
|
-
};
|
|
39252
|
-
}, []);
|
|
39253
|
-
return null;
|
|
39254
|
-
}
|
|
39255
|
-
function classNames(...classes) {
|
|
39256
|
-
return classes.filter(Boolean).join(" ");
|
|
39257
|
-
}
|
|
39258
|
-
const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
|
|
39259
|
-
const [open, setOpen] = useState(false);
|
|
39260
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(
|
|
39261
|
-
PopoverPrimitive.Trigger,
|
|
39262
|
-
{
|
|
39263
|
-
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}}`
|
|
39264
|
-
},
|
|
39265
|
-
/* @__PURE__ */ React__default.createElement(
|
|
39266
|
-
"svg",
|
|
39267
|
-
{
|
|
39268
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39269
|
-
className: "h-5 w-5",
|
|
39270
|
-
fill: "none",
|
|
39271
|
-
viewBox: "0 0 24 24",
|
|
39272
|
-
stroke: "currentColor"
|
|
39273
|
-
},
|
|
39274
|
-
/* @__PURE__ */ React__default.createElement(
|
|
39275
|
-
"path",
|
|
39276
|
-
{
|
|
39277
|
-
strokeLinecap: "round",
|
|
39278
|
-
strokeLinejoin: "round",
|
|
39279
|
-
strokeWidth: 2,
|
|
39280
|
-
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"
|
|
39281
|
-
}
|
|
39282
|
-
)
|
|
39283
|
-
)
|
|
39284
|
-
), /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React__default.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
|
|
39285
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
39286
|
-
"span",
|
|
39287
|
-
{
|
|
39288
|
-
"data-test": `${toolbarItem.name}OverflowButton`,
|
|
39289
|
-
key: toolbarItem.name,
|
|
39290
|
-
onMouseDown: (event) => {
|
|
39291
|
-
event.preventDefault();
|
|
39292
|
-
toolbarItem.onMouseDown(event);
|
|
39293
|
-
setOpen(false);
|
|
39294
|
-
},
|
|
39295
|
-
className: classNames(
|
|
39296
|
-
toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
|
|
39297
|
-
"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",
|
|
39298
|
-
toolbarItem.className ?? ""
|
|
39299
|
-
)
|
|
39300
|
-
},
|
|
39301
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
|
|
39302
|
-
" ",
|
|
39303
|
-
toolbarItem.label
|
|
39304
|
-
);
|
|
39305
|
-
}))))));
|
|
39306
|
-
};
|
|
39307
|
-
function BsArrowRightShort(props) {
|
|
39308
|
-
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);
|
|
39309
|
-
}
|
|
39310
|
-
function BsCheckCircleFill(props) {
|
|
39311
|
-
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);
|
|
39312
|
-
}
|
|
39313
|
-
function BsExclamationOctagonFill(props) {
|
|
39314
|
-
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);
|
|
39315
|
-
}
|
|
39316
|
-
const MessageIcon = ({
|
|
39317
|
-
type = "success",
|
|
39318
|
-
className = ""
|
|
39319
|
-
}) => {
|
|
39320
|
-
const icons = {
|
|
39321
|
-
success: BiCheckCircle,
|
|
39322
|
-
warning: BiError,
|
|
39323
|
-
error: BiError,
|
|
39324
|
-
info: BiInfoCircle
|
|
39325
|
-
};
|
|
39326
|
-
const Icon = icons[type];
|
|
39327
|
-
return /* @__PURE__ */ React__default.createElement(Icon, { className });
|
|
39328
|
-
};
|
|
39329
|
-
const Message = ({
|
|
39330
|
-
children,
|
|
39331
|
-
type = "success",
|
|
39332
|
-
size: size2 = "medium",
|
|
39333
|
-
className = "",
|
|
39334
|
-
link,
|
|
39335
|
-
linkLabel = "Learn More"
|
|
39336
|
-
}) => {
|
|
39337
|
-
const containerClasses = {
|
|
39338
|
-
success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
|
|
39339
|
-
warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
|
|
39340
|
-
error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
|
|
39341
|
-
info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
|
|
39342
|
-
};
|
|
39343
|
-
const textClasses = {
|
|
39344
|
-
success: "text-green-700",
|
|
39345
|
-
warning: "text-yellow-700",
|
|
39346
|
-
error: "text-red-700",
|
|
39347
|
-
info: "text-blue-700"
|
|
39348
|
-
};
|
|
39349
|
-
const iconClasses = {
|
|
39350
|
-
success: "text-green-400",
|
|
39351
|
-
warning: "text-yellow-400",
|
|
39352
|
-
error: "text-red-400",
|
|
39353
|
-
info: "text-blue-400"
|
|
39354
|
-
};
|
|
39355
|
-
const sizeClasses = {
|
|
39356
|
-
small: "px-3 py-1.5 text-xs",
|
|
39357
|
-
medium: "px-4 py-2.5 text-sm"
|
|
39358
|
-
};
|
|
39359
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
39360
|
-
"div",
|
|
39361
|
-
{
|
|
39362
|
-
className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
|
|
39363
|
-
},
|
|
39364
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
|
|
39365
|
-
MessageIcon,
|
|
39366
|
-
{
|
|
39367
|
-
type,
|
|
39368
|
-
className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
39369
|
-
}
|
|
39370
|
-
), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
|
|
39371
|
-
"a",
|
|
39372
|
-
{
|
|
39373
|
-
href: link,
|
|
39374
|
-
target: "_blank",
|
|
39375
|
-
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"
|
|
39376
|
-
},
|
|
39377
|
-
linkLabel,
|
|
39378
|
-
" ",
|
|
39379
|
-
/* @__PURE__ */ React__default.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
|
|
39380
|
-
))
|
|
39381
|
-
);
|
|
39382
|
-
};
|
|
39383
39777
|
function useCMS() {
|
|
39384
39778
|
return useCMS$1();
|
|
39385
39779
|
}
|
|
@@ -42488,30 +42882,6 @@ const PasswordFieldPlugin = {
|
|
|
42488
42882
|
},
|
|
42489
42883
|
parse: parse$2
|
|
42490
42884
|
};
|
|
42491
|
-
function AiFillWarning(props) {
|
|
42492
|
-
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);
|
|
42493
|
-
}
|
|
42494
|
-
function AiOutlineLoading(props) {
|
|
42495
|
-
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);
|
|
42496
|
-
}
|
|
42497
|
-
function FaCircle(props) {
|
|
42498
|
-
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);
|
|
42499
|
-
}
|
|
42500
|
-
function FaFile(props) {
|
|
42501
|
-
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);
|
|
42502
|
-
}
|
|
42503
|
-
function FaFolder(props) {
|
|
42504
|
-
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);
|
|
42505
|
-
}
|
|
42506
|
-
function FaLock(props) {
|
|
42507
|
-
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);
|
|
42508
|
-
}
|
|
42509
|
-
function FaSpinner(props) {
|
|
42510
|
-
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);
|
|
42511
|
-
}
|
|
42512
|
-
function FaUnlock(props) {
|
|
42513
|
-
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);
|
|
42514
|
-
}
|
|
42515
42885
|
function GrCircleQuestion(props) {
|
|
42516
42886
|
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);
|
|
42517
42887
|
}
|
|
@@ -43227,6 +43597,93 @@ class GlobalFormPlugin {
|
|
|
43227
43597
|
};
|
|
43228
43598
|
}
|
|
43229
43599
|
}
|
|
43600
|
+
const isSafeHref = (href) => {
|
|
43601
|
+
return /^https?:\/\//.test(href) && !/^javascript:/i.test(href) && !/^data:/i.test(href) && !/^vbscript:/i.test(href);
|
|
43602
|
+
};
|
|
43603
|
+
const parseUrlsInText$1 = (text) => {
|
|
43604
|
+
const urlRegex = /(https?:\/\/[^\s]+|www\.[^\s]+)/g;
|
|
43605
|
+
const parts = text.split(urlRegex);
|
|
43606
|
+
return parts.map((part, index) => {
|
|
43607
|
+
if (part.match(urlRegex)) {
|
|
43608
|
+
let href = part.startsWith("http") ? part : `https://${part}`;
|
|
43609
|
+
href = DOMPurify.sanitize(href, {
|
|
43610
|
+
ALLOWED_URI_REGEXP: /^https?:\/\/.*/i
|
|
43611
|
+
});
|
|
43612
|
+
if (isSafeHref(href)) {
|
|
43613
|
+
const safeText2 = DOMPurify.sanitize(part, {
|
|
43614
|
+
ALLOWED_TAGS: [],
|
|
43615
|
+
ALLOWED_ATTR: []
|
|
43616
|
+
});
|
|
43617
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
43618
|
+
"a",
|
|
43619
|
+
{
|
|
43620
|
+
key: index,
|
|
43621
|
+
href,
|
|
43622
|
+
target: "_blank",
|
|
43623
|
+
rel: "noopener noreferrer",
|
|
43624
|
+
className: "underline hover:opacity-80",
|
|
43625
|
+
onClick: (e3) => e3.stopPropagation()
|
|
43626
|
+
},
|
|
43627
|
+
safeText2
|
|
43628
|
+
);
|
|
43629
|
+
} else {
|
|
43630
|
+
const safeText2 = DOMPurify.sanitize(part, {
|
|
43631
|
+
ALLOWED_TAGS: [],
|
|
43632
|
+
ALLOWED_ATTR: []
|
|
43633
|
+
});
|
|
43634
|
+
return /* @__PURE__ */ React__default.createElement("span", { key: index }, safeText2);
|
|
43635
|
+
}
|
|
43636
|
+
}
|
|
43637
|
+
const safeText = DOMPurify.sanitize(part, {
|
|
43638
|
+
ALLOWED_TAGS: [],
|
|
43639
|
+
ALLOWED_ATTR: []
|
|
43640
|
+
});
|
|
43641
|
+
return safeText;
|
|
43642
|
+
});
|
|
43643
|
+
};
|
|
43644
|
+
const toast = {
|
|
43645
|
+
success: (message, options) => {
|
|
43646
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43647
|
+
return toast$1.success(content, options);
|
|
43648
|
+
},
|
|
43649
|
+
error: (message, options) => {
|
|
43650
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43651
|
+
return toast$1.error(content, options);
|
|
43652
|
+
},
|
|
43653
|
+
warning: (message, options) => {
|
|
43654
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43655
|
+
return toast$1.warning(content, options);
|
|
43656
|
+
},
|
|
43657
|
+
info: (message, options) => {
|
|
43658
|
+
const content = typeof message === "string" ? parseUrlsInText$1(message) : message;
|
|
43659
|
+
return toast$1.info(content, options);
|
|
43660
|
+
},
|
|
43661
|
+
dismiss: toast$1.dismiss
|
|
43662
|
+
};
|
|
43663
|
+
const Toaster = ({ ...props }) => {
|
|
43664
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
43665
|
+
Toaster$1,
|
|
43666
|
+
{
|
|
43667
|
+
className: "toaster group",
|
|
43668
|
+
position: "top-left",
|
|
43669
|
+
closeButton: true,
|
|
43670
|
+
toastOptions: {
|
|
43671
|
+
classNames: {
|
|
43672
|
+
toast: "group toast group-[.toaster]:bg-white group-[.toaster]:shadow-lg",
|
|
43673
|
+
description: "group-[.toast]:text-gray-700",
|
|
43674
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
43675
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
43676
|
+
closeButton: "group-[.toast]:bg-white group-[.toast]:text-current group-[.toast]:border-0",
|
|
43677
|
+
success: "group-[.toaster]:border-green-500 [&_[data-icon]]:text-green-500 [&_[data-content]]:text-gray-700",
|
|
43678
|
+
error: "group-[.toaster]:border-red-500 [&_[data-icon]]:text-red-500 [&_[data-content]]:text-gray-700",
|
|
43679
|
+
warning: "group-[.toaster]:border-yellow-500 [&_[data-icon]]:text-yellow-500 [&_[data-content]]:text-gray-700",
|
|
43680
|
+
info: "group-[.toaster]:border-blue-500 [&_[data-icon]]:text-blue-500 [&_[data-content]]:text-gray-700"
|
|
43681
|
+
}
|
|
43682
|
+
},
|
|
43683
|
+
...props
|
|
43684
|
+
}
|
|
43685
|
+
);
|
|
43686
|
+
};
|
|
43230
43687
|
let Alerts$1 = class Alerts {
|
|
43231
43688
|
constructor(events2, map2 = {}) {
|
|
43232
43689
|
this.events = events2;
|
|
@@ -43253,21 +43710,44 @@ let Alerts$1 = class Alerts {
|
|
|
43253
43710
|
...eventsToAlerts
|
|
43254
43711
|
};
|
|
43255
43712
|
}
|
|
43256
|
-
add(level, message, timeout =
|
|
43713
|
+
add(level, message, timeout = 8e3) {
|
|
43714
|
+
let id2;
|
|
43715
|
+
const toastMessage = typeof message === "string" ? message : React__default.createElement(message);
|
|
43716
|
+
switch (level) {
|
|
43717
|
+
case "success":
|
|
43718
|
+
id2 = toast.success(toastMessage, {
|
|
43719
|
+
duration: timeout
|
|
43720
|
+
});
|
|
43721
|
+
break;
|
|
43722
|
+
case "error":
|
|
43723
|
+
id2 = `${message}|${Date.now()}`;
|
|
43724
|
+
break;
|
|
43725
|
+
case "warn":
|
|
43726
|
+
id2 = toast.warning(toastMessage, {
|
|
43727
|
+
duration: timeout
|
|
43728
|
+
});
|
|
43729
|
+
break;
|
|
43730
|
+
case "info":
|
|
43731
|
+
default:
|
|
43732
|
+
id2 = toast.info(toastMessage, {
|
|
43733
|
+
duration: timeout
|
|
43734
|
+
});
|
|
43735
|
+
break;
|
|
43736
|
+
}
|
|
43257
43737
|
const alert = {
|
|
43258
43738
|
level,
|
|
43259
43739
|
message,
|
|
43260
43740
|
timeout,
|
|
43261
|
-
id:
|
|
43741
|
+
id: String(id2)
|
|
43262
43742
|
};
|
|
43263
43743
|
this.alerts.set(alert.id, alert);
|
|
43264
43744
|
this.events.dispatch({ type: "alerts:add", alert });
|
|
43265
|
-
let timeoutId = null;
|
|
43266
43745
|
const dismiss = () => {
|
|
43267
|
-
|
|
43746
|
+
if (level !== "error") {
|
|
43747
|
+
toast.dismiss(id2);
|
|
43748
|
+
}
|
|
43268
43749
|
this.dismiss(alert);
|
|
43269
43750
|
};
|
|
43270
|
-
timeoutId = level !== "error" ? setTimeout(dismiss, alert.timeout) : null;
|
|
43271
43751
|
return dismiss;
|
|
43272
43752
|
}
|
|
43273
43753
|
dismiss(alert) {
|
|
@@ -44304,9 +44784,6 @@ const CopyField = ({ label, description, value }) => {
|
|
|
44304
44784
|
)
|
|
44305
44785
|
), description && /* @__PURE__ */ React__default.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
|
|
44306
44786
|
};
|
|
44307
|
-
function cn(...inputs) {
|
|
44308
|
-
return twMerge(clsx(inputs));
|
|
44309
|
-
}
|
|
44310
44787
|
const checkerboardStyle = {
|
|
44311
44788
|
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%)",
|
|
44312
44789
|
backgroundSize: "12px 12px",
|
|
@@ -45215,7 +45692,7 @@ const Callout = ({
|
|
|
45215
45692
|
className = "",
|
|
45216
45693
|
...props
|
|
45217
45694
|
}) => {
|
|
45218
|
-
const commonAlertStyles = "
|
|
45695
|
+
const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
|
|
45219
45696
|
const styles = {
|
|
45220
45697
|
warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
|
|
45221
45698
|
info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
|
|
@@ -45239,14 +45716,14 @@ const Callout = ({
|
|
|
45239
45716
|
children
|
|
45240
45717
|
);
|
|
45241
45718
|
};
|
|
45242
|
-
const LocalWarning = () => {
|
|
45719
|
+
const LocalWarning = ({ className = "" }) => {
|
|
45243
45720
|
var _a2, _b;
|
|
45244
45721
|
const cms = useCMS$1();
|
|
45245
45722
|
const isLocalMode = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isLocalMode;
|
|
45246
45723
|
if (!isLocalMode) {
|
|
45247
45724
|
return null;
|
|
45248
45725
|
}
|
|
45249
|
-
return /* @__PURE__ */ React.createElement(Callout, { calloutStyle: "warning", className: "w-fit" }, /* @__PURE__ */ React.createElement("a", { href: "https://tina.io/docs/r/what-is-tinacloud/", target: "_blank" }, "You are in local mode"));
|
|
45726
|
+
return /* @__PURE__ */ React.createElement(Callout, { calloutStyle: "warning", className: cn("w-fit", className) }, /* @__PURE__ */ React.createElement("a", { href: "https://tina.io/docs/r/what-is-tinacloud/", target: "_blank" }, "You are in local mode"));
|
|
45250
45727
|
};
|
|
45251
45728
|
const BillingWarning = () => {
|
|
45252
45729
|
var _a2;
|
|
@@ -45987,7 +46464,7 @@ function formatDistanceToNow(dirtyDate, options) {
|
|
|
45987
46464
|
requiredArgs(1, arguments);
|
|
45988
46465
|
return formatDistance2(dirtyDate, Date.now(), options);
|
|
45989
46466
|
}
|
|
45990
|
-
const version$1 = "2.9.
|
|
46467
|
+
const version$1 = "2.9.4";
|
|
45991
46468
|
const VersionInfo = () => {
|
|
45992
46469
|
var _a2, _b, _c, _d, _e, _f;
|
|
45993
46470
|
const cms = useCMS();
|
|
@@ -46223,7 +46700,7 @@ const Nav = ({
|
|
|
46223
46700
|
toggleMenu();
|
|
46224
46701
|
}
|
|
46225
46702
|
},
|
|
46226
|
-
/* @__PURE__ */ React.createElement(BiMenu, { className: "h-
|
|
46703
|
+
/* @__PURE__ */ React.createElement(BiMenu, { className: "h-8 w-auto text-gray-600" })
|
|
46227
46704
|
)), /* @__PURE__ */ React.createElement(
|
|
46228
46705
|
"div",
|
|
46229
46706
|
{
|
|
@@ -46244,8 +46721,8 @@ const Nav = ({
|
|
|
46244
46721
|
toggleMenu();
|
|
46245
46722
|
}
|
|
46246
46723
|
},
|
|
46247
|
-
/* @__PURE__ */ React.createElement(BiMenu, { className: "h-
|
|
46248
|
-
), /* @__PURE__ */ React.createElement("span", { className: "text-left inline-flex items-center text-xl tracking-wide text-gray-800/80 flex-1 gap-1" }, /* @__PURE__ */ React.createElement(
|
|
46724
|
+
/* @__PURE__ */ React.createElement(BiMenu, { className: "h-8 w-auto text-gray-600" })
|
|
46725
|
+
), /* @__PURE__ */ React.createElement("span", { className: "text-left inline-flex items-center text-xl tracking-wide text-gray-800/80 flex-1 gap-1" }, /* @__PURE__ */ React.createElement(TinaExtendedIcon, { className: "h-8 w-auto fill-orange-500" }))),
|
|
46249
46726
|
children,
|
|
46250
46727
|
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col px-6 flex-1 overflow-auto" }, showCollections && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.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.createElement("span", null, "Collections"), isLocalMode && /* @__PURE__ */ React.createElement("span", { className: "flex items-center" }, /* @__PURE__ */ React.createElement(
|
|
46251
46728
|
"a",
|
|
@@ -46495,60 +46972,6 @@ function BreadcrumbEllipsis({
|
|
|
46495
46972
|
/* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "More")
|
|
46496
46973
|
);
|
|
46497
46974
|
}
|
|
46498
|
-
function DropdownMenu({
|
|
46499
|
-
...props
|
|
46500
|
-
}) {
|
|
46501
|
-
return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
46502
|
-
}
|
|
46503
|
-
function DropdownMenuTrigger({
|
|
46504
|
-
...props
|
|
46505
|
-
}) {
|
|
46506
|
-
return /* @__PURE__ */ React.createElement(
|
|
46507
|
-
DropdownMenuPrimitive.Trigger,
|
|
46508
|
-
{
|
|
46509
|
-
"data-slot": "dropdown-menu-trigger",
|
|
46510
|
-
...props
|
|
46511
|
-
}
|
|
46512
|
-
);
|
|
46513
|
-
}
|
|
46514
|
-
function DropdownMenuContent({
|
|
46515
|
-
className,
|
|
46516
|
-
sideOffset = 4,
|
|
46517
|
-
...props
|
|
46518
|
-
}) {
|
|
46519
|
-
return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
|
|
46520
|
-
DropdownMenuPrimitive.Content,
|
|
46521
|
-
{
|
|
46522
|
-
"data-slot": "dropdown-menu-content",
|
|
46523
|
-
sideOffset,
|
|
46524
|
-
className: cn(
|
|
46525
|
-
"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",
|
|
46526
|
-
className
|
|
46527
|
-
),
|
|
46528
|
-
...props
|
|
46529
|
-
}
|
|
46530
|
-
));
|
|
46531
|
-
}
|
|
46532
|
-
function DropdownMenuItem({
|
|
46533
|
-
className,
|
|
46534
|
-
inset,
|
|
46535
|
-
variant = "default",
|
|
46536
|
-
...props
|
|
46537
|
-
}) {
|
|
46538
|
-
return /* @__PURE__ */ React.createElement(
|
|
46539
|
-
DropdownMenuPrimitive.Item,
|
|
46540
|
-
{
|
|
46541
|
-
"data-slot": "dropdown-menu-item",
|
|
46542
|
-
"data-inset": inset,
|
|
46543
|
-
"data-variant": variant,
|
|
46544
|
-
className: cn(
|
|
46545
|
-
"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",
|
|
46546
|
-
className
|
|
46547
|
-
),
|
|
46548
|
-
...props
|
|
46549
|
-
}
|
|
46550
|
-
);
|
|
46551
|
-
}
|
|
46552
46975
|
const Item = ({
|
|
46553
46976
|
item,
|
|
46554
46977
|
depth,
|
|
@@ -46817,7 +47240,6 @@ const FormBreadcrumbs = ({
|
|
|
46817
47240
|
DropdownMenuItem,
|
|
46818
47241
|
{
|
|
46819
47242
|
key: breadcrumb.formId,
|
|
46820
|
-
className: "cursor-pointer text-gray-700 hover:text-blue-500",
|
|
46821
47243
|
onClick: (e3) => {
|
|
46822
47244
|
e3.preventDefault();
|
|
46823
47245
|
goBack(breadcrumb.formId, breadcrumb.formName);
|
|
@@ -47145,7 +47567,7 @@ const updateBodyDisplacement = ({
|
|
|
47145
47567
|
};
|
|
47146
47568
|
const SidebarHeader = ({ isLocalMode }) => {
|
|
47147
47569
|
const { toggleSidebarOpen, toggleMenu } = React.useContext(SidebarContext);
|
|
47148
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "p-2 flex-grow-0 w-full" }, !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-center" }, /* @__PURE__ */ React.createElement("div", { className: "flex" }, /* @__PURE__ */ React.createElement(
|
|
47570
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "p-2 flex-grow-0 w-full" }, !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-center" }, /* @__PURE__ */ React.createElement("div", { className: "flex overflow-hidden py-1" }, /* @__PURE__ */ React.createElement(
|
|
47149
47571
|
"button",
|
|
47150
47572
|
{
|
|
47151
47573
|
className: "p-2 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded",
|
|
@@ -47153,8 +47575,8 @@ const SidebarHeader = ({ isLocalMode }) => {
|
|
|
47153
47575
|
title: "Open navigation menu",
|
|
47154
47576
|
"aria-label": "Open navigation menu"
|
|
47155
47577
|
},
|
|
47156
|
-
/* @__PURE__ */ React.createElement(BiMenu, { className: "h-
|
|
47157
|
-
), /* @__PURE__ */ React.createElement(
|
|
47578
|
+
/* @__PURE__ */ React.createElement(BiMenu, { className: "h-8 w-auto text-gray-600" })
|
|
47579
|
+
), /* @__PURE__ */ React.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500 mr-2" }), /* @__PURE__ */ React.createElement(BranchButton, { className: "overflow-hidden mr-2" }), /* @__PURE__ */ React.createElement(LocalWarning, { className: "px-4" })), /* @__PURE__ */ React.createElement("div", { className: "flex" }, /* @__PURE__ */ React.createElement(BranchPreviewButton, null), /* @__PURE__ */ React.createElement(
|
|
47158
47580
|
"button",
|
|
47159
47581
|
{
|
|
47160
47582
|
type: "button",
|
|
@@ -47679,21 +48101,10 @@ const parseUrlsInText = (text) => {
|
|
|
47679
48101
|
};
|
|
47680
48102
|
function Alerts2({ alerts }) {
|
|
47681
48103
|
useSubscribable(alerts);
|
|
47682
|
-
if (
|
|
48104
|
+
if (alerts.all.length === 0) {
|
|
47683
48105
|
return null;
|
|
47684
48106
|
}
|
|
47685
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
47686
|
-
return alert.level !== "error";
|
|
47687
|
-
}).map((alert) => {
|
|
47688
|
-
return /* @__PURE__ */ React__default.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React__default.createElement(MdInfo, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React__default.createElement(MdCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React__default.createElement(MdWarning, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React__default.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, parseUrlsInText(alert.message.toString())), /* @__PURE__ */ React__default.createElement(
|
|
47689
|
-
CloseAlert,
|
|
47690
|
-
{
|
|
47691
|
-
onClick: () => {
|
|
47692
|
-
alerts.dismiss(alert);
|
|
47693
|
-
}
|
|
47694
|
-
}
|
|
47695
|
-
));
|
|
47696
|
-
})), alerts.all.filter((alert) => {
|
|
48107
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Toaster, null), alerts.all.filter((alert) => {
|
|
47697
48108
|
return alert.level === "error";
|
|
47698
48109
|
}).map((alert) => {
|
|
47699
48110
|
const AlertMessage = typeof alert.message === "string" ? () => {
|
|
@@ -47721,51 +48132,6 @@ function Alerts2({ alerts }) {
|
|
|
47721
48132
|
))));
|
|
47722
48133
|
}));
|
|
47723
48134
|
}
|
|
47724
|
-
const Alert = ({
|
|
47725
|
-
level,
|
|
47726
|
-
...props
|
|
47727
|
-
}) => {
|
|
47728
|
-
const colorClasses = {
|
|
47729
|
-
info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
|
|
47730
|
-
success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
|
|
47731
|
-
warn: "bg-yellow-100 border-yellow-500 text-yellow-600 fill-yellow-500",
|
|
47732
|
-
error: "bg-red-100 border-red-500 text-red-600 fill-red-500"
|
|
47733
|
-
};
|
|
47734
|
-
const borderClasses = {
|
|
47735
|
-
info: "border-blue-200",
|
|
47736
|
-
success: "border-green-200",
|
|
47737
|
-
warn: "border-yellow-200",
|
|
47738
|
-
error: "border-red-200"
|
|
47739
|
-
};
|
|
47740
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
47741
|
-
"div",
|
|
47742
|
-
{
|
|
47743
|
-
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]}}`,
|
|
47744
|
-
style: {
|
|
47745
|
-
animationName: "fly-in-up, fade-in",
|
|
47746
|
-
animationTimingFunction: "ease-out",
|
|
47747
|
-
animationIterationCount: 1,
|
|
47748
|
-
animationFillMode: "both",
|
|
47749
|
-
animationDuration: "150ms"
|
|
47750
|
-
}
|
|
47751
|
-
},
|
|
47752
|
-
/* @__PURE__ */ React__default.createElement(
|
|
47753
|
-
"div",
|
|
47754
|
-
{
|
|
47755
|
-
className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
|
|
47756
|
-
...props
|
|
47757
|
-
}
|
|
47758
|
-
)
|
|
47759
|
-
);
|
|
47760
|
-
};
|
|
47761
|
-
const CloseAlert = ({ ...styleProps }) => /* @__PURE__ */ React__default.createElement(
|
|
47762
|
-
"button",
|
|
47763
|
-
{
|
|
47764
|
-
className: "border-none bg-transparent p-0 outline-none flex items-center",
|
|
47765
|
-
...styleProps
|
|
47766
|
-
},
|
|
47767
|
-
/* @__PURE__ */ React__default.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
|
|
47768
|
-
);
|
|
47769
48135
|
function CursorPaginator({
|
|
47770
48136
|
navigateNext,
|
|
47771
48137
|
navigatePrev,
|
|
@@ -48001,10 +48367,7 @@ const BranchModal = ({ close: close2 }) => {
|
|
|
48001
48367
|
}
|
|
48002
48368
|
))));
|
|
48003
48369
|
};
|
|
48004
|
-
const
|
|
48005
|
-
return branchName.replace(/^tina\//, "");
|
|
48006
|
-
};
|
|
48007
|
-
const BranchButton = () => {
|
|
48370
|
+
const BranchButton = ({ className = "" }) => {
|
|
48008
48371
|
const [open, setOpen] = React.useState(false);
|
|
48009
48372
|
const { currentBranch } = useBranchData();
|
|
48010
48373
|
const cms = useCMS();
|
|
@@ -48014,22 +48377,19 @@ const BranchButton = () => {
|
|
|
48014
48377
|
}
|
|
48015
48378
|
const isProtected = cms.api.tina.usingProtectedBranch();
|
|
48016
48379
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
48017
|
-
|
|
48380
|
+
Button$1,
|
|
48018
48381
|
{
|
|
48382
|
+
variant: "secondary",
|
|
48383
|
+
size: "custom",
|
|
48019
48384
|
className: cn(
|
|
48020
|
-
|
|
48021
|
-
|
|
48022
|
-
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"
|
|
48385
|
+
"pointer-events-auto px-3 py-3 flex shrink gap-1 items-center justify-between",
|
|
48386
|
+
className
|
|
48023
48387
|
),
|
|
48024
|
-
onClick: () => setOpen(true)
|
|
48388
|
+
onClick: () => setOpen(true),
|
|
48389
|
+
title: currentBranch
|
|
48025
48390
|
},
|
|
48026
|
-
isProtected ? /* @__PURE__ */ React.createElement(BiLockAlt, { className: "flex-shrink-0 h-
|
|
48027
|
-
|
|
48028
|
-
{
|
|
48029
|
-
className: `flex-shrink-0 h-4 w-auto opacity-70 text-zinc-400`
|
|
48030
|
-
}
|
|
48031
|
-
),
|
|
48032
|
-
/* @__PURE__ */ React.createElement("span", { className: "truncate max-w-full -mr-1" }, trimPrefix(currentBranch)),
|
|
48391
|
+
isProtected ? /* @__PURE__ */ React.createElement(BiLockAlt, { className: "flex-shrink-0 h-6 w-auto opacity-70" }) : /* @__PURE__ */ React.createElement(BiGitBranch, { className: "flex-shrink-0 h-6 w-auto opacity-70 text-zinc-400" }),
|
|
48392
|
+
/* @__PURE__ */ React.createElement("span", { className: "truncate max-w-full -mr-1" }, currentBranch),
|
|
48033
48393
|
/* @__PURE__ */ React.createElement(
|
|
48034
48394
|
BiChevronDown,
|
|
48035
48395
|
{
|
|
@@ -48059,7 +48419,7 @@ const BranchPreviewButton = (props) => {
|
|
|
48059
48419
|
className: "p-2 text-gray-500 hover:text-blue-500 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded",
|
|
48060
48420
|
...props,
|
|
48061
48421
|
onClick: () => {
|
|
48062
|
-
window.open(
|
|
48422
|
+
window.open("", "_blank");
|
|
48063
48423
|
},
|
|
48064
48424
|
title: "Preview site in new tab"
|
|
48065
48425
|
},
|
|
@@ -48067,6 +48427,18 @@ const BranchPreviewButton = (props) => {
|
|
|
48067
48427
|
/* @__PURE__ */ React.createElement(BiLinkExternal, { className: "h-5 w-auto" })
|
|
48068
48428
|
);
|
|
48069
48429
|
};
|
|
48430
|
+
const EDITORIAL_WORKFLOW_STATUS = {
|
|
48431
|
+
QUEUED: "queued",
|
|
48432
|
+
PROCESSING: "processing",
|
|
48433
|
+
SETTING_UP: "setting_up",
|
|
48434
|
+
CREATING_BRANCH: "creating_branch",
|
|
48435
|
+
INDEXING: "indexing",
|
|
48436
|
+
CONTENT_GENERATION: "content_generation",
|
|
48437
|
+
CREATING_PR: "creating_pr",
|
|
48438
|
+
COMPLETE: "complete",
|
|
48439
|
+
ERROR: "error",
|
|
48440
|
+
TIMEOUT: "timeout"
|
|
48441
|
+
};
|
|
48070
48442
|
const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
48071
48443
|
const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
|
|
48072
48444
|
const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
@@ -63480,367 +63852,6 @@ class TinaAdminApi {
|
|
|
63480
63852
|
);
|
|
63481
63853
|
}
|
|
63482
63854
|
}
|
|
63483
|
-
const ProgressBar = ({
|
|
63484
|
-
progress,
|
|
63485
|
-
className = "",
|
|
63486
|
-
color = "blue"
|
|
63487
|
-
}) => {
|
|
63488
|
-
const clampedProgress = Math.min(Math.max(progress, 0), 100);
|
|
63489
|
-
const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
|
|
63490
|
-
return /* @__PURE__ */ React.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ React.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ React.createElement(
|
|
63491
|
-
"div",
|
|
63492
|
-
{
|
|
63493
|
-
className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
|
|
63494
|
-
style: { width: `${clampedProgress}%` }
|
|
63495
|
-
}
|
|
63496
|
-
)));
|
|
63497
|
-
};
|
|
63498
|
-
const EDITORIAL_WORKFLOW_STATUS = {
|
|
63499
|
-
QUEUED: "queued",
|
|
63500
|
-
PROCESSING: "processing",
|
|
63501
|
-
SETTING_UP: "setting_up",
|
|
63502
|
-
CREATING_BRANCH: "creating_branch",
|
|
63503
|
-
INDEXING: "indexing",
|
|
63504
|
-
CONTENT_GENERATION: "content_generation",
|
|
63505
|
-
CREATING_PR: "creating_pr",
|
|
63506
|
-
COMPLETE: "complete",
|
|
63507
|
-
ERROR: "error",
|
|
63508
|
-
TIMEOUT: "timeout"
|
|
63509
|
-
};
|
|
63510
|
-
const FormActionMenu = ({ actions, form }) => {
|
|
63511
|
-
const [actionMenuVisibility, setActionMenuVisibility] = useState(false);
|
|
63512
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React.createElement(
|
|
63513
|
-
Dismissible,
|
|
63514
|
-
{
|
|
63515
|
-
click: true,
|
|
63516
|
-
escape: true,
|
|
63517
|
-
disabled: !actionMenuVisibility,
|
|
63518
|
-
onDismiss: () => {
|
|
63519
|
-
setActionMenuVisibility((p2) => !p2);
|
|
63520
|
-
}
|
|
63521
|
-
},
|
|
63522
|
-
actions.map((Action, i2) => (
|
|
63523
|
-
// TODO: `i` will suppress warnings but this indicates that maybe
|
|
63524
|
-
// Actions should just be componets
|
|
63525
|
-
/* @__PURE__ */ React.createElement(Action, { form, key: i2 })
|
|
63526
|
-
))
|
|
63527
|
-
)));
|
|
63528
|
-
};
|
|
63529
|
-
const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
63530
|
-
"button",
|
|
63531
|
-
{
|
|
63532
|
-
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}`,
|
|
63533
|
-
...props
|
|
63534
|
-
},
|
|
63535
|
-
/* @__PURE__ */ React.createElement(EllipsisVerticalIcon, null)
|
|
63536
|
-
);
|
|
63537
|
-
const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React.createElement(
|
|
63538
|
-
"div",
|
|
63539
|
-
{
|
|
63540
|
-
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}`,
|
|
63541
|
-
style: {
|
|
63542
|
-
transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
|
|
63543
|
-
pointerEvents: open ? "all" : "none",
|
|
63544
|
-
...style
|
|
63545
|
-
},
|
|
63546
|
-
...props
|
|
63547
|
-
}
|
|
63548
|
-
);
|
|
63549
|
-
const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
63550
|
-
"button",
|
|
63551
|
-
{
|
|
63552
|
-
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}`,
|
|
63553
|
-
...props
|
|
63554
|
-
}
|
|
63555
|
-
);
|
|
63556
|
-
const FormPortalContext = React.createContext(() => {
|
|
63557
|
-
return null;
|
|
63558
|
-
});
|
|
63559
|
-
function useFormPortal() {
|
|
63560
|
-
return React.useContext(FormPortalContext);
|
|
63561
|
-
}
|
|
63562
|
-
const FormPortalProvider = ({
|
|
63563
|
-
children
|
|
63564
|
-
}) => {
|
|
63565
|
-
const wrapperRef = React.useRef(null);
|
|
63566
|
-
const zIndexRef = React.useRef(0);
|
|
63567
|
-
const FormPortal = React.useCallback(
|
|
63568
|
-
(props) => {
|
|
63569
|
-
if (!wrapperRef.current)
|
|
63570
|
-
return null;
|
|
63571
|
-
return createPortal(
|
|
63572
|
-
props.children({ zIndexShift: zIndexRef.current += 1 }),
|
|
63573
|
-
wrapperRef.current
|
|
63574
|
-
);
|
|
63575
|
-
},
|
|
63576
|
-
[wrapperRef, zIndexRef]
|
|
63577
|
-
);
|
|
63578
|
-
return /* @__PURE__ */ React.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
|
|
63579
|
-
};
|
|
63580
|
-
const LoadingDots = ({
|
|
63581
|
-
dotSize = 8,
|
|
63582
|
-
color = "white"
|
|
63583
|
-
}) => {
|
|
63584
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
|
|
63585
|
-
};
|
|
63586
|
-
const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React.createElement(
|
|
63587
|
-
"span",
|
|
63588
|
-
{
|
|
63589
|
-
className: "inline-block mr-1",
|
|
63590
|
-
style: {
|
|
63591
|
-
animation: "loading-dots-scale-up-and-down 2s linear infinite",
|
|
63592
|
-
animationDelay: `${delay}s`,
|
|
63593
|
-
background: color,
|
|
63594
|
-
width: dotSize,
|
|
63595
|
-
height: dotSize,
|
|
63596
|
-
borderRadius: dotSize
|
|
63597
|
-
}
|
|
63598
|
-
}
|
|
63599
|
-
);
|
|
63600
|
-
const ResetForm = ({
|
|
63601
|
-
pristine,
|
|
63602
|
-
reset: reset2,
|
|
63603
|
-
children,
|
|
63604
|
-
...props
|
|
63605
|
-
}) => {
|
|
63606
|
-
const [open, setOpen] = React.useState(false);
|
|
63607
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
63608
|
-
Button$1,
|
|
63609
|
-
{
|
|
63610
|
-
onClick: () => {
|
|
63611
|
-
setOpen((p2) => !p2);
|
|
63612
|
-
},
|
|
63613
|
-
disabled: pristine,
|
|
63614
|
-
...props
|
|
63615
|
-
},
|
|
63616
|
-
children
|
|
63617
|
-
), open && /* @__PURE__ */ React.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
|
|
63618
|
-
};
|
|
63619
|
-
const ResetModal = ({ close: close2, reset: reset2 }) => {
|
|
63620
|
-
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
63621
|
-
Button$1,
|
|
63622
|
-
{
|
|
63623
|
-
style: { flexGrow: 3 },
|
|
63624
|
-
variant: "primary",
|
|
63625
|
-
onClick: async () => {
|
|
63626
|
-
await reset2();
|
|
63627
|
-
close2();
|
|
63628
|
-
}
|
|
63629
|
-
},
|
|
63630
|
-
"Reset"
|
|
63631
|
-
))));
|
|
63632
|
-
};
|
|
63633
|
-
const NoFieldsPlaceholder = () => /* @__PURE__ */ React.createElement(
|
|
63634
|
-
"div",
|
|
63635
|
-
{
|
|
63636
|
-
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
63637
|
-
style: {
|
|
63638
|
-
animationName: "fade-in",
|
|
63639
|
-
animationDelay: "300ms",
|
|
63640
|
-
animationTimingFunction: "ease-out",
|
|
63641
|
-
animationIterationCount: 1,
|
|
63642
|
-
animationFillMode: "both",
|
|
63643
|
-
animationDuration: "150ms"
|
|
63644
|
-
}
|
|
63645
|
-
},
|
|
63646
|
-
/* @__PURE__ */ React.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
63647
|
-
/* @__PURE__ */ React.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
|
|
63648
|
-
/* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React.createElement(
|
|
63649
|
-
"a",
|
|
63650
|
-
{
|
|
63651
|
-
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",
|
|
63652
|
-
href: "https://tinacms.org/docs/fields",
|
|
63653
|
-
target: "_blank",
|
|
63654
|
-
rel: "noopener noreferrer"
|
|
63655
|
-
},
|
|
63656
|
-
/* @__PURE__ */ React.createElement(
|
|
63657
|
-
Emoji,
|
|
63658
|
-
{
|
|
63659
|
-
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
63660
|
-
style: { fontSize: 24 }
|
|
63661
|
-
},
|
|
63662
|
-
"📖"
|
|
63663
|
-
),
|
|
63664
|
-
" ",
|
|
63665
|
-
"Field Setup Guide"
|
|
63666
|
-
))
|
|
63667
|
-
);
|
|
63668
|
-
const FormKeyBindings = ({ onSubmit }) => {
|
|
63669
|
-
useEffect(() => {
|
|
63670
|
-
const handleKeyDown = (e3) => {
|
|
63671
|
-
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
63672
|
-
e3.preventDefault();
|
|
63673
|
-
onSubmit();
|
|
63674
|
-
}
|
|
63675
|
-
};
|
|
63676
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
63677
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
63678
|
-
}, [onSubmit]);
|
|
63679
|
-
return null;
|
|
63680
|
-
};
|
|
63681
|
-
const FormBuilder = ({
|
|
63682
|
-
form,
|
|
63683
|
-
onPristineChange,
|
|
63684
|
-
...rest
|
|
63685
|
-
}) => {
|
|
63686
|
-
const cms = useCMS$1();
|
|
63687
|
-
const hideFooter = !!rest.hideFooter;
|
|
63688
|
-
const [createBranchModalOpen, setCreateBranchModalOpen] = React.useState(false);
|
|
63689
|
-
const tinaForm = form.tinaForm;
|
|
63690
|
-
const finalForm = form.tinaForm.finalForm;
|
|
63691
|
-
React.useEffect(() => {
|
|
63692
|
-
var _a2;
|
|
63693
|
-
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
63694
|
-
tinaForm.path
|
|
63695
|
-
);
|
|
63696
|
-
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
63697
|
-
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
63698
|
-
} else {
|
|
63699
|
-
tinaForm.beforeSubmit = void 0;
|
|
63700
|
-
}
|
|
63701
|
-
}, [tinaForm.path]);
|
|
63702
|
-
const moveArrayItem = React.useCallback(
|
|
63703
|
-
(result) => {
|
|
63704
|
-
if (!result.destination || !finalForm)
|
|
63705
|
-
return;
|
|
63706
|
-
const name = result.type;
|
|
63707
|
-
finalForm.mutators.move(
|
|
63708
|
-
name,
|
|
63709
|
-
result.source.index,
|
|
63710
|
-
result.destination.index
|
|
63711
|
-
);
|
|
63712
|
-
},
|
|
63713
|
-
[tinaForm]
|
|
63714
|
-
);
|
|
63715
|
-
React.useEffect(() => {
|
|
63716
|
-
const unsubscribe = finalForm.subscribe(
|
|
63717
|
-
({ pristine }) => {
|
|
63718
|
-
if (onPristineChange) {
|
|
63719
|
-
onPristineChange(pristine);
|
|
63720
|
-
}
|
|
63721
|
-
},
|
|
63722
|
-
{ pristine: true }
|
|
63723
|
-
);
|
|
63724
|
-
return () => {
|
|
63725
|
-
unsubscribe();
|
|
63726
|
-
};
|
|
63727
|
-
}, [finalForm]);
|
|
63728
|
-
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
63729
|
-
return /* @__PURE__ */ React.createElement(
|
|
63730
|
-
Form$1,
|
|
63731
|
-
{
|
|
63732
|
-
key: tinaForm.id,
|
|
63733
|
-
form: tinaForm.finalForm,
|
|
63734
|
-
onSubmit: tinaForm.onSubmit
|
|
63735
|
-
},
|
|
63736
|
-
({
|
|
63737
|
-
handleSubmit,
|
|
63738
|
-
pristine,
|
|
63739
|
-
invalid,
|
|
63740
|
-
submitting,
|
|
63741
|
-
dirtySinceLastSubmit,
|
|
63742
|
-
hasValidationErrors
|
|
63743
|
-
}) => {
|
|
63744
|
-
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
63745
|
-
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
63746
|
-
const safeSubmit = async () => {
|
|
63747
|
-
if (canSubmit) {
|
|
63748
|
-
await handleSubmit();
|
|
63749
|
-
}
|
|
63750
|
-
};
|
|
63751
|
-
const safeHandleSubmit = async () => {
|
|
63752
|
-
if (usingProtectedBranch) {
|
|
63753
|
-
setCreateBranchModalOpen(true);
|
|
63754
|
-
} else {
|
|
63755
|
-
safeSubmit();
|
|
63756
|
-
}
|
|
63757
|
-
};
|
|
63758
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React.createElement(
|
|
63759
|
-
CreateBranchModal,
|
|
63760
|
-
{
|
|
63761
|
-
safeSubmit,
|
|
63762
|
-
crudType: tinaForm.crudType,
|
|
63763
|
-
path: tinaForm.path,
|
|
63764
|
-
values: tinaForm.values,
|
|
63765
|
-
close: () => setCreateBranchModalOpen(false)
|
|
63766
|
-
}
|
|
63767
|
-
), /* @__PURE__ */ React.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React.createElement(FormPortalProvider, null, /* @__PURE__ */ React.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
|
|
63768
|
-
FieldsBuilder,
|
|
63769
|
-
{
|
|
63770
|
-
form: tinaForm,
|
|
63771
|
-
activeFieldName: form.activeFieldName,
|
|
63772
|
-
fields: fieldGroup.fields
|
|
63773
|
-
}
|
|
63774
|
-
) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React.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.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
|
|
63775
|
-
ResetForm,
|
|
63776
|
-
{
|
|
63777
|
-
pristine,
|
|
63778
|
-
reset: async () => {
|
|
63779
|
-
finalForm.reset();
|
|
63780
|
-
await tinaForm.reset();
|
|
63781
|
-
}
|
|
63782
|
-
},
|
|
63783
|
-
tinaForm.buttons.reset
|
|
63784
|
-
), /* @__PURE__ */ React.createElement(
|
|
63785
|
-
Button$1,
|
|
63786
|
-
{
|
|
63787
|
-
onClick: safeHandleSubmit,
|
|
63788
|
-
disabled: !canSubmit,
|
|
63789
|
-
busy: submitting,
|
|
63790
|
-
variant: "primary"
|
|
63791
|
-
},
|
|
63792
|
-
submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
|
|
63793
|
-
!submitting && tinaForm.buttons.save
|
|
63794
|
-
), tinaForm.actions.length > 0 && /* @__PURE__ */ React.createElement(
|
|
63795
|
-
FormActionMenu,
|
|
63796
|
-
{
|
|
63797
|
-
form: tinaForm,
|
|
63798
|
-
actions: tinaForm.actions
|
|
63799
|
-
}
|
|
63800
|
-
)))));
|
|
63801
|
-
}
|
|
63802
|
-
);
|
|
63803
|
-
};
|
|
63804
|
-
const FormStatus = ({ pristine }) => {
|
|
63805
|
-
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
63806
|
-
return /* @__PURE__ */ React.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
63807
|
-
};
|
|
63808
|
-
const FormWrapper = ({
|
|
63809
|
-
id: id2,
|
|
63810
|
-
children
|
|
63811
|
-
}) => {
|
|
63812
|
-
return /* @__PURE__ */ React.createElement(
|
|
63813
|
-
"div",
|
|
63814
|
-
{
|
|
63815
|
-
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
63816
|
-
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
63817
|
-
},
|
|
63818
|
-
/* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
|
|
63819
|
-
);
|
|
63820
|
-
};
|
|
63821
|
-
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
63822
|
-
"span",
|
|
63823
|
-
{
|
|
63824
|
-
className: `text-[40px] leading-none inline-block ${className}`,
|
|
63825
|
-
...props
|
|
63826
|
-
}
|
|
63827
|
-
);
|
|
63828
|
-
const CreateBranchModel = ({
|
|
63829
|
-
close: close2,
|
|
63830
|
-
safeSubmit,
|
|
63831
|
-
relativePath: relativePath2,
|
|
63832
|
-
values,
|
|
63833
|
-
crudType
|
|
63834
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
63835
|
-
CreateBranchModal,
|
|
63836
|
-
{
|
|
63837
|
-
close: close2,
|
|
63838
|
-
safeSubmit,
|
|
63839
|
-
path: relativePath2,
|
|
63840
|
-
values,
|
|
63841
|
-
crudType
|
|
63842
|
-
}
|
|
63843
|
-
);
|
|
63844
63855
|
const pathRelativeToCollection = (collectionPath, fullPath) => {
|
|
63845
63856
|
const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
|
|
63846
63857
|
const normalizedFullPath = fullPath.replace(/\\/g, "/");
|
|
@@ -63869,7 +63880,6 @@ const CreateBranchModal = ({
|
|
|
63869
63880
|
const [isExecuting, setIsExecuting] = React.useState(false);
|
|
63870
63881
|
const [errorMessage, setErrorMessage] = React.useState("");
|
|
63871
63882
|
const [currentStep, setCurrentStep] = React.useState(0);
|
|
63872
|
-
const [statusMessage, setStatusMessage] = React.useState("");
|
|
63873
63883
|
const [elapsedTime, setElapsedTime] = React.useState(0);
|
|
63874
63884
|
React.useEffect(() => {
|
|
63875
63885
|
let interval;
|
|
@@ -63913,7 +63923,6 @@ const CreateBranchModal = ({
|
|
|
63913
63923
|
setDisabled(true);
|
|
63914
63924
|
setIsExecuting(true);
|
|
63915
63925
|
setCurrentStep(1);
|
|
63916
|
-
setStatusMessage("Initializing workflow...");
|
|
63917
63926
|
let graphql2 = "";
|
|
63918
63927
|
if (crudType === "create") {
|
|
63919
63928
|
graphql2 = CREATE_DOCUMENT_GQL;
|
|
@@ -63938,8 +63947,6 @@ const CreateBranchModal = ({
|
|
|
63938
63947
|
}
|
|
63939
63948
|
},
|
|
63940
63949
|
onStatusUpdate: (status) => {
|
|
63941
|
-
const message = status.message || `Status: ${status.status}`;
|
|
63942
|
-
setStatusMessage(message);
|
|
63943
63950
|
switch (status.status) {
|
|
63944
63951
|
case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
|
|
63945
63952
|
case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
|
|
@@ -63976,9 +63983,7 @@ const CreateBranchModal = ({
|
|
|
63976
63983
|
}
|
|
63977
63984
|
};
|
|
63978
63985
|
const renderProgressIndicator = () => {
|
|
63979
|
-
|
|
63980
|
-
const progressPercentage = (currentStep - 1) / steps.length * 100;
|
|
63981
|
-
return /* @__PURE__ */ React.createElement("div", { className: "py-6" }, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between mb-4 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React.createElement(
|
|
63986
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between my-8 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React.createElement(
|
|
63982
63987
|
"div",
|
|
63983
63988
|
{
|
|
63984
63989
|
className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
|
|
@@ -63987,7 +63992,7 @@ const CreateBranchModal = ({
|
|
|
63987
63992
|
), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React.createElement(
|
|
63988
63993
|
"div",
|
|
63989
63994
|
{
|
|
63990
|
-
className: "absolute top-5 h-0.5 bg-
|
|
63995
|
+
className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
|
|
63991
63996
|
style: {
|
|
63992
63997
|
left: "50px",
|
|
63993
63998
|
width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
|
|
@@ -64015,7 +64020,7 @@ const CreateBranchModal = ({
|
|
|
64015
64020
|
/* @__PURE__ */ React.createElement(
|
|
64016
64021
|
"div",
|
|
64017
64022
|
{
|
|
64018
|
-
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-
|
|
64023
|
+
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"}`
|
|
64019
64024
|
},
|
|
64020
64025
|
isCompleted ? /* @__PURE__ */ React.createElement(
|
|
64021
64026
|
"svg",
|
|
@@ -64034,15 +64039,9 @@ const CreateBranchModal = ({
|
|
|
64034
64039
|
)
|
|
64035
64040
|
) : isActive ? /* @__PURE__ */ React.createElement(AiOutlineLoading, { className: "animate-spin text-lg" }) : stepNumber
|
|
64036
64041
|
),
|
|
64037
|
-
/* @__PURE__ */ React.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React.createElement(
|
|
64038
|
-
"div",
|
|
64039
|
-
{
|
|
64040
|
-
className: `text-sm font-semibold leading-tight ${isActive ? "text-blue-600" : isCompleted ? "text-green-600" : "text-gray-400"}`
|
|
64041
|
-
},
|
|
64042
|
-
step.name
|
|
64043
|
-
), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
|
|
64042
|
+
/* @__PURE__ */ React.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-semibold leading-tight" }, step.name), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
|
|
64044
64043
|
);
|
|
64045
|
-
})), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between
|
|
64044
|
+
})), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 min "), isExecuting && currentStep > 0 && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React.createElement(
|
|
64046
64045
|
"path",
|
|
64047
64046
|
{
|
|
64048
64047
|
fillRule: "evenodd",
|
|
@@ -64050,37 +64049,23 @@ const CreateBranchModal = ({
|
|
|
64050
64049
|
clipRule: "evenodd"
|
|
64051
64050
|
}
|
|
64052
64051
|
)), formatTime(elapsedTime))), /* @__PURE__ */ React.createElement(
|
|
64053
|
-
|
|
64054
|
-
{
|
|
64055
|
-
progress: progressPercentage,
|
|
64056
|
-
className: "mb-4",
|
|
64057
|
-
color: currentStep > steps.length ? "green" : "blue"
|
|
64058
|
-
}
|
|
64059
|
-
), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React.createElement(
|
|
64060
|
-
"svg",
|
|
64052
|
+
"a",
|
|
64061
64053
|
{
|
|
64062
|
-
className: "
|
|
64063
|
-
|
|
64064
|
-
|
|
64054
|
+
className: "underline text-tina-orange-dark font-medium text-xs",
|
|
64055
|
+
href: "https://tina.io/docs/tinacloud/editorial-workflow",
|
|
64056
|
+
target: "_blank"
|
|
64065
64057
|
},
|
|
64066
|
-
|
|
64067
|
-
|
|
64068
|
-
{
|
|
64069
|
-
fillRule: "evenodd",
|
|
64070
|
-
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",
|
|
64071
|
-
clipRule: "evenodd"
|
|
64072
|
-
}
|
|
64073
|
-
)
|
|
64074
|
-
) : /* @__PURE__ */ React.createElement(AiOutlineLoading, { className: "text-blue-500 animate-spin" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium text-gray-700" }, statusMessage || `${(_a2 = steps[currentStep - 1]) == null ? void 0 : _a2.name}...`)), /* @__PURE__ */ React.createElement("div", { className: "text-left" }, /* @__PURE__ */ React.createElement("p", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 minutes")));
|
|
64058
|
+
"Learn more about Editorial Workflow"
|
|
64059
|
+
));
|
|
64075
64060
|
};
|
|
64076
64061
|
const renderStateContent = () => {
|
|
64077
64062
|
if (isExecuting) {
|
|
64078
64063
|
return renderProgressIndicator();
|
|
64079
64064
|
} else {
|
|
64080
|
-
return /* @__PURE__ */ React.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React.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.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React.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.
|
|
64065
|
+
return /* @__PURE__ */ React.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React.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.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React.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.createElement("br", null), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("span", { className: "text-gray-500" }, "Learn more about "), /* @__PURE__ */ React.createElement(
|
|
64081
64066
|
"a",
|
|
64082
64067
|
{
|
|
64083
|
-
className: "underline
|
|
64068
|
+
className: "underline text-tina-orange-dark font-medium",
|
|
64084
64069
|
href: "https://tina.io/docs/tinacloud/editorial-workflow",
|
|
64085
64070
|
target: "_blank"
|
|
64086
64071
|
},
|
|
@@ -64088,54 +64073,273 @@ const CreateBranchModal = ({
|
|
|
64088
64073
|
), "."), /* @__PURE__ */ React.createElement(
|
|
64089
64074
|
PrefixedTextField,
|
|
64090
64075
|
{
|
|
64076
|
+
name: "new-branch-name",
|
|
64077
|
+
label: "Branch Name",
|
|
64091
64078
|
placeholder: "e.g. {{PAGE-NAME}}-updates",
|
|
64092
64079
|
value: newBranchName,
|
|
64093
64080
|
onChange: (e3) => {
|
|
64094
64081
|
setErrorMessage("");
|
|
64095
|
-
setStatusMessage("");
|
|
64096
64082
|
setNewBranchName(e3.target.value);
|
|
64097
64083
|
}
|
|
64098
64084
|
}
|
|
64099
64085
|
));
|
|
64100
64086
|
}
|
|
64101
64087
|
};
|
|
64102
|
-
return /* @__PURE__ */ React.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center" },
|
|
64103
|
-
|
|
64088
|
+
return /* @__PURE__ */ React.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, "Save changes to new branch"))), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
64089
|
+
DropdownButton,
|
|
64104
64090
|
{
|
|
64105
64091
|
variant: "primary",
|
|
64106
|
-
|
|
64092
|
+
align: "start",
|
|
64093
|
+
className: "w-full sm:w-auto",
|
|
64107
64094
|
disabled: newBranchName === "" || disabled,
|
|
64108
|
-
|
|
64109
|
-
|
|
64110
|
-
"Continue"
|
|
64111
|
-
), /* @__PURE__ */ React.createElement(
|
|
64112
|
-
OverflowMenu$1,
|
|
64113
|
-
{
|
|
64114
|
-
className: "-ml-2",
|
|
64115
|
-
toolbarItems: [
|
|
64095
|
+
onMainAction: executeEditorialWorkflow,
|
|
64096
|
+
items: [
|
|
64116
64097
|
{
|
|
64117
|
-
name: "override",
|
|
64118
64098
|
label: "Save to Protected Branch",
|
|
64119
|
-
|
|
64120
|
-
onMouseDown: () => {
|
|
64099
|
+
onClick: () => {
|
|
64121
64100
|
close2();
|
|
64122
64101
|
safeSubmit();
|
|
64123
|
-
}
|
|
64102
|
+
},
|
|
64103
|
+
icon: /* @__PURE__ */ React.createElement(TriangleAlert, { className: "w-4 h-4" })
|
|
64124
64104
|
}
|
|
64125
64105
|
]
|
|
64126
|
-
}
|
|
64106
|
+
},
|
|
64107
|
+
/* @__PURE__ */ React.createElement(
|
|
64108
|
+
GitBranchIcon,
|
|
64109
|
+
{
|
|
64110
|
+
className: "w-4 h-4 mr-1",
|
|
64111
|
+
style: { fill: "none" }
|
|
64112
|
+
}
|
|
64113
|
+
),
|
|
64114
|
+
"Save to a new branch"
|
|
64127
64115
|
))));
|
|
64128
64116
|
};
|
|
64129
|
-
const PrefixedTextField = ({
|
|
64130
|
-
|
|
64117
|
+
const PrefixedTextField = ({
|
|
64118
|
+
label = null,
|
|
64119
|
+
prefix = "tina/",
|
|
64120
|
+
...props
|
|
64121
|
+
}) => {
|
|
64122
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, label && /* @__PURE__ */ React.createElement(FieldLabel, { name: props.name }, label), /* @__PURE__ */ React.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.createElement("span", { className: "pl-3 pr-2 py-2 text-base text-tina-orange-dark bg-tina-orange-light" }, prefix), /* @__PURE__ */ React.createElement(
|
|
64131
64123
|
"input",
|
|
64132
64124
|
{
|
|
64125
|
+
id: props.name,
|
|
64133
64126
|
type: "text",
|
|
64134
64127
|
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",
|
|
64135
64128
|
...props
|
|
64136
64129
|
}
|
|
64137
|
-
));
|
|
64130
|
+
)));
|
|
64131
|
+
};
|
|
64132
|
+
const NoFieldsPlaceholder = () => /* @__PURE__ */ React.createElement(
|
|
64133
|
+
"div",
|
|
64134
|
+
{
|
|
64135
|
+
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
64136
|
+
style: {
|
|
64137
|
+
animationName: "fade-in",
|
|
64138
|
+
animationDelay: "300ms",
|
|
64139
|
+
animationTimingFunction: "ease-out",
|
|
64140
|
+
animationIterationCount: 1,
|
|
64141
|
+
animationFillMode: "both",
|
|
64142
|
+
animationDuration: "150ms"
|
|
64143
|
+
}
|
|
64144
|
+
},
|
|
64145
|
+
/* @__PURE__ */ React.createElement(Emoji, { className: "block pb-5" }, "🤔"),
|
|
64146
|
+
/* @__PURE__ */ React.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
|
|
64147
|
+
/* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React.createElement(
|
|
64148
|
+
"a",
|
|
64149
|
+
{
|
|
64150
|
+
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",
|
|
64151
|
+
href: "https://tinacms.org/docs/fields",
|
|
64152
|
+
target: "_blank",
|
|
64153
|
+
rel: "noopener noreferrer"
|
|
64154
|
+
},
|
|
64155
|
+
/* @__PURE__ */ React.createElement(
|
|
64156
|
+
Emoji,
|
|
64157
|
+
{
|
|
64158
|
+
className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
|
|
64159
|
+
style: { fontSize: 24 }
|
|
64160
|
+
},
|
|
64161
|
+
"📖"
|
|
64162
|
+
),
|
|
64163
|
+
" ",
|
|
64164
|
+
"Field Setup Guide"
|
|
64165
|
+
))
|
|
64166
|
+
);
|
|
64167
|
+
const FormKeyBindings = ({ onSubmit }) => {
|
|
64168
|
+
useEffect(() => {
|
|
64169
|
+
const handleKeyDown = (e3) => {
|
|
64170
|
+
if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
|
|
64171
|
+
e3.preventDefault();
|
|
64172
|
+
onSubmit();
|
|
64173
|
+
}
|
|
64174
|
+
};
|
|
64175
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
64176
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
64177
|
+
}, [onSubmit]);
|
|
64178
|
+
return null;
|
|
64138
64179
|
};
|
|
64180
|
+
const FormBuilder = ({
|
|
64181
|
+
form,
|
|
64182
|
+
onPristineChange,
|
|
64183
|
+
...rest
|
|
64184
|
+
}) => {
|
|
64185
|
+
const cms = useCMS$1();
|
|
64186
|
+
const hideFooter = !!rest.hideFooter;
|
|
64187
|
+
const [createBranchModalOpen, setCreateBranchModalOpen] = React.useState(false);
|
|
64188
|
+
const tinaForm = form.tinaForm;
|
|
64189
|
+
const finalForm = form.tinaForm.finalForm;
|
|
64190
|
+
React.useEffect(() => {
|
|
64191
|
+
var _a2;
|
|
64192
|
+
const collection = cms.api.tina.schema.getCollectionByFullPath(
|
|
64193
|
+
tinaForm.path
|
|
64194
|
+
);
|
|
64195
|
+
if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
|
|
64196
|
+
tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
|
|
64197
|
+
} else {
|
|
64198
|
+
tinaForm.beforeSubmit = void 0;
|
|
64199
|
+
}
|
|
64200
|
+
}, [tinaForm.path]);
|
|
64201
|
+
const moveArrayItem = React.useCallback(
|
|
64202
|
+
(result) => {
|
|
64203
|
+
if (!result.destination || !finalForm)
|
|
64204
|
+
return;
|
|
64205
|
+
const name = result.type;
|
|
64206
|
+
finalForm.mutators.move(
|
|
64207
|
+
name,
|
|
64208
|
+
result.source.index,
|
|
64209
|
+
result.destination.index
|
|
64210
|
+
);
|
|
64211
|
+
},
|
|
64212
|
+
[tinaForm]
|
|
64213
|
+
);
|
|
64214
|
+
React.useEffect(() => {
|
|
64215
|
+
const unsubscribe = finalForm.subscribe(
|
|
64216
|
+
({ pristine }) => {
|
|
64217
|
+
if (onPristineChange) {
|
|
64218
|
+
onPristineChange(pristine);
|
|
64219
|
+
}
|
|
64220
|
+
},
|
|
64221
|
+
{ pristine: true }
|
|
64222
|
+
);
|
|
64223
|
+
return () => {
|
|
64224
|
+
unsubscribe();
|
|
64225
|
+
};
|
|
64226
|
+
}, [finalForm]);
|
|
64227
|
+
const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
|
|
64228
|
+
return /* @__PURE__ */ React.createElement(
|
|
64229
|
+
Form$1,
|
|
64230
|
+
{
|
|
64231
|
+
key: tinaForm.id,
|
|
64232
|
+
form: tinaForm.finalForm,
|
|
64233
|
+
onSubmit: tinaForm.onSubmit
|
|
64234
|
+
},
|
|
64235
|
+
({
|
|
64236
|
+
handleSubmit,
|
|
64237
|
+
pristine,
|
|
64238
|
+
invalid,
|
|
64239
|
+
submitting,
|
|
64240
|
+
dirtySinceLastSubmit,
|
|
64241
|
+
hasValidationErrors
|
|
64242
|
+
}) => {
|
|
64243
|
+
const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
|
|
64244
|
+
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
64245
|
+
const safeSubmit = async () => {
|
|
64246
|
+
if (canSubmit) {
|
|
64247
|
+
await handleSubmit();
|
|
64248
|
+
}
|
|
64249
|
+
};
|
|
64250
|
+
const safeHandleSubmit = async () => {
|
|
64251
|
+
if (usingProtectedBranch) {
|
|
64252
|
+
setCreateBranchModalOpen(true);
|
|
64253
|
+
} else {
|
|
64254
|
+
safeSubmit();
|
|
64255
|
+
}
|
|
64256
|
+
};
|
|
64257
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React.createElement(
|
|
64258
|
+
CreateBranchModal,
|
|
64259
|
+
{
|
|
64260
|
+
safeSubmit,
|
|
64261
|
+
crudType: tinaForm.crudType,
|
|
64262
|
+
path: tinaForm.path,
|
|
64263
|
+
values: tinaForm.values,
|
|
64264
|
+
close: () => setCreateBranchModalOpen(false)
|
|
64265
|
+
}
|
|
64266
|
+
), /* @__PURE__ */ React.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React.createElement(FormPortalProvider, null, /* @__PURE__ */ React.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
|
|
64267
|
+
FieldsBuilder,
|
|
64268
|
+
{
|
|
64269
|
+
form: tinaForm,
|
|
64270
|
+
activeFieldName: form.activeFieldName,
|
|
64271
|
+
fields: fieldGroup.fields
|
|
64272
|
+
}
|
|
64273
|
+
) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React.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.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
|
|
64274
|
+
ResetForm,
|
|
64275
|
+
{
|
|
64276
|
+
pristine,
|
|
64277
|
+
reset: async () => {
|
|
64278
|
+
finalForm.reset();
|
|
64279
|
+
await tinaForm.reset();
|
|
64280
|
+
}
|
|
64281
|
+
},
|
|
64282
|
+
tinaForm.buttons.reset
|
|
64283
|
+
), /* @__PURE__ */ React.createElement(
|
|
64284
|
+
Button$1,
|
|
64285
|
+
{
|
|
64286
|
+
onClick: safeHandleSubmit,
|
|
64287
|
+
disabled: !canSubmit,
|
|
64288
|
+
busy: submitting,
|
|
64289
|
+
variant: "primary"
|
|
64290
|
+
},
|
|
64291
|
+
submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
|
|
64292
|
+
!submitting && tinaForm.buttons.save
|
|
64293
|
+
), tinaForm.actions.length > 0 && /* @__PURE__ */ React.createElement(
|
|
64294
|
+
FormActionMenu,
|
|
64295
|
+
{
|
|
64296
|
+
form: tinaForm,
|
|
64297
|
+
actions: tinaForm.actions
|
|
64298
|
+
}
|
|
64299
|
+
)))));
|
|
64300
|
+
}
|
|
64301
|
+
);
|
|
64302
|
+
};
|
|
64303
|
+
const FormStatus = ({ pristine }) => {
|
|
64304
|
+
const pristineClass = pristine ? "text-green-500" : "text-red-500";
|
|
64305
|
+
return /* @__PURE__ */ React.createElement(FaCircle, { className: cn("h-3", pristineClass) });
|
|
64306
|
+
};
|
|
64307
|
+
const FormWrapper = ({
|
|
64308
|
+
id: id2,
|
|
64309
|
+
children
|
|
64310
|
+
}) => {
|
|
64311
|
+
return /* @__PURE__ */ React.createElement(
|
|
64312
|
+
"div",
|
|
64313
|
+
{
|
|
64314
|
+
"data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
|
|
64315
|
+
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
64316
|
+
},
|
|
64317
|
+
/* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
|
|
64318
|
+
);
|
|
64319
|
+
};
|
|
64320
|
+
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
64321
|
+
"span",
|
|
64322
|
+
{
|
|
64323
|
+
className: `text-[40px] leading-none inline-block ${className}`,
|
|
64324
|
+
...props
|
|
64325
|
+
}
|
|
64326
|
+
);
|
|
64327
|
+
const CreateBranchModel = ({
|
|
64328
|
+
close: close2,
|
|
64329
|
+
safeSubmit,
|
|
64330
|
+
relativePath: relativePath2,
|
|
64331
|
+
values,
|
|
64332
|
+
crudType
|
|
64333
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
64334
|
+
CreateBranchModal,
|
|
64335
|
+
{
|
|
64336
|
+
close: close2,
|
|
64337
|
+
safeSubmit,
|
|
64338
|
+
path: relativePath2,
|
|
64339
|
+
values,
|
|
64340
|
+
crudType
|
|
64341
|
+
}
|
|
64342
|
+
);
|
|
64139
64343
|
const NestedForm = (props) => {
|
|
64140
64344
|
const FormPortal = useFormPortal();
|
|
64141
64345
|
const id2 = React__default.useMemo(() => uuid(), [props.id, props.initialValues]);
|
|
@@ -65470,9 +65674,9 @@ const editorVariants = cva(
|
|
|
65470
65674
|
ai: "w-full px-0 text-base md:text-sm",
|
|
65471
65675
|
aiChat: "max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm",
|
|
65472
65676
|
comment: cn$2("rounded-none border-none bg-transparent text-sm"),
|
|
65473
|
-
default: "size-full px-
|
|
65474
|
-
demo: "size-full px-
|
|
65475
|
-
fullWidth: "size-full px-
|
|
65677
|
+
default: "size-full px-2 sm:px-4 pt-2 text-base",
|
|
65678
|
+
demo: "size-full px-2 sm:px-4 pt-2 text-base h-[650px]",
|
|
65679
|
+
fullWidth: "size-full px-2 sm:px-4 pt-4 pb-72 text-base",
|
|
65476
65680
|
none: "",
|
|
65477
65681
|
select: "px-3 py-2 text-base data-readonly:w-fit"
|
|
65478
65682
|
}
|
|
@@ -65904,7 +66108,7 @@ const EmbedButton = ({ editor, templates }) => {
|
|
|
65904
66108
|
className: "w-full p-2 border border-gray-300 rounded",
|
|
65905
66109
|
onChange: filterChange
|
|
65906
66110
|
}
|
|
65907
|
-
), /* @__PURE__ */ React__default.createElement(DropdownMenuSeparator, null), filteredTemplates.map((template) => /* @__PURE__ */ React__default.createElement(
|
|
66111
|
+
), /* @__PURE__ */ React__default.createElement(DropdownMenuSeparator$1, null), filteredTemplates.map((template) => /* @__PURE__ */ React__default.createElement(
|
|
65908
66112
|
DropdownMenuItem$1,
|
|
65909
66113
|
{
|
|
65910
66114
|
key: template.name,
|
|
@@ -119276,7 +119480,7 @@ class LocalSearchClient {
|
|
|
119276
119480
|
}
|
|
119277
119481
|
}
|
|
119278
119482
|
function ModalBuilder(modalProps) {
|
|
119279
|
-
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(ModalPopup, null, /* @__PURE__ */ React__default.createElement(ModalHeader, null,
|
|
119483
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(ModalPopup, null, /* @__PURE__ */ React__default.createElement(ModalHeader, null, modalProps.title), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, modalProps.message && (typeof modalProps.message === "string" ? /* @__PURE__ */ React__default.createElement("p", null, modalProps.message) : modalProps.message), modalProps.error && /* @__PURE__ */ React__default.createElement(ErrorLabel, null, modalProps.error), modalProps.children), /* @__PURE__ */ React__default.createElement(ModalActions, null, modalProps.actions.map((action) => /* @__PURE__ */ React__default.createElement(AsyncButton, { key: action.name, ...action })))));
|
|
119280
119484
|
}
|
|
119281
119485
|
const ErrorLabel = ({ style = {}, ...props }) => /* @__PURE__ */ React__default.createElement("p", { style: { ...style, color: "var(--tina-color-error)" }, ...props });
|
|
119282
119486
|
const AsyncButton = ({ name, primary, action }) => {
|
|
@@ -120490,7 +120694,7 @@ const PageWrapper = ({
|
|
|
120490
120694
|
headerClassName,
|
|
120491
120695
|
children
|
|
120492
120696
|
}) => {
|
|
120493
|
-
return /* @__PURE__ */ React__default.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__default.createElement("div", { className: `py-2
|
|
120697
|
+
return /* @__PURE__ */ React__default.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__default.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React__default.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React__default.createElement(BranchButton, null), /* @__PURE__ */ React__default.createElement(BranchPreviewButton, null))), children);
|
|
120494
120698
|
};
|
|
120495
120699
|
const PageHeader = ({
|
|
120496
120700
|
children
|
|
@@ -120882,7 +121086,7 @@ const CollectionListPage = () => {
|
|
|
120882
121086
|
},
|
|
120883
121087
|
close: () => setFolderModalOpen(false)
|
|
120884
121088
|
}
|
|
120885
|
-
), /* @__PURE__ */ React__default.createElement(PageHeader, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.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__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
|
|
121089
|
+
), /* @__PURE__ */ React__default.createElement(PageHeader, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.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__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
|
|
120886
121090
|
"label",
|
|
120887
121091
|
{
|
|
120888
121092
|
htmlFor: "sort",
|
|
@@ -120972,7 +121176,7 @@ const CollectionListPage = () => {
|
|
|
120972
121176
|
},
|
|
120973
121177
|
to: "/collections/new-folder",
|
|
120974
121178
|
className: cn$1(
|
|
120975
|
-
"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-
|
|
121179
|
+
"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",
|
|
120976
121180
|
collection.templates && "opacity-50 pointer-events-none cursor-not-allowed"
|
|
120977
121181
|
),
|
|
120978
121182
|
"aria-disabled": !!collection.templates,
|
|
@@ -121010,7 +121214,7 @@ const CollectionListPage = () => {
|
|
|
121010
121214
|
"new",
|
|
121011
121215
|
collectionName
|
|
121012
121216
|
].join("/")}`,
|
|
121013
|
-
className: "inline-flex items-center font-medium focus:outline-none focus:ring-
|
|
121217
|
+
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"
|
|
121014
121218
|
},
|
|
121015
121219
|
/* @__PURE__ */ React__default.createElement(FaFile, { className: "mr-2" }),
|
|
121016
121220
|
"Add File"
|
|
@@ -122578,6 +122782,7 @@ export {
|
|
|
122578
122782
|
Dismissible,
|
|
122579
122783
|
DragHandle,
|
|
122580
122784
|
DragIcon,
|
|
122785
|
+
DropdownButton,
|
|
122581
122786
|
DummyMediaStore,
|
|
122582
122787
|
DuplicateIcon,
|
|
122583
122788
|
EditIcon,
|
|
@@ -122707,6 +122912,7 @@ export {
|
|
|
122707
122912
|
TinaCloudAuthProvider,
|
|
122708
122913
|
TinaCloudAuthWall,
|
|
122709
122914
|
TinaCloudProvider,
|
|
122915
|
+
TinaExtendedIcon,
|
|
122710
122916
|
TinaField,
|
|
122711
122917
|
TinaForm,
|
|
122712
122918
|
TinaIcon,
|