tinacms 0.0.0-c8b1d84-20241003015733 → 0.0.0-d08af95-20241024210716
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/cache/node-cache.d.ts +1 -0
- package/dist/client.js +19 -17
- package/dist/client.mjs +2 -2
- package/dist/index.js +1528 -904
- package/dist/index.mjs +1497 -869
- package/dist/{node-cache-7fa2452c.mjs → node-cache-4c336858.mjs} +18 -11
- package/dist/rich-text/index.d.ts +3 -0
- package/dist/rich-text/index.js +45 -12
- package/dist/rich-text/index.mjs +45 -12
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/fixed-toolbar-buttons.d.ts +0 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +11 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +39 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +27 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-dropdown-menu.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +14 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +13 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/text-area.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +1 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +4 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +58 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +7 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +1 -1
- package/package.json +8 -6
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/plate"), require("
|
|
3
|
-
})(this, function(exports2, zod, React, reactDom, plate,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate"), require("@udecode/plate-common"), require("@udecode/plate-slash-command"), require("slate-react"), require("@udecode/plate-code-block"), require("@monaco-editor/react"), require("@headlessui/react"), require("class-variance-authority"), require("lucide-react"), require("mermaid"), require("@udecode/plate-heading"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-table"), require("@udecode/plate-resizable"), require("@radix-ui/react-popover"), require("@radix-ui/react-slot"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-separator"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("react-color"), require("color-string"), require("react-dropzone"), require("clsx"), require("tailwind-merge"), require("cmdk"), require("is-hotkey"), require("slate"), require("lodash.get"), require("moment"), require("date-fns"), require("@udecode/plate-link"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-tooltip"), require("@udecode/plate-paragraph"), require("@udecode/plate-block-quote"), require("@udecode/plate-floating"), require("@react-hook/window-size"), require("graphql"), require("graphql-tag"), require("@tinacms/schema-tools"), require("yup"), require("@graphql-inspector/core"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate", "@udecode/plate-common", "@udecode/plate-slash-command", "slate-react", "@udecode/plate-code-block", "@monaco-editor/react", "@headlessui/react", "class-variance-authority", "lucide-react", "mermaid", "@udecode/plate-heading", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-table", "@udecode/plate-resizable", "@radix-ui/react-popover", "@radix-ui/react-slot", "@radix-ui/react-dropdown-menu", "@radix-ui/react-separator", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "react-color", "color-string", "react-dropzone", "clsx", "tailwind-merge", "cmdk", "is-hotkey", "slate", "lodash.get", "moment", "date-fns", "@udecode/plate-link", "@radix-ui/react-toolbar", "@radix-ui/react-tooltip", "@udecode/plate-paragraph", "@udecode/plate-block-quote", "@udecode/plate-floating", "@react-hook/window-size", "graphql", "graphql-tag", "@tinacms/schema-tools", "yup", "@graphql-inspector/core", "react-router-dom", "@tinacms/mdx"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
|
|
3
|
+
})(this, function(exports2, zod, React, reactDom, cn$1, plate, plateCommon, plateSlashCommand, slateReact, plateCodeBlock, MonacoEditor, react, classVarianceAuthority, lucideReact, mermaid, plateHeading, react$1, plateCombobox, plateTable, plateResizable, PopoverPrimitive, reactSlot, DropdownMenuPrimitive, SeparatorPrimitive, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, pkg$1, pkg, dropzone, clsx, tailwindMerge, cmdk, isHotkey, slate, get, moment, dateFns, plateLink, ToolbarPrimitive, TooltipPrimitive, plateParagraph, plateBlockQuote, plateFloating, windowSize, graphql, gql, schemaTools, yup, core, reactRouterDom, mdx) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -26,13 +26,13 @@ var __publicField = (obj, key, value) => {
|
|
|
26
26
|
}
|
|
27
27
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
28
28
|
const PopoverPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(PopoverPrimitive);
|
|
29
|
+
const DropdownMenuPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DropdownMenuPrimitive);
|
|
30
|
+
const SeparatorPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SeparatorPrimitive);
|
|
29
31
|
const pkg__namespace$1 = /* @__PURE__ */ _interopNamespaceDefault(pkg$1);
|
|
30
32
|
const pkg__namespace = /* @__PURE__ */ _interopNamespaceDefault(pkg);
|
|
31
33
|
const dropzone__namespace = /* @__PURE__ */ _interopNamespaceDefault(dropzone);
|
|
32
34
|
const ToolbarPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(ToolbarPrimitive);
|
|
33
|
-
const SeparatorPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SeparatorPrimitive);
|
|
34
35
|
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
35
|
-
const DropdownMenuPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DropdownMenuPrimitive);
|
|
36
36
|
const yup__namespace = /* @__PURE__ */ _interopNamespaceDefault(yup);
|
|
37
37
|
const ModalProvider = ({ children }) => {
|
|
38
38
|
const [modalRootContainerRef, setModalRootContainerRef] = React.useState(
|
|
@@ -882,6 +882,20 @@ var __publicField = (obj, key, value) => {
|
|
|
882
882
|
const useTemplates = () => {
|
|
883
883
|
return React.useContext(EditorContext);
|
|
884
884
|
};
|
|
885
|
+
const BlockquoteElement = cn$1.withRef(
|
|
886
|
+
({ children, className, ...props }, ref) => {
|
|
887
|
+
return /* @__PURE__ */ React.createElement(
|
|
888
|
+
plateCommon.PlateElement,
|
|
889
|
+
{
|
|
890
|
+
asChild: true,
|
|
891
|
+
className: cn$1.cn("my-1 border-l-2 pl-6 italic", className),
|
|
892
|
+
ref,
|
|
893
|
+
...props
|
|
894
|
+
},
|
|
895
|
+
/* @__PURE__ */ React.createElement("blockquote", null, children)
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
);
|
|
885
899
|
function classNames$1(...classes) {
|
|
886
900
|
return classes.filter(Boolean).join(" ");
|
|
887
901
|
}
|
|
@@ -891,170 +905,690 @@ var __publicField = (obj, key, value) => {
|
|
|
891
905
|
(c) => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
|
892
906
|
);
|
|
893
907
|
};
|
|
894
|
-
|
|
908
|
+
function ChevronDownIcon(props, svgRef) {
|
|
909
|
+
return /* @__PURE__ */ React__namespace.createElement("svg", Object.assign({
|
|
910
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
911
|
+
viewBox: "0 0 20 20",
|
|
912
|
+
fill: "currentColor",
|
|
913
|
+
"aria-hidden": "true",
|
|
914
|
+
ref: svgRef
|
|
915
|
+
}, props), /* @__PURE__ */ React__namespace.createElement("path", {
|
|
916
|
+
fillRule: "evenodd",
|
|
917
|
+
d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
|
|
918
|
+
clipRule: "evenodd"
|
|
919
|
+
}));
|
|
920
|
+
}
|
|
921
|
+
const ForwardRef = React__namespace.forwardRef(ChevronDownIcon);
|
|
922
|
+
const ChevronDownIcon$1 = ForwardRef;
|
|
923
|
+
const Autocomplete = ({
|
|
924
|
+
value,
|
|
925
|
+
onChange,
|
|
926
|
+
defaultQuery,
|
|
927
|
+
items: items2
|
|
928
|
+
}) => {
|
|
929
|
+
const [query, setQuery] = React.useState(defaultQuery ?? "");
|
|
930
|
+
const filteredItems = React.useMemo(() => {
|
|
931
|
+
try {
|
|
932
|
+
const reFilter = new RegExp(query, "i");
|
|
933
|
+
const _items = items2.filter((item) => reFilter.test(item.label));
|
|
934
|
+
if (_items.length === 0)
|
|
935
|
+
return items2;
|
|
936
|
+
return _items;
|
|
937
|
+
} catch (err) {
|
|
938
|
+
return items2;
|
|
939
|
+
}
|
|
940
|
+
}, [items2, query]);
|
|
895
941
|
return /* @__PURE__ */ React.createElement(
|
|
896
|
-
|
|
942
|
+
react.Combobox,
|
|
897
943
|
{
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
className: "h-5 w-5",
|
|
903
|
-
viewBox: "0 0 24 24",
|
|
904
|
-
height: "1em",
|
|
905
|
-
width: "1em",
|
|
906
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
944
|
+
value,
|
|
945
|
+
onChange,
|
|
946
|
+
as: "div",
|
|
947
|
+
className: "relative inline-block text-left z-20"
|
|
907
948
|
},
|
|
908
|
-
/* @__PURE__ */ React.createElement("
|
|
909
|
-
|
|
949
|
+
/* @__PURE__ */ React.createElement("div", { className: "mt-1" }, /* @__PURE__ */ React.createElement("div", { className: "relative w-full cursor-default overflow-hidden rounded-lg bg-white text-left shadow-md sm:text-sm" }, /* @__PURE__ */ React.createElement(
|
|
950
|
+
react.ComboboxInput,
|
|
951
|
+
{
|
|
952
|
+
className: "w-full border-none py-2 pl-3 pr-10 text-sm leading-5 text-gray-900 focus:ring-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-teal-300",
|
|
953
|
+
displayValue: (item) => (item == null ? void 0 : item.label) ?? "Plain Text",
|
|
954
|
+
onChange: (event) => setQuery(event.target.value),
|
|
955
|
+
onClick: (ev) => ev.stopPropagation()
|
|
956
|
+
}
|
|
957
|
+
), /* @__PURE__ */ React.createElement(react.ComboboxButton, { className: "absolute inset-y-0 right-0 flex items-center pr-2" }, /* @__PURE__ */ React.createElement(
|
|
958
|
+
ChevronDownIcon$1,
|
|
959
|
+
{
|
|
960
|
+
className: "h-5 w-5 text-gray-400",
|
|
961
|
+
"aria-hidden": "true"
|
|
962
|
+
}
|
|
963
|
+
)))),
|
|
964
|
+
/* @__PURE__ */ React.createElement(
|
|
965
|
+
react.Transition,
|
|
966
|
+
{
|
|
967
|
+
enter: "transition ease-out duration-100",
|
|
968
|
+
enterFrom: "transform opacity-0 scale-95",
|
|
969
|
+
enterTo: "transform opacity-100 scale-100",
|
|
970
|
+
leave: "transition ease-in duration-75",
|
|
971
|
+
leaveFrom: "transform opacity-100 scale-100",
|
|
972
|
+
leaveTo: "transform opacity-0 scale-95"
|
|
973
|
+
},
|
|
974
|
+
/* @__PURE__ */ React.createElement(react.ComboboxOptions, { className: "origin-top-right absolute right-0 mt-1 w-full max-h-[300px] overflow-y-auto rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" }, filteredItems.map((item) => /* @__PURE__ */ React.createElement(react.ComboboxOption, { key: item.key, value: item }, ({ focus }) => /* @__PURE__ */ React.createElement(
|
|
975
|
+
"button",
|
|
976
|
+
{
|
|
977
|
+
className: classNames$1(
|
|
978
|
+
focus ? "bg-gray-100 text-gray-900" : "text-gray-700",
|
|
979
|
+
"block px-4 py-2 text-xs w-full text-right"
|
|
980
|
+
)
|
|
981
|
+
},
|
|
982
|
+
item.render(item)
|
|
983
|
+
))))
|
|
984
|
+
)
|
|
910
985
|
);
|
|
911
986
|
};
|
|
912
|
-
|
|
913
|
-
"
|
|
914
|
-
{
|
|
915
|
-
viewBox: "0 0 24 24",
|
|
916
|
-
height: "48",
|
|
917
|
-
width: "48",
|
|
918
|
-
focusable: "false",
|
|
919
|
-
role: "img",
|
|
920
|
-
fill: "currentColor",
|
|
921
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
922
|
-
...props
|
|
923
|
-
},
|
|
924
|
-
/* @__PURE__ */ React.createElement("path", { d: "M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6zm10 13h5a1 1 0 0 0 1-1v-5h-6v6zm-2-6H5v5a1 1 0 0 0 1 1h5v-6zm2-2h6V6a1 1 0 0 0-1-1h-5v6zm-2-6H6a1 1 0 0 0-1 1v5h6V5z" })
|
|
925
|
-
);
|
|
926
|
-
const borderBottom = (props) => /* @__PURE__ */ React.createElement(
|
|
927
|
-
"svg",
|
|
928
|
-
{
|
|
929
|
-
viewBox: "0 0 24 24",
|
|
930
|
-
height: "48",
|
|
931
|
-
width: "48",
|
|
932
|
-
focusable: "false",
|
|
933
|
-
role: "img",
|
|
934
|
-
fill: "currentColor",
|
|
935
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
936
|
-
...props
|
|
937
|
-
},
|
|
938
|
-
/* @__PURE__ */ React.createElement("path", { d: "M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm-2 7a1 1 0 1 1 2 0 1 1 0 0 0 1 1h12a1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm17-8a1 1 0 0 0-1 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1-1zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3z" })
|
|
939
|
-
);
|
|
940
|
-
const borderLeft = (props) => /* @__PURE__ */ React.createElement(
|
|
941
|
-
"svg",
|
|
942
|
-
{
|
|
943
|
-
viewBox: "0 0 24 24",
|
|
944
|
-
height: "48",
|
|
945
|
-
width: "48",
|
|
946
|
-
focusable: "false",
|
|
947
|
-
role: "img",
|
|
948
|
-
fill: "currentColor",
|
|
949
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
950
|
-
...props
|
|
951
|
-
},
|
|
952
|
-
/* @__PURE__ */ React.createElement("path", { d: "M6 21a1 1 0 1 0 0-2 1 1 0 0 1-1-1V6a1 1 0 0 1 1-1 1 1 0 0 0 0-2 3 3 0 0 0-3 3v12a3 3 0 0 0 3 3zm7-16a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm6 6a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm4-17a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zm-1 17a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z" })
|
|
953
|
-
);
|
|
954
|
-
const borderNone = (props) => /* @__PURE__ */ React.createElement(
|
|
955
|
-
"svg",
|
|
956
|
-
{
|
|
957
|
-
viewBox: "0 0 24 24",
|
|
958
|
-
height: "48",
|
|
959
|
-
width: "48",
|
|
960
|
-
focusable: "false",
|
|
961
|
-
role: "img",
|
|
962
|
-
fill: "currentColor",
|
|
963
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
964
|
-
...props
|
|
965
|
-
},
|
|
966
|
-
/* @__PURE__ */ React.createElement("path", { d: "M14 4a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-9 7a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-6 10a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zM7 20a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3z" })
|
|
967
|
-
);
|
|
968
|
-
const borderRight = (props) => /* @__PURE__ */ React.createElement(
|
|
969
|
-
"svg",
|
|
970
|
-
{
|
|
971
|
-
viewBox: "0 0 24 24",
|
|
972
|
-
height: "48",
|
|
973
|
-
width: "48",
|
|
974
|
-
focusable: "false",
|
|
975
|
-
role: "img",
|
|
976
|
-
fill: "currentColor",
|
|
977
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
978
|
-
...props
|
|
979
|
-
},
|
|
980
|
-
/* @__PURE__ */ React.createElement("path", { d: "M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm9 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zM6 3a1 1 0 0 1 0 2 1 1 0 0 0-1 1 1 1 0 0 1-2 0 3 3 0 0 1 3-3zm1 17a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1V6a1 1 0 0 0-1-1 1 1 0 1 1 0-2 3 3 0 0 1 3 3v12a3 3 0 0 1-3 3z" })
|
|
981
|
-
);
|
|
982
|
-
const borderTop = (props) => /* @__PURE__ */ React.createElement(
|
|
983
|
-
"svg",
|
|
984
|
-
{
|
|
985
|
-
viewBox: "0 0 24 24",
|
|
986
|
-
height: "48",
|
|
987
|
-
width: "48",
|
|
988
|
-
focusable: "false",
|
|
989
|
-
role: "img",
|
|
990
|
-
fill: "currentColor",
|
|
991
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
992
|
-
...props
|
|
993
|
-
},
|
|
994
|
-
/* @__PURE__ */ React.createElement("path", { d: "M3 6a1 1 0 0 0 2 0 1 1 0 0 1 1-1h12a1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3zm2 5a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-8 1a1 1 0 1 0 0-2 1 1 0 0 1-1-1 1 1 0 1 0-2 0 3 3 0 0 0 3 3zm11-1a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z" })
|
|
995
|
-
);
|
|
996
|
-
classVarianceAuthority.cva("", {
|
|
997
|
-
variants: {
|
|
998
|
-
variant: {
|
|
999
|
-
toolbar: "size-5",
|
|
1000
|
-
menuItem: "mr-2 size-5"
|
|
1001
|
-
},
|
|
1002
|
-
size: {
|
|
1003
|
-
sm: "mr-2 size-4",
|
|
1004
|
-
md: "mr-2 size-6"
|
|
1005
|
-
}
|
|
1006
|
-
},
|
|
1007
|
-
defaultVariants: {}
|
|
987
|
+
MonacoEditor.loader.config({
|
|
988
|
+
paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs" }
|
|
1008
989
|
});
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
{
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
/* @__PURE__ */ React.createElement(
|
|
1020
|
-
"path",
|
|
1021
|
-
{
|
|
1022
|
-
clipRule: "evenodd",
|
|
1023
|
-
d: "M8.5 3H13V13H8.5V3ZM7.5 2H8.5H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H8.5H7.5H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H7.5ZM7.5 13H3L3 3H7.5V13Z",
|
|
1024
|
-
fill: "#595E6F",
|
|
1025
|
-
fillRule: "evenodd"
|
|
1026
|
-
}
|
|
1027
|
-
)
|
|
1028
|
-
);
|
|
1029
|
-
const ThreeColumnOutlined = (props) => /* @__PURE__ */ React.createElement(
|
|
1030
|
-
"svg",
|
|
1031
|
-
{
|
|
1032
|
-
fill: "none",
|
|
1033
|
-
height: "16",
|
|
1034
|
-
viewBox: "0 0 16 16",
|
|
1035
|
-
width: "16",
|
|
1036
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1037
|
-
...props
|
|
1038
|
-
},
|
|
1039
|
-
/* @__PURE__ */ React.createElement(
|
|
1040
|
-
"path",
|
|
1041
|
-
{
|
|
1042
|
-
clipRule: "evenodd",
|
|
1043
|
-
d: "M9.25 3H6.75V13H9.25V3ZM9.25 2H6.75H5.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H5.75H6.75H9.25H10.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H10.25H9.25ZM10.25 3V13H13V3H10.25ZM3 13H5.75V3H3L3 13Z",
|
|
1044
|
-
fill: "#4C5161",
|
|
1045
|
-
fillRule: "evenodd"
|
|
990
|
+
let retryCount = 0;
|
|
991
|
+
const retryFocus = (ref) => {
|
|
992
|
+
if (ref.current) {
|
|
993
|
+
ref.current.focus();
|
|
994
|
+
} else {
|
|
995
|
+
if (retryCount < 30) {
|
|
996
|
+
setTimeout(() => {
|
|
997
|
+
retryCount = retryCount + 1;
|
|
998
|
+
retryFocus(ref);
|
|
999
|
+
}, 100);
|
|
1046
1000
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
const MINIMUM_HEIGHT = 75;
|
|
1004
|
+
const CodeBlock = ({
|
|
1005
|
+
attributes,
|
|
1006
|
+
editor,
|
|
1007
|
+
element,
|
|
1008
|
+
language: restrictLanguage,
|
|
1009
|
+
onChangeCallback,
|
|
1010
|
+
defaultValue,
|
|
1011
|
+
...props
|
|
1012
|
+
}) => {
|
|
1013
|
+
const [navigateAway, setNavigateAway] = React.useState(null);
|
|
1014
|
+
const monaco = MonacoEditor.useMonaco();
|
|
1015
|
+
const monacoEditorRef = React.useRef(null);
|
|
1016
|
+
const selected = slateReact.useSelected();
|
|
1017
|
+
const [height, setHeight] = React.useState(MINIMUM_HEIGHT);
|
|
1018
|
+
React.useEffect(() => {
|
|
1019
|
+
if (selected && plateCommon.isCollapsed(editor.selection)) {
|
|
1020
|
+
retryFocus(monacoEditorRef);
|
|
1021
|
+
}
|
|
1022
|
+
}, [selected, monacoEditorRef.current]);
|
|
1023
|
+
const value = element.value || "";
|
|
1024
|
+
if (typeof value !== "string") {
|
|
1025
|
+
throw new Error("Element must be of type string for code block");
|
|
1026
|
+
}
|
|
1027
|
+
const language = restrictLanguage || element.lang;
|
|
1028
|
+
const id = React.useMemo(() => uuid(), []);
|
|
1029
|
+
const languages = React.useMemo(() => {
|
|
1030
|
+
const defaultLangSet = { "": "plain text" };
|
|
1031
|
+
if (!monaco)
|
|
1032
|
+
return defaultLangSet;
|
|
1033
|
+
return monaco.languages.getLanguages().reduce((ac, cv) => {
|
|
1034
|
+
if (cv.id === "plaintext")
|
|
1035
|
+
return ac;
|
|
1036
|
+
return { ...ac, [cv.id]: cv.id };
|
|
1037
|
+
}, defaultLangSet);
|
|
1038
|
+
}, [monaco]);
|
|
1039
|
+
React.useEffect(() => {
|
|
1040
|
+
if (monaco) {
|
|
1041
|
+
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
|
|
1042
|
+
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
1043
|
+
// disable errors
|
|
1044
|
+
noSemanticValidation: true,
|
|
1045
|
+
noSyntaxValidation: true
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
}, [monaco]);
|
|
1049
|
+
const items2 = Object.entries(languages).map(([key, label]) => ({
|
|
1050
|
+
key,
|
|
1051
|
+
label,
|
|
1052
|
+
render: (item) => item.label
|
|
1053
|
+
}));
|
|
1054
|
+
const currentItem = React.useMemo(() => {
|
|
1055
|
+
return items2.find((item) => item.key === language) ?? {
|
|
1056
|
+
key: "",
|
|
1057
|
+
label: "Plain Text"
|
|
1058
|
+
};
|
|
1059
|
+
}, [items2, language]);
|
|
1060
|
+
React.useEffect(() => {
|
|
1061
|
+
if (navigateAway) {
|
|
1062
|
+
setNavigateAway(null);
|
|
1063
|
+
switch (navigateAway) {
|
|
1064
|
+
case "remove":
|
|
1065
|
+
{
|
|
1066
|
+
plateCommon.focusEditor(editor);
|
|
1067
|
+
plateCommon.setNodes(
|
|
1068
|
+
editor,
|
|
1069
|
+
{
|
|
1070
|
+
type: "p",
|
|
1071
|
+
children: [{ text: "" }],
|
|
1072
|
+
lang: void 0,
|
|
1073
|
+
value: void 0
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
match: (n) => {
|
|
1077
|
+
if (plateCommon.isElement(n) && n.type === element.type) {
|
|
1078
|
+
return true;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
break;
|
|
1085
|
+
case "insertNext":
|
|
1086
|
+
{
|
|
1087
|
+
plateCommon.insertNodes(
|
|
1088
|
+
editor,
|
|
1089
|
+
[
|
|
1090
|
+
{
|
|
1091
|
+
type: plateCommon.ELEMENT_DEFAULT,
|
|
1092
|
+
children: [{ text: "" }],
|
|
1093
|
+
lang: void 0,
|
|
1094
|
+
value: void 0
|
|
1095
|
+
}
|
|
1096
|
+
],
|
|
1097
|
+
{ select: true }
|
|
1098
|
+
);
|
|
1099
|
+
plateCommon.focusEditor(editor);
|
|
1100
|
+
}
|
|
1101
|
+
break;
|
|
1102
|
+
case "up":
|
|
1103
|
+
{
|
|
1104
|
+
const path = plateCommon.findNodePath(editor, element);
|
|
1105
|
+
if (!path) {
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
const previousNodePath = plateCommon.getPointBefore(editor, path);
|
|
1109
|
+
if (!previousNodePath) {
|
|
1110
|
+
plateCommon.focusEditor(editor);
|
|
1111
|
+
plateCommon.insertNodes(
|
|
1112
|
+
editor,
|
|
1113
|
+
[
|
|
1114
|
+
{
|
|
1115
|
+
type: plateCommon.ELEMENT_DEFAULT,
|
|
1116
|
+
children: [{ text: "" }],
|
|
1117
|
+
lang: void 0,
|
|
1118
|
+
value: void 0
|
|
1119
|
+
}
|
|
1120
|
+
],
|
|
1121
|
+
// Insert a new node at the current path, resulting in the code_block
|
|
1122
|
+
// moving down one block
|
|
1123
|
+
{ at: path, select: true }
|
|
1124
|
+
);
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
plateCommon.focusEditor(editor, previousNodePath);
|
|
1128
|
+
}
|
|
1129
|
+
break;
|
|
1130
|
+
case "down": {
|
|
1131
|
+
const path = plateCommon.findNodePath(editor, element);
|
|
1132
|
+
if (!path) {
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1135
|
+
const nextNodePath = plateCommon.getPointAfter(editor, path);
|
|
1136
|
+
if (!nextNodePath) {
|
|
1137
|
+
plateCommon.insertNodes(
|
|
1138
|
+
editor,
|
|
1139
|
+
[
|
|
1140
|
+
{
|
|
1141
|
+
type: plateCommon.ELEMENT_DEFAULT,
|
|
1142
|
+
children: [{ text: "" }],
|
|
1143
|
+
lang: void 0,
|
|
1144
|
+
value: void 0
|
|
1145
|
+
}
|
|
1146
|
+
],
|
|
1147
|
+
{ select: true }
|
|
1148
|
+
);
|
|
1149
|
+
plateCommon.focusEditor(editor);
|
|
1150
|
+
} else {
|
|
1151
|
+
plateCommon.focusEditor(editor, nextNodePath);
|
|
1152
|
+
}
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}, [navigateAway]);
|
|
1158
|
+
function handleEditorDidMount(monacoEditor, monaco2) {
|
|
1159
|
+
monacoEditorRef.current = monacoEditor;
|
|
1160
|
+
monacoEditor.onDidContentSizeChange(() => {
|
|
1161
|
+
setHeight(
|
|
1162
|
+
monacoEditor.getContentHeight() > MINIMUM_HEIGHT ? monacoEditor.getContentHeight() : MINIMUM_HEIGHT
|
|
1163
|
+
);
|
|
1164
|
+
monacoEditor.layout();
|
|
1165
|
+
});
|
|
1166
|
+
plateCommon.setNodes(editor, { value: defaultValue, lang: language });
|
|
1167
|
+
monacoEditor.addCommand(monaco2.KeyMod.Shift | monaco2.KeyCode.Enter, () => {
|
|
1168
|
+
if (monacoEditor.hasTextFocus()) {
|
|
1169
|
+
setNavigateAway("insertNext");
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
monacoEditor.onKeyDown((l) => {
|
|
1173
|
+
if (l.code === "ArrowUp") {
|
|
1174
|
+
const selection = monacoEditor.getSelection();
|
|
1175
|
+
if (selection.endLineNumber === 1 && selection.startLineNumber === 1) {
|
|
1176
|
+
setNavigateAway("up");
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
if (l.code === "ArrowDown") {
|
|
1180
|
+
const selection = monacoEditor.getSelection();
|
|
1181
|
+
const totalLines = monacoEditor.getModel().getLineCount();
|
|
1182
|
+
if (selection.endLineNumber === totalLines && selection.startLineNumber === totalLines) {
|
|
1183
|
+
setNavigateAway("down");
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
if (l.code === "Backspace") {
|
|
1187
|
+
const selection = monacoEditor.getSelection();
|
|
1188
|
+
if (selection.endColumn === 1 && selection.endLineNumber === 1 && selection.positionColumn === 1 && selection.positionLineNumber === 1 && selection.selectionStartColumn === 1 && selection.selectionStartLineNumber === 1 && selection.startColumn === 1 && selection.startLineNumber === 1) {
|
|
1189
|
+
setNavigateAway("remove");
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
return /* @__PURE__ */ React.createElement(
|
|
1195
|
+
"div",
|
|
1196
|
+
{
|
|
1197
|
+
...attributes,
|
|
1198
|
+
className: "relative mb-2 mt-0.5 rounded-lg shadow-md p-2 border-gray-200 border"
|
|
1199
|
+
},
|
|
1200
|
+
/* @__PURE__ */ React.createElement("style", null, `.monaco-editor .editor-widget {
|
|
1201
|
+
display: none !important;
|
|
1202
|
+
visibility: hidden !important;
|
|
1203
|
+
}`),
|
|
1204
|
+
props.children,
|
|
1205
|
+
/* @__PURE__ */ React.createElement("div", { contentEditable: false }, !restrictLanguage && /* @__PURE__ */ React.createElement("div", { className: "flex justify-between pb-2" }, /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement(
|
|
1206
|
+
Autocomplete,
|
|
1207
|
+
{
|
|
1208
|
+
items: items2,
|
|
1209
|
+
value: currentItem,
|
|
1210
|
+
defaultQuery: "plaintext",
|
|
1211
|
+
onChange: (item) => plateCommon.setNodes(editor, { lang: item.key })
|
|
1212
|
+
}
|
|
1213
|
+
)), /* @__PURE__ */ React.createElement("div", { style: { height: `${height}px` } }, /* @__PURE__ */ React.createElement(
|
|
1214
|
+
MonacoEditor,
|
|
1215
|
+
{
|
|
1216
|
+
path: id,
|
|
1217
|
+
onMount: handleEditorDidMount,
|
|
1218
|
+
options: {
|
|
1219
|
+
scrollBeyondLastLine: false,
|
|
1220
|
+
// automaticLayout: true,
|
|
1221
|
+
tabSize: 2,
|
|
1222
|
+
disableLayerHinting: true,
|
|
1223
|
+
accessibilitySupport: "off",
|
|
1224
|
+
codeLens: false,
|
|
1225
|
+
wordWrap: "on",
|
|
1226
|
+
minimap: {
|
|
1227
|
+
enabled: false
|
|
1228
|
+
},
|
|
1229
|
+
fontSize: 14,
|
|
1230
|
+
lineHeight: 2,
|
|
1231
|
+
formatOnPaste: true,
|
|
1232
|
+
lineNumbers: "off",
|
|
1233
|
+
formatOnType: true,
|
|
1234
|
+
fixedOverflowWidgets: true,
|
|
1235
|
+
// Takes too much horizontal space for iframe
|
|
1236
|
+
folding: false,
|
|
1237
|
+
renderLineHighlight: "none",
|
|
1238
|
+
scrollbar: {
|
|
1239
|
+
verticalScrollbarSize: 1,
|
|
1240
|
+
horizontalScrollbarSize: 1,
|
|
1241
|
+
// https://github.com/microsoft/monaco-editor/issues/2007#issuecomment-644425664
|
|
1242
|
+
alwaysConsumeMouseWheel: false
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
language: String(language),
|
|
1246
|
+
value: String(element.value),
|
|
1247
|
+
onChange: (value2) => {
|
|
1248
|
+
onChangeCallback == null ? void 0 : onChangeCallback(value2);
|
|
1249
|
+
plateCommon.setNodes(editor, { value: value2, lang: language });
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
)))
|
|
1253
|
+
);
|
|
1254
|
+
};
|
|
1255
|
+
const CodeBlockElement = cn$1.withRef(
|
|
1256
|
+
({ className, ...props }, ref) => {
|
|
1257
|
+
const { element } = props;
|
|
1258
|
+
const state = plateCodeBlock.useCodeBlockElementState({ element });
|
|
1259
|
+
return /* @__PURE__ */ React.createElement(
|
|
1260
|
+
plateCommon.PlateElement,
|
|
1261
|
+
{
|
|
1262
|
+
className: cn$1.cn("relative py-1", state.className, className),
|
|
1263
|
+
ref,
|
|
1264
|
+
...props
|
|
1265
|
+
},
|
|
1266
|
+
/* @__PURE__ */ React.createElement(CodeBlock, { ...props })
|
|
1267
|
+
);
|
|
1268
|
+
}
|
|
1269
|
+
);
|
|
1270
|
+
const CodeLeaf = cn$1.withRef(
|
|
1271
|
+
({ children, className, ...props }, ref) => {
|
|
1272
|
+
return /* @__PURE__ */ React.createElement(
|
|
1273
|
+
plateCommon.PlateLeaf,
|
|
1274
|
+
{
|
|
1275
|
+
asChild: true,
|
|
1276
|
+
className: cn$1.cn(
|
|
1277
|
+
"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm",
|
|
1278
|
+
className
|
|
1279
|
+
),
|
|
1280
|
+
ref,
|
|
1281
|
+
...props
|
|
1282
|
+
},
|
|
1283
|
+
/* @__PURE__ */ React.createElement("code", null, children)
|
|
1284
|
+
);
|
|
1285
|
+
}
|
|
1286
|
+
);
|
|
1287
|
+
const CodeLineElement = cn$1.withRef((props, ref) => /* @__PURE__ */ React.createElement(plateCommon.PlateElement, { ref, ...props }));
|
|
1288
|
+
const CodeSyntaxLeaf = cn$1.withRef(
|
|
1289
|
+
({ children, ...props }, ref) => {
|
|
1290
|
+
const { leaf } = props;
|
|
1291
|
+
const { tokenProps } = plateCodeBlock.useCodeSyntaxLeaf({ leaf });
|
|
1292
|
+
return /* @__PURE__ */ React.createElement(plateCommon.PlateLeaf, { ref, ...props }, /* @__PURE__ */ React.createElement("span", { ...tokenProps }, children));
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1295
|
+
const listVariants = classVarianceAuthority.cva("m-0 ps-6", {
|
|
1296
|
+
variants: {
|
|
1297
|
+
variant: {
|
|
1298
|
+
ol: "list-decimal",
|
|
1299
|
+
ul: "list-disc [&_ul]:list-[circle] [&_ul_ul]:list-[square]"
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
const ListElementVariants = cn$1.withVariants(plateCommon.PlateElement, listVariants, [
|
|
1304
|
+
"variant"
|
|
1305
|
+
]);
|
|
1306
|
+
const ListElement = cn$1.withRef(
|
|
1307
|
+
({ children, variant = "ul", ...props }, ref) => {
|
|
1308
|
+
const Component = variant;
|
|
1309
|
+
return /* @__PURE__ */ React.createElement(ListElementVariants, { asChild: true, ref, variant, ...props }, /* @__PURE__ */ React.createElement(Component, null, children));
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
const ELEMENT_MERMAID = "mermaid";
|
|
1313
|
+
const createMermaidPlugin = plateCommon.createPluginFactory({
|
|
1314
|
+
isElement: true,
|
|
1315
|
+
isVoid: true,
|
|
1316
|
+
isInline: false,
|
|
1317
|
+
key: ELEMENT_MERMAID
|
|
1318
|
+
});
|
|
1319
|
+
const MermaidElementWithRef = ({ config }) => {
|
|
1320
|
+
const mermaidRef = React.useRef(null);
|
|
1321
|
+
React.useEffect(() => {
|
|
1322
|
+
if (mermaidRef.current) {
|
|
1323
|
+
mermaid.initialize({ startOnLoad: true });
|
|
1324
|
+
mermaid.init();
|
|
1325
|
+
}
|
|
1326
|
+
}, [config]);
|
|
1327
|
+
return /* @__PURE__ */ React.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
1328
|
+
};
|
|
1329
|
+
const Bubble = ({ children }) => {
|
|
1330
|
+
return /* @__PURE__ */ React.createElement("div", { className: "bg-blue-600 rounded-full p-2 transition-transform duration-200 ease-in-out hover:scale-110" }, children);
|
|
1331
|
+
};
|
|
1332
|
+
const ErrorMsg = ({ error }) => {
|
|
1333
|
+
if (error) {
|
|
1334
|
+
return /* @__PURE__ */ React.createElement(
|
|
1335
|
+
"div",
|
|
1336
|
+
{
|
|
1337
|
+
contentEditable: false,
|
|
1338
|
+
className: "font-mono bg-red-600 text-white p-2 rounded-md cursor-default"
|
|
1339
|
+
},
|
|
1340
|
+
error
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
return null;
|
|
1344
|
+
};
|
|
1345
|
+
const DEFAULT_MERMAID_CONFIG = `%% This won't render without implementing a rendering engine (e.g. mermaid on npm)
|
|
1346
|
+
flowchart TD
|
|
1347
|
+
id1(this is an example flow diagram)
|
|
1348
|
+
--> id2(modify me to see changes!)
|
|
1349
|
+
id2
|
|
1350
|
+
--> id3(Click the top button to preview the changes)
|
|
1351
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1352
|
+
const MermaidElement = cn$1.withRef(
|
|
1353
|
+
({ children, nodeProps, element, ...props }, ref) => {
|
|
1354
|
+
const [mermaidConfig, setMermaidConfig] = React.useState(
|
|
1355
|
+
element.value || DEFAULT_MERMAID_CONFIG
|
|
1356
|
+
);
|
|
1357
|
+
const [isEditing, setIsEditing] = React.useState(
|
|
1358
|
+
mermaidConfig === DEFAULT_MERMAID_CONFIG || false
|
|
1359
|
+
);
|
|
1360
|
+
const [mermaidError, setMermaidError] = React.useState(null);
|
|
1361
|
+
const node = {
|
|
1362
|
+
type: ELEMENT_MERMAID,
|
|
1363
|
+
value: mermaidConfig,
|
|
1364
|
+
children: [{ type: "text", text: "" }]
|
|
1365
|
+
};
|
|
1366
|
+
React.useEffect(() => {
|
|
1367
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1368
|
+
setMermaidError(null);
|
|
1369
|
+
}
|
|
1370
|
+
}, [mermaidConfig]);
|
|
1371
|
+
mermaid.parseError = (err) => {
|
|
1372
|
+
setMermaidError(
|
|
1373
|
+
String(err.message) || "An error occurred while parsing the diagram."
|
|
1374
|
+
);
|
|
1375
|
+
};
|
|
1376
|
+
return /* @__PURE__ */ React.createElement(plateCommon.PlateElement, { element, ref, ...props }, /* @__PURE__ */ React.createElement("div", { className: "relative group" }, /* @__PURE__ */ React.createElement("div", { className: "absolute top-2 right-2 z-10 space-y-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 ease-in-out" }, /* @__PURE__ */ React.createElement(Bubble, null, isEditing ? /* @__PURE__ */ React.createElement(
|
|
1377
|
+
lucideReact.Eye,
|
|
1378
|
+
{
|
|
1379
|
+
className: "w-5 h-5 fill-white cursor-pointer",
|
|
1380
|
+
onClick: () => {
|
|
1381
|
+
setIsEditing(!isEditing);
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
) : /* @__PURE__ */ React.createElement(
|
|
1385
|
+
lucideReact.SquarePen,
|
|
1386
|
+
{
|
|
1387
|
+
className: "w-5 h-5 fill-white cursor-pointer",
|
|
1388
|
+
onClick: () => {
|
|
1389
|
+
setIsEditing(!isEditing);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
))), isEditing ? /* @__PURE__ */ React.createElement(
|
|
1393
|
+
CodeBlock,
|
|
1394
|
+
{
|
|
1395
|
+
children: "",
|
|
1396
|
+
language: "yaml",
|
|
1397
|
+
...props,
|
|
1398
|
+
element: node,
|
|
1399
|
+
defaultValue: mermaidConfig,
|
|
1400
|
+
onChangeCallback: (value) => setMermaidConfig(value)
|
|
1401
|
+
}
|
|
1402
|
+
) : /* @__PURE__ */ React.createElement(MermaidElementWithRef, { config: mermaidConfig })), children, /* @__PURE__ */ React.createElement(ErrorMsg, { error: mermaidError }));
|
|
1403
|
+
}
|
|
1404
|
+
);
|
|
1405
|
+
const RawMarkdown = () => {
|
|
1406
|
+
return /* @__PURE__ */ React.createElement(
|
|
1407
|
+
"svg",
|
|
1408
|
+
{
|
|
1409
|
+
stroke: "currentColor",
|
|
1410
|
+
fill: "currentColor",
|
|
1411
|
+
strokeWidth: 0,
|
|
1412
|
+
role: "img",
|
|
1413
|
+
className: "h-5 w-5",
|
|
1414
|
+
viewBox: "0 0 24 24",
|
|
1415
|
+
height: "1em",
|
|
1416
|
+
width: "1em",
|
|
1417
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1418
|
+
},
|
|
1419
|
+
/* @__PURE__ */ React.createElement("title", null),
|
|
1420
|
+
/* @__PURE__ */ React.createElement("path", { d: "M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z" })
|
|
1421
|
+
);
|
|
1422
|
+
};
|
|
1423
|
+
const MermaidIcon = () => /* @__PURE__ */ React.createElement(
|
|
1424
|
+
"svg",
|
|
1425
|
+
{
|
|
1426
|
+
width: "100%",
|
|
1427
|
+
height: "100%",
|
|
1428
|
+
viewBox: "0 0 491 491",
|
|
1429
|
+
version: "1.1",
|
|
1430
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1431
|
+
fillRule: "evenodd",
|
|
1432
|
+
clipRule: "evenodd",
|
|
1433
|
+
strokeLinejoin: "round",
|
|
1434
|
+
strokeMiterlimit: 2
|
|
1435
|
+
},
|
|
1436
|
+
/* @__PURE__ */ React.createElement("path", { d: "M490.16,84.61C490.16,37.912 452.248,0 405.55,0L84.61,0C37.912,0 0,37.912 0,84.61L0,405.55C0,452.248 37.912,490.16 84.61,490.16L405.55,490.16C452.248,490.16 490.16,452.248 490.16,405.55L490.16,84.61Z" }),
|
|
1437
|
+
/* @__PURE__ */ React.createElement(
|
|
1438
|
+
"path",
|
|
1439
|
+
{
|
|
1440
|
+
d: "M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z",
|
|
1441
|
+
fill: "white",
|
|
1442
|
+
fillRule: "nonzero"
|
|
1443
|
+
}
|
|
1444
|
+
)
|
|
1445
|
+
);
|
|
1446
|
+
const borderAll = (props) => /* @__PURE__ */ React.createElement(
|
|
1447
|
+
"svg",
|
|
1448
|
+
{
|
|
1449
|
+
viewBox: "0 0 24 24",
|
|
1450
|
+
height: "48",
|
|
1451
|
+
width: "48",
|
|
1452
|
+
focusable: "false",
|
|
1453
|
+
role: "img",
|
|
1454
|
+
fill: "currentColor",
|
|
1455
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1456
|
+
...props
|
|
1457
|
+
},
|
|
1458
|
+
/* @__PURE__ */ React.createElement("path", { d: "M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6zm10 13h5a1 1 0 0 0 1-1v-5h-6v6zm-2-6H5v5a1 1 0 0 0 1 1h5v-6zm2-2h6V6a1 1 0 0 0-1-1h-5v6zm-2-6H6a1 1 0 0 0-1 1v5h6V5z" })
|
|
1459
|
+
);
|
|
1460
|
+
const borderBottom = (props) => /* @__PURE__ */ React.createElement(
|
|
1461
|
+
"svg",
|
|
1462
|
+
{
|
|
1463
|
+
viewBox: "0 0 24 24",
|
|
1464
|
+
height: "48",
|
|
1465
|
+
width: "48",
|
|
1466
|
+
focusable: "false",
|
|
1467
|
+
role: "img",
|
|
1468
|
+
fill: "currentColor",
|
|
1469
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1470
|
+
...props
|
|
1471
|
+
},
|
|
1472
|
+
/* @__PURE__ */ React.createElement("path", { d: "M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm-2 7a1 1 0 1 1 2 0 1 1 0 0 0 1 1h12a1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm17-8a1 1 0 0 0-1 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1-1zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3z" })
|
|
1473
|
+
);
|
|
1474
|
+
const borderLeft = (props) => /* @__PURE__ */ React.createElement(
|
|
1475
|
+
"svg",
|
|
1476
|
+
{
|
|
1477
|
+
viewBox: "0 0 24 24",
|
|
1478
|
+
height: "48",
|
|
1479
|
+
width: "48",
|
|
1480
|
+
focusable: "false",
|
|
1481
|
+
role: "img",
|
|
1482
|
+
fill: "currentColor",
|
|
1483
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1484
|
+
...props
|
|
1485
|
+
},
|
|
1486
|
+
/* @__PURE__ */ React.createElement("path", { d: "M6 21a1 1 0 1 0 0-2 1 1 0 0 1-1-1V6a1 1 0 0 1 1-1 1 1 0 0 0 0-2 3 3 0 0 0-3 3v12a3 3 0 0 0 3 3zm7-16a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm6 6a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm4-17a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zm-1 17a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z" })
|
|
1487
|
+
);
|
|
1488
|
+
const borderNone = (props) => /* @__PURE__ */ React.createElement(
|
|
1489
|
+
"svg",
|
|
1490
|
+
{
|
|
1491
|
+
viewBox: "0 0 24 24",
|
|
1492
|
+
height: "48",
|
|
1493
|
+
width: "48",
|
|
1494
|
+
focusable: "false",
|
|
1495
|
+
role: "img",
|
|
1496
|
+
fill: "currentColor",
|
|
1497
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1498
|
+
...props
|
|
1499
|
+
},
|
|
1500
|
+
/* @__PURE__ */ React.createElement("path", { d: "M14 4a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-9 7a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-6 10a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zM7 20a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3z" })
|
|
1501
|
+
);
|
|
1502
|
+
const borderRight = (props) => /* @__PURE__ */ React.createElement(
|
|
1503
|
+
"svg",
|
|
1504
|
+
{
|
|
1505
|
+
viewBox: "0 0 24 24",
|
|
1506
|
+
height: "48",
|
|
1507
|
+
width: "48",
|
|
1508
|
+
focusable: "false",
|
|
1509
|
+
role: "img",
|
|
1510
|
+
fill: "currentColor",
|
|
1511
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1512
|
+
...props
|
|
1513
|
+
},
|
|
1514
|
+
/* @__PURE__ */ React.createElement("path", { d: "M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm9 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zM6 3a1 1 0 0 1 0 2 1 1 0 0 0-1 1 1 1 0 0 1-2 0 3 3 0 0 1 3-3zm1 17a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1V6a1 1 0 0 0-1-1 1 1 0 1 1 0-2 3 3 0 0 1 3 3v12a3 3 0 0 1-3 3z" })
|
|
1515
|
+
);
|
|
1516
|
+
const borderTop = (props) => /* @__PURE__ */ React.createElement(
|
|
1517
|
+
"svg",
|
|
1518
|
+
{
|
|
1519
|
+
viewBox: "0 0 24 24",
|
|
1520
|
+
height: "48",
|
|
1521
|
+
width: "48",
|
|
1522
|
+
focusable: "false",
|
|
1523
|
+
role: "img",
|
|
1524
|
+
fill: "currentColor",
|
|
1525
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1526
|
+
...props
|
|
1527
|
+
},
|
|
1528
|
+
/* @__PURE__ */ React.createElement("path", { d: "M3 6a1 1 0 0 0 2 0 1 1 0 0 1 1-1h12a1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3zm2 5a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-8 1a1 1 0 1 0 0-2 1 1 0 0 1-1-1 1 1 0 1 0-2 0 3 3 0 0 0 3 3zm11-1a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z" })
|
|
1529
|
+
);
|
|
1530
|
+
const iconVariants = classVarianceAuthority.cva("", {
|
|
1531
|
+
variants: {
|
|
1532
|
+
variant: {
|
|
1533
|
+
toolbar: "size-5",
|
|
1534
|
+
menuItem: "mr-2 size-5"
|
|
1535
|
+
},
|
|
1536
|
+
size: {
|
|
1537
|
+
sm: "mr-2 size-4",
|
|
1538
|
+
md: "mr-2 size-6"
|
|
1539
|
+
}
|
|
1540
|
+
},
|
|
1541
|
+
defaultVariants: {}
|
|
1542
|
+
});
|
|
1543
|
+
const DoubleColumnOutlined = (props) => /* @__PURE__ */ React.createElement(
|
|
1544
|
+
"svg",
|
|
1545
|
+
{
|
|
1546
|
+
fill: "none",
|
|
1547
|
+
height: "16",
|
|
1548
|
+
viewBox: "0 0 16 16",
|
|
1549
|
+
width: "16",
|
|
1550
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1551
|
+
...props
|
|
1552
|
+
},
|
|
1553
|
+
/* @__PURE__ */ React.createElement(
|
|
1554
|
+
"path",
|
|
1555
|
+
{
|
|
1556
|
+
clipRule: "evenodd",
|
|
1557
|
+
d: "M8.5 3H13V13H8.5V3ZM7.5 2H8.5H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H8.5H7.5H3C2.44772 14 2 13.5523 2 13V3C2 2.44772 2.44772 2 3 2H7.5ZM7.5 13H3L3 3H7.5V13Z",
|
|
1558
|
+
fill: "#595E6F",
|
|
1559
|
+
fillRule: "evenodd"
|
|
1560
|
+
}
|
|
1561
|
+
)
|
|
1562
|
+
);
|
|
1563
|
+
const ThreeColumnOutlined = (props) => /* @__PURE__ */ React.createElement(
|
|
1564
|
+
"svg",
|
|
1565
|
+
{
|
|
1566
|
+
fill: "none",
|
|
1567
|
+
height: "16",
|
|
1568
|
+
viewBox: "0 0 16 16",
|
|
1569
|
+
width: "16",
|
|
1570
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1571
|
+
...props
|
|
1572
|
+
},
|
|
1573
|
+
/* @__PURE__ */ React.createElement(
|
|
1574
|
+
"path",
|
|
1575
|
+
{
|
|
1576
|
+
clipRule: "evenodd",
|
|
1577
|
+
d: "M9.25 3H6.75V13H9.25V3ZM9.25 2H6.75H5.75H3C2.44772 2 2 2.44772 2 3V13C2 13.5523 2.44772 14 3 14H5.75H6.75H9.25H10.25H13C13.5523 14 14 13.5523 14 13V3C14 2.44772 13.5523 2 13 2H10.25H9.25ZM10.25 3V13H13V3H10.25ZM3 13H5.75V3H3L3 13Z",
|
|
1578
|
+
fill: "#4C5161",
|
|
1579
|
+
fillRule: "evenodd"
|
|
1580
|
+
}
|
|
1581
|
+
)
|
|
1582
|
+
);
|
|
1583
|
+
const RightSideDoubleColumnOutlined = (props) => /* @__PURE__ */ React.createElement(
|
|
1584
|
+
"svg",
|
|
1585
|
+
{
|
|
1586
|
+
fill: "none",
|
|
1587
|
+
height: "16",
|
|
1588
|
+
viewBox: "0 0 16 16",
|
|
1589
|
+
width: "16",
|
|
1590
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1591
|
+
...props
|
|
1058
1592
|
},
|
|
1059
1593
|
/* @__PURE__ */ React.createElement(
|
|
1060
1594
|
"path",
|
|
@@ -1149,6 +1683,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1149
1683
|
clear: lucideReact.X,
|
|
1150
1684
|
close: lucideReact.X,
|
|
1151
1685
|
// code: Code2,
|
|
1686
|
+
paint: lucideReact.PaintBucket,
|
|
1152
1687
|
codeblock: lucideReact.FileCode,
|
|
1153
1688
|
color: lucideReact.Baseline,
|
|
1154
1689
|
column: lucideReact.RectangleVertical,
|
|
@@ -1174,6 +1709,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1174
1709
|
lineHeight: lucideReact.WrapText,
|
|
1175
1710
|
// link: Link2,
|
|
1176
1711
|
minus: lucideReact.Minus,
|
|
1712
|
+
mermaid: MermaidIcon,
|
|
1177
1713
|
more: lucideReact.MoreHorizontal,
|
|
1178
1714
|
// ol: ListOrdered,
|
|
1179
1715
|
outdent: lucideReact.Outdent,
|
|
@@ -1548,7 +2084,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1548
2084
|
setHasEmpty
|
|
1549
2085
|
]
|
|
1550
2086
|
);
|
|
1551
|
-
const store = react.useComboboxStore({
|
|
2087
|
+
const store = react$1.useComboboxStore({
|
|
1552
2088
|
setValue: (newValue) => React.startTransition(() => setValue(newValue))
|
|
1553
2089
|
});
|
|
1554
2090
|
const items2 = store.useState("items");
|
|
@@ -1558,7 +2094,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1558
2094
|
}
|
|
1559
2095
|
}, [items2, store]);
|
|
1560
2096
|
return /* @__PURE__ */ React.createElement("span", { contentEditable: false }, /* @__PURE__ */ React.createElement(
|
|
1561
|
-
react.ComboboxProvider,
|
|
2097
|
+
react$1.ComboboxProvider,
|
|
1562
2098
|
{
|
|
1563
2099
|
open: (items2.length > 0 || hasEmpty) && (!hideWhenNoValue || value.length > 0),
|
|
1564
2100
|
store
|
|
@@ -1573,7 +2109,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1573
2109
|
showTrigger,
|
|
1574
2110
|
trigger
|
|
1575
2111
|
} = React.useContext(InlineComboboxContext);
|
|
1576
|
-
const store = react.useComboboxContext();
|
|
2112
|
+
const store = react$1.useComboboxContext();
|
|
1577
2113
|
const value = store.useState("value");
|
|
1578
2114
|
const ref = plateCommon.useComposedRef(propRef, contextRef);
|
|
1579
2115
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, showTrigger && trigger, /* @__PURE__ */ React.createElement("span", { className: "relative min-h-[1lh]" }, /* @__PURE__ */ React.createElement(
|
|
@@ -1584,7 +2120,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1584
2120
|
},
|
|
1585
2121
|
value || ""
|
|
1586
2122
|
), /* @__PURE__ */ React.createElement(
|
|
1587
|
-
react.Combobox,
|
|
2123
|
+
react$1.Combobox,
|
|
1588
2124
|
{
|
|
1589
2125
|
autoSelect: true,
|
|
1590
2126
|
className: cn$1.cn(
|
|
@@ -1603,8 +2139,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1603
2139
|
className,
|
|
1604
2140
|
...props
|
|
1605
2141
|
}) => {
|
|
1606
|
-
return /* @__PURE__ */ React.createElement(react.Portal, null, /* @__PURE__ */ React.createElement(
|
|
1607
|
-
react.ComboboxPopover,
|
|
2142
|
+
return /* @__PURE__ */ React.createElement(react$1.Portal, null, /* @__PURE__ */ React.createElement(
|
|
2143
|
+
react$1.ComboboxPopover,
|
|
1608
2144
|
{
|
|
1609
2145
|
className: cn$1.cn(
|
|
1610
2146
|
"z-[9999999] max-h-[288px] w-[300px] overflow-y-auto rounded-md bg-white shadow-md",
|
|
@@ -1636,7 +2172,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1636
2172
|
}) => {
|
|
1637
2173
|
const { value } = props;
|
|
1638
2174
|
const { filter, removeInput } = React.useContext(InlineComboboxContext);
|
|
1639
|
-
const store = react.useComboboxContext();
|
|
2175
|
+
const store = react$1.useComboboxContext();
|
|
1640
2176
|
const search = filter && store.useState("value");
|
|
1641
2177
|
const visible = React.useMemo(
|
|
1642
2178
|
() => !filter || filter({ keywords, value }, search),
|
|
@@ -1645,7 +2181,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1645
2181
|
if (!visible)
|
|
1646
2182
|
return null;
|
|
1647
2183
|
return /* @__PURE__ */ React.createElement(
|
|
1648
|
-
react.ComboboxItem,
|
|
2184
|
+
react$1.ComboboxItem,
|
|
1649
2185
|
{
|
|
1650
2186
|
className: cn$1.cn(comboboxItemVariants(), className),
|
|
1651
2187
|
onClick: (event) => {
|
|
@@ -1661,7 +2197,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1661
2197
|
className
|
|
1662
2198
|
}) => {
|
|
1663
2199
|
const { setHasEmpty } = React.useContext(InlineComboboxContext);
|
|
1664
|
-
const store = react.useComboboxContext();
|
|
2200
|
+
const store = react$1.useComboboxContext();
|
|
1665
2201
|
const items2 = store.useState("items");
|
|
1666
2202
|
React.useEffect(() => {
|
|
1667
2203
|
setHasEmpty(true);
|
|
@@ -1744,417 +2280,482 @@ var __publicField = (obj, key, value) => {
|
|
|
1744
2280
|
);
|
|
1745
2281
|
}
|
|
1746
2282
|
);
|
|
1747
|
-
const
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
className: cn$1.cn("my-1 border-l-2 pl-6 italic", className),
|
|
1771
|
-
ref,
|
|
1772
|
-
...props
|
|
1773
|
-
},
|
|
1774
|
-
/* @__PURE__ */ React.createElement("blockquote", null, children)
|
|
1775
|
-
);
|
|
1776
|
-
}
|
|
1777
|
-
);
|
|
1778
|
-
const CodeLeaf = cn$1.withRef(
|
|
1779
|
-
({ children, className, ...props }, ref) => {
|
|
1780
|
-
return /* @__PURE__ */ React.createElement(
|
|
1781
|
-
plateCommon.PlateLeaf,
|
|
1782
|
-
{
|
|
1783
|
-
asChild: true,
|
|
1784
|
-
className: cn$1.cn(
|
|
1785
|
-
"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm",
|
|
1786
|
-
className
|
|
1787
|
-
),
|
|
1788
|
-
ref,
|
|
1789
|
-
...props
|
|
1790
|
-
},
|
|
1791
|
-
/* @__PURE__ */ React.createElement("code", null, children)
|
|
1792
|
-
);
|
|
1793
|
-
}
|
|
1794
|
-
);
|
|
1795
|
-
const CodeLineElement = cn$1.withRef((props, ref) => /* @__PURE__ */ React.createElement(plateCommon.PlateElement, { ref, ...props }));
|
|
1796
|
-
const CodeSyntaxLeaf = cn$1.withRef(
|
|
1797
|
-
({ children, ...props }, ref) => {
|
|
1798
|
-
const { leaf } = props;
|
|
1799
|
-
const { tokenProps } = plateCodeBlock.useCodeSyntaxLeaf({ leaf });
|
|
1800
|
-
return /* @__PURE__ */ React.createElement(plateCommon.PlateLeaf, { ref, ...props }, /* @__PURE__ */ React.createElement("span", { ...tokenProps }, children));
|
|
1801
|
-
}
|
|
1802
|
-
);
|
|
1803
|
-
function ChevronDownIcon(props, svgRef) {
|
|
1804
|
-
return /* @__PURE__ */ React__namespace.createElement("svg", Object.assign({
|
|
1805
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1806
|
-
viewBox: "0 0 20 20",
|
|
1807
|
-
fill: "currentColor",
|
|
1808
|
-
"aria-hidden": "true",
|
|
1809
|
-
ref: svgRef
|
|
1810
|
-
}, props), /* @__PURE__ */ React__namespace.createElement("path", {
|
|
1811
|
-
fillRule: "evenodd",
|
|
1812
|
-
d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
|
|
1813
|
-
clipRule: "evenodd"
|
|
1814
|
-
}));
|
|
1815
|
-
}
|
|
1816
|
-
const ForwardRef = React__namespace.forwardRef(ChevronDownIcon);
|
|
1817
|
-
const ChevronDownIcon$1 = ForwardRef;
|
|
1818
|
-
const Autocomplete = ({
|
|
1819
|
-
value,
|
|
1820
|
-
onChange,
|
|
1821
|
-
defaultQuery,
|
|
1822
|
-
items: items2
|
|
1823
|
-
}) => {
|
|
1824
|
-
const [query, setQuery] = React.useState(defaultQuery ?? "");
|
|
1825
|
-
const filteredItems = React.useMemo(() => {
|
|
1826
|
-
try {
|
|
1827
|
-
const reFilter = new RegExp(query, "i");
|
|
1828
|
-
const _items = items2.filter((item) => reFilter.test(item.label));
|
|
1829
|
-
if (_items.length === 0)
|
|
1830
|
-
return items2;
|
|
1831
|
-
return _items;
|
|
1832
|
-
} catch (err) {
|
|
1833
|
-
return items2;
|
|
1834
|
-
}
|
|
1835
|
-
}, [items2, query]);
|
|
2283
|
+
const TableCellElement = cn$1.withRef(({ children, className, hideBorder, isHeader, style, ...props }, ref) => {
|
|
2284
|
+
var _a, _b, _c, _d;
|
|
2285
|
+
const { element } = props;
|
|
2286
|
+
const {
|
|
2287
|
+
borders,
|
|
2288
|
+
colIndex,
|
|
2289
|
+
colSpan,
|
|
2290
|
+
hovered,
|
|
2291
|
+
hoveredLeft,
|
|
2292
|
+
isSelectingCell,
|
|
2293
|
+
readOnly,
|
|
2294
|
+
rowIndex,
|
|
2295
|
+
rowSize,
|
|
2296
|
+
selected
|
|
2297
|
+
} = plateTable.useTableCellElementState();
|
|
2298
|
+
const { props: cellProps } = plateTable.useTableCellElement({ element: props.element });
|
|
2299
|
+
const resizableState = plateTable.useTableCellElementResizableState({
|
|
2300
|
+
colIndex,
|
|
2301
|
+
colSpan,
|
|
2302
|
+
rowIndex
|
|
2303
|
+
});
|
|
2304
|
+
const { bottomProps, hiddenLeft, leftProps, rightProps } = plateTable.useTableCellElementResizable(resizableState);
|
|
2305
|
+
const Cell = isHeader ? "th" : "td";
|
|
1836
2306
|
return /* @__PURE__ */ React.createElement(
|
|
1837
|
-
|
|
2307
|
+
plateCommon.PlateElement,
|
|
1838
2308
|
{
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
2309
|
+
asChild: true,
|
|
2310
|
+
className: cn$1.cn(
|
|
2311
|
+
"relative h-full overflow-visible border-none bg-background p-0",
|
|
2312
|
+
hideBorder && "before:border-none",
|
|
2313
|
+
element.background ? "bg-[--cellBackground]" : "bg-background",
|
|
2314
|
+
!hideBorder && cn$1.cn(
|
|
2315
|
+
isHeader && "text-left [&_>_*]:m-0",
|
|
2316
|
+
"before:size-full",
|
|
2317
|
+
selected && "before:z-10 before:bg-muted",
|
|
2318
|
+
"before:absolute before:box-border before:select-none before:content-['']",
|
|
2319
|
+
borders && cn$1.cn(
|
|
2320
|
+
((_a = borders.bottom) == null ? void 0 : _a.size) && `before:border-b before:border-b-border`,
|
|
2321
|
+
((_b = borders.right) == null ? void 0 : _b.size) && `before:border-r before:border-r-border`,
|
|
2322
|
+
((_c = borders.left) == null ? void 0 : _c.size) && `before:border-l before:border-l-border`,
|
|
2323
|
+
((_d = borders.top) == null ? void 0 : _d.size) && `before:border-t before:border-t-border`
|
|
2324
|
+
)
|
|
2325
|
+
),
|
|
2326
|
+
className
|
|
2327
|
+
),
|
|
2328
|
+
ref,
|
|
2329
|
+
...cellProps,
|
|
2330
|
+
...props,
|
|
2331
|
+
style: {
|
|
2332
|
+
"--cellBackground": element.background,
|
|
2333
|
+
...style
|
|
1851
2334
|
}
|
|
1852
|
-
|
|
1853
|
-
|
|
2335
|
+
},
|
|
2336
|
+
/* @__PURE__ */ React.createElement(Cell, null, /* @__PURE__ */ React.createElement(
|
|
2337
|
+
"div",
|
|
1854
2338
|
{
|
|
1855
|
-
className: "h-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
2339
|
+
className: "relative z-20 box-border h-full px-3 py-2",
|
|
2340
|
+
style: {
|
|
2341
|
+
minHeight: rowSize
|
|
2342
|
+
}
|
|
2343
|
+
},
|
|
2344
|
+
children
|
|
2345
|
+
), !isSelectingCell && /* @__PURE__ */ React.createElement(
|
|
2346
|
+
"div",
|
|
1861
2347
|
{
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
leave: "transition ease-in duration-75",
|
|
1866
|
-
leaveFrom: "transform opacity-100 scale-100",
|
|
1867
|
-
leaveTo: "transform opacity-0 scale-95"
|
|
2348
|
+
className: "group absolute top-0 size-full select-none",
|
|
2349
|
+
contentEditable: false,
|
|
2350
|
+
suppressContentEditableWarning: true
|
|
1868
2351
|
},
|
|
1869
|
-
|
|
1870
|
-
|
|
2352
|
+
!readOnly && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
2353
|
+
plateResizable.ResizeHandle,
|
|
1871
2354
|
{
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
2355
|
+
...rightProps,
|
|
2356
|
+
className: "-top-3 right-[-5px] w-[10px]"
|
|
2357
|
+
}
|
|
2358
|
+
), /* @__PURE__ */ React.createElement(
|
|
2359
|
+
plateResizable.ResizeHandle,
|
|
2360
|
+
{
|
|
2361
|
+
...bottomProps,
|
|
2362
|
+
className: "bottom-[-5px] h-[10px]"
|
|
2363
|
+
}
|
|
2364
|
+
), !hiddenLeft && /* @__PURE__ */ React.createElement(
|
|
2365
|
+
plateResizable.ResizeHandle,
|
|
2366
|
+
{
|
|
2367
|
+
...leftProps,
|
|
2368
|
+
className: "-top-3 left-[-5px] w-[10px]"
|
|
2369
|
+
}
|
|
2370
|
+
), hovered && /* @__PURE__ */ React.createElement(
|
|
2371
|
+
"div",
|
|
2372
|
+
{
|
|
2373
|
+
className: cn$1.cn(
|
|
2374
|
+
"absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring",
|
|
2375
|
+
"right-[-1.5px]"
|
|
1875
2376
|
)
|
|
1876
|
-
},
|
|
1877
|
-
item.render(item)
|
|
1878
|
-
))))
|
|
1879
|
-
)
|
|
1880
|
-
);
|
|
1881
|
-
};
|
|
1882
|
-
MonacoEditor.loader.config({
|
|
1883
|
-
paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs" }
|
|
1884
|
-
});
|
|
1885
|
-
let retryCount = 0;
|
|
1886
|
-
const retryFocus = (ref) => {
|
|
1887
|
-
if (ref.current) {
|
|
1888
|
-
ref.current.focus();
|
|
1889
|
-
} else {
|
|
1890
|
-
if (retryCount < 30) {
|
|
1891
|
-
setTimeout(() => {
|
|
1892
|
-
retryCount = retryCount + 1;
|
|
1893
|
-
retryFocus(ref);
|
|
1894
|
-
}, 100);
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
};
|
|
1898
|
-
const CodeBlock = ({
|
|
1899
|
-
attributes,
|
|
1900
|
-
editor,
|
|
1901
|
-
element,
|
|
1902
|
-
language: restrictLanguage,
|
|
1903
|
-
...props
|
|
1904
|
-
}) => {
|
|
1905
|
-
const [navigateAway, setNavigateAway] = React.useState(null);
|
|
1906
|
-
const monaco = MonacoEditor.useMonaco();
|
|
1907
|
-
const monacoEditorRef = React.useRef(null);
|
|
1908
|
-
const selected = slateReact.useSelected();
|
|
1909
|
-
const [height, setHeight] = React.useState(28);
|
|
1910
|
-
React.useEffect(() => {
|
|
1911
|
-
if (selected && plateCommon.isCollapsed(editor.selection)) {
|
|
1912
|
-
retryFocus(monacoEditorRef);
|
|
1913
|
-
}
|
|
1914
|
-
}, [selected, monacoEditorRef.current]);
|
|
1915
|
-
const value = element.value || "";
|
|
1916
|
-
if (typeof value !== "string") {
|
|
1917
|
-
throw new Error("Element must be of type string for code block");
|
|
1918
|
-
}
|
|
1919
|
-
const language = restrictLanguage || element.lang;
|
|
1920
|
-
const id = React.useMemo(() => uuid(), []);
|
|
1921
|
-
const languages = React.useMemo(() => {
|
|
1922
|
-
const defaultLangSet = { "": "plain text" };
|
|
1923
|
-
if (!monaco)
|
|
1924
|
-
return defaultLangSet;
|
|
1925
|
-
return monaco.languages.getLanguages().reduce((ac, cv) => {
|
|
1926
|
-
if (cv.id === "plaintext")
|
|
1927
|
-
return ac;
|
|
1928
|
-
return { ...ac, [cv.id]: cv.id };
|
|
1929
|
-
}, defaultLangSet);
|
|
1930
|
-
}, [monaco]);
|
|
1931
|
-
React.useEffect(() => {
|
|
1932
|
-
if (monaco) {
|
|
1933
|
-
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
|
|
1934
|
-
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
1935
|
-
// disable errors
|
|
1936
|
-
noSemanticValidation: true,
|
|
1937
|
-
noSyntaxValidation: true
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
}, [monaco]);
|
|
1941
|
-
const items2 = Object.entries(languages).map(([key, label]) => ({
|
|
1942
|
-
key,
|
|
1943
|
-
label,
|
|
1944
|
-
render: (item) => item.label
|
|
1945
|
-
}));
|
|
1946
|
-
const currentItem = React.useMemo(() => {
|
|
1947
|
-
return items2.find((item) => item.key === language) ?? {
|
|
1948
|
-
key: "",
|
|
1949
|
-
label: "Plain Text"
|
|
1950
|
-
};
|
|
1951
|
-
}, [items2, language]);
|
|
1952
|
-
React.useEffect(() => {
|
|
1953
|
-
if (navigateAway) {
|
|
1954
|
-
setNavigateAway(null);
|
|
1955
|
-
switch (navigateAway) {
|
|
1956
|
-
case "remove":
|
|
1957
|
-
{
|
|
1958
|
-
plateCommon.focusEditor(editor);
|
|
1959
|
-
plateCommon.setNodes(
|
|
1960
|
-
editor,
|
|
1961
|
-
{
|
|
1962
|
-
type: "p",
|
|
1963
|
-
children: [{ text: "" }],
|
|
1964
|
-
lang: void 0,
|
|
1965
|
-
value: void 0
|
|
1966
|
-
},
|
|
1967
|
-
{
|
|
1968
|
-
match: (n) => {
|
|
1969
|
-
if (plateCommon.isElement(n) && n.type === element.type) {
|
|
1970
|
-
return true;
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
);
|
|
1975
|
-
}
|
|
1976
|
-
break;
|
|
1977
|
-
case "insertNext":
|
|
1978
|
-
{
|
|
1979
|
-
plateCommon.insertNodes(
|
|
1980
|
-
editor,
|
|
1981
|
-
[
|
|
1982
|
-
{
|
|
1983
|
-
type: plateCommon.ELEMENT_DEFAULT,
|
|
1984
|
-
children: [{ text: "" }],
|
|
1985
|
-
lang: void 0,
|
|
1986
|
-
value: void 0
|
|
1987
|
-
}
|
|
1988
|
-
],
|
|
1989
|
-
{ select: true }
|
|
1990
|
-
);
|
|
1991
|
-
plateCommon.focusEditor(editor);
|
|
1992
|
-
}
|
|
1993
|
-
break;
|
|
1994
|
-
case "up":
|
|
1995
|
-
{
|
|
1996
|
-
const path = plateCommon.findNodePath(editor, element);
|
|
1997
|
-
if (!path) {
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
|
-
const previousNodePath = plateCommon.getPointBefore(editor, path);
|
|
2001
|
-
if (!previousNodePath) {
|
|
2002
|
-
plateCommon.focusEditor(editor);
|
|
2003
|
-
plateCommon.insertNodes(
|
|
2004
|
-
editor,
|
|
2005
|
-
[
|
|
2006
|
-
{
|
|
2007
|
-
type: plateCommon.ELEMENT_DEFAULT,
|
|
2008
|
-
children: [{ text: "" }],
|
|
2009
|
-
lang: void 0,
|
|
2010
|
-
value: void 0
|
|
2011
|
-
}
|
|
2012
|
-
],
|
|
2013
|
-
// Insert a new node at the current path, resulting in the code_block
|
|
2014
|
-
// moving down one block
|
|
2015
|
-
{ at: path, select: true }
|
|
2016
|
-
);
|
|
2017
|
-
return;
|
|
2018
|
-
}
|
|
2019
|
-
plateCommon.focusEditor(editor, previousNodePath);
|
|
2020
|
-
}
|
|
2021
|
-
break;
|
|
2022
|
-
case "down": {
|
|
2023
|
-
const path = plateCommon.findNodePath(editor, element);
|
|
2024
|
-
if (!path) {
|
|
2025
|
-
return;
|
|
2026
|
-
}
|
|
2027
|
-
const nextNodePath = plateCommon.getPointAfter(editor, path);
|
|
2028
|
-
if (!nextNodePath) {
|
|
2029
|
-
plateCommon.insertNodes(
|
|
2030
|
-
editor,
|
|
2031
|
-
[
|
|
2032
|
-
{
|
|
2033
|
-
type: plateCommon.ELEMENT_DEFAULT,
|
|
2034
|
-
children: [{ text: "" }],
|
|
2035
|
-
lang: void 0,
|
|
2036
|
-
value: void 0
|
|
2037
|
-
}
|
|
2038
|
-
],
|
|
2039
|
-
{ select: true }
|
|
2040
|
-
);
|
|
2041
|
-
plateCommon.focusEditor(editor);
|
|
2042
|
-
} else {
|
|
2043
|
-
plateCommon.focusEditor(editor, nextNodePath);
|
|
2044
|
-
}
|
|
2045
|
-
break;
|
|
2046
2377
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
monacoEditor.layout();
|
|
2055
|
-
});
|
|
2056
|
-
monacoEditor.addCommand(monaco2.KeyMod.Shift | monaco2.KeyCode.Enter, () => {
|
|
2057
|
-
if (monacoEditor.hasTextFocus()) {
|
|
2058
|
-
setNavigateAway("insertNext");
|
|
2059
|
-
}
|
|
2060
|
-
});
|
|
2061
|
-
monacoEditor.onKeyDown((l) => {
|
|
2062
|
-
if (l.code === "ArrowUp") {
|
|
2063
|
-
const selection = monacoEditor.getSelection();
|
|
2064
|
-
if (selection.endLineNumber === 1 && selection.startLineNumber === 1) {
|
|
2065
|
-
setNavigateAway("up");
|
|
2378
|
+
), hoveredLeft && /* @__PURE__ */ React.createElement(
|
|
2379
|
+
"div",
|
|
2380
|
+
{
|
|
2381
|
+
className: cn$1.cn(
|
|
2382
|
+
"absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring",
|
|
2383
|
+
"left-[-1.5px]"
|
|
2384
|
+
)
|
|
2066
2385
|
}
|
|
2386
|
+
))
|
|
2387
|
+
))
|
|
2388
|
+
);
|
|
2389
|
+
});
|
|
2390
|
+
TableCellElement.displayName = "TableCellElement";
|
|
2391
|
+
const TableCellHeaderElement = cn$1.withProps(TableCellElement, {
|
|
2392
|
+
isHeader: true
|
|
2393
|
+
});
|
|
2394
|
+
const buttonVariants$1 = classVarianceAuthority.cva(
|
|
2395
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
2396
|
+
{
|
|
2397
|
+
defaultVariants: {
|
|
2398
|
+
size: "default",
|
|
2399
|
+
variant: "default"
|
|
2400
|
+
},
|
|
2401
|
+
variants: {
|
|
2402
|
+
isMenu: {
|
|
2403
|
+
true: "h-auto w-full cursor-pointer justify-start"
|
|
2404
|
+
},
|
|
2405
|
+
size: {
|
|
2406
|
+
default: "h-10 px-4 py-2",
|
|
2407
|
+
icon: "size-10",
|
|
2408
|
+
lg: "h-11 rounded-md px-8",
|
|
2409
|
+
none: "",
|
|
2410
|
+
sm: "h-9 rounded-md px-3",
|
|
2411
|
+
sms: "size-9 rounded-md px-0",
|
|
2412
|
+
xs: "h-8 rounded-md px-3"
|
|
2413
|
+
},
|
|
2414
|
+
variant: {
|
|
2415
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
2416
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
2417
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
2418
|
+
inlineLink: "text-base text-primary underline underline-offset-4",
|
|
2419
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
2420
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
2421
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80"
|
|
2067
2422
|
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
);
|
|
2426
|
+
const Button$2 = cn$1.withRef(({ asChild = false, className, isMenu, size, variant, ...props }, ref) => {
|
|
2427
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
2428
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
2429
|
+
Comp,
|
|
2430
|
+
{
|
|
2431
|
+
className: cn$1.cn(buttonVariants$1({ className, isMenu, size, variant })),
|
|
2432
|
+
ref,
|
|
2433
|
+
...props
|
|
2434
|
+
}
|
|
2435
|
+
);
|
|
2436
|
+
});
|
|
2437
|
+
const DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
|
2438
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
2439
|
+
const DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
2440
|
+
const DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
2441
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
2442
|
+
const DropdownMenuSubTrigger = cn$1.withRef(({ children, className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
2443
|
+
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
2444
|
+
{
|
|
2445
|
+
className: cn$1.cn(
|
|
2446
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
2447
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2448
|
+
inset && "pl-8",
|
|
2449
|
+
className
|
|
2450
|
+
),
|
|
2451
|
+
ref,
|
|
2452
|
+
...props
|
|
2453
|
+
},
|
|
2454
|
+
children,
|
|
2455
|
+
/* @__PURE__ */ React.createElement(Icons.chevronRight, { className: "ml-auto size-4" })
|
|
2456
|
+
));
|
|
2457
|
+
const DropdownMenuSubContent = cn$1.withCn(
|
|
2458
|
+
DropdownMenuPrimitive__namespace.SubContent,
|
|
2459
|
+
"z-[99999] min-w-32 overflow-hidden rounded-md border bg-white p-1 text-black shadow-lg 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"
|
|
2460
|
+
);
|
|
2461
|
+
const DropdownMenuContentVariants = cn$1.withProps(DropdownMenuPrimitive__namespace.Content, {
|
|
2462
|
+
className: cn$1.cn(
|
|
2463
|
+
"z-[99999] min-w-32 overflow-hidden rounded-md border bg-white p-1 text-black shadow-md 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"
|
|
2464
|
+
),
|
|
2465
|
+
sideOffset: 4
|
|
2466
|
+
});
|
|
2467
|
+
const DropdownMenuContent = cn$1.withRef(({ ...props }, ref) => /* @__PURE__ */ React.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(DropdownMenuContentVariants, { ref, ...props })));
|
|
2468
|
+
const menuItemVariants = classVarianceAuthority.cva(
|
|
2469
|
+
cn$1.cn(
|
|
2470
|
+
"relative flex h-9 cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",
|
|
2471
|
+
"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
2472
|
+
),
|
|
2473
|
+
{
|
|
2474
|
+
variants: {
|
|
2475
|
+
inset: {
|
|
2476
|
+
true: "pl-8"
|
|
2074
2477
|
}
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
);
|
|
2481
|
+
const DropdownMenuItem = cn$1.withVariants(
|
|
2482
|
+
DropdownMenuPrimitive__namespace.Item,
|
|
2483
|
+
menuItemVariants,
|
|
2484
|
+
["inset"]
|
|
2485
|
+
);
|
|
2486
|
+
const DropdownMenuCheckboxItem = cn$1.withRef(({ children, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
2487
|
+
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
2488
|
+
{
|
|
2489
|
+
className: cn$1.cn(
|
|
2490
|
+
"relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2491
|
+
"cursor-pointer",
|
|
2492
|
+
className
|
|
2493
|
+
),
|
|
2494
|
+
ref,
|
|
2495
|
+
...props
|
|
2496
|
+
},
|
|
2497
|
+
/* @__PURE__ */ React.createElement("span", { className: "absolute left-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React.createElement(Icons.check, { className: "size-4" }))),
|
|
2498
|
+
children
|
|
2499
|
+
));
|
|
2500
|
+
const DropdownMenuRadioItem = cn$1.withRef(({ children, className, hideIcon, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
2501
|
+
DropdownMenuPrimitive__namespace.RadioItem,
|
|
2502
|
+
{
|
|
2503
|
+
className: cn$1.cn(
|
|
2504
|
+
"relative flex select-none items-center rounded-sm pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2505
|
+
"h-9 cursor-pointer px-2 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground",
|
|
2506
|
+
className
|
|
2507
|
+
),
|
|
2508
|
+
ref,
|
|
2509
|
+
...props
|
|
2510
|
+
},
|
|
2511
|
+
!hideIcon && /* @__PURE__ */ React.createElement("span", { className: "absolute right-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React.createElement(Icons.check, { className: "size-4" }))),
|
|
2512
|
+
children
|
|
2513
|
+
));
|
|
2514
|
+
const dropdownMenuLabelVariants = classVarianceAuthority.cva(
|
|
2515
|
+
cn$1.cn("select-none px-2 py-1.5 text-sm font-semibold"),
|
|
2516
|
+
{
|
|
2517
|
+
variants: {
|
|
2518
|
+
inset: {
|
|
2519
|
+
true: "pl-8"
|
|
2080
2520
|
}
|
|
2081
|
-
}
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
);
|
|
2524
|
+
const DropdownMenuLabel = cn$1.withVariants(
|
|
2525
|
+
DropdownMenuPrimitive__namespace.Label,
|
|
2526
|
+
dropdownMenuLabelVariants,
|
|
2527
|
+
["inset"]
|
|
2528
|
+
);
|
|
2529
|
+
const DropdownMenuSeparator = cn$1.withCn(
|
|
2530
|
+
DropdownMenuPrimitive__namespace.Separator,
|
|
2531
|
+
"-mx-1 my-1 h-px bg-muted"
|
|
2532
|
+
);
|
|
2533
|
+
cn$1.withCn(
|
|
2534
|
+
cn$1.createPrimitiveElement("span"),
|
|
2535
|
+
"ml-auto text-xs tracking-widest opacity-60"
|
|
2536
|
+
);
|
|
2537
|
+
const useOpenState = () => {
|
|
2538
|
+
const [open2, setOpen] = React.useState(false);
|
|
2539
|
+
const onOpenChange = React.useCallback(
|
|
2540
|
+
(_value = !open2) => {
|
|
2541
|
+
setOpen(_value);
|
|
2542
|
+
},
|
|
2543
|
+
[open2]
|
|
2544
|
+
);
|
|
2545
|
+
return {
|
|
2546
|
+
onOpenChange,
|
|
2547
|
+
open: open2
|
|
2548
|
+
};
|
|
2549
|
+
};
|
|
2550
|
+
const Popover$2 = PopoverPrimitive__namespace.Root;
|
|
2551
|
+
const popoverVariants = classVarianceAuthority.cva(
|
|
2552
|
+
"w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 print:hidden"
|
|
2553
|
+
);
|
|
2554
|
+
const PopoverContent$1 = cn$1.withRef(
|
|
2555
|
+
({ align = "center", className, sideOffset = 4, style, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
|
|
2556
|
+
PopoverPrimitive__namespace.Content,
|
|
2557
|
+
{
|
|
2558
|
+
align,
|
|
2559
|
+
className: cn$1.cn(popoverVariants(), className),
|
|
2560
|
+
ref,
|
|
2561
|
+
sideOffset,
|
|
2562
|
+
style: { zIndex: 1e3, ...style },
|
|
2563
|
+
...props
|
|
2564
|
+
}
|
|
2565
|
+
))
|
|
2566
|
+
);
|
|
2567
|
+
const separatorVariants = classVarianceAuthority.cva("shrink-0 bg-border", {
|
|
2568
|
+
defaultVariants: {
|
|
2569
|
+
orientation: "horizontal"
|
|
2570
|
+
},
|
|
2571
|
+
variants: {
|
|
2572
|
+
orientation: {
|
|
2573
|
+
horizontal: "h-px w-full",
|
|
2574
|
+
vertical: "h-full w-px"
|
|
2575
|
+
}
|
|
2082
2576
|
}
|
|
2577
|
+
});
|
|
2578
|
+
const Separator = cn$1.withVariants(
|
|
2579
|
+
cn$1.withProps(SeparatorPrimitive__namespace.Root, {
|
|
2580
|
+
decorative: true,
|
|
2581
|
+
orientation: "horizontal"
|
|
2582
|
+
}),
|
|
2583
|
+
separatorVariants
|
|
2584
|
+
);
|
|
2585
|
+
const TableBordersDropdownMenuContent = cn$1.withRef((props, ref) => {
|
|
2586
|
+
const {
|
|
2587
|
+
getOnSelectTableBorder,
|
|
2588
|
+
hasBottomBorder,
|
|
2589
|
+
hasLeftBorder,
|
|
2590
|
+
hasNoBorders,
|
|
2591
|
+
hasOuterBorders,
|
|
2592
|
+
hasRightBorder,
|
|
2593
|
+
hasTopBorder
|
|
2594
|
+
} = plateTable.useTableBordersDropdownMenuContentState();
|
|
2083
2595
|
return /* @__PURE__ */ React.createElement(
|
|
2084
|
-
|
|
2596
|
+
DropdownMenuContent,
|
|
2085
2597
|
{
|
|
2086
|
-
|
|
2087
|
-
className: "
|
|
2598
|
+
align: "start",
|
|
2599
|
+
className: cn$1.cn("min-w-[220px]"),
|
|
2600
|
+
ref,
|
|
2601
|
+
side: "right",
|
|
2602
|
+
sideOffset: 0,
|
|
2603
|
+
...props
|
|
2088
2604
|
},
|
|
2089
|
-
/* @__PURE__ */ React.createElement(
|
|
2090
|
-
|
|
2091
|
-
visibility: hidden !important;
|
|
2092
|
-
}`),
|
|
2093
|
-
props.children,
|
|
2094
|
-
/* @__PURE__ */ React.createElement("div", { contentEditable: false }, !restrictLanguage && /* @__PURE__ */ React.createElement("div", { className: "flex justify-between pb-2" }, /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement(
|
|
2095
|
-
Autocomplete,
|
|
2605
|
+
/* @__PURE__ */ React.createElement(
|
|
2606
|
+
DropdownMenuCheckboxItem,
|
|
2096
2607
|
{
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
)
|
|
2103
|
-
|
|
2608
|
+
checked: hasBottomBorder,
|
|
2609
|
+
onCheckedChange: getOnSelectTableBorder("bottom")
|
|
2610
|
+
},
|
|
2611
|
+
/* @__PURE__ */ React.createElement(Icons.borderBottom, { className: iconVariants({ size: "sm" }) }),
|
|
2612
|
+
/* @__PURE__ */ React.createElement("div", null, "Bottom Border")
|
|
2613
|
+
),
|
|
2614
|
+
/* @__PURE__ */ React.createElement(
|
|
2615
|
+
DropdownMenuCheckboxItem,
|
|
2104
2616
|
{
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2617
|
+
checked: hasTopBorder,
|
|
2618
|
+
onCheckedChange: getOnSelectTableBorder("top")
|
|
2619
|
+
},
|
|
2620
|
+
/* @__PURE__ */ React.createElement(Icons.borderTop, { className: iconVariants({ size: "sm" }) }),
|
|
2621
|
+
/* @__PURE__ */ React.createElement("div", null, "Top Border")
|
|
2622
|
+
),
|
|
2623
|
+
/* @__PURE__ */ React.createElement(
|
|
2624
|
+
DropdownMenuCheckboxItem,
|
|
2625
|
+
{
|
|
2626
|
+
checked: hasLeftBorder,
|
|
2627
|
+
onCheckedChange: getOnSelectTableBorder("left")
|
|
2628
|
+
},
|
|
2629
|
+
/* @__PURE__ */ React.createElement(Icons.borderLeft, { className: iconVariants({ size: "sm" }) }),
|
|
2630
|
+
/* @__PURE__ */ React.createElement("div", null, "Left Border")
|
|
2631
|
+
),
|
|
2632
|
+
/* @__PURE__ */ React.createElement(
|
|
2633
|
+
DropdownMenuCheckboxItem,
|
|
2634
|
+
{
|
|
2635
|
+
checked: hasRightBorder,
|
|
2636
|
+
onCheckedChange: getOnSelectTableBorder("right")
|
|
2637
|
+
},
|
|
2638
|
+
/* @__PURE__ */ React.createElement(Icons.borderRight, { className: iconVariants({ size: "sm" }) }),
|
|
2639
|
+
/* @__PURE__ */ React.createElement("div", null, "Right Border")
|
|
2640
|
+
),
|
|
2641
|
+
/* @__PURE__ */ React.createElement(Separator, null),
|
|
2642
|
+
/* @__PURE__ */ React.createElement(
|
|
2643
|
+
DropdownMenuCheckboxItem,
|
|
2644
|
+
{
|
|
2645
|
+
checked: hasNoBorders,
|
|
2646
|
+
onCheckedChange: getOnSelectTableBorder("none")
|
|
2647
|
+
},
|
|
2648
|
+
/* @__PURE__ */ React.createElement(Icons.borderNone, { className: iconVariants({ size: "sm" }) }),
|
|
2649
|
+
/* @__PURE__ */ React.createElement("div", null, "No Border")
|
|
2650
|
+
),
|
|
2651
|
+
/* @__PURE__ */ React.createElement(
|
|
2652
|
+
DropdownMenuCheckboxItem,
|
|
2653
|
+
{
|
|
2654
|
+
checked: hasOuterBorders,
|
|
2655
|
+
onCheckedChange: getOnSelectTableBorder("outer")
|
|
2656
|
+
},
|
|
2657
|
+
/* @__PURE__ */ React.createElement(Icons.borderAll, { className: iconVariants({ size: "sm" }) }),
|
|
2658
|
+
/* @__PURE__ */ React.createElement("div", null, "Outside Borders")
|
|
2659
|
+
)
|
|
2141
2660
|
);
|
|
2142
|
-
};
|
|
2143
|
-
const
|
|
2144
|
-
({
|
|
2145
|
-
const
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
plateCommon.
|
|
2661
|
+
});
|
|
2662
|
+
const TableFloatingToolbar = cn$1.withRef(
|
|
2663
|
+
({ children, ...props }, ref) => {
|
|
2664
|
+
const element = plateCommon.useElement();
|
|
2665
|
+
const { props: buttonProps } = plateCommon.useRemoveNodeButton({ element });
|
|
2666
|
+
const selectionCollapsed = plateCommon.useEditorSelector(
|
|
2667
|
+
(editor2) => !plateCommon.isSelectionExpanded(editor2),
|
|
2668
|
+
[]
|
|
2669
|
+
);
|
|
2670
|
+
const readOnly = slateReact.useReadOnly();
|
|
2671
|
+
const selected = slateReact.useSelected();
|
|
2672
|
+
const editor = plateCommon.useEditorRef();
|
|
2673
|
+
const collapsed = !readOnly && selected && selectionCollapsed;
|
|
2674
|
+
const open2 = !readOnly && selected;
|
|
2675
|
+
const { canMerge, canUnmerge } = plateTable.useTableMergeState();
|
|
2676
|
+
const mergeContent = canMerge && /* @__PURE__ */ React.createElement(
|
|
2677
|
+
Button$2,
|
|
2149
2678
|
{
|
|
2150
|
-
|
|
2679
|
+
contentEditable: false,
|
|
2680
|
+
isMenu: true,
|
|
2681
|
+
onClick: () => plateTable.mergeTableCells(editor),
|
|
2682
|
+
variant: "ghost"
|
|
2683
|
+
},
|
|
2684
|
+
/* @__PURE__ */ React.createElement(Icons.combine, { className: "mr-2 size-4" }),
|
|
2685
|
+
"Merge"
|
|
2686
|
+
);
|
|
2687
|
+
const unmergeButton = canUnmerge && /* @__PURE__ */ React.createElement(
|
|
2688
|
+
Button$2,
|
|
2689
|
+
{
|
|
2690
|
+
contentEditable: false,
|
|
2691
|
+
isMenu: true,
|
|
2692
|
+
onClick: () => plateTable.unmergeTableCells(editor),
|
|
2693
|
+
variant: "ghost"
|
|
2694
|
+
},
|
|
2695
|
+
/* @__PURE__ */ React.createElement(Icons.ungroup, { className: "mr-2 size-4" }),
|
|
2696
|
+
"Unmerge"
|
|
2697
|
+
);
|
|
2698
|
+
const bordersContent = collapsed && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DropdownMenu, { modal: false }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button$2, { isMenu: true, variant: "ghost" }, /* @__PURE__ */ React.createElement(Icons.borderAll, { className: "mr-2 size-4" }), "Borders")), /* @__PURE__ */ React.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React.createElement(TableBordersDropdownMenuContent, null))), /* @__PURE__ */ React.createElement(Button$2, { contentEditable: false, isMenu: true, variant: "ghost", ...buttonProps }, /* @__PURE__ */ React.createElement(Icons.delete, { className: "mr-2 size-4" }), "Delete"));
|
|
2699
|
+
return /* @__PURE__ */ React.createElement(Popover$2, { modal: false, open: open2 }, /* @__PURE__ */ React.createElement(PopoverPrimitive.PopoverAnchor, { asChild: true }, children), (canMerge || canUnmerge || collapsed) && /* @__PURE__ */ React.createElement(
|
|
2700
|
+
PopoverContent$1,
|
|
2701
|
+
{
|
|
2702
|
+
className: cn$1.cn(
|
|
2703
|
+
popoverVariants(),
|
|
2704
|
+
"flex w-[220px] flex-col gap-1 p-1"
|
|
2705
|
+
),
|
|
2706
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
2151
2707
|
ref,
|
|
2152
2708
|
...props
|
|
2153
2709
|
},
|
|
2154
|
-
|
|
2155
|
-
|
|
2710
|
+
unmergeButton,
|
|
2711
|
+
mergeContent,
|
|
2712
|
+
bordersContent
|
|
2713
|
+
));
|
|
2156
2714
|
}
|
|
2157
2715
|
);
|
|
2716
|
+
const TableElement = plateCommon.withHOC(
|
|
2717
|
+
plateTable.TableProvider,
|
|
2718
|
+
cn$1.withRef(({ children, className, ...props }, ref) => {
|
|
2719
|
+
const { colSizes, isSelectingCell, marginLeft, minColumnWidth } = plateTable.useTableElementState();
|
|
2720
|
+
const { colGroupProps, props: tableProps } = plateTable.useTableElement();
|
|
2721
|
+
return /* @__PURE__ */ React.createElement(TableFloatingToolbar, null, /* @__PURE__ */ React.createElement("div", { style: { paddingLeft: marginLeft } }, /* @__PURE__ */ React.createElement(
|
|
2722
|
+
plateCommon.PlateElement,
|
|
2723
|
+
{
|
|
2724
|
+
asChild: true,
|
|
2725
|
+
className: cn$1.cn(
|
|
2726
|
+
"my-4 ml-px mr-0 table h-px w-full table-fixed border-collapse",
|
|
2727
|
+
isSelectingCell && "[&_*::selection]:bg-none",
|
|
2728
|
+
className
|
|
2729
|
+
),
|
|
2730
|
+
ref,
|
|
2731
|
+
...tableProps,
|
|
2732
|
+
...props
|
|
2733
|
+
},
|
|
2734
|
+
/* @__PURE__ */ React.createElement("table", null, /* @__PURE__ */ React.createElement("colgroup", { ...colGroupProps }, colSizes.map((width, index) => /* @__PURE__ */ React.createElement(
|
|
2735
|
+
"col",
|
|
2736
|
+
{
|
|
2737
|
+
key: index,
|
|
2738
|
+
style: {
|
|
2739
|
+
minWidth: minColumnWidth,
|
|
2740
|
+
width: width || void 0
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
))), /* @__PURE__ */ React.createElement("tbody", { className: "min-w-full" }, children))
|
|
2744
|
+
)));
|
|
2745
|
+
})
|
|
2746
|
+
);
|
|
2747
|
+
const TableRowElement = cn$1.withRef(({ children, hideBorder, ...props }, ref) => {
|
|
2748
|
+
return /* @__PURE__ */ React.createElement(
|
|
2749
|
+
plateCommon.PlateElement,
|
|
2750
|
+
{
|
|
2751
|
+
asChild: true,
|
|
2752
|
+
className: cn$1.cn("h-full", hideBorder && "border-none"),
|
|
2753
|
+
ref,
|
|
2754
|
+
...props
|
|
2755
|
+
},
|
|
2756
|
+
/* @__PURE__ */ React.createElement("tr", null, children)
|
|
2757
|
+
);
|
|
2758
|
+
});
|
|
2158
2759
|
const blockClasses = "mt-0.5";
|
|
2159
2760
|
const headerClasses = "font-normal";
|
|
2160
2761
|
const Components = () => {
|
|
@@ -2260,6 +2861,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2260
2861
|
}
|
|
2261
2862
|
)
|
|
2262
2863
|
),
|
|
2864
|
+
[ELEMENT_MERMAID]: MermaidElement,
|
|
2263
2865
|
[plate.ELEMENT_BLOCKQUOTE]: BlockquoteElement,
|
|
2264
2866
|
[plate.ELEMENT_CODE_BLOCK]: CodeBlockElement,
|
|
2265
2867
|
[plate.ELEMENT_CODE_LINE]: CodeLineElement,
|
|
@@ -2340,7 +2942,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2340
2942
|
children,
|
|
2341
2943
|
selected && /* @__PURE__ */ React.createElement("span", { className: "absolute h-4 -top-2 inset-0 ring-2 ring-blue-100 ring-inset rounded-md z-10 pointer-events-none" })
|
|
2342
2944
|
);
|
|
2343
|
-
}
|
|
2945
|
+
},
|
|
2946
|
+
[plate.ELEMENT_TABLE]: TableElement,
|
|
2947
|
+
[plate.ELEMENT_TR]: TableRowElement,
|
|
2948
|
+
[plate.ELEMENT_TD]: TableCellElement,
|
|
2949
|
+
[plate.ELEMENT_TH]: TableCellHeaderElement
|
|
2344
2950
|
};
|
|
2345
2951
|
};
|
|
2346
2952
|
const createCodeBlockPlugin = plateCommon.createPluginFactory({
|
|
@@ -2750,7 +3356,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2750
3356
|
{
|
|
2751
3357
|
type: "string",
|
|
2752
3358
|
label: "Caption",
|
|
2753
|
-
name: [templateName.replace(/\.props$/, ""), "caption"].join(
|
|
3359
|
+
name: [templateName.replace(/\.props$/, ""), "caption"].join(
|
|
3360
|
+
"."
|
|
3361
|
+
),
|
|
2754
3362
|
component: "text"
|
|
2755
3363
|
}
|
|
2756
3364
|
]
|
|
@@ -3068,7 +3676,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3068
3676
|
};
|
|
3069
3677
|
const sizeClasses = {
|
|
3070
3678
|
small: `text-xs h-8 px-3`,
|
|
3071
|
-
medium: `text-sm h-10 px-
|
|
3679
|
+
medium: `text-sm h-10 px-8`,
|
|
3072
3680
|
custom: ``
|
|
3073
3681
|
};
|
|
3074
3682
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -4410,7 +5018,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4410
5018
|
function cn(...inputs) {
|
|
4411
5019
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
4412
5020
|
}
|
|
4413
|
-
const buttonVariants
|
|
5021
|
+
const buttonVariants = classVarianceAuthority.cva(
|
|
4414
5022
|
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
4415
5023
|
{
|
|
4416
5024
|
variants: {
|
|
@@ -4436,7 +5044,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4436
5044
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
4437
5045
|
Comp,
|
|
4438
5046
|
{
|
|
4439
|
-
className: cn(buttonVariants
|
|
5047
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
4440
5048
|
ref,
|
|
4441
5049
|
...props
|
|
4442
5050
|
}
|
|
@@ -5135,7 +5743,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5135
5743
|
return template.label ? template.label.toLowerCase().includes(filter.toLowerCase()) || name.toLowerCase().includes(filter.toLowerCase()) : name.toLowerCase().includes(filter.toLowerCase());
|
|
5136
5744
|
});
|
|
5137
5745
|
}, [filter]);
|
|
5138
|
-
return /* @__PURE__ */ React__namespace.createElement(react
|
|
5746
|
+
return /* @__PURE__ */ React__namespace.createElement(react.Popover, null, ({ open: open2 }) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(react.PopoverButton, { as: "span" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5139
5747
|
IconButton,
|
|
5140
5748
|
{
|
|
5141
5749
|
variant: open2 ? "secondary" : "primary",
|
|
@@ -5144,7 +5752,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5144
5752
|
},
|
|
5145
5753
|
/* @__PURE__ */ React__namespace.createElement(AddIcon, { className: "w-5/6 h-auto" })
|
|
5146
5754
|
)), /* @__PURE__ */ React__namespace.createElement("div", { className: "transform translate-y-full absolute -bottom-1 right-0 z-50" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5147
|
-
react
|
|
5755
|
+
react.Transition,
|
|
5148
5756
|
{
|
|
5149
5757
|
enter: "transition duration-150 ease-out",
|
|
5150
5758
|
enterFrom: "transform opacity-0 -translate-y-2",
|
|
@@ -5153,7 +5761,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5153
5761
|
leaveFrom: "transform opacity-100 translate-y-0",
|
|
5154
5762
|
leaveTo: "transform opacity-0 -translate-y-2"
|
|
5155
5763
|
},
|
|
5156
|
-
/* @__PURE__ */ React__namespace.createElement(react
|
|
5764
|
+
/* @__PURE__ */ React__namespace.createElement(react.PopoverPanel, { className: "relative overflow-hidden rounded-lg shadow-lg bg-white border border-gray-100" }, ({ close: close2 }) => /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-[192px] max-h-[24rem] overflow-y-auto flex flex-col w-full h-full" }, showFilter && /* @__PURE__ */ React__namespace.createElement("div", { className: "sticky top-0 bg-gray-50 p-2 border-b border-gray-100 z-10" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5157
5765
|
"input",
|
|
5158
5766
|
{
|
|
5159
5767
|
type: "text",
|
|
@@ -5330,8 +5938,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5330
5938
|
onClick: () => setPickerIsOpen(!pickerIsOpen)
|
|
5331
5939
|
},
|
|
5332
5940
|
/* @__PURE__ */ React__namespace.createElement(AddIcon, { className: "w-5/6 h-auto" })
|
|
5333
|
-
), /* @__PURE__ */ React__namespace.createElement(FormPortal, null, ({ zIndexShift }) => /* @__PURE__ */ React__namespace.createElement(react
|
|
5334
|
-
react
|
|
5941
|
+
), /* @__PURE__ */ React__namespace.createElement(FormPortal, null, ({ zIndexShift }) => /* @__PURE__ */ React__namespace.createElement(react.Transition, { show: pickerIsOpen }, /* @__PURE__ */ React__namespace.createElement(
|
|
5942
|
+
react.TransitionChild,
|
|
5335
5943
|
{
|
|
5336
5944
|
enter: "transform transition-all ease-out duration-200",
|
|
5337
5945
|
enterFrom: "opacity-0 -translate-x-1/2",
|
|
@@ -5418,14 +6026,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5418
6026
|
};
|
|
5419
6027
|
const BlockGroup = ({ category, templates, close: close2, isLast = false }) => {
|
|
5420
6028
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
5421
|
-
react
|
|
6029
|
+
react.Disclosure,
|
|
5422
6030
|
{
|
|
5423
6031
|
defaultOpen: true,
|
|
5424
6032
|
as: "div",
|
|
5425
6033
|
className: `left-0 right-0 relative`
|
|
5426
6034
|
},
|
|
5427
6035
|
({ open: open2 }) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
5428
|
-
react
|
|
6036
|
+
react.DisclosureButton,
|
|
5429
6037
|
{
|
|
5430
6038
|
className: `relative block group text-left w-full text-base font-bold tracking-wide py-2 truncate ${templates.length === 0 ? `pointer-events-none` : ``} ${!isLast && (!open2 || templates.length === 0) && `border-b border-gray-100`}`
|
|
5431
6039
|
},
|
|
@@ -5443,7 +6051,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5443
6051
|
}
|
|
5444
6052
|
)
|
|
5445
6053
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
5446
|
-
react
|
|
6054
|
+
react.Transition,
|
|
5447
6055
|
{
|
|
5448
6056
|
enter: "transition duration-100 ease-out",
|
|
5449
6057
|
enterFrom: "transform scale-95 opacity-0",
|
|
@@ -5452,7 +6060,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5452
6060
|
leaveFrom: "transform scale-100 opacity-100",
|
|
5453
6061
|
leaveTo: "transform scale-95 opacity-0"
|
|
5454
6062
|
},
|
|
5455
|
-
/* @__PURE__ */ React__namespace.createElement(react
|
|
6063
|
+
/* @__PURE__ */ React__namespace.createElement(react.DisclosurePanel, null, templates.length > 0 && /* @__PURE__ */ React__namespace.createElement(CardColumns, null, templates.map(([name, template], index) => /* @__PURE__ */ React__namespace.createElement(
|
|
5456
6064
|
BlockCard,
|
|
5457
6065
|
{
|
|
5458
6066
|
key: index,
|
|
@@ -9271,7 +9879,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9271
9879
|
const FormLists = (props) => {
|
|
9272
9880
|
const cms = useCMS();
|
|
9273
9881
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
9274
|
-
react
|
|
9882
|
+
react.Transition,
|
|
9275
9883
|
{
|
|
9276
9884
|
appear: true,
|
|
9277
9885
|
show: true,
|
|
@@ -9700,7 +10308,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9700
10308
|
"Event Log"
|
|
9701
10309
|
));
|
|
9702
10310
|
};
|
|
9703
|
-
const version = "2.
|
|
10311
|
+
const version = "2.3.0";
|
|
9704
10312
|
const Nav = ({
|
|
9705
10313
|
isLocalMode,
|
|
9706
10314
|
className = "",
|
|
@@ -9754,8 +10362,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9754
10362
|
style: { maxWidth: `${sidebarWidth}px` },
|
|
9755
10363
|
...props
|
|
9756
10364
|
},
|
|
9757
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "border-b border-gray-200" }, /* @__PURE__ */ React__namespace.createElement(react
|
|
9758
|
-
react
|
|
10365
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "border-b border-gray-200" }, /* @__PURE__ */ React__namespace.createElement(react.Menu, { as: "div", className: "relative block" }, ({ open: open2 }) => /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(
|
|
10366
|
+
react.MenuButton,
|
|
9759
10367
|
{
|
|
9760
10368
|
className: `group w-full px-6 py-3 gap-2 flex justify-between items-center transition-colors duration-150 ease-out ${open2 ? "bg-gray-50" : "bg-transparent"}`
|
|
9761
10369
|
},
|
|
@@ -9778,7 +10386,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9778
10386
|
}
|
|
9779
10387
|
)
|
|
9780
10388
|
), /* @__PURE__ */ React__namespace.createElement("div", { className: "transform translate-y-full absolute bottom-3 right-5 z-50" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9781
|
-
react
|
|
10389
|
+
react.Transition,
|
|
9782
10390
|
{
|
|
9783
10391
|
enter: "transition duration-150 ease-out",
|
|
9784
10392
|
enterFrom: "transform opacity-0 -translate-y-2",
|
|
@@ -9787,7 +10395,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9787
10395
|
leaveFrom: "transform opacity-100 translate-y-0",
|
|
9788
10396
|
leaveTo: "transform opacity-0 -translate-y-2"
|
|
9789
10397
|
},
|
|
9790
|
-
/* @__PURE__ */ React__namespace.createElement(react
|
|
10398
|
+
/* @__PURE__ */ React__namespace.createElement(react.MenuItems, { className: "bg-white border border-gray-150 rounded-lg shadow-lg flex flex-col items-stretch overflow-hidden" }, /* @__PURE__ */ React__namespace.createElement(react.MenuItem, null, /* @__PURE__ */ React__namespace.createElement(
|
|
9791
10399
|
"button",
|
|
9792
10400
|
{
|
|
9793
10401
|
className: `text-lg px-4 py-2 first:pt-3 last:pb-3 tracking-wide whitespace-nowrap flex items-center opacity-80 text-gray-600 hover:text-blue-400 hover:bg-gray-50 hover:opacity-100`,
|
|
@@ -9820,7 +10428,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9820
10428
|
},
|
|
9821
10429
|
/* @__PURE__ */ React__namespace.createElement(BiExit, { className: "w-6 h-auto mr-2 text-blue-400" }),
|
|
9822
10430
|
" Log Out"
|
|
9823
|
-
)), /* @__PURE__ */ React__namespace.createElement(react
|
|
10431
|
+
)), /* @__PURE__ */ React__namespace.createElement(react.MenuItem, null, /* @__PURE__ */ React__namespace.createElement(
|
|
9824
10432
|
WrappedSyncStatus,
|
|
9825
10433
|
{
|
|
9826
10434
|
cms,
|
|
@@ -10166,8 +10774,8 @@ var __publicField = (obj, key, value) => {
|
|
|
10166
10774
|
screen: activeScreen,
|
|
10167
10775
|
close: () => setActiveView(null)
|
|
10168
10776
|
}
|
|
10169
|
-
)), /* @__PURE__ */ React__namespace.createElement(ResizeHandle, null)), renderMobileNav && /* @__PURE__ */ React__namespace.createElement(react
|
|
10170
|
-
react
|
|
10777
|
+
)), /* @__PURE__ */ React__namespace.createElement(ResizeHandle, null)), renderMobileNav && /* @__PURE__ */ React__namespace.createElement(react.Transition, { show: menuIsOpen, as: "div" }, /* @__PURE__ */ React__namespace.createElement(
|
|
10778
|
+
react.TransitionChild,
|
|
10171
10779
|
{
|
|
10172
10780
|
enter: "transform transition-all ease-out duration-300",
|
|
10173
10781
|
enterFrom: "opacity-0 -translate-x-full",
|
|
@@ -10232,7 +10840,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10232
10840
|
))
|
|
10233
10841
|
))
|
|
10234
10842
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
10235
|
-
react
|
|
10843
|
+
react.TransitionChild,
|
|
10236
10844
|
{
|
|
10237
10845
|
enter: "ease-out duration-300",
|
|
10238
10846
|
enterFrom: "opacity-0",
|
|
@@ -12231,15 +12839,14 @@ var __publicField = (obj, key, value) => {
|
|
|
12231
12839
|
fields: fieldGroup.fields
|
|
12232
12840
|
}
|
|
12233
12841
|
) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null)
|
|
12234
|
-
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12842
|
+
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-12 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
|
|
12235
12843
|
ResetForm,
|
|
12236
12844
|
{
|
|
12237
12845
|
pristine,
|
|
12238
12846
|
reset: async () => {
|
|
12239
12847
|
finalForm2.reset();
|
|
12240
12848
|
await tinaForm.reset();
|
|
12241
|
-
}
|
|
12242
|
-
style: { flexGrow: 1 }
|
|
12849
|
+
}
|
|
12243
12850
|
},
|
|
12244
12851
|
tinaForm.buttons.reset
|
|
12245
12852
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -12248,8 +12855,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12248
12855
|
onClick: safeHandleSubmit,
|
|
12249
12856
|
disabled: !canSubmit,
|
|
12250
12857
|
busy: submitting,
|
|
12251
|
-
variant: "primary"
|
|
12252
|
-
style: { flexGrow: 3 }
|
|
12858
|
+
variant: "primary"
|
|
12253
12859
|
},
|
|
12254
12860
|
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
12255
12861
|
!submitting && tinaForm.buttons.save
|
|
@@ -12767,15 +13373,15 @@ var __publicField = (obj, key, value) => {
|
|
|
12767
13373
|
);
|
|
12768
13374
|
};
|
|
12769
13375
|
const DotMenu = ({ onOpen, onRemove }) => {
|
|
12770
|
-
return /* @__PURE__ */ React.createElement(react
|
|
12771
|
-
react
|
|
13376
|
+
return /* @__PURE__ */ React.createElement(react.Popover, { as: "span", className: "-ml-px relative block" }, /* @__PURE__ */ React.createElement(
|
|
13377
|
+
react.PopoverButton,
|
|
12772
13378
|
{
|
|
12773
13379
|
as: "span",
|
|
12774
13380
|
className: "cursor-pointer h-full relative inline-flex items-center px-1 py-0.5 rounded-r-md border border-gray-200 bg-white text-gray-500 hover:bg-gray-50 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"
|
|
12775
13381
|
},
|
|
12776
13382
|
/* @__PURE__ */ React.createElement(EllipsisIcon, { title: "Open options" })
|
|
12777
13383
|
), /* @__PURE__ */ React.createElement(
|
|
12778
|
-
react
|
|
13384
|
+
react.Transition,
|
|
12779
13385
|
{
|
|
12780
13386
|
enter: "transition ease-out duration-100",
|
|
12781
13387
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -12784,7 +13390,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12784
13390
|
leaveFrom: "transform opacity-100 scale-100",
|
|
12785
13391
|
leaveTo: "transform opacity-0 scale-95"
|
|
12786
13392
|
},
|
|
12787
|
-
/* @__PURE__ */ React.createElement(react
|
|
13393
|
+
/* @__PURE__ */ React.createElement(react.PopoverPanel, { className: "z-30 absolute origin-top-right right-0" }, /* @__PURE__ */ React.createElement("div", { className: "mt-2 -mr-1 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" }, /* @__PURE__ */ React.createElement("div", { className: "py-1" }, /* @__PURE__ */ React.createElement(
|
|
12788
13394
|
"span",
|
|
12789
13395
|
{
|
|
12790
13396
|
onClick: onOpen,
|
|
@@ -13207,13 +13813,26 @@ var __publicField = (obj, key, value) => {
|
|
|
13207
13813
|
plate.createUnderlinePlugin(),
|
|
13208
13814
|
plate.createCodePlugin(),
|
|
13209
13815
|
plate.createListPlugin(),
|
|
13210
|
-
plate.createIndentPlugin(),
|
|
13211
13816
|
plate.createIndentListPlugin(),
|
|
13212
13817
|
plate.createHorizontalRulePlugin(),
|
|
13213
13818
|
// Allows us to do things like copy/paste, remembering the state of the element (like mdx)
|
|
13214
13819
|
plate.createNodeIdPlugin(),
|
|
13215
|
-
plateSlashCommand.createSlashPlugin()
|
|
13820
|
+
plateSlashCommand.createSlashPlugin(),
|
|
13821
|
+
plate.createTablePlugin()
|
|
13216
13822
|
];
|
|
13823
|
+
const unsupportedItemsInTable = /* @__PURE__ */ new Set([
|
|
13824
|
+
"Code Block",
|
|
13825
|
+
"Unordered List",
|
|
13826
|
+
"Ordered List",
|
|
13827
|
+
"Quote",
|
|
13828
|
+
"Mermaid",
|
|
13829
|
+
"Heading 1",
|
|
13830
|
+
"Heading 2",
|
|
13831
|
+
"Heading 3",
|
|
13832
|
+
"Heading 4",
|
|
13833
|
+
"Heading 5",
|
|
13834
|
+
"Heading 6"
|
|
13835
|
+
]);
|
|
13217
13836
|
const isNodeActive = (editor, type) => {
|
|
13218
13837
|
const pluginType = plateCommon.getPluginType(editor, type);
|
|
13219
13838
|
return !!(editor == null ? void 0 : editor.selection) && plateCommon.someNode(editor, { match: { type: pluginType } });
|
|
@@ -13398,24 +14017,6 @@ var __publicField = (obj, key, value) => {
|
|
|
13398
14017
|
}
|
|
13399
14018
|
);
|
|
13400
14019
|
Editor.displayName = "Editor";
|
|
13401
|
-
const separatorVariants = classVarianceAuthority.cva("shrink-0 bg-border", {
|
|
13402
|
-
defaultVariants: {
|
|
13403
|
-
orientation: "horizontal"
|
|
13404
|
-
},
|
|
13405
|
-
variants: {
|
|
13406
|
-
orientation: {
|
|
13407
|
-
horizontal: "h-px w-full",
|
|
13408
|
-
vertical: "h-full w-px"
|
|
13409
|
-
}
|
|
13410
|
-
}
|
|
13411
|
-
});
|
|
13412
|
-
const Separator = cn$1.withVariants(
|
|
13413
|
-
cn$1.withProps(SeparatorPrimitive__namespace.Root, {
|
|
13414
|
-
decorative: true,
|
|
13415
|
-
orientation: "horizontal"
|
|
13416
|
-
}),
|
|
13417
|
-
separatorVariants
|
|
13418
|
-
);
|
|
13419
14020
|
const TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
13420
14021
|
const Tooltip = TooltipPrimitive__namespace.Root;
|
|
13421
14022
|
const TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
@@ -13424,7 +14025,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13424
14025
|
cn$1.withProps(TooltipPrimitive__namespace.Content, {
|
|
13425
14026
|
sideOffset: 4
|
|
13426
14027
|
}),
|
|
13427
|
-
"z-
|
|
14028
|
+
"z-[9999] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md"
|
|
13428
14029
|
);
|
|
13429
14030
|
function withTooltip(Component) {
|
|
13430
14031
|
return React.forwardRef(function ExtendComponent({ tooltip, tooltipContentProps, tooltipProps, ...props }, ref) {
|
|
@@ -13550,140 +14151,41 @@ var __publicField = (obj, key, value) => {
|
|
|
13550
14151
|
Toolbar,
|
|
13551
14152
|
"p-1 sticky left-0 top-0 z-50 w-full justify-between overflow-x-auto border border-border bg-background"
|
|
13552
14153
|
);
|
|
13553
|
-
const
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
const IndentListToolbarButton = cn$1.withRef(({ nodeType = plate.ELEMENT_UL }, ref) => {
|
|
13559
|
-
const editor = plateCommon.useEditorState();
|
|
13560
|
-
const state = plate.useListToolbarButtonState({ nodeType });
|
|
13561
|
-
const { props } = plate.useListToolbarButton(state);
|
|
13562
|
-
return /* @__PURE__ */ React.createElement(
|
|
13563
|
-
ToolbarButton,
|
|
13564
|
-
{
|
|
13565
|
-
ref,
|
|
13566
|
-
tooltip: nodeType === plate.ELEMENT_UL ? "Bulleted List" : "Numbered List",
|
|
13567
|
-
...props,
|
|
13568
|
-
onClick: (e) => {
|
|
13569
|
-
e.preventDefault();
|
|
13570
|
-
e.stopPropagation();
|
|
13571
|
-
plate.toggleList(editor, { type: nodeType });
|
|
13572
|
-
}
|
|
13573
|
-
},
|
|
13574
|
-
nodeType === plate.ELEMENT_UL ? /* @__PURE__ */ React.createElement(Icons.ul, null) : /* @__PURE__ */ React.createElement(Icons.ol, null)
|
|
13575
|
-
);
|
|
13576
|
-
});
|
|
13577
|
-
const DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
|
13578
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
13579
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
13580
|
-
cn$1.withRef(({ children, className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
13581
|
-
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
13582
|
-
{
|
|
13583
|
-
className: cn$1.cn(
|
|
13584
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
13585
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
13586
|
-
inset && "pl-8",
|
|
13587
|
-
className
|
|
13588
|
-
),
|
|
13589
|
-
ref,
|
|
13590
|
-
...props
|
|
13591
|
-
},
|
|
13592
|
-
children,
|
|
13593
|
-
/* @__PURE__ */ React.createElement(Icons.chevronRight, { className: "ml-auto size-4" })
|
|
13594
|
-
));
|
|
13595
|
-
cn$1.withCn(
|
|
13596
|
-
DropdownMenuPrimitive__namespace.SubContent,
|
|
13597
|
-
"z-[99999] min-w-32 overflow-hidden rounded-md border bg-white p-1 text-black shadow-lg 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"
|
|
13598
|
-
);
|
|
13599
|
-
const DropdownMenuContentVariants = cn$1.withProps(DropdownMenuPrimitive__namespace.Content, {
|
|
13600
|
-
className: cn$1.cn(
|
|
13601
|
-
"z-[99999] min-w-32 overflow-hidden rounded-md border bg-white p-1 text-black shadow-md 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"
|
|
13602
|
-
),
|
|
13603
|
-
sideOffset: 4
|
|
13604
|
-
});
|
|
13605
|
-
const DropdownMenuContent = cn$1.withRef(({ ...props }, ref) => /* @__PURE__ */ React.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(DropdownMenuContentVariants, { ref, ...props })));
|
|
13606
|
-
const menuItemVariants = classVarianceAuthority.cva(
|
|
13607
|
-
cn$1.cn(
|
|
13608
|
-
"relative flex h-9 cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",
|
|
13609
|
-
"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
13610
|
-
),
|
|
13611
|
-
{
|
|
13612
|
-
variants: {
|
|
13613
|
-
inset: {
|
|
13614
|
-
true: "pl-8"
|
|
14154
|
+
const useResize = (ref, callback) => {
|
|
14155
|
+
React.useEffect(() => {
|
|
14156
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
14157
|
+
for (const entry of entries) {
|
|
14158
|
+
callback(entry);
|
|
13615
14159
|
}
|
|
14160
|
+
});
|
|
14161
|
+
if (ref.current) {
|
|
14162
|
+
resizeObserver.observe(ref.current);
|
|
13616
14163
|
}
|
|
13617
|
-
|
|
13618
|
-
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
ref,
|
|
13633
|
-
...props
|
|
13634
|
-
},
|
|
13635
|
-
/* @__PURE__ */ React.createElement("span", { className: "absolute left-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React.createElement(Icons.check, { className: "size-4" }))),
|
|
13636
|
-
children
|
|
13637
|
-
));
|
|
13638
|
-
const DropdownMenuRadioItem = cn$1.withRef(({ children, className, hideIcon, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
13639
|
-
DropdownMenuPrimitive__namespace.RadioItem,
|
|
13640
|
-
{
|
|
13641
|
-
className: cn$1.cn(
|
|
13642
|
-
"relative flex select-none items-center rounded-sm pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
13643
|
-
"h-9 cursor-pointer px-2 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground",
|
|
13644
|
-
className
|
|
13645
|
-
),
|
|
13646
|
-
ref,
|
|
13647
|
-
...props
|
|
13648
|
-
},
|
|
13649
|
-
!hideIcon && /* @__PURE__ */ React.createElement("span", { className: "absolute right-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive__namespace.ItemIndicator, null, /* @__PURE__ */ React.createElement(Icons.check, { className: "size-4" }))),
|
|
14164
|
+
return () => resizeObserver.disconnect();
|
|
14165
|
+
}, [ref.current]);
|
|
14166
|
+
};
|
|
14167
|
+
const STANDARD_ICON_WIDTH = 32;
|
|
14168
|
+
const HEADING_ICON_WITH_TEXT = 127;
|
|
14169
|
+
const HEADING_ICON_ONLY = 58;
|
|
14170
|
+
const EMBED_ICON_WIDTH = 78;
|
|
14171
|
+
const CONTAINER_MD_BREAKPOINT = 448;
|
|
14172
|
+
const FLOAT_BUTTON_WIDTH = 25;
|
|
14173
|
+
const HEADING_LABEL = "Headings";
|
|
14174
|
+
const ToolbarContext = React.createContext(void 0);
|
|
14175
|
+
const ToolbarProvider = ({
|
|
14176
|
+
tinaForm,
|
|
14177
|
+
templates,
|
|
14178
|
+
overrides,
|
|
13650
14179
|
children
|
|
13651
|
-
)
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13658
|
-
}
|
|
13659
|
-
}
|
|
14180
|
+
}) => {
|
|
14181
|
+
return /* @__PURE__ */ React.createElement(ToolbarContext.Provider, { value: { tinaForm, templates, overrides } }, children);
|
|
14182
|
+
};
|
|
14183
|
+
const useToolbarContext = () => {
|
|
14184
|
+
const context = React.useContext(ToolbarContext);
|
|
14185
|
+
if (!context) {
|
|
14186
|
+
throw new Error("useToolbarContext must be used within a ToolbarProvider");
|
|
13660
14187
|
}
|
|
13661
|
-
|
|
13662
|
-
const DropdownMenuLabel = cn$1.withVariants(
|
|
13663
|
-
DropdownMenuPrimitive__namespace.Label,
|
|
13664
|
-
dropdownMenuLabelVariants,
|
|
13665
|
-
["inset"]
|
|
13666
|
-
);
|
|
13667
|
-
const DropdownMenuSeparator = cn$1.withCn(
|
|
13668
|
-
DropdownMenuPrimitive__namespace.Separator,
|
|
13669
|
-
"-mx-1 my-1 h-px bg-muted"
|
|
13670
|
-
);
|
|
13671
|
-
cn$1.withCn(
|
|
13672
|
-
cn$1.createPrimitiveElement("span"),
|
|
13673
|
-
"ml-auto text-xs tracking-widest opacity-60"
|
|
13674
|
-
);
|
|
13675
|
-
const useOpenState = () => {
|
|
13676
|
-
const [open2, setOpen] = React.useState(false);
|
|
13677
|
-
const onOpenChange = React.useCallback(
|
|
13678
|
-
(_value = !open2) => {
|
|
13679
|
-
setOpen(_value);
|
|
13680
|
-
},
|
|
13681
|
-
[open2]
|
|
13682
|
-
);
|
|
13683
|
-
return {
|
|
13684
|
-
onOpenChange,
|
|
13685
|
-
open: open2
|
|
13686
|
-
};
|
|
14188
|
+
return context;
|
|
13687
14189
|
};
|
|
13688
14190
|
const items$1 = [
|
|
13689
14191
|
{
|
|
@@ -13749,7 +14251,9 @@ var __publicField = (obj, key, value) => {
|
|
|
13749
14251
|
return allNodesMatchInitialNodeType ? initialNodeType : plateParagraph.ELEMENT_PARAGRAPH;
|
|
13750
14252
|
}, []);
|
|
13751
14253
|
const editor = plateCommon.useEditorRef();
|
|
14254
|
+
const editorState = plateCommon.useEditorState();
|
|
13752
14255
|
const openState = useOpenState();
|
|
14256
|
+
const userInTable = helpers.isNodeActive(editorState, plateTable.ELEMENT_TABLE);
|
|
13753
14257
|
const selectedItem = items$1.find((item) => item.value === value) ?? defaultItem$1;
|
|
13754
14258
|
const { icon: SelectedItemIcon, label: selectedItemLabel } = selectedItem;
|
|
13755
14259
|
return /* @__PURE__ */ React.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
@@ -13761,7 +14265,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13761
14265
|
tooltip: "Headings"
|
|
13762
14266
|
},
|
|
13763
14267
|
/* @__PURE__ */ React.createElement(SelectedItemIcon, { className: "size-5" }),
|
|
13764
|
-
/* @__PURE__ */ React.createElement("span", { className: "
|
|
14268
|
+
/* @__PURE__ */ React.createElement("span", { className: "@md/toolbar:flex hidden" }, selectedItemLabel)
|
|
13765
14269
|
)), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "start", className: "min-w-0" }, /* @__PURE__ */ React.createElement(
|
|
13766
14270
|
DropdownMenuRadioGroup,
|
|
13767
14271
|
{
|
|
@@ -13773,7 +14277,12 @@ var __publicField = (obj, key, value) => {
|
|
|
13773
14277
|
},
|
|
13774
14278
|
value
|
|
13775
14279
|
},
|
|
13776
|
-
items$1.
|
|
14280
|
+
items$1.filter((item) => {
|
|
14281
|
+
if (userInTable) {
|
|
14282
|
+
return !unsupportedItemsInTable.has(item.label);
|
|
14283
|
+
}
|
|
14284
|
+
return true;
|
|
14285
|
+
}).map(({ icon: Icon, label, value: itemValue }) => /* @__PURE__ */ React.createElement(
|
|
13777
14286
|
DropdownMenuRadioItem,
|
|
13778
14287
|
{
|
|
13779
14288
|
className: "min-w-[180px]",
|
|
@@ -13785,42 +14294,6 @@ var __publicField = (obj, key, value) => {
|
|
|
13785
14294
|
))
|
|
13786
14295
|
)));
|
|
13787
14296
|
}
|
|
13788
|
-
const LinkToolbarButton = cn$1.withRef((rest, ref) => {
|
|
13789
|
-
const state = plateLink.useLinkToolbarButtonState();
|
|
13790
|
-
const { props } = plateLink.useLinkToolbarButton(state);
|
|
13791
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...props, ...rest }, /* @__PURE__ */ React.createElement(Icons.link, null));
|
|
13792
|
-
});
|
|
13793
|
-
const useBlockQuoteToolbarButtonState = () => {
|
|
13794
|
-
const editor = plateCommon.useEditorState();
|
|
13795
|
-
const isBlockActive = () => helpers.isNodeActive(editor, plateBlockQuote.ELEMENT_BLOCKQUOTE);
|
|
13796
|
-
return {
|
|
13797
|
-
pressed: isBlockActive()
|
|
13798
|
-
};
|
|
13799
|
-
};
|
|
13800
|
-
const useBlockQuoteToolbarButton = (state) => {
|
|
13801
|
-
const editor = plateCommon.useEditorState();
|
|
13802
|
-
const onClick = () => {
|
|
13803
|
-
plateCommon.toggleNodeType(editor, {
|
|
13804
|
-
activeType: plateBlockQuote.ELEMENT_BLOCKQUOTE
|
|
13805
|
-
});
|
|
13806
|
-
};
|
|
13807
|
-
const onMouseDown = (e) => {
|
|
13808
|
-
e.preventDefault();
|
|
13809
|
-
e.stopPropagation();
|
|
13810
|
-
};
|
|
13811
|
-
return {
|
|
13812
|
-
props: {
|
|
13813
|
-
onClick,
|
|
13814
|
-
onMouseDown,
|
|
13815
|
-
pressed: state.pressed
|
|
13816
|
-
}
|
|
13817
|
-
};
|
|
13818
|
-
};
|
|
13819
|
-
const QuoteToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
13820
|
-
const state = useBlockQuoteToolbarButtonState();
|
|
13821
|
-
const { props } = useBlockQuoteToolbarButton(state);
|
|
13822
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.quote, null));
|
|
13823
|
-
});
|
|
13824
14297
|
const useCodeBlockToolbarButtonState = () => {
|
|
13825
14298
|
const editor = plateCommon.useEditorState();
|
|
13826
14299
|
const isBlockActive = () => helpers.isNodeActive(editor, plateCodeBlock.ELEMENT_CODE_BLOCK);
|
|
@@ -13882,6 +14355,115 @@ var __publicField = (obj, key, value) => {
|
|
|
13882
14355
|
const { props } = useImageToolbarButton(state);
|
|
13883
14356
|
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.image, null));
|
|
13884
14357
|
});
|
|
14358
|
+
const IndentListToolbarButton = cn$1.withRef(({ nodeType = plate.ELEMENT_UL }, ref) => {
|
|
14359
|
+
const editor = plateCommon.useEditorState();
|
|
14360
|
+
const state = plate.useListToolbarButtonState({ nodeType });
|
|
14361
|
+
const { props } = plate.useListToolbarButton(state);
|
|
14362
|
+
return /* @__PURE__ */ React.createElement(
|
|
14363
|
+
ToolbarButton,
|
|
14364
|
+
{
|
|
14365
|
+
ref,
|
|
14366
|
+
tooltip: nodeType === plate.ELEMENT_UL ? "Bulleted List" : "Numbered List",
|
|
14367
|
+
...props,
|
|
14368
|
+
onClick: (e) => {
|
|
14369
|
+
e.preventDefault();
|
|
14370
|
+
e.stopPropagation();
|
|
14371
|
+
plate.toggleList(editor, { type: nodeType });
|
|
14372
|
+
}
|
|
14373
|
+
},
|
|
14374
|
+
nodeType === plate.ELEMENT_UL ? /* @__PURE__ */ React.createElement(Icons.ul, null) : /* @__PURE__ */ React.createElement(Icons.ol, null)
|
|
14375
|
+
);
|
|
14376
|
+
});
|
|
14377
|
+
const LinkToolbarButton = cn$1.withRef((rest, ref) => {
|
|
14378
|
+
const state = plateLink.useLinkToolbarButtonState();
|
|
14379
|
+
const { props } = plateLink.useLinkToolbarButton(state);
|
|
14380
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...props, ...rest }, /* @__PURE__ */ React.createElement(Icons.link, null));
|
|
14381
|
+
});
|
|
14382
|
+
const MarkToolbarButton = cn$1.withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
14383
|
+
const state = plateCommon.useMarkToolbarButtonState({ clear, nodeType });
|
|
14384
|
+
const { props } = plateCommon.useMarkToolbarButton(state);
|
|
14385
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest });
|
|
14386
|
+
});
|
|
14387
|
+
const useMermaidToolbarButtonState = () => {
|
|
14388
|
+
const editor = plateCommon.useEditorState();
|
|
14389
|
+
const isBlockActive = () => helpers.isNodeActive(editor, ELEMENT_MERMAID);
|
|
14390
|
+
return {
|
|
14391
|
+
pressed: isBlockActive()
|
|
14392
|
+
};
|
|
14393
|
+
};
|
|
14394
|
+
const useMermaidToolbarButton = (state) => {
|
|
14395
|
+
const editor = plateCommon.useEditorState();
|
|
14396
|
+
const onClick = () => {
|
|
14397
|
+
plateCommon.insertEmptyElement(editor, ELEMENT_MERMAID, {
|
|
14398
|
+
nextBlock: true,
|
|
14399
|
+
select: true
|
|
14400
|
+
});
|
|
14401
|
+
};
|
|
14402
|
+
const onMouseDown = (e) => {
|
|
14403
|
+
e.preventDefault();
|
|
14404
|
+
e.stopPropagation();
|
|
14405
|
+
};
|
|
14406
|
+
return {
|
|
14407
|
+
props: {
|
|
14408
|
+
onClick,
|
|
14409
|
+
onMouseDown,
|
|
14410
|
+
pressed: state.pressed
|
|
14411
|
+
}
|
|
14412
|
+
};
|
|
14413
|
+
};
|
|
14414
|
+
const MermaidToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14415
|
+
const state = useMermaidToolbarButtonState();
|
|
14416
|
+
const { props } = useMermaidToolbarButton(state);
|
|
14417
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Mermaid", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.mermaid, null));
|
|
14418
|
+
});
|
|
14419
|
+
function OverflowMenu({
|
|
14420
|
+
children,
|
|
14421
|
+
...props
|
|
14422
|
+
}) {
|
|
14423
|
+
const openState = useOpenState();
|
|
14424
|
+
return /* @__PURE__ */ React.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
14425
|
+
ToolbarButton,
|
|
14426
|
+
{
|
|
14427
|
+
showArrow: false,
|
|
14428
|
+
className: "lg:min-w-[130px]",
|
|
14429
|
+
isDropdown: true,
|
|
14430
|
+
pressed: openState.open,
|
|
14431
|
+
tooltip: "Headings"
|
|
14432
|
+
},
|
|
14433
|
+
/* @__PURE__ */ React.createElement(Icons.overflow, { className: "size-5" })
|
|
14434
|
+
)), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "start", className: "min-w-0 flex flex-grow" }, children));
|
|
14435
|
+
}
|
|
14436
|
+
const useBlockQuoteToolbarButtonState = () => {
|
|
14437
|
+
const editor = plateCommon.useEditorState();
|
|
14438
|
+
const isBlockActive = () => helpers.isNodeActive(editor, plateBlockQuote.ELEMENT_BLOCKQUOTE);
|
|
14439
|
+
return {
|
|
14440
|
+
pressed: isBlockActive()
|
|
14441
|
+
};
|
|
14442
|
+
};
|
|
14443
|
+
const useBlockQuoteToolbarButton = (state) => {
|
|
14444
|
+
const editor = plateCommon.useEditorState();
|
|
14445
|
+
const onClick = () => {
|
|
14446
|
+
plateCommon.toggleNodeType(editor, {
|
|
14447
|
+
activeType: plateBlockQuote.ELEMENT_BLOCKQUOTE
|
|
14448
|
+
});
|
|
14449
|
+
};
|
|
14450
|
+
const onMouseDown = (e) => {
|
|
14451
|
+
e.preventDefault();
|
|
14452
|
+
e.stopPropagation();
|
|
14453
|
+
};
|
|
14454
|
+
return {
|
|
14455
|
+
props: {
|
|
14456
|
+
onClick,
|
|
14457
|
+
onMouseDown,
|
|
14458
|
+
pressed: state.pressed
|
|
14459
|
+
}
|
|
14460
|
+
};
|
|
14461
|
+
};
|
|
14462
|
+
const QuoteToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14463
|
+
const state = useBlockQuoteToolbarButtonState();
|
|
14464
|
+
const { props } = useBlockQuoteToolbarButton(state);
|
|
14465
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.quote, null));
|
|
14466
|
+
});
|
|
13885
14467
|
const useRawMarkdownToolbarButton = () => {
|
|
13886
14468
|
const { setRawMode } = useEditorContext();
|
|
13887
14469
|
const onMouseDown = (e) => {
|
|
@@ -13898,29 +14480,111 @@ var __publicField = (obj, key, value) => {
|
|
|
13898
14480
|
const { props } = useRawMarkdownToolbarButton();
|
|
13899
14481
|
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.raw, null));
|
|
13900
14482
|
});
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
14483
|
+
function TableDropdownMenu(props) {
|
|
14484
|
+
const tableSelected = plateCommon.useEditorSelector(
|
|
14485
|
+
(editor2) => plateCommon.someNode(editor2, { match: { type: plateTable.ELEMENT_TABLE } }),
|
|
14486
|
+
[]
|
|
14487
|
+
);
|
|
14488
|
+
const [enableDeleteColumn, enableDeleteRow] = plateCommon.useEditorSelector((editor2) => {
|
|
14489
|
+
const tableNodeEntry = plateCommon.findNode(editor2, { match: { type: plateTable.ELEMENT_TABLE } });
|
|
14490
|
+
if (!tableNodeEntry)
|
|
14491
|
+
return [false, false];
|
|
14492
|
+
const [tableNode] = tableNodeEntry;
|
|
14493
|
+
if (!plateCommon.isElement(tableNode))
|
|
14494
|
+
return [false, false];
|
|
14495
|
+
const columnCount = plateTable.getTableColumnCount(tableNode);
|
|
14496
|
+
const rowCount = tableNode.children.length;
|
|
14497
|
+
return [columnCount > 1, rowCount > 1];
|
|
14498
|
+
}, []);
|
|
14499
|
+
const editor = plateCommon.useEditorRef();
|
|
14500
|
+
const openState = useOpenState();
|
|
14501
|
+
return /* @__PURE__ */ React.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(ToolbarButton, { isDropdown: true, pressed: openState.open, tooltip: "Table" }, /* @__PURE__ */ React.createElement(Icons.table, null))), /* @__PURE__ */ React.createElement(
|
|
14502
|
+
DropdownMenuContent,
|
|
14503
|
+
{
|
|
14504
|
+
align: "start",
|
|
14505
|
+
className: "flex w-[180px] min-w-0 flex-col gap-0.5"
|
|
14506
|
+
},
|
|
14507
|
+
/* @__PURE__ */ React.createElement(
|
|
14508
|
+
DropdownMenuItem,
|
|
14509
|
+
{
|
|
14510
|
+
className: "min-w-[180px]",
|
|
14511
|
+
disabled: tableSelected,
|
|
14512
|
+
onSelect: () => {
|
|
14513
|
+
plateTable.insertTable(editor);
|
|
14514
|
+
plateCommon.focusEditor(editor);
|
|
14515
|
+
}
|
|
14516
|
+
},
|
|
14517
|
+
/* @__PURE__ */ React.createElement(Icons.add, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14518
|
+
"Insert table"
|
|
14519
|
+
),
|
|
14520
|
+
/* @__PURE__ */ React.createElement(
|
|
14521
|
+
DropdownMenuItem,
|
|
14522
|
+
{
|
|
14523
|
+
className: "min-w-[180px]",
|
|
14524
|
+
disabled: !tableSelected,
|
|
14525
|
+
onSelect: () => {
|
|
14526
|
+
plateTable.deleteTable(editor);
|
|
14527
|
+
plateCommon.focusEditor(editor);
|
|
14528
|
+
}
|
|
14529
|
+
},
|
|
14530
|
+
/* @__PURE__ */ React.createElement(Icons.minus, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14531
|
+
"Delete table"
|
|
14532
|
+
),
|
|
14533
|
+
/* @__PURE__ */ React.createElement(DropdownMenuSub, null, /* @__PURE__ */ React.createElement(DropdownMenuSubTrigger, { disabled: !tableSelected }, /* @__PURE__ */ React.createElement(Icons.column, { className: iconVariants({ variant: "menuItem" }) }), /* @__PURE__ */ React.createElement("span", null, "Column")), /* @__PURE__ */ React.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React.createElement(
|
|
14534
|
+
DropdownMenuItem,
|
|
14535
|
+
{
|
|
14536
|
+
className: "min-w-[180px]",
|
|
14537
|
+
disabled: !tableSelected,
|
|
14538
|
+
onSelect: () => {
|
|
14539
|
+
plateTable.insertTableColumn(editor);
|
|
14540
|
+
plateCommon.focusEditor(editor);
|
|
14541
|
+
}
|
|
14542
|
+
},
|
|
14543
|
+
/* @__PURE__ */ React.createElement(Icons.add, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14544
|
+
"Insert column after"
|
|
14545
|
+
), /* @__PURE__ */ React.createElement(
|
|
14546
|
+
DropdownMenuItem,
|
|
14547
|
+
{
|
|
14548
|
+
className: "min-w-[180px]",
|
|
14549
|
+
disabled: !enableDeleteColumn,
|
|
14550
|
+
onSelect: () => {
|
|
14551
|
+
plateTable.deleteColumn(editor);
|
|
14552
|
+
plateCommon.focusEditor(editor);
|
|
14553
|
+
}
|
|
14554
|
+
},
|
|
14555
|
+
/* @__PURE__ */ React.createElement(Icons.minus, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14556
|
+
"Delete column"
|
|
14557
|
+
))),
|
|
14558
|
+
/* @__PURE__ */ React.createElement(DropdownMenuSub, null, /* @__PURE__ */ React.createElement(DropdownMenuSubTrigger, { disabled: !tableSelected }, /* @__PURE__ */ React.createElement(Icons.row, { className: iconVariants({ variant: "menuItem" }) }), /* @__PURE__ */ React.createElement("span", null, "Row")), /* @__PURE__ */ React.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React.createElement(
|
|
14559
|
+
DropdownMenuItem,
|
|
14560
|
+
{
|
|
14561
|
+
className: "min-w-[180px]",
|
|
14562
|
+
disabled: !tableSelected,
|
|
14563
|
+
onSelect: () => {
|
|
14564
|
+
plateTable.insertTableRow(editor);
|
|
14565
|
+
plateCommon.focusEditor(editor);
|
|
14566
|
+
}
|
|
14567
|
+
},
|
|
14568
|
+
/* @__PURE__ */ React.createElement(Icons.add, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14569
|
+
"Insert row after"
|
|
14570
|
+
), /* @__PURE__ */ React.createElement(
|
|
14571
|
+
DropdownMenuItem,
|
|
14572
|
+
{
|
|
14573
|
+
className: "min-w-[180px]",
|
|
14574
|
+
disabled: !enableDeleteRow,
|
|
14575
|
+
onSelect: () => {
|
|
14576
|
+
plateTable.deleteRow(editor);
|
|
14577
|
+
plateCommon.focusEditor(editor);
|
|
14578
|
+
}
|
|
14579
|
+
},
|
|
14580
|
+
/* @__PURE__ */ React.createElement(Icons.minus, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14581
|
+
"Delete row"
|
|
14582
|
+
)))
|
|
14583
|
+
));
|
|
14584
|
+
}
|
|
13917
14585
|
function TemplatesToolbarButton() {
|
|
13918
14586
|
const { templates } = useToolbarContext();
|
|
13919
|
-
const showEmbed = templates.length > 0;
|
|
13920
14587
|
const editor = plateCommon.useEditorState();
|
|
13921
|
-
if (!showEmbed) {
|
|
13922
|
-
return null;
|
|
13923
|
-
}
|
|
13924
14588
|
return /* @__PURE__ */ React.createElement(EmbedButton, { templates, editor });
|
|
13925
14589
|
}
|
|
13926
14590
|
const EmbedButton = ({ editor, templates }) => {
|
|
@@ -13961,99 +14625,113 @@ var __publicField = (obj, key, value) => {
|
|
|
13961
14625
|
template.label || template.name
|
|
13962
14626
|
))));
|
|
13963
14627
|
};
|
|
13964
|
-
const ICON_WIDTH = 32;
|
|
13965
|
-
const EMBED_ICON_WIDTH = 78;
|
|
13966
|
-
const useResize = (ref, callback) => {
|
|
13967
|
-
React.useEffect(() => {
|
|
13968
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
13969
|
-
for (const entry of entries) {
|
|
13970
|
-
callback(entry);
|
|
13971
|
-
}
|
|
13972
|
-
});
|
|
13973
|
-
if (ref.current) {
|
|
13974
|
-
resizeObserver.observe(ref.current);
|
|
13975
|
-
}
|
|
13976
|
-
return () => resizeObserver.disconnect();
|
|
13977
|
-
}, [ref.current]);
|
|
13978
|
-
};
|
|
13979
|
-
function OverflowMenu({
|
|
13980
|
-
children,
|
|
13981
|
-
...props
|
|
13982
|
-
}) {
|
|
13983
|
-
const openState = useOpenState();
|
|
13984
|
-
return /* @__PURE__ */ React.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
13985
|
-
ToolbarButton,
|
|
13986
|
-
{
|
|
13987
|
-
showArrow: false,
|
|
13988
|
-
className: "lg:min-w-[130px]",
|
|
13989
|
-
isDropdown: true,
|
|
13990
|
-
pressed: openState.open,
|
|
13991
|
-
tooltip: "Headings"
|
|
13992
|
-
},
|
|
13993
|
-
/* @__PURE__ */ React.createElement(Icons.overflow, { className: "size-5" })
|
|
13994
|
-
)), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "start", className: "min-w-0 flex flex-grow" }, children));
|
|
13995
|
-
}
|
|
13996
14628
|
const toolbarItems = {
|
|
13997
14629
|
heading: {
|
|
13998
|
-
label:
|
|
14630
|
+
label: HEADING_LABEL,
|
|
14631
|
+
width: (paragraphIconExists) => paragraphIconExists ? HEADING_ICON_WITH_TEXT : HEADING_ICON_ONLY,
|
|
14632
|
+
// Dynamically handle width based on paragraph icon
|
|
13999
14633
|
Component: /* @__PURE__ */ React.createElement(ToolbarGroup, { noSeparator: true }, /* @__PURE__ */ React.createElement(HeadingsMenu, null))
|
|
14000
14634
|
},
|
|
14001
14635
|
link: {
|
|
14002
14636
|
label: "Link",
|
|
14637
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14003
14638
|
Component: /* @__PURE__ */ React.createElement(LinkToolbarButton, null)
|
|
14004
14639
|
},
|
|
14005
14640
|
image: {
|
|
14006
14641
|
label: "Image",
|
|
14642
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14007
14643
|
Component: /* @__PURE__ */ React.createElement(ImageToolbarButton, null)
|
|
14008
14644
|
},
|
|
14009
14645
|
quote: {
|
|
14010
14646
|
label: "Quote",
|
|
14647
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14011
14648
|
Component: /* @__PURE__ */ React.createElement(QuoteToolbarButton, { tooltip: "Quote Quote (⌘+⇧+.)" })
|
|
14012
14649
|
},
|
|
14013
14650
|
ul: {
|
|
14014
14651
|
label: "Unordered List",
|
|
14652
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14015
14653
|
Component: /* @__PURE__ */ React.createElement(IndentListToolbarButton, { nodeType: plate.ELEMENT_UL })
|
|
14016
14654
|
},
|
|
14017
14655
|
ol: {
|
|
14018
14656
|
label: "Ordered List",
|
|
14657
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14019
14658
|
Component: /* @__PURE__ */ React.createElement(IndentListToolbarButton, { nodeType: plate.ELEMENT_OL })
|
|
14020
14659
|
},
|
|
14021
14660
|
bold: {
|
|
14022
14661
|
label: "Bold",
|
|
14662
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14023
14663
|
Component: /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: plate.MARK_BOLD }, /* @__PURE__ */ React.createElement(Icons.bold, null))
|
|
14024
14664
|
},
|
|
14025
14665
|
italic: {
|
|
14026
14666
|
label: "Italic",
|
|
14667
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14027
14668
|
Component: /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: plate.MARK_ITALIC }, /* @__PURE__ */ React.createElement(Icons.italic, null))
|
|
14028
14669
|
},
|
|
14029
14670
|
code: {
|
|
14030
14671
|
label: "Code",
|
|
14672
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14031
14673
|
Component: /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: plate.MARK_CODE }, /* @__PURE__ */ React.createElement(Icons.code, null))
|
|
14032
14674
|
},
|
|
14033
14675
|
codeBlock: {
|
|
14034
14676
|
label: "Code Block",
|
|
14677
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14035
14678
|
Component: /* @__PURE__ */ React.createElement(CodeBlockToolbarButton, null)
|
|
14036
14679
|
},
|
|
14680
|
+
mermaid: {
|
|
14681
|
+
label: "Mermaid",
|
|
14682
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14683
|
+
Component: /* @__PURE__ */ React.createElement(MermaidToolbarButton, null)
|
|
14684
|
+
},
|
|
14685
|
+
table: {
|
|
14686
|
+
label: "Table",
|
|
14687
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14688
|
+
Component: /* @__PURE__ */ React.createElement(TableDropdownMenu, null)
|
|
14689
|
+
},
|
|
14037
14690
|
raw: {
|
|
14038
14691
|
label: "Raw Markdown",
|
|
14692
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14039
14693
|
Component: /* @__PURE__ */ React.createElement(RawMarkdownToolbarButton, null)
|
|
14040
14694
|
},
|
|
14041
14695
|
embed: {
|
|
14042
14696
|
label: "Templates",
|
|
14697
|
+
width: () => EMBED_ICON_WIDTH,
|
|
14043
14698
|
Component: /* @__PURE__ */ React.createElement(TemplatesToolbarButton, null)
|
|
14044
14699
|
}
|
|
14045
14700
|
};
|
|
14046
14701
|
function FixedToolbarButtons() {
|
|
14047
14702
|
const toolbarRef = React.useRef(null);
|
|
14048
14703
|
const [itemsShown, setItemsShown] = React.useState(11);
|
|
14049
|
-
const { overrides } = useToolbarContext();
|
|
14704
|
+
const { overrides, templates } = useToolbarContext();
|
|
14705
|
+
const showEmbedButton = templates.length > 0;
|
|
14706
|
+
let items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14707
|
+
if (!showEmbedButton) {
|
|
14708
|
+
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14709
|
+
}
|
|
14710
|
+
const editorState = plateCommon.useEditorState();
|
|
14711
|
+
const userInTable = helpers.isNodeActive(editorState, plate.ELEMENT_TABLE);
|
|
14712
|
+
if (userInTable) {
|
|
14713
|
+
items2 = items2.filter((item) => !unsupportedItemsInTable.has(item.label));
|
|
14714
|
+
}
|
|
14050
14715
|
useResize(toolbarRef, (entry) => {
|
|
14051
14716
|
const width = entry.target.getBoundingClientRect().width;
|
|
14052
|
-
const
|
|
14053
|
-
|
|
14717
|
+
const headingButton = items2.find((item) => item.label === HEADING_LABEL);
|
|
14718
|
+
const headingWidth = headingButton ? headingButton.width(width > CONTAINER_MD_BREAKPOINT) : 0;
|
|
14719
|
+
const availableWidth = width - headingWidth - FLOAT_BUTTON_WIDTH;
|
|
14720
|
+
const { itemFitCount } = items2.reduce(
|
|
14721
|
+
(acc, item) => {
|
|
14722
|
+
if (item.label !== HEADING_LABEL && acc.totalItemsWidth + item.width() <= availableWidth) {
|
|
14723
|
+
return {
|
|
14724
|
+
totalItemsWidth: acc.totalItemsWidth + item.width(),
|
|
14725
|
+
itemFitCount: acc.itemFitCount + 1
|
|
14726
|
+
};
|
|
14727
|
+
}
|
|
14728
|
+
return acc;
|
|
14729
|
+
},
|
|
14730
|
+
{ totalItemsWidth: 0, itemFitCount: 1 }
|
|
14731
|
+
);
|
|
14732
|
+
setItemsShown(itemFitCount);
|
|
14054
14733
|
});
|
|
14055
|
-
|
|
14056
|
-
return /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-hidden", ref: toolbarRef }, /* @__PURE__ */ React.createElement(
|
|
14734
|
+
return /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-hidden @container/toolbar", ref: toolbarRef }, /* @__PURE__ */ React.createElement(
|
|
14057
14735
|
"div",
|
|
14058
14736
|
{
|
|
14059
14737
|
className: "flex",
|
|
@@ -14061,7 +14739,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14061
14739
|
transform: "translateX(calc(-1px))"
|
|
14062
14740
|
}
|
|
14063
14741
|
},
|
|
14064
|
-
/* @__PURE__ */ React.createElement(React.Fragment, null,
|
|
14742
|
+
/* @__PURE__ */ React.createElement(React.Fragment, null, items2.slice(0, itemsShown).map((item) => /* @__PURE__ */ React.createElement(React.Fragment, { key: item.label }, item.Component)), items2.length > itemsShown && /* @__PURE__ */ React.createElement(OverflowMenu, null, items2.slice(itemsShown).flatMap((c) => /* @__PURE__ */ React.createElement(React.Fragment, { key: c.label }, c.Component))))
|
|
14065
14743
|
));
|
|
14066
14744
|
}
|
|
14067
14745
|
const FloatingToolbar = cn$1.withRef(({ children, state, ...props }, componentRef) => {
|
|
@@ -14176,6 +14854,10 @@ var __publicField = (obj, key, value) => {
|
|
|
14176
14854
|
const openState = useOpenState();
|
|
14177
14855
|
const selectedItem = items.find((item) => item.value === value) ?? defaultItem;
|
|
14178
14856
|
const { icon: SelectedItemIcon, label: selectedItemLabel } = selectedItem;
|
|
14857
|
+
const editorState = plateCommon.useEditorState();
|
|
14858
|
+
const userInTable = helpers.isNodeActive(editorState, plateTable.ELEMENT_TABLE);
|
|
14859
|
+
if (userInTable)
|
|
14860
|
+
return null;
|
|
14179
14861
|
return /* @__PURE__ */ React.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
14180
14862
|
ToolbarButton,
|
|
14181
14863
|
{
|
|
@@ -14217,49 +14899,6 @@ var __publicField = (obj, key, value) => {
|
|
|
14217
14899
|
function FloatingToolbarButtons() {
|
|
14218
14900
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TurnIntoDropdownMenu, null));
|
|
14219
14901
|
}
|
|
14220
|
-
const buttonVariants = classVarianceAuthority.cva(
|
|
14221
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
14222
|
-
{
|
|
14223
|
-
defaultVariants: {
|
|
14224
|
-
size: "default",
|
|
14225
|
-
variant: "default"
|
|
14226
|
-
},
|
|
14227
|
-
variants: {
|
|
14228
|
-
isMenu: {
|
|
14229
|
-
true: "h-auto w-full cursor-pointer justify-start"
|
|
14230
|
-
},
|
|
14231
|
-
size: {
|
|
14232
|
-
default: "h-10 px-4 py-2",
|
|
14233
|
-
icon: "size-10",
|
|
14234
|
-
lg: "h-11 rounded-md px-8",
|
|
14235
|
-
none: "",
|
|
14236
|
-
sm: "h-9 rounded-md px-3",
|
|
14237
|
-
sms: "size-9 rounded-md px-0",
|
|
14238
|
-
xs: "h-8 rounded-md px-3"
|
|
14239
|
-
},
|
|
14240
|
-
variant: {
|
|
14241
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
14242
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
14243
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14244
|
-
inlineLink: "text-base text-primary underline underline-offset-4",
|
|
14245
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
14246
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14247
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80"
|
|
14248
|
-
}
|
|
14249
|
-
}
|
|
14250
|
-
}
|
|
14251
|
-
);
|
|
14252
|
-
cn$1.withRef(({ asChild = false, className, isMenu, size, variant, ...props }, ref) => {
|
|
14253
|
-
const Comp = asChild ? reactSlot.Slot : "button";
|
|
14254
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
14255
|
-
Comp,
|
|
14256
|
-
{
|
|
14257
|
-
className: cn$1.cn(buttonVariants({ className, isMenu, size, variant })),
|
|
14258
|
-
ref,
|
|
14259
|
-
...props
|
|
14260
|
-
}
|
|
14261
|
-
);
|
|
14262
|
-
});
|
|
14263
14902
|
const inputVariants = classVarianceAuthority.cva(
|
|
14264
14903
|
"flex w-full rounded-md bg-transparent text-sm file:border-0 file:bg-background file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
14265
14904
|
{
|
|
@@ -14280,22 +14919,6 @@ var __publicField = (obj, key, value) => {
|
|
|
14280
14919
|
}
|
|
14281
14920
|
);
|
|
14282
14921
|
cn$1.withVariants("input", inputVariants, ["variant", "h"]);
|
|
14283
|
-
const popoverVariants = classVarianceAuthority.cva(
|
|
14284
|
-
"w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 print:hidden"
|
|
14285
|
-
);
|
|
14286
|
-
cn$1.withRef(
|
|
14287
|
-
({ align = "center", className, sideOffset = 4, style, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
|
|
14288
|
-
PopoverPrimitive__namespace.Content,
|
|
14289
|
-
{
|
|
14290
|
-
align,
|
|
14291
|
-
className: cn$1.cn(popoverVariants(), className),
|
|
14292
|
-
ref,
|
|
14293
|
-
sideOffset,
|
|
14294
|
-
style: { zIndex: 1e3, ...style },
|
|
14295
|
-
...props
|
|
14296
|
-
}
|
|
14297
|
-
))
|
|
14298
|
-
);
|
|
14299
14922
|
const floatingOptions = {
|
|
14300
14923
|
middleware: [
|
|
14301
14924
|
plateFloating.offset(12),
|
|
@@ -14355,7 +14978,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14355
14978
|
const editContent = editState.isEditing ? input : /* @__PURE__ */ React.createElement("div", { className: "box-content flex h-9 items-center gap-1" }, /* @__PURE__ */ React.createElement(
|
|
14356
14979
|
"button",
|
|
14357
14980
|
{
|
|
14358
|
-
className: buttonVariants({ size: "sm", variant: "ghost" }),
|
|
14981
|
+
className: buttonVariants$1({ size: "sm", variant: "ghost" }),
|
|
14359
14982
|
type: "button",
|
|
14360
14983
|
...editButtonProps
|
|
14361
14984
|
},
|
|
@@ -14363,7 +14986,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14363
14986
|
), /* @__PURE__ */ React.createElement(Separator, { orientation: "vertical" }), /* @__PURE__ */ React.createElement(
|
|
14364
14987
|
plateLink.LinkOpenButton,
|
|
14365
14988
|
{
|
|
14366
|
-
className: buttonVariants({
|
|
14989
|
+
className: buttonVariants$1({
|
|
14367
14990
|
size: "sms",
|
|
14368
14991
|
variant: "ghost"
|
|
14369
14992
|
})
|
|
@@ -14372,7 +14995,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14372
14995
|
), /* @__PURE__ */ React.createElement(Separator, { orientation: "vertical" }), /* @__PURE__ */ React.createElement(
|
|
14373
14996
|
"button",
|
|
14374
14997
|
{
|
|
14375
|
-
className: buttonVariants({
|
|
14998
|
+
className: buttonVariants$1({
|
|
14376
14999
|
size: "sms",
|
|
14377
15000
|
variant: "ghost"
|
|
14378
15001
|
}),
|
|
@@ -14446,6 +15069,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14446
15069
|
createMdxBlockPlugin(),
|
|
14447
15070
|
createMdxInlinePlugin(),
|
|
14448
15071
|
createImgPlugin(),
|
|
15072
|
+
createMermaidPlugin(),
|
|
14449
15073
|
createInvalidMarkdownPlugin(),
|
|
14450
15074
|
plateLink.createLinkPlugin({
|
|
14451
15075
|
options: {
|
|
@@ -30568,8 +31192,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30568
31192
|
}
|
|
30569
31193
|
)
|
|
30570
31194
|
}
|
|
30571
|
-
), !renderDesktopNav && /* @__PURE__ */ React.createElement(react
|
|
30572
|
-
react
|
|
31195
|
+
), !renderDesktopNav && /* @__PURE__ */ React.createElement(react.Transition, { show: menuIsOpen }, /* @__PURE__ */ React.createElement(
|
|
31196
|
+
react.TransitionChild,
|
|
30573
31197
|
{
|
|
30574
31198
|
enter: "transform transition-all ease-out duration-300",
|
|
30575
31199
|
enterFrom: "opacity-0 -translate-x-full",
|
|
@@ -30638,7 +31262,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30638
31262
|
))
|
|
30639
31263
|
))
|
|
30640
31264
|
), /* @__PURE__ */ React.createElement(
|
|
30641
|
-
react
|
|
31265
|
+
react.TransitionChild,
|
|
30642
31266
|
{
|
|
30643
31267
|
enter: "ease-out duration-300",
|
|
30644
31268
|
enterFrom: "opacity-0",
|
|
@@ -31092,8 +31716,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31092
31716
|
folder,
|
|
31093
31717
|
collectionName
|
|
31094
31718
|
}) => {
|
|
31095
|
-
return /* @__PURE__ */ React.createElement(react
|
|
31096
|
-
react
|
|
31719
|
+
return /* @__PURE__ */ React.createElement(react.Menu, { as: "div", className: "relative inline-block text-left" }, () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(react.MenuButton, { className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 text-sm h-10 px-6" }, "Create New ", /* @__PURE__ */ React.createElement(BiPlus, { className: "w-5 h-full ml-1 opacity-70" }))), /* @__PURE__ */ React.createElement(
|
|
31720
|
+
react.Transition,
|
|
31097
31721
|
{
|
|
31098
31722
|
enter: "transition ease-out duration-100",
|
|
31099
31723
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -31102,7 +31726,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31102
31726
|
leaveFrom: "transform opacity-100 scale-100",
|
|
31103
31727
|
leaveTo: "transform opacity-0 scale-95"
|
|
31104
31728
|
},
|
|
31105
|
-
/* @__PURE__ */ React.createElement(react
|
|
31729
|
+
/* @__PURE__ */ React.createElement(react.MenuItems, { className: "origin-top-right absolute right-0 mt-2 z-menu w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" }, /* @__PURE__ */ React.createElement("div", { className: "py-1" }, templates.map((template) => /* @__PURE__ */ React.createElement(react.MenuItem, { key: `${template.label}-${template.name}` }, ({ focus }) => /* @__PURE__ */ React.createElement(
|
|
31106
31730
|
reactRouterDom.Link,
|
|
31107
31731
|
{
|
|
31108
31732
|
to: `/${folder.fullyQualifiedName ? [
|