tinacms 0.0.0-bf22bf8-20241004045704 → 0.0.0-c45ac5d-20241213020122
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/admin/types.d.ts +3 -0
- package/dist/cache/node-cache.d.ts +1 -0
- package/dist/client.js +22 -23
- package/dist/client.mjs +3 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1509 -772
- package/dist/index.mjs +1490 -749
- 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/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
- package/package.json +28 -27
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
package/dist/index.mjs
CHANGED
|
@@ -6,32 +6,38 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import React__default, { useState, useCallback, createContext, forwardRef, useContext,
|
|
9
|
+
import React__default, { useState, useCallback, useEffect, useRef, createContext, forwardRef, useContext, useMemo, startTransition, createElement, Component } from "react";
|
|
10
10
|
import { createPortal, findDOMNode } from "react-dom";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { withRef, cn as cn$1, withVariants, withProps, withCn, createPrimitiveElement } from "@udecode/cn";
|
|
12
|
+
import { toggleList, ELEMENT_UL, ELEMENT_OL, ELEMENT_H1 as ELEMENT_H1$1, ELEMENT_H2 as ELEMENT_H2$1, ELEMENT_H3 as ELEMENT_H3$1, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_PARAGRAPH, ELEMENT_BLOCKQUOTE, ELEMENT_CODE_BLOCK, ELEMENT_CODE_LINE, ELEMENT_CODE_SYNTAX, ELEMENT_LI, ELEMENT_LINK, MARK_CODE, MARK_UNDERLINE, MARK_STRIKETHROUGH, MARK_ITALIC, MARK_BOLD, ELEMENT_HR, ELEMENT_TABLE, ELEMENT_TR, ELEMENT_TD, ELEMENT_TH, unwrapList, ELEMENT_TODO_LI, createTrailingBlockPlugin, createAutoformatPlugin, createExitBreakPlugin, KEYS_HEADING, createResetNodePlugin, createHeadingPlugin, createParagraphPlugin, createBlockquotePlugin, createBoldPlugin, createItalicPlugin, createUnderlinePlugin, createCodePlugin, createListPlugin, createIndentListPlugin, createHorizontalRulePlugin, createNodeIdPlugin, createTablePlugin, getListItemEntry, useListToolbarButtonState, useListToolbarButton } from "@udecode/plate";
|
|
13
|
+
import { PlateElement, isCollapsed, findNodePath, getPointAfter, insertNodes, ELEMENT_DEFAULT, focusEditor, getPointBefore, setNodes, isElement, PlateLeaf, createPluginFactory, useComposedRef, useEditorRef, createPointRef, insertText, moveSelection, toggleNodeType, useElement, useRemoveNodeButton, useEditorSelector, isSelectionExpanded, withHOC, normalizeEditor, getBlockAbove, queryNode, getParentNode, isType, someNode, isSelectionAtBlockStart, setElements, insertNode, getPluginType, isBlock, isBlockAboveEmpty, findNode, PlateContent, getNodeEntries, useEditorState, collapseSelection, useMarkToolbarButtonState, useMarkToolbarButton, insertEmptyElement, usePlateSelectors, useEventEditorSelectors, PortalBody, useFormInputProps, createPlugins, Plate } from "@udecode/plate-common";
|
|
13
14
|
import { ELEMENT_SLASH_INPUT, createSlashPlugin } from "@udecode/plate-slash-command";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
15
|
+
import { useSelected, useReadOnly, ReactEditor } from "slate-react";
|
|
16
|
+
import { useCodeBlockElementState, useCodeSyntaxLeaf, ELEMENT_CODE_BLOCK as ELEMENT_CODE_BLOCK$1 } from "@udecode/plate-code-block";
|
|
17
|
+
import MonacoEditor, { loader, useMonaco } from "@monaco-editor/react";
|
|
18
|
+
import { Combobox, ComboboxInput, ComboboxButton, Transition, ComboboxOptions, ComboboxOption, Popover as Popover$3, PopoverButton, PopoverPanel, TransitionChild, Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItems, MenuItem } from "@headlessui/react";
|
|
17
19
|
import { cva } from "class-variance-authority";
|
|
18
|
-
import { Plus, AlignCenter as AlignCenter$1, AlignJustify, AlignLeft as AlignLeft$1, AlignRight as AlignRight$1, ChevronDown, PaintBucket, Quote, Check, ChevronRight, ChevronsUpDown, X, FileCode, Baseline, RectangleVertical, Combine, Ungroup, MessageSquare, MessageSquarePlus, Trash, GripVertical, Edit2, Smile, ExternalLink, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Indent, Keyboard, WrapText, Minus, MoreHorizontal, Outdent, Pilcrow, RotateCcw, RectangleHorizontal, Search, Settings, Strikethrough, Subscript, Superscript, Table, Text, Underline, Link2Off,
|
|
19
|
-
import
|
|
20
|
+
import { Eye, SquarePen, Plus, AlignCenter as AlignCenter$1, AlignJustify, AlignLeft as AlignLeft$1, AlignRight as AlignRight$1, ChevronDown, PaintBucket, Quote, Check, ChevronRight, ChevronsUpDown, X, FileCode, Baseline, RectangleVertical, Combine, Ungroup, MessageSquare, MessageSquarePlus, Trash, GripVertical, Edit2, Smile, ExternalLink, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Indent, Keyboard, WrapText, Minus, MoreHorizontal, Outdent, Pilcrow, RotateCcw, RectangleHorizontal, Search, Settings, Strikethrough, Subscript, Superscript, Table, Text, Underline, Link2Off, Moon, SunMedium, Twitter } from "lucide-react";
|
|
21
|
+
import mermaid from "mermaid";
|
|
22
|
+
import { ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4 as ELEMENT_H4$1, ELEMENT_H5 as ELEMENT_H5$1, ELEMENT_H6 as ELEMENT_H6$1 } from "@udecode/plate-heading";
|
|
23
|
+
import { useComboboxContext, Combobox as Combobox$1, useComboboxStore, ComboboxProvider, Portal, ComboboxPopover, ComboboxItem } from "@ariakit/react";
|
|
20
24
|
import { useHTMLInputCursorState, useComboboxInput, filterWords } from "@udecode/plate-combobox";
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
25
|
+
import { useTableCellElementState, useTableCellElement, useTableCellElementResizableState, useTableCellElementResizable, useTableBordersDropdownMenuContentState, useTableMergeState, TableProvider, useTableElementState, useTableElement, mergeTableCells, unmergeTableCells, ELEMENT_TABLE as ELEMENT_TABLE$1, getTableColumnCount, insertTable, deleteTable, insertTableColumn, deleteColumn, insertTableRow, deleteRow } from "@udecode/plate-table";
|
|
26
|
+
import { ResizeHandle as ResizeHandle$1 } from "@udecode/plate-resizable";
|
|
27
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
28
|
+
import { PopoverAnchor } from "@radix-ui/react-popover";
|
|
29
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
30
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
31
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
24
32
|
import arrayMutators from "final-form-arrays";
|
|
25
33
|
import setFieldData from "final-form-set-field-data";
|
|
26
34
|
import { FORM_ERROR, createForm, getIn } from "final-form";
|
|
27
35
|
import { Field, Form as Form$1 } from "react-final-form";
|
|
28
36
|
import PropTypes from "prop-types";
|
|
29
37
|
import { Droppable, Draggable, DragDropContext } from "react-beautiful-dnd";
|
|
30
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
31
38
|
import * as pkg$1 from "react-color";
|
|
32
39
|
import * as pkg from "color-string";
|
|
33
40
|
import * as dropzone from "react-dropzone";
|
|
34
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
35
41
|
import { clsx } from "clsx";
|
|
36
42
|
import { twMerge } from "tailwind-merge";
|
|
37
43
|
import { Command as Command$1 } from "cmdk";
|
|
@@ -42,10 +48,8 @@ import moment from "moment";
|
|
|
42
48
|
import { formatDistanceToNow } from "date-fns";
|
|
43
49
|
import { useLinkToolbarButtonState, useLinkToolbarButton, useFloatingLinkInsertState, useFloatingLinkInsert, useFloatingLinkEditState, useFloatingLinkEdit, FloatingLinkUrlInput, LinkOpenButton, createLinkPlugin } from "@udecode/plate-link";
|
|
44
50
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
45
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
46
51
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
47
52
|
import { ELEMENT_PARAGRAPH as ELEMENT_PARAGRAPH$1 } from "@udecode/plate-paragraph";
|
|
48
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
49
53
|
import { ELEMENT_BLOCKQUOTE as ELEMENT_BLOCKQUOTE$1 } from "@udecode/plate-block-quote";
|
|
50
54
|
import { useFloatingToolbarState, offset, flip, useFloatingToolbar } from "@udecode/plate-floating";
|
|
51
55
|
import { useWindowWidth } from "@react-hook/window-size";
|
|
@@ -797,6 +801,22 @@ function wrapFieldsWithMeta(Field2) {
|
|
|
797
801
|
);
|
|
798
802
|
};
|
|
799
803
|
}
|
|
804
|
+
function wrapFieldWithNoHeader(Field2) {
|
|
805
|
+
return (props) => {
|
|
806
|
+
return /* @__PURE__ */ React.createElement(
|
|
807
|
+
FieldMeta,
|
|
808
|
+
{
|
|
809
|
+
name: props.input.name,
|
|
810
|
+
label: false,
|
|
811
|
+
description: "",
|
|
812
|
+
error: props.meta.error,
|
|
813
|
+
index: props.index,
|
|
814
|
+
tinaForm: props.tinaForm
|
|
815
|
+
},
|
|
816
|
+
/* @__PURE__ */ React.createElement(Field2, { ...props })
|
|
817
|
+
);
|
|
818
|
+
};
|
|
819
|
+
}
|
|
800
820
|
function wrapFieldWithError(Field2) {
|
|
801
821
|
return (props) => {
|
|
802
822
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -869,6 +889,16 @@ const FieldDescription = ({
|
|
|
869
889
|
className,
|
|
870
890
|
...props
|
|
871
891
|
}) => {
|
|
892
|
+
if (typeof children === "string") {
|
|
893
|
+
return /* @__PURE__ */ React.createElement(
|
|
894
|
+
"span",
|
|
895
|
+
{
|
|
896
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
897
|
+
...props,
|
|
898
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
}
|
|
872
902
|
return /* @__PURE__ */ React.createElement(
|
|
873
903
|
"span",
|
|
874
904
|
{
|
|
@@ -905,6 +935,20 @@ const useEditorContext = () => {
|
|
|
905
935
|
const useTemplates = () => {
|
|
906
936
|
return React__default.useContext(EditorContext);
|
|
907
937
|
};
|
|
938
|
+
const BlockquoteElement = withRef(
|
|
939
|
+
({ children, className, ...props }, ref) => {
|
|
940
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
941
|
+
PlateElement,
|
|
942
|
+
{
|
|
943
|
+
asChild: true,
|
|
944
|
+
className: cn$1("my-1 border-l-2 pl-6 italic", className),
|
|
945
|
+
ref,
|
|
946
|
+
...props
|
|
947
|
+
},
|
|
948
|
+
/* @__PURE__ */ React__default.createElement("blockquote", null, children)
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
);
|
|
908
952
|
function classNames$1(...classes) {
|
|
909
953
|
return classes.filter(Boolean).join(" ");
|
|
910
954
|
}
|
|
@@ -914,6 +958,503 @@ const uuid = () => {
|
|
|
914
958
|
(c) => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
|
915
959
|
);
|
|
916
960
|
};
|
|
961
|
+
function ChevronDownIcon(props, svgRef) {
|
|
962
|
+
return /* @__PURE__ */ React.createElement("svg", Object.assign({
|
|
963
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
964
|
+
viewBox: "0 0 20 20",
|
|
965
|
+
fill: "currentColor",
|
|
966
|
+
"aria-hidden": "true",
|
|
967
|
+
ref: svgRef
|
|
968
|
+
}, props), /* @__PURE__ */ React.createElement("path", {
|
|
969
|
+
fillRule: "evenodd",
|
|
970
|
+
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",
|
|
971
|
+
clipRule: "evenodd"
|
|
972
|
+
}));
|
|
973
|
+
}
|
|
974
|
+
const ForwardRef = React.forwardRef(ChevronDownIcon);
|
|
975
|
+
const ChevronDownIcon$1 = ForwardRef;
|
|
976
|
+
const Autocomplete = ({
|
|
977
|
+
value,
|
|
978
|
+
onChange,
|
|
979
|
+
defaultQuery,
|
|
980
|
+
items: items2
|
|
981
|
+
}) => {
|
|
982
|
+
const [query, setQuery] = React__default.useState(defaultQuery ?? "");
|
|
983
|
+
const filteredItems = React__default.useMemo(() => {
|
|
984
|
+
try {
|
|
985
|
+
const reFilter = new RegExp(query, "i");
|
|
986
|
+
const _items = items2.filter((item) => reFilter.test(item.label));
|
|
987
|
+
if (_items.length === 0)
|
|
988
|
+
return items2;
|
|
989
|
+
return _items;
|
|
990
|
+
} catch (err) {
|
|
991
|
+
return items2;
|
|
992
|
+
}
|
|
993
|
+
}, [items2, query]);
|
|
994
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
995
|
+
Combobox,
|
|
996
|
+
{
|
|
997
|
+
value,
|
|
998
|
+
onChange,
|
|
999
|
+
as: "div",
|
|
1000
|
+
className: "relative inline-block text-left z-20"
|
|
1001
|
+
},
|
|
1002
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "mt-1" }, /* @__PURE__ */ React__default.createElement("div", { className: "relative w-full cursor-default overflow-hidden rounded-lg bg-white text-left shadow-md sm:text-sm" }, /* @__PURE__ */ React__default.createElement(
|
|
1003
|
+
ComboboxInput,
|
|
1004
|
+
{
|
|
1005
|
+
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",
|
|
1006
|
+
displayValue: (item) => (item == null ? void 0 : item.label) ?? "Plain Text",
|
|
1007
|
+
onChange: (event) => setQuery(event.target.value),
|
|
1008
|
+
onClick: (ev) => ev.stopPropagation()
|
|
1009
|
+
}
|
|
1010
|
+
), /* @__PURE__ */ React__default.createElement(ComboboxButton, { className: "absolute inset-y-0 right-0 flex items-center pr-2" }, /* @__PURE__ */ React__default.createElement(
|
|
1011
|
+
ChevronDownIcon$1,
|
|
1012
|
+
{
|
|
1013
|
+
className: "h-5 w-5 text-gray-400",
|
|
1014
|
+
"aria-hidden": "true"
|
|
1015
|
+
}
|
|
1016
|
+
)))),
|
|
1017
|
+
/* @__PURE__ */ React__default.createElement(
|
|
1018
|
+
Transition,
|
|
1019
|
+
{
|
|
1020
|
+
enter: "transition ease-out duration-100",
|
|
1021
|
+
enterFrom: "transform opacity-0 scale-95",
|
|
1022
|
+
enterTo: "transform opacity-100 scale-100",
|
|
1023
|
+
leave: "transition ease-in duration-75",
|
|
1024
|
+
leaveFrom: "transform opacity-100 scale-100",
|
|
1025
|
+
leaveTo: "transform opacity-0 scale-95"
|
|
1026
|
+
},
|
|
1027
|
+
/* @__PURE__ */ React__default.createElement(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__default.createElement(ComboboxOption, { key: item.key, value: item }, ({ focus }) => /* @__PURE__ */ React__default.createElement(
|
|
1028
|
+
"button",
|
|
1029
|
+
{
|
|
1030
|
+
className: classNames$1(
|
|
1031
|
+
focus ? "bg-gray-100 text-gray-900" : "text-gray-700",
|
|
1032
|
+
"block px-4 py-2 text-xs w-full text-right"
|
|
1033
|
+
)
|
|
1034
|
+
},
|
|
1035
|
+
item.render(item)
|
|
1036
|
+
))))
|
|
1037
|
+
)
|
|
1038
|
+
);
|
|
1039
|
+
};
|
|
1040
|
+
loader.config({
|
|
1041
|
+
paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs" }
|
|
1042
|
+
});
|
|
1043
|
+
let retryCount = 0;
|
|
1044
|
+
const retryFocus = (ref) => {
|
|
1045
|
+
if (ref.current) {
|
|
1046
|
+
ref.current.focus();
|
|
1047
|
+
} else {
|
|
1048
|
+
if (retryCount < 30) {
|
|
1049
|
+
setTimeout(() => {
|
|
1050
|
+
retryCount = retryCount + 1;
|
|
1051
|
+
retryFocus(ref);
|
|
1052
|
+
}, 100);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
const MINIMUM_HEIGHT = 75;
|
|
1057
|
+
const CodeBlock = ({
|
|
1058
|
+
attributes,
|
|
1059
|
+
editor,
|
|
1060
|
+
element,
|
|
1061
|
+
language: restrictLanguage,
|
|
1062
|
+
onChangeCallback,
|
|
1063
|
+
defaultValue,
|
|
1064
|
+
...props
|
|
1065
|
+
}) => {
|
|
1066
|
+
const [navigateAway, setNavigateAway] = React__default.useState(null);
|
|
1067
|
+
const monaco = useMonaco();
|
|
1068
|
+
const monacoEditorRef = React__default.useRef(null);
|
|
1069
|
+
const selected = useSelected();
|
|
1070
|
+
const [height, setHeight] = React__default.useState(MINIMUM_HEIGHT);
|
|
1071
|
+
React__default.useEffect(() => {
|
|
1072
|
+
if (selected && isCollapsed(editor.selection)) {
|
|
1073
|
+
retryFocus(monacoEditorRef);
|
|
1074
|
+
}
|
|
1075
|
+
}, [selected, monacoEditorRef.current]);
|
|
1076
|
+
const value = element.value || "";
|
|
1077
|
+
if (typeof value !== "string") {
|
|
1078
|
+
throw new Error("Element must be of type string for code block");
|
|
1079
|
+
}
|
|
1080
|
+
const language = restrictLanguage || element.lang;
|
|
1081
|
+
const id = React__default.useMemo(() => uuid(), []);
|
|
1082
|
+
const languages = React__default.useMemo(() => {
|
|
1083
|
+
const defaultLangSet = { "": "plain text" };
|
|
1084
|
+
if (!monaco)
|
|
1085
|
+
return defaultLangSet;
|
|
1086
|
+
return monaco.languages.getLanguages().reduce((ac, cv) => {
|
|
1087
|
+
if (cv.id === "plaintext")
|
|
1088
|
+
return ac;
|
|
1089
|
+
return { ...ac, [cv.id]: cv.id };
|
|
1090
|
+
}, defaultLangSet);
|
|
1091
|
+
}, [monaco]);
|
|
1092
|
+
React__default.useEffect(() => {
|
|
1093
|
+
if (monaco) {
|
|
1094
|
+
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
|
|
1095
|
+
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
1096
|
+
// disable errors
|
|
1097
|
+
noSemanticValidation: true,
|
|
1098
|
+
noSyntaxValidation: true
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
}, [monaco]);
|
|
1102
|
+
const items2 = Object.entries(languages).map(([key, label]) => ({
|
|
1103
|
+
key,
|
|
1104
|
+
label,
|
|
1105
|
+
render: (item) => item.label
|
|
1106
|
+
}));
|
|
1107
|
+
const currentItem = React__default.useMemo(() => {
|
|
1108
|
+
return items2.find((item) => item.key === language) ?? {
|
|
1109
|
+
key: "",
|
|
1110
|
+
label: "Plain Text"
|
|
1111
|
+
};
|
|
1112
|
+
}, [items2, language]);
|
|
1113
|
+
React__default.useEffect(() => {
|
|
1114
|
+
if (navigateAway) {
|
|
1115
|
+
setNavigateAway(null);
|
|
1116
|
+
switch (navigateAway) {
|
|
1117
|
+
case "remove":
|
|
1118
|
+
{
|
|
1119
|
+
focusEditor(editor);
|
|
1120
|
+
setNodes(
|
|
1121
|
+
editor,
|
|
1122
|
+
{
|
|
1123
|
+
type: "p",
|
|
1124
|
+
children: [{ text: "" }],
|
|
1125
|
+
lang: void 0,
|
|
1126
|
+
value: void 0
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
match: (n) => {
|
|
1130
|
+
if (isElement(n) && n.type === element.type) {
|
|
1131
|
+
return true;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
break;
|
|
1138
|
+
case "insertNext":
|
|
1139
|
+
{
|
|
1140
|
+
insertNodes(
|
|
1141
|
+
editor,
|
|
1142
|
+
[
|
|
1143
|
+
{
|
|
1144
|
+
type: ELEMENT_DEFAULT,
|
|
1145
|
+
children: [{ text: "" }],
|
|
1146
|
+
lang: void 0,
|
|
1147
|
+
value: void 0
|
|
1148
|
+
}
|
|
1149
|
+
],
|
|
1150
|
+
{ select: true }
|
|
1151
|
+
);
|
|
1152
|
+
focusEditor(editor);
|
|
1153
|
+
}
|
|
1154
|
+
break;
|
|
1155
|
+
case "up":
|
|
1156
|
+
{
|
|
1157
|
+
const path = findNodePath(editor, element);
|
|
1158
|
+
if (!path) {
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
const previousNodePath = getPointBefore(editor, path);
|
|
1162
|
+
if (!previousNodePath) {
|
|
1163
|
+
focusEditor(editor);
|
|
1164
|
+
insertNodes(
|
|
1165
|
+
editor,
|
|
1166
|
+
[
|
|
1167
|
+
{
|
|
1168
|
+
type: ELEMENT_DEFAULT,
|
|
1169
|
+
children: [{ text: "" }],
|
|
1170
|
+
lang: void 0,
|
|
1171
|
+
value: void 0
|
|
1172
|
+
}
|
|
1173
|
+
],
|
|
1174
|
+
// Insert a new node at the current path, resulting in the code_block
|
|
1175
|
+
// moving down one block
|
|
1176
|
+
{ at: path, select: true }
|
|
1177
|
+
);
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
focusEditor(editor, previousNodePath);
|
|
1181
|
+
}
|
|
1182
|
+
break;
|
|
1183
|
+
case "down": {
|
|
1184
|
+
const path = findNodePath(editor, element);
|
|
1185
|
+
if (!path) {
|
|
1186
|
+
return;
|
|
1187
|
+
}
|
|
1188
|
+
const nextNodePath = getPointAfter(editor, path);
|
|
1189
|
+
if (!nextNodePath) {
|
|
1190
|
+
insertNodes(
|
|
1191
|
+
editor,
|
|
1192
|
+
[
|
|
1193
|
+
{
|
|
1194
|
+
type: ELEMENT_DEFAULT,
|
|
1195
|
+
children: [{ text: "" }],
|
|
1196
|
+
lang: void 0,
|
|
1197
|
+
value: void 0
|
|
1198
|
+
}
|
|
1199
|
+
],
|
|
1200
|
+
{ select: true }
|
|
1201
|
+
);
|
|
1202
|
+
focusEditor(editor);
|
|
1203
|
+
} else {
|
|
1204
|
+
focusEditor(editor, nextNodePath);
|
|
1205
|
+
}
|
|
1206
|
+
break;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
}, [navigateAway]);
|
|
1211
|
+
function handleEditorDidMount(monacoEditor, monaco2) {
|
|
1212
|
+
monacoEditorRef.current = monacoEditor;
|
|
1213
|
+
monacoEditor.onDidContentSizeChange(() => {
|
|
1214
|
+
setHeight(
|
|
1215
|
+
monacoEditor.getContentHeight() > MINIMUM_HEIGHT ? monacoEditor.getContentHeight() : MINIMUM_HEIGHT
|
|
1216
|
+
);
|
|
1217
|
+
monacoEditor.layout();
|
|
1218
|
+
});
|
|
1219
|
+
setNodes(editor, { value: defaultValue, lang: language });
|
|
1220
|
+
monacoEditor.addCommand(monaco2.KeyMod.Shift | monaco2.KeyCode.Enter, () => {
|
|
1221
|
+
if (monacoEditor.hasTextFocus()) {
|
|
1222
|
+
setNavigateAway("insertNext");
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
monacoEditor.onKeyDown((l) => {
|
|
1226
|
+
if (l.code === "ArrowUp") {
|
|
1227
|
+
const selection = monacoEditor.getSelection();
|
|
1228
|
+
if (selection.endLineNumber === 1 && selection.startLineNumber === 1) {
|
|
1229
|
+
setNavigateAway("up");
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
if (l.code === "ArrowDown") {
|
|
1233
|
+
const selection = monacoEditor.getSelection();
|
|
1234
|
+
const totalLines = monacoEditor.getModel().getLineCount();
|
|
1235
|
+
if (selection.endLineNumber === totalLines && selection.startLineNumber === totalLines) {
|
|
1236
|
+
setNavigateAway("down");
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
if (l.code === "Backspace") {
|
|
1240
|
+
const selection = monacoEditor.getSelection();
|
|
1241
|
+
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) {
|
|
1242
|
+
setNavigateAway("remove");
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
1248
|
+
"div",
|
|
1249
|
+
{
|
|
1250
|
+
...attributes,
|
|
1251
|
+
className: "relative mb-2 mt-0.5 rounded-lg shadow-md p-2 border-gray-200 border"
|
|
1252
|
+
},
|
|
1253
|
+
/* @__PURE__ */ React__default.createElement("style", null, `.monaco-editor .editor-widget {
|
|
1254
|
+
display: none !important;
|
|
1255
|
+
visibility: hidden !important;
|
|
1256
|
+
}`),
|
|
1257
|
+
props.children,
|
|
1258
|
+
/* @__PURE__ */ React__default.createElement("div", { contentEditable: false }, !restrictLanguage && /* @__PURE__ */ React__default.createElement("div", { className: "flex justify-between pb-2" }, /* @__PURE__ */ React__default.createElement("div", null), /* @__PURE__ */ React__default.createElement(
|
|
1259
|
+
Autocomplete,
|
|
1260
|
+
{
|
|
1261
|
+
items: items2,
|
|
1262
|
+
value: currentItem,
|
|
1263
|
+
defaultQuery: "plaintext",
|
|
1264
|
+
onChange: (item) => setNodes(editor, { lang: item.key })
|
|
1265
|
+
}
|
|
1266
|
+
)), /* @__PURE__ */ React__default.createElement("div", { style: { height: `${height}px` } }, /* @__PURE__ */ React__default.createElement(
|
|
1267
|
+
MonacoEditor,
|
|
1268
|
+
{
|
|
1269
|
+
path: id,
|
|
1270
|
+
onMount: handleEditorDidMount,
|
|
1271
|
+
options: {
|
|
1272
|
+
scrollBeyondLastLine: false,
|
|
1273
|
+
// automaticLayout: true,
|
|
1274
|
+
tabSize: 2,
|
|
1275
|
+
disableLayerHinting: true,
|
|
1276
|
+
accessibilitySupport: "off",
|
|
1277
|
+
codeLens: false,
|
|
1278
|
+
wordWrap: "on",
|
|
1279
|
+
minimap: {
|
|
1280
|
+
enabled: false
|
|
1281
|
+
},
|
|
1282
|
+
fontSize: 14,
|
|
1283
|
+
lineHeight: 2,
|
|
1284
|
+
formatOnPaste: true,
|
|
1285
|
+
lineNumbers: "off",
|
|
1286
|
+
formatOnType: true,
|
|
1287
|
+
fixedOverflowWidgets: true,
|
|
1288
|
+
// Takes too much horizontal space for iframe
|
|
1289
|
+
folding: false,
|
|
1290
|
+
renderLineHighlight: "none",
|
|
1291
|
+
scrollbar: {
|
|
1292
|
+
verticalScrollbarSize: 1,
|
|
1293
|
+
horizontalScrollbarSize: 1,
|
|
1294
|
+
// https://github.com/microsoft/monaco-editor/issues/2007#issuecomment-644425664
|
|
1295
|
+
alwaysConsumeMouseWheel: false
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
language: String(language),
|
|
1299
|
+
value: String(element.value),
|
|
1300
|
+
onChange: (value2) => {
|
|
1301
|
+
onChangeCallback == null ? void 0 : onChangeCallback(value2);
|
|
1302
|
+
setNodes(editor, { value: value2, lang: language });
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
)))
|
|
1306
|
+
);
|
|
1307
|
+
};
|
|
1308
|
+
const CodeBlockElement = withRef(
|
|
1309
|
+
({ className, ...props }, ref) => {
|
|
1310
|
+
const { element } = props;
|
|
1311
|
+
const state = useCodeBlockElementState({ element });
|
|
1312
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
1313
|
+
PlateElement,
|
|
1314
|
+
{
|
|
1315
|
+
className: cn$1("relative py-1", state.className, className),
|
|
1316
|
+
ref,
|
|
1317
|
+
...props
|
|
1318
|
+
},
|
|
1319
|
+
/* @__PURE__ */ React__default.createElement(CodeBlock, { ...props })
|
|
1320
|
+
);
|
|
1321
|
+
}
|
|
1322
|
+
);
|
|
1323
|
+
const CodeLeaf = withRef(
|
|
1324
|
+
({ children, className, ...props }, ref) => {
|
|
1325
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
1326
|
+
PlateLeaf,
|
|
1327
|
+
{
|
|
1328
|
+
asChild: true,
|
|
1329
|
+
className: cn$1(
|
|
1330
|
+
"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm",
|
|
1331
|
+
className
|
|
1332
|
+
),
|
|
1333
|
+
ref,
|
|
1334
|
+
...props
|
|
1335
|
+
},
|
|
1336
|
+
/* @__PURE__ */ React__default.createElement("code", null, children)
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
);
|
|
1340
|
+
const CodeLineElement = withRef((props, ref) => /* @__PURE__ */ React__default.createElement(PlateElement, { ref, ...props }));
|
|
1341
|
+
const CodeSyntaxLeaf = withRef(
|
|
1342
|
+
({ children, ...props }, ref) => {
|
|
1343
|
+
const { leaf } = props;
|
|
1344
|
+
const { tokenProps } = useCodeSyntaxLeaf({ leaf });
|
|
1345
|
+
return /* @__PURE__ */ React__default.createElement(PlateLeaf, { ref, ...props }, /* @__PURE__ */ React__default.createElement("span", { ...tokenProps }, children));
|
|
1346
|
+
}
|
|
1347
|
+
);
|
|
1348
|
+
const listVariants = cva("m-0 ps-6", {
|
|
1349
|
+
variants: {
|
|
1350
|
+
variant: {
|
|
1351
|
+
ol: "list-decimal",
|
|
1352
|
+
ul: "list-disc [&_ul]:list-[circle] [&_ul_ul]:list-[square]"
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
const ListElementVariants = withVariants(PlateElement, listVariants, [
|
|
1357
|
+
"variant"
|
|
1358
|
+
]);
|
|
1359
|
+
const ListElement = withRef(
|
|
1360
|
+
({ children, variant = "ul", ...props }, ref) => {
|
|
1361
|
+
const Component2 = variant;
|
|
1362
|
+
return /* @__PURE__ */ React__default.createElement(ListElementVariants, { asChild: true, ref, variant, ...props }, /* @__PURE__ */ React__default.createElement(Component2, null, children));
|
|
1363
|
+
}
|
|
1364
|
+
);
|
|
1365
|
+
const ELEMENT_MERMAID = "mermaid";
|
|
1366
|
+
const createMermaidPlugin = createPluginFactory({
|
|
1367
|
+
isElement: true,
|
|
1368
|
+
isVoid: true,
|
|
1369
|
+
isInline: false,
|
|
1370
|
+
key: ELEMENT_MERMAID
|
|
1371
|
+
});
|
|
1372
|
+
const MermaidElementWithRef = ({ config }) => {
|
|
1373
|
+
const mermaidRef = useRef(null);
|
|
1374
|
+
useEffect(() => {
|
|
1375
|
+
if (mermaidRef.current) {
|
|
1376
|
+
mermaid.initialize({ startOnLoad: true });
|
|
1377
|
+
mermaid.init();
|
|
1378
|
+
}
|
|
1379
|
+
}, [config]);
|
|
1380
|
+
return /* @__PURE__ */ React__default.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React__default.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React__default.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
1381
|
+
};
|
|
1382
|
+
const Bubble = ({ children }) => {
|
|
1383
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "bg-blue-600 rounded-full p-2 transition-transform duration-200 ease-in-out hover:scale-110" }, children);
|
|
1384
|
+
};
|
|
1385
|
+
const ErrorMsg = ({ error }) => {
|
|
1386
|
+
if (error) {
|
|
1387
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
1388
|
+
"div",
|
|
1389
|
+
{
|
|
1390
|
+
contentEditable: false,
|
|
1391
|
+
className: "font-mono bg-red-600 text-white p-2 rounded-md cursor-default"
|
|
1392
|
+
},
|
|
1393
|
+
error
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
return null;
|
|
1397
|
+
};
|
|
1398
|
+
const DEFAULT_MERMAID_CONFIG = `%% This won't render without implementing a rendering engine (e.g. mermaid on npm)
|
|
1399
|
+
flowchart TD
|
|
1400
|
+
id1(this is an example flow diagram)
|
|
1401
|
+
--> id2(modify me to see changes!)
|
|
1402
|
+
id2
|
|
1403
|
+
--> id3(Click the top button to preview the changes)
|
|
1404
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1405
|
+
const MermaidElement = withRef(
|
|
1406
|
+
({ children, nodeProps, element, ...props }, ref) => {
|
|
1407
|
+
const [mermaidConfig, setMermaidConfig] = useState(
|
|
1408
|
+
element.value || DEFAULT_MERMAID_CONFIG
|
|
1409
|
+
);
|
|
1410
|
+
const [isEditing, setIsEditing] = useState(
|
|
1411
|
+
mermaidConfig === DEFAULT_MERMAID_CONFIG || false
|
|
1412
|
+
);
|
|
1413
|
+
const [mermaidError, setMermaidError] = useState(null);
|
|
1414
|
+
const node = {
|
|
1415
|
+
type: ELEMENT_MERMAID,
|
|
1416
|
+
value: mermaidConfig,
|
|
1417
|
+
children: [{ type: "text", text: "" }]
|
|
1418
|
+
};
|
|
1419
|
+
useEffect(() => {
|
|
1420
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1421
|
+
setMermaidError(null);
|
|
1422
|
+
}
|
|
1423
|
+
}, [mermaidConfig]);
|
|
1424
|
+
mermaid.parseError = (err) => {
|
|
1425
|
+
setMermaidError(
|
|
1426
|
+
String(err.message) || "An error occurred while parsing the diagram."
|
|
1427
|
+
);
|
|
1428
|
+
};
|
|
1429
|
+
return /* @__PURE__ */ React__default.createElement(PlateElement, { element, ref, ...props }, /* @__PURE__ */ React__default.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__default.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__default.createElement(Bubble, null, isEditing ? /* @__PURE__ */ React__default.createElement(
|
|
1430
|
+
Eye,
|
|
1431
|
+
{
|
|
1432
|
+
className: "w-5 h-5 fill-white cursor-pointer",
|
|
1433
|
+
onClick: () => {
|
|
1434
|
+
setIsEditing(!isEditing);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
) : /* @__PURE__ */ React__default.createElement(
|
|
1438
|
+
SquarePen,
|
|
1439
|
+
{
|
|
1440
|
+
className: "w-5 h-5 fill-white cursor-pointer",
|
|
1441
|
+
onClick: () => {
|
|
1442
|
+
setIsEditing(!isEditing);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
))), isEditing ? /* @__PURE__ */ React__default.createElement(
|
|
1446
|
+
CodeBlock,
|
|
1447
|
+
{
|
|
1448
|
+
children: "",
|
|
1449
|
+
language: "yaml",
|
|
1450
|
+
...props,
|
|
1451
|
+
element: node,
|
|
1452
|
+
defaultValue: mermaidConfig,
|
|
1453
|
+
onChangeCallback: (value) => setMermaidConfig(value)
|
|
1454
|
+
}
|
|
1455
|
+
) : /* @__PURE__ */ React__default.createElement(MermaidElementWithRef, { config: mermaidConfig })), children, /* @__PURE__ */ React__default.createElement(ErrorMsg, { error: mermaidError }));
|
|
1456
|
+
}
|
|
1457
|
+
);
|
|
917
1458
|
const RawMarkdown = () => {
|
|
918
1459
|
return /* @__PURE__ */ React__default.createElement(
|
|
919
1460
|
"svg",
|
|
@@ -932,6 +1473,29 @@ const RawMarkdown = () => {
|
|
|
932
1473
|
/* @__PURE__ */ React__default.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" })
|
|
933
1474
|
);
|
|
934
1475
|
};
|
|
1476
|
+
const MermaidIcon = () => /* @__PURE__ */ React__default.createElement(
|
|
1477
|
+
"svg",
|
|
1478
|
+
{
|
|
1479
|
+
width: "100%",
|
|
1480
|
+
height: "100%",
|
|
1481
|
+
viewBox: "0 0 491 491",
|
|
1482
|
+
version: "1.1",
|
|
1483
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1484
|
+
fillRule: "evenodd",
|
|
1485
|
+
clipRule: "evenodd",
|
|
1486
|
+
strokeLinejoin: "round",
|
|
1487
|
+
strokeMiterlimit: 2
|
|
1488
|
+
},
|
|
1489
|
+
/* @__PURE__ */ React__default.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" }),
|
|
1490
|
+
/* @__PURE__ */ React__default.createElement(
|
|
1491
|
+
"path",
|
|
1492
|
+
{
|
|
1493
|
+
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",
|
|
1494
|
+
fill: "white",
|
|
1495
|
+
fillRule: "nonzero"
|
|
1496
|
+
}
|
|
1497
|
+
)
|
|
1498
|
+
);
|
|
935
1499
|
const borderAll = (props) => /* @__PURE__ */ React__default.createElement(
|
|
936
1500
|
"svg",
|
|
937
1501
|
{
|
|
@@ -1016,7 +1580,7 @@ const borderTop = (props) => /* @__PURE__ */ React__default.createElement(
|
|
|
1016
1580
|
},
|
|
1017
1581
|
/* @__PURE__ */ React__default.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" })
|
|
1018
1582
|
);
|
|
1019
|
-
cva("", {
|
|
1583
|
+
const iconVariants = cva("", {
|
|
1020
1584
|
variants: {
|
|
1021
1585
|
variant: {
|
|
1022
1586
|
toolbar: "size-5",
|
|
@@ -1172,6 +1736,7 @@ const Icons = {
|
|
|
1172
1736
|
clear: X,
|
|
1173
1737
|
close: X,
|
|
1174
1738
|
// code: Code2,
|
|
1739
|
+
paint: PaintBucket,
|
|
1175
1740
|
codeblock: FileCode,
|
|
1176
1741
|
color: Baseline,
|
|
1177
1742
|
column: RectangleVertical,
|
|
@@ -1197,6 +1762,7 @@ const Icons = {
|
|
|
1197
1762
|
lineHeight: WrapText,
|
|
1198
1763
|
// link: Link2,
|
|
1199
1764
|
minus: Minus,
|
|
1765
|
+
mermaid: MermaidIcon,
|
|
1200
1766
|
more: MoreHorizontal,
|
|
1201
1767
|
// ol: ListOrdered,
|
|
1202
1768
|
outdent: Outdent,
|
|
@@ -1607,7 +2173,7 @@ const InlineComboboxInput = forwardRef(({ className, ...props }, propRef) => {
|
|
|
1607
2173
|
},
|
|
1608
2174
|
value || ""
|
|
1609
2175
|
), /* @__PURE__ */ React__default.createElement(
|
|
1610
|
-
Combobox,
|
|
2176
|
+
Combobox$1,
|
|
1611
2177
|
{
|
|
1612
2178
|
autoSelect: true,
|
|
1613
2179
|
className: cn$1(
|
|
@@ -1767,417 +2333,482 @@ const SlashInputElement = withRef(
|
|
|
1767
2333
|
);
|
|
1768
2334
|
}
|
|
1769
2335
|
);
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
className: cn$1("my-1 border-l-2 pl-6 italic", className),
|
|
1794
|
-
ref,
|
|
1795
|
-
...props
|
|
1796
|
-
},
|
|
1797
|
-
/* @__PURE__ */ React__default.createElement("blockquote", null, children)
|
|
1798
|
-
);
|
|
1799
|
-
}
|
|
1800
|
-
);
|
|
1801
|
-
const CodeLeaf = withRef(
|
|
1802
|
-
({ children, className, ...props }, ref) => {
|
|
1803
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
1804
|
-
PlateLeaf,
|
|
1805
|
-
{
|
|
1806
|
-
asChild: true,
|
|
1807
|
-
className: cn$1(
|
|
1808
|
-
"whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm",
|
|
1809
|
-
className
|
|
1810
|
-
),
|
|
1811
|
-
ref,
|
|
1812
|
-
...props
|
|
1813
|
-
},
|
|
1814
|
-
/* @__PURE__ */ React__default.createElement("code", null, children)
|
|
1815
|
-
);
|
|
1816
|
-
}
|
|
1817
|
-
);
|
|
1818
|
-
const CodeLineElement = withRef((props, ref) => /* @__PURE__ */ React__default.createElement(PlateElement, { ref, ...props }));
|
|
1819
|
-
const CodeSyntaxLeaf = withRef(
|
|
1820
|
-
({ children, ...props }, ref) => {
|
|
1821
|
-
const { leaf } = props;
|
|
1822
|
-
const { tokenProps } = useCodeSyntaxLeaf({ leaf });
|
|
1823
|
-
return /* @__PURE__ */ React__default.createElement(PlateLeaf, { ref, ...props }, /* @__PURE__ */ React__default.createElement("span", { ...tokenProps }, children));
|
|
1824
|
-
}
|
|
1825
|
-
);
|
|
1826
|
-
function ChevronDownIcon(props, svgRef) {
|
|
1827
|
-
return /* @__PURE__ */ React.createElement("svg", Object.assign({
|
|
1828
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1829
|
-
viewBox: "0 0 20 20",
|
|
1830
|
-
fill: "currentColor",
|
|
1831
|
-
"aria-hidden": "true",
|
|
1832
|
-
ref: svgRef
|
|
1833
|
-
}, props), /* @__PURE__ */ React.createElement("path", {
|
|
1834
|
-
fillRule: "evenodd",
|
|
1835
|
-
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",
|
|
1836
|
-
clipRule: "evenodd"
|
|
1837
|
-
}));
|
|
1838
|
-
}
|
|
1839
|
-
const ForwardRef = React.forwardRef(ChevronDownIcon);
|
|
1840
|
-
const ChevronDownIcon$1 = ForwardRef;
|
|
1841
|
-
const Autocomplete = ({
|
|
1842
|
-
value,
|
|
1843
|
-
onChange,
|
|
1844
|
-
defaultQuery,
|
|
1845
|
-
items: items2
|
|
1846
|
-
}) => {
|
|
1847
|
-
const [query, setQuery] = React__default.useState(defaultQuery ?? "");
|
|
1848
|
-
const filteredItems = React__default.useMemo(() => {
|
|
1849
|
-
try {
|
|
1850
|
-
const reFilter = new RegExp(query, "i");
|
|
1851
|
-
const _items = items2.filter((item) => reFilter.test(item.label));
|
|
1852
|
-
if (_items.length === 0)
|
|
1853
|
-
return items2;
|
|
1854
|
-
return _items;
|
|
1855
|
-
} catch (err) {
|
|
1856
|
-
return items2;
|
|
1857
|
-
}
|
|
1858
|
-
}, [items2, query]);
|
|
2336
|
+
const TableCellElement = withRef(({ children, className, hideBorder, isHeader, style, ...props }, ref) => {
|
|
2337
|
+
var _a, _b, _c, _d;
|
|
2338
|
+
const { element } = props;
|
|
2339
|
+
const {
|
|
2340
|
+
borders,
|
|
2341
|
+
colIndex,
|
|
2342
|
+
colSpan,
|
|
2343
|
+
hovered,
|
|
2344
|
+
hoveredLeft,
|
|
2345
|
+
isSelectingCell,
|
|
2346
|
+
readOnly,
|
|
2347
|
+
rowIndex,
|
|
2348
|
+
rowSize,
|
|
2349
|
+
selected
|
|
2350
|
+
} = useTableCellElementState();
|
|
2351
|
+
const { props: cellProps } = useTableCellElement({ element: props.element });
|
|
2352
|
+
const resizableState = useTableCellElementResizableState({
|
|
2353
|
+
colIndex,
|
|
2354
|
+
colSpan,
|
|
2355
|
+
rowIndex
|
|
2356
|
+
});
|
|
2357
|
+
const { bottomProps, hiddenLeft, leftProps, rightProps } = useTableCellElementResizable(resizableState);
|
|
2358
|
+
const Cell = isHeader ? "th" : "td";
|
|
1859
2359
|
return /* @__PURE__ */ React__default.createElement(
|
|
1860
|
-
|
|
2360
|
+
PlateElement,
|
|
1861
2361
|
{
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
2362
|
+
asChild: true,
|
|
2363
|
+
className: cn$1(
|
|
2364
|
+
"relative h-full overflow-visible border-none bg-background p-0",
|
|
2365
|
+
hideBorder && "before:border-none",
|
|
2366
|
+
element.background ? "bg-[--cellBackground]" : "bg-background",
|
|
2367
|
+
!hideBorder && cn$1(
|
|
2368
|
+
isHeader && "text-left [&_>_*]:m-0",
|
|
2369
|
+
"before:size-full",
|
|
2370
|
+
selected && "before:z-10 before:bg-muted",
|
|
2371
|
+
"before:absolute before:box-border before:select-none before:content-['']",
|
|
2372
|
+
borders && cn$1(
|
|
2373
|
+
((_a = borders.bottom) == null ? void 0 : _a.size) && `before:border-b before:border-b-border`,
|
|
2374
|
+
((_b = borders.right) == null ? void 0 : _b.size) && `before:border-r before:border-r-border`,
|
|
2375
|
+
((_c = borders.left) == null ? void 0 : _c.size) && `before:border-l before:border-l-border`,
|
|
2376
|
+
((_d = borders.top) == null ? void 0 : _d.size) && `before:border-t before:border-t-border`
|
|
2377
|
+
)
|
|
2378
|
+
),
|
|
2379
|
+
className
|
|
2380
|
+
),
|
|
2381
|
+
ref,
|
|
2382
|
+
...cellProps,
|
|
2383
|
+
...props,
|
|
2384
|
+
style: {
|
|
2385
|
+
"--cellBackground": element.background,
|
|
2386
|
+
...style
|
|
1874
2387
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
2388
|
+
},
|
|
2389
|
+
/* @__PURE__ */ React__default.createElement(Cell, null, /* @__PURE__ */ React__default.createElement(
|
|
2390
|
+
"div",
|
|
1877
2391
|
{
|
|
1878
|
-
className: "h-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2392
|
+
className: "relative z-20 box-border h-full px-3 py-2",
|
|
2393
|
+
style: {
|
|
2394
|
+
minHeight: rowSize
|
|
2395
|
+
}
|
|
2396
|
+
},
|
|
2397
|
+
children
|
|
2398
|
+
), !isSelectingCell && /* @__PURE__ */ React__default.createElement(
|
|
2399
|
+
"div",
|
|
1884
2400
|
{
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
leave: "transition ease-in duration-75",
|
|
1889
|
-
leaveFrom: "transform opacity-100 scale-100",
|
|
1890
|
-
leaveTo: "transform opacity-0 scale-95"
|
|
2401
|
+
className: "group absolute top-0 size-full select-none",
|
|
2402
|
+
contentEditable: false,
|
|
2403
|
+
suppressContentEditableWarning: true
|
|
1891
2404
|
},
|
|
1892
|
-
|
|
1893
|
-
|
|
2405
|
+
!readOnly && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
2406
|
+
ResizeHandle$1,
|
|
1894
2407
|
{
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
2408
|
+
...rightProps,
|
|
2409
|
+
className: "-top-3 right-[-5px] w-[10px]"
|
|
2410
|
+
}
|
|
2411
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
2412
|
+
ResizeHandle$1,
|
|
2413
|
+
{
|
|
2414
|
+
...bottomProps,
|
|
2415
|
+
className: "bottom-[-5px] h-[10px]"
|
|
2416
|
+
}
|
|
2417
|
+
), !hiddenLeft && /* @__PURE__ */ React__default.createElement(
|
|
2418
|
+
ResizeHandle$1,
|
|
2419
|
+
{
|
|
2420
|
+
...leftProps,
|
|
2421
|
+
className: "-top-3 left-[-5px] w-[10px]"
|
|
2422
|
+
}
|
|
2423
|
+
), hovered && /* @__PURE__ */ React__default.createElement(
|
|
2424
|
+
"div",
|
|
2425
|
+
{
|
|
2426
|
+
className: cn$1(
|
|
2427
|
+
"absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring",
|
|
2428
|
+
"right-[-1.5px]"
|
|
1898
2429
|
)
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
2430
|
+
}
|
|
2431
|
+
), hoveredLeft && /* @__PURE__ */ React__default.createElement(
|
|
2432
|
+
"div",
|
|
2433
|
+
{
|
|
2434
|
+
className: cn$1(
|
|
2435
|
+
"absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring",
|
|
2436
|
+
"left-[-1.5px]"
|
|
2437
|
+
)
|
|
2438
|
+
}
|
|
2439
|
+
))
|
|
2440
|
+
))
|
|
1903
2441
|
);
|
|
1904
|
-
};
|
|
1905
|
-
loader.config({
|
|
1906
|
-
paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs" }
|
|
1907
2442
|
});
|
|
1908
|
-
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
2443
|
+
TableCellElement.displayName = "TableCellElement";
|
|
2444
|
+
const TableCellHeaderElement = withProps(TableCellElement, {
|
|
2445
|
+
isHeader: true
|
|
2446
|
+
});
|
|
2447
|
+
const buttonVariants$1 = cva(
|
|
2448
|
+
"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",
|
|
2449
|
+
{
|
|
2450
|
+
defaultVariants: {
|
|
2451
|
+
size: "default",
|
|
2452
|
+
variant: "default"
|
|
2453
|
+
},
|
|
2454
|
+
variants: {
|
|
2455
|
+
isMenu: {
|
|
2456
|
+
true: "h-auto w-full cursor-pointer justify-start"
|
|
2457
|
+
},
|
|
2458
|
+
size: {
|
|
2459
|
+
default: "h-10 px-4 py-2",
|
|
2460
|
+
icon: "size-10",
|
|
2461
|
+
lg: "h-11 rounded-md px-8",
|
|
2462
|
+
none: "",
|
|
2463
|
+
sm: "h-9 rounded-md px-3",
|
|
2464
|
+
sms: "size-9 rounded-md px-0",
|
|
2465
|
+
xs: "h-8 rounded-md px-3"
|
|
2466
|
+
},
|
|
2467
|
+
variant: {
|
|
2468
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
2469
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
2470
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
2471
|
+
inlineLink: "text-base text-primary underline underline-offset-4",
|
|
2472
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
2473
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
2474
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80"
|
|
2475
|
+
}
|
|
1936
2476
|
}
|
|
1937
|
-
}, [selected, monacoEditorRef.current]);
|
|
1938
|
-
const value = element.value || "";
|
|
1939
|
-
if (typeof value !== "string") {
|
|
1940
|
-
throw new Error("Element must be of type string for code block");
|
|
1941
2477
|
}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
const
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
return { ...ac, [cv.id]: cv.id };
|
|
1952
|
-
}, defaultLangSet);
|
|
1953
|
-
}, [monaco]);
|
|
1954
|
-
React__default.useEffect(() => {
|
|
1955
|
-
if (monaco) {
|
|
1956
|
-
monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
|
|
1957
|
-
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
1958
|
-
// disable errors
|
|
1959
|
-
noSemanticValidation: true,
|
|
1960
|
-
noSyntaxValidation: true
|
|
1961
|
-
});
|
|
2478
|
+
);
|
|
2479
|
+
const Button$2 = withRef(({ asChild = false, className, isMenu, size, variant, ...props }, ref) => {
|
|
2480
|
+
const Comp = asChild ? Slot : "button";
|
|
2481
|
+
return /* @__PURE__ */ React.createElement(
|
|
2482
|
+
Comp,
|
|
2483
|
+
{
|
|
2484
|
+
className: cn$1(buttonVariants$1({ className, isMenu, size, variant })),
|
|
2485
|
+
ref,
|
|
2486
|
+
...props
|
|
1962
2487
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
{
|
|
2006
|
-
type: ELEMENT_DEFAULT,
|
|
2007
|
-
children: [{ text: "" }],
|
|
2008
|
-
lang: void 0,
|
|
2009
|
-
value: void 0
|
|
2010
|
-
}
|
|
2011
|
-
],
|
|
2012
|
-
{ select: true }
|
|
2013
|
-
);
|
|
2014
|
-
focusEditor(editor);
|
|
2015
|
-
}
|
|
2016
|
-
break;
|
|
2017
|
-
case "up":
|
|
2018
|
-
{
|
|
2019
|
-
const path = findNodePath(editor, element);
|
|
2020
|
-
if (!path) {
|
|
2021
|
-
return;
|
|
2022
|
-
}
|
|
2023
|
-
const previousNodePath = getPointBefore(editor, path);
|
|
2024
|
-
if (!previousNodePath) {
|
|
2025
|
-
focusEditor(editor);
|
|
2026
|
-
insertNodes(
|
|
2027
|
-
editor,
|
|
2028
|
-
[
|
|
2029
|
-
{
|
|
2030
|
-
type: ELEMENT_DEFAULT,
|
|
2031
|
-
children: [{ text: "" }],
|
|
2032
|
-
lang: void 0,
|
|
2033
|
-
value: void 0
|
|
2034
|
-
}
|
|
2035
|
-
],
|
|
2036
|
-
// Insert a new node at the current path, resulting in the code_block
|
|
2037
|
-
// moving down one block
|
|
2038
|
-
{ at: path, select: true }
|
|
2039
|
-
);
|
|
2040
|
-
return;
|
|
2041
|
-
}
|
|
2042
|
-
focusEditor(editor, previousNodePath);
|
|
2043
|
-
}
|
|
2044
|
-
break;
|
|
2045
|
-
case "down": {
|
|
2046
|
-
const path = findNodePath(editor, element);
|
|
2047
|
-
if (!path) {
|
|
2048
|
-
return;
|
|
2049
|
-
}
|
|
2050
|
-
const nextNodePath = getPointAfter(editor, path);
|
|
2051
|
-
if (!nextNodePath) {
|
|
2052
|
-
insertNodes(
|
|
2053
|
-
editor,
|
|
2054
|
-
[
|
|
2055
|
-
{
|
|
2056
|
-
type: ELEMENT_DEFAULT,
|
|
2057
|
-
children: [{ text: "" }],
|
|
2058
|
-
lang: void 0,
|
|
2059
|
-
value: void 0
|
|
2060
|
-
}
|
|
2061
|
-
],
|
|
2062
|
-
{ select: true }
|
|
2063
|
-
);
|
|
2064
|
-
focusEditor(editor);
|
|
2065
|
-
} else {
|
|
2066
|
-
focusEditor(editor, nextNodePath);
|
|
2067
|
-
}
|
|
2068
|
-
break;
|
|
2069
|
-
}
|
|
2488
|
+
);
|
|
2489
|
+
});
|
|
2490
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2491
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
2492
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
2493
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
2494
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
2495
|
+
const DropdownMenuSubTrigger = withRef(({ children, className, inset, ...props }, ref) => /* @__PURE__ */ React__default.createElement(
|
|
2496
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
2497
|
+
{
|
|
2498
|
+
className: cn$1(
|
|
2499
|
+
"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",
|
|
2500
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2501
|
+
inset && "pl-8",
|
|
2502
|
+
className
|
|
2503
|
+
),
|
|
2504
|
+
ref,
|
|
2505
|
+
...props
|
|
2506
|
+
},
|
|
2507
|
+
children,
|
|
2508
|
+
/* @__PURE__ */ React__default.createElement(Icons.chevronRight, { className: "ml-auto size-4" })
|
|
2509
|
+
));
|
|
2510
|
+
const DropdownMenuSubContent = withCn(
|
|
2511
|
+
DropdownMenuPrimitive.SubContent,
|
|
2512
|
+
"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"
|
|
2513
|
+
);
|
|
2514
|
+
const DropdownMenuContentVariants = withProps(DropdownMenuPrimitive.Content, {
|
|
2515
|
+
className: cn$1(
|
|
2516
|
+
"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"
|
|
2517
|
+
),
|
|
2518
|
+
sideOffset: 4
|
|
2519
|
+
});
|
|
2520
|
+
const DropdownMenuContent = withRef(({ ...props }, ref) => /* @__PURE__ */ React__default.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(DropdownMenuContentVariants, { ref, ...props })));
|
|
2521
|
+
const menuItemVariants = cva(
|
|
2522
|
+
cn$1(
|
|
2523
|
+
"relative flex h-9 cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",
|
|
2524
|
+
"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
2525
|
+
),
|
|
2526
|
+
{
|
|
2527
|
+
variants: {
|
|
2528
|
+
inset: {
|
|
2529
|
+
true: "pl-8"
|
|
2070
2530
|
}
|
|
2071
2531
|
}
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2532
|
+
}
|
|
2533
|
+
);
|
|
2534
|
+
const DropdownMenuItem = withVariants(
|
|
2535
|
+
DropdownMenuPrimitive.Item,
|
|
2536
|
+
menuItemVariants,
|
|
2537
|
+
["inset"]
|
|
2538
|
+
);
|
|
2539
|
+
const DropdownMenuCheckboxItem = withRef(({ children, className, ...props }, ref) => /* @__PURE__ */ React__default.createElement(
|
|
2540
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
2541
|
+
{
|
|
2542
|
+
className: cn$1(
|
|
2543
|
+
"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",
|
|
2544
|
+
"cursor-pointer",
|
|
2545
|
+
className
|
|
2546
|
+
),
|
|
2547
|
+
ref,
|
|
2548
|
+
...props
|
|
2549
|
+
},
|
|
2550
|
+
/* @__PURE__ */ React__default.createElement("span", { className: "absolute left-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React__default.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React__default.createElement(Icons.check, { className: "size-4" }))),
|
|
2551
|
+
children
|
|
2552
|
+
));
|
|
2553
|
+
const DropdownMenuRadioItem = withRef(({ children, className, hideIcon, ...props }, ref) => /* @__PURE__ */ React__default.createElement(
|
|
2554
|
+
DropdownMenuPrimitive.RadioItem,
|
|
2555
|
+
{
|
|
2556
|
+
className: cn$1(
|
|
2557
|
+
"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",
|
|
2558
|
+
"h-9 cursor-pointer px-2 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground",
|
|
2559
|
+
className
|
|
2560
|
+
),
|
|
2561
|
+
ref,
|
|
2562
|
+
...props
|
|
2563
|
+
},
|
|
2564
|
+
!hideIcon && /* @__PURE__ */ React__default.createElement("span", { className: "absolute right-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React__default.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React__default.createElement(Icons.check, { className: "size-4" }))),
|
|
2565
|
+
children
|
|
2566
|
+
));
|
|
2567
|
+
const dropdownMenuLabelVariants = cva(
|
|
2568
|
+
cn$1("select-none px-2 py-1.5 text-sm font-semibold"),
|
|
2569
|
+
{
|
|
2570
|
+
variants: {
|
|
2571
|
+
inset: {
|
|
2572
|
+
true: "pl-8"
|
|
2103
2573
|
}
|
|
2104
|
-
}
|
|
2574
|
+
}
|
|
2105
2575
|
}
|
|
2576
|
+
);
|
|
2577
|
+
const DropdownMenuLabel = withVariants(
|
|
2578
|
+
DropdownMenuPrimitive.Label,
|
|
2579
|
+
dropdownMenuLabelVariants,
|
|
2580
|
+
["inset"]
|
|
2581
|
+
);
|
|
2582
|
+
const DropdownMenuSeparator = withCn(
|
|
2583
|
+
DropdownMenuPrimitive.Separator,
|
|
2584
|
+
"-mx-1 my-1 h-px bg-muted"
|
|
2585
|
+
);
|
|
2586
|
+
withCn(
|
|
2587
|
+
createPrimitiveElement("span"),
|
|
2588
|
+
"ml-auto text-xs tracking-widest opacity-60"
|
|
2589
|
+
);
|
|
2590
|
+
const useOpenState = () => {
|
|
2591
|
+
const [open2, setOpen] = useState(false);
|
|
2592
|
+
const onOpenChange = useCallback(
|
|
2593
|
+
(_value = !open2) => {
|
|
2594
|
+
setOpen(_value);
|
|
2595
|
+
},
|
|
2596
|
+
[open2]
|
|
2597
|
+
);
|
|
2598
|
+
return {
|
|
2599
|
+
onOpenChange,
|
|
2600
|
+
open: open2
|
|
2601
|
+
};
|
|
2602
|
+
};
|
|
2603
|
+
const Popover$2 = PopoverPrimitive.Root;
|
|
2604
|
+
const popoverVariants = cva(
|
|
2605
|
+
"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"
|
|
2606
|
+
);
|
|
2607
|
+
const PopoverContent$1 = withRef(
|
|
2608
|
+
({ align = "center", className, sideOffset = 4, style, ...props }, ref) => /* @__PURE__ */ React.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
|
|
2609
|
+
PopoverPrimitive.Content,
|
|
2610
|
+
{
|
|
2611
|
+
align,
|
|
2612
|
+
className: cn$1(popoverVariants(), className),
|
|
2613
|
+
ref,
|
|
2614
|
+
sideOffset,
|
|
2615
|
+
style: { zIndex: 1e3, ...style },
|
|
2616
|
+
...props
|
|
2617
|
+
}
|
|
2618
|
+
))
|
|
2619
|
+
);
|
|
2620
|
+
const separatorVariants = cva("shrink-0 bg-border", {
|
|
2621
|
+
defaultVariants: {
|
|
2622
|
+
orientation: "horizontal"
|
|
2623
|
+
},
|
|
2624
|
+
variants: {
|
|
2625
|
+
orientation: {
|
|
2626
|
+
horizontal: "h-px w-full",
|
|
2627
|
+
vertical: "h-full w-px"
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
});
|
|
2631
|
+
const Separator = withVariants(
|
|
2632
|
+
withProps(SeparatorPrimitive.Root, {
|
|
2633
|
+
decorative: true,
|
|
2634
|
+
orientation: "horizontal"
|
|
2635
|
+
}),
|
|
2636
|
+
separatorVariants
|
|
2637
|
+
);
|
|
2638
|
+
const TableBordersDropdownMenuContent = withRef((props, ref) => {
|
|
2639
|
+
const {
|
|
2640
|
+
getOnSelectTableBorder,
|
|
2641
|
+
hasBottomBorder,
|
|
2642
|
+
hasLeftBorder,
|
|
2643
|
+
hasNoBorders,
|
|
2644
|
+
hasOuterBorders,
|
|
2645
|
+
hasRightBorder,
|
|
2646
|
+
hasTopBorder
|
|
2647
|
+
} = useTableBordersDropdownMenuContentState();
|
|
2106
2648
|
return /* @__PURE__ */ React__default.createElement(
|
|
2107
|
-
|
|
2649
|
+
DropdownMenuContent,
|
|
2108
2650
|
{
|
|
2109
|
-
|
|
2110
|
-
className: "
|
|
2651
|
+
align: "start",
|
|
2652
|
+
className: cn$1("min-w-[220px]"),
|
|
2653
|
+
ref,
|
|
2654
|
+
side: "right",
|
|
2655
|
+
sideOffset: 0,
|
|
2656
|
+
...props
|
|
2111
2657
|
},
|
|
2112
|
-
/* @__PURE__ */ React__default.createElement(
|
|
2113
|
-
|
|
2114
|
-
visibility: hidden !important;
|
|
2115
|
-
}`),
|
|
2116
|
-
props.children,
|
|
2117
|
-
/* @__PURE__ */ React__default.createElement("div", { contentEditable: false }, !restrictLanguage && /* @__PURE__ */ React__default.createElement("div", { className: "flex justify-between pb-2" }, /* @__PURE__ */ React__default.createElement("div", null), /* @__PURE__ */ React__default.createElement(
|
|
2118
|
-
Autocomplete,
|
|
2658
|
+
/* @__PURE__ */ React__default.createElement(
|
|
2659
|
+
DropdownMenuCheckboxItem,
|
|
2119
2660
|
{
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
)
|
|
2126
|
-
|
|
2661
|
+
checked: hasBottomBorder,
|
|
2662
|
+
onCheckedChange: getOnSelectTableBorder("bottom")
|
|
2663
|
+
},
|
|
2664
|
+
/* @__PURE__ */ React__default.createElement(Icons.borderBottom, { className: iconVariants({ size: "sm" }) }),
|
|
2665
|
+
/* @__PURE__ */ React__default.createElement("div", null, "Bottom Border")
|
|
2666
|
+
),
|
|
2667
|
+
/* @__PURE__ */ React__default.createElement(
|
|
2668
|
+
DropdownMenuCheckboxItem,
|
|
2127
2669
|
{
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2670
|
+
checked: hasTopBorder,
|
|
2671
|
+
onCheckedChange: getOnSelectTableBorder("top")
|
|
2672
|
+
},
|
|
2673
|
+
/* @__PURE__ */ React__default.createElement(Icons.borderTop, { className: iconVariants({ size: "sm" }) }),
|
|
2674
|
+
/* @__PURE__ */ React__default.createElement("div", null, "Top Border")
|
|
2675
|
+
),
|
|
2676
|
+
/* @__PURE__ */ React__default.createElement(
|
|
2677
|
+
DropdownMenuCheckboxItem,
|
|
2678
|
+
{
|
|
2679
|
+
checked: hasLeftBorder,
|
|
2680
|
+
onCheckedChange: getOnSelectTableBorder("left")
|
|
2681
|
+
},
|
|
2682
|
+
/* @__PURE__ */ React__default.createElement(Icons.borderLeft, { className: iconVariants({ size: "sm" }) }),
|
|
2683
|
+
/* @__PURE__ */ React__default.createElement("div", null, "Left Border")
|
|
2684
|
+
),
|
|
2685
|
+
/* @__PURE__ */ React__default.createElement(
|
|
2686
|
+
DropdownMenuCheckboxItem,
|
|
2687
|
+
{
|
|
2688
|
+
checked: hasRightBorder,
|
|
2689
|
+
onCheckedChange: getOnSelectTableBorder("right")
|
|
2690
|
+
},
|
|
2691
|
+
/* @__PURE__ */ React__default.createElement(Icons.borderRight, { className: iconVariants({ size: "sm" }) }),
|
|
2692
|
+
/* @__PURE__ */ React__default.createElement("div", null, "Right Border")
|
|
2693
|
+
),
|
|
2694
|
+
/* @__PURE__ */ React__default.createElement(Separator, null),
|
|
2695
|
+
/* @__PURE__ */ React__default.createElement(
|
|
2696
|
+
DropdownMenuCheckboxItem,
|
|
2697
|
+
{
|
|
2698
|
+
checked: hasNoBorders,
|
|
2699
|
+
onCheckedChange: getOnSelectTableBorder("none")
|
|
2700
|
+
},
|
|
2701
|
+
/* @__PURE__ */ React__default.createElement(Icons.borderNone, { className: iconVariants({ size: "sm" }) }),
|
|
2702
|
+
/* @__PURE__ */ React__default.createElement("div", null, "No Border")
|
|
2703
|
+
),
|
|
2704
|
+
/* @__PURE__ */ React__default.createElement(
|
|
2705
|
+
DropdownMenuCheckboxItem,
|
|
2706
|
+
{
|
|
2707
|
+
checked: hasOuterBorders,
|
|
2708
|
+
onCheckedChange: getOnSelectTableBorder("outer")
|
|
2709
|
+
},
|
|
2710
|
+
/* @__PURE__ */ React__default.createElement(Icons.borderAll, { className: iconVariants({ size: "sm" }) }),
|
|
2711
|
+
/* @__PURE__ */ React__default.createElement("div", null, "Outside Borders")
|
|
2712
|
+
)
|
|
2164
2713
|
);
|
|
2165
|
-
};
|
|
2166
|
-
const
|
|
2167
|
-
({
|
|
2168
|
-
const
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2171
|
-
|
|
2714
|
+
});
|
|
2715
|
+
const TableFloatingToolbar = withRef(
|
|
2716
|
+
({ children, ...props }, ref) => {
|
|
2717
|
+
const element = useElement();
|
|
2718
|
+
const { props: buttonProps } = useRemoveNodeButton({ element });
|
|
2719
|
+
const selectionCollapsed = useEditorSelector(
|
|
2720
|
+
(editor2) => !isSelectionExpanded(editor2),
|
|
2721
|
+
[]
|
|
2722
|
+
);
|
|
2723
|
+
const readOnly = useReadOnly();
|
|
2724
|
+
const selected = useSelected();
|
|
2725
|
+
const editor = useEditorRef();
|
|
2726
|
+
const collapsed = !readOnly && selected && selectionCollapsed;
|
|
2727
|
+
const open2 = !readOnly && selected;
|
|
2728
|
+
const { canMerge, canUnmerge } = useTableMergeState();
|
|
2729
|
+
const mergeContent = canMerge && /* @__PURE__ */ React__default.createElement(
|
|
2730
|
+
Button$2,
|
|
2172
2731
|
{
|
|
2173
|
-
|
|
2732
|
+
contentEditable: false,
|
|
2733
|
+
isMenu: true,
|
|
2734
|
+
onClick: () => mergeTableCells(editor),
|
|
2735
|
+
variant: "ghost"
|
|
2736
|
+
},
|
|
2737
|
+
/* @__PURE__ */ React__default.createElement(Icons.combine, { className: "mr-2 size-4" }),
|
|
2738
|
+
"Merge"
|
|
2739
|
+
);
|
|
2740
|
+
const unmergeButton = canUnmerge && /* @__PURE__ */ React__default.createElement(
|
|
2741
|
+
Button$2,
|
|
2742
|
+
{
|
|
2743
|
+
contentEditable: false,
|
|
2744
|
+
isMenu: true,
|
|
2745
|
+
onClick: () => unmergeTableCells(editor),
|
|
2746
|
+
variant: "ghost"
|
|
2747
|
+
},
|
|
2748
|
+
/* @__PURE__ */ React__default.createElement(Icons.ungroup, { className: "mr-2 size-4" }),
|
|
2749
|
+
"Unmerge"
|
|
2750
|
+
);
|
|
2751
|
+
const bordersContent = collapsed && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(DropdownMenu, { modal: false }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(Button$2, { isMenu: true, variant: "ghost" }, /* @__PURE__ */ React__default.createElement(Icons.borderAll, { className: "mr-2 size-4" }), "Borders")), /* @__PURE__ */ React__default.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React__default.createElement(TableBordersDropdownMenuContent, null))), /* @__PURE__ */ React__default.createElement(Button$2, { contentEditable: false, isMenu: true, variant: "ghost", ...buttonProps }, /* @__PURE__ */ React__default.createElement(Icons.delete, { className: "mr-2 size-4" }), "Delete"));
|
|
2752
|
+
return /* @__PURE__ */ React__default.createElement(Popover$2, { modal: false, open: open2 }, /* @__PURE__ */ React__default.createElement(PopoverAnchor, { asChild: true }, children), (canMerge || canUnmerge || collapsed) && /* @__PURE__ */ React__default.createElement(
|
|
2753
|
+
PopoverContent$1,
|
|
2754
|
+
{
|
|
2755
|
+
className: cn$1(
|
|
2756
|
+
popoverVariants(),
|
|
2757
|
+
"flex w-[220px] flex-col gap-1 p-1"
|
|
2758
|
+
),
|
|
2759
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
2174
2760
|
ref,
|
|
2175
2761
|
...props
|
|
2176
2762
|
},
|
|
2177
|
-
|
|
2178
|
-
|
|
2763
|
+
unmergeButton,
|
|
2764
|
+
mergeContent,
|
|
2765
|
+
bordersContent
|
|
2766
|
+
));
|
|
2179
2767
|
}
|
|
2180
2768
|
);
|
|
2769
|
+
const TableElement = withHOC(
|
|
2770
|
+
TableProvider,
|
|
2771
|
+
withRef(({ children, className, ...props }, ref) => {
|
|
2772
|
+
const { colSizes, isSelectingCell, marginLeft, minColumnWidth } = useTableElementState();
|
|
2773
|
+
const { colGroupProps, props: tableProps } = useTableElement();
|
|
2774
|
+
return /* @__PURE__ */ React__default.createElement(TableFloatingToolbar, null, /* @__PURE__ */ React__default.createElement("div", { style: { paddingLeft: marginLeft } }, /* @__PURE__ */ React__default.createElement(
|
|
2775
|
+
PlateElement,
|
|
2776
|
+
{
|
|
2777
|
+
asChild: true,
|
|
2778
|
+
className: cn$1(
|
|
2779
|
+
"my-4 ml-px mr-0 table h-px w-full table-fixed border-collapse",
|
|
2780
|
+
isSelectingCell && "[&_*::selection]:bg-none",
|
|
2781
|
+
className
|
|
2782
|
+
),
|
|
2783
|
+
ref,
|
|
2784
|
+
...tableProps,
|
|
2785
|
+
...props
|
|
2786
|
+
},
|
|
2787
|
+
/* @__PURE__ */ React__default.createElement("table", null, /* @__PURE__ */ React__default.createElement("colgroup", { ...colGroupProps }, colSizes.map((width, index) => /* @__PURE__ */ React__default.createElement(
|
|
2788
|
+
"col",
|
|
2789
|
+
{
|
|
2790
|
+
key: index,
|
|
2791
|
+
style: {
|
|
2792
|
+
minWidth: minColumnWidth,
|
|
2793
|
+
width: width || void 0
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
))), /* @__PURE__ */ React__default.createElement("tbody", { className: "min-w-full" }, children))
|
|
2797
|
+
)));
|
|
2798
|
+
})
|
|
2799
|
+
);
|
|
2800
|
+
const TableRowElement = withRef(({ children, hideBorder, ...props }, ref) => {
|
|
2801
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
2802
|
+
PlateElement,
|
|
2803
|
+
{
|
|
2804
|
+
asChild: true,
|
|
2805
|
+
className: cn$1("h-full", hideBorder && "border-none"),
|
|
2806
|
+
ref,
|
|
2807
|
+
...props
|
|
2808
|
+
},
|
|
2809
|
+
/* @__PURE__ */ React__default.createElement("tr", null, children)
|
|
2810
|
+
);
|
|
2811
|
+
});
|
|
2181
2812
|
const blockClasses = "mt-0.5";
|
|
2182
2813
|
const headerClasses = "font-normal";
|
|
2183
2814
|
const Components = () => {
|
|
@@ -2283,6 +2914,7 @@ const Components = () => {
|
|
|
2283
2914
|
}
|
|
2284
2915
|
)
|
|
2285
2916
|
),
|
|
2917
|
+
[ELEMENT_MERMAID]: MermaidElement,
|
|
2286
2918
|
[ELEMENT_BLOCKQUOTE]: BlockquoteElement,
|
|
2287
2919
|
[ELEMENT_CODE_BLOCK]: CodeBlockElement,
|
|
2288
2920
|
[ELEMENT_CODE_LINE]: CodeLineElement,
|
|
@@ -2363,7 +2995,11 @@ const Components = () => {
|
|
|
2363
2995
|
children,
|
|
2364
2996
|
selected && /* @__PURE__ */ React__default.createElement("span", { className: "absolute h-4 -top-2 inset-0 ring-2 ring-blue-100 ring-inset rounded-md z-10 pointer-events-none" })
|
|
2365
2997
|
);
|
|
2366
|
-
}
|
|
2998
|
+
},
|
|
2999
|
+
[ELEMENT_TABLE]: TableElement,
|
|
3000
|
+
[ELEMENT_TR]: TableRowElement,
|
|
3001
|
+
[ELEMENT_TD]: TableCellElement,
|
|
3002
|
+
[ELEMENT_TH]: TableCellHeaderElement
|
|
2367
3003
|
};
|
|
2368
3004
|
};
|
|
2369
3005
|
const createCodeBlockPlugin = createPluginFactory({
|
|
@@ -2773,7 +3409,9 @@ class Form {
|
|
|
2773
3409
|
{
|
|
2774
3410
|
type: "string",
|
|
2775
3411
|
label: "Caption",
|
|
2776
|
-
name: [templateName.replace(/\.props$/, ""), "caption"].join(
|
|
3412
|
+
name: [templateName.replace(/\.props$/, ""), "caption"].join(
|
|
3413
|
+
"."
|
|
3414
|
+
),
|
|
2777
3415
|
component: "text"
|
|
2778
3416
|
}
|
|
2779
3417
|
]
|
|
@@ -3091,7 +3729,7 @@ const Button$1 = ({
|
|
|
3091
3729
|
};
|
|
3092
3730
|
const sizeClasses = {
|
|
3093
3731
|
small: `text-xs h-8 px-3`,
|
|
3094
|
-
medium: `text-sm h-10 px-
|
|
3732
|
+
medium: `text-sm h-10 px-8`,
|
|
3095
3733
|
custom: ``
|
|
3096
3734
|
};
|
|
3097
3735
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -4324,7 +4962,28 @@ const NumberInput = ({
|
|
|
4324
4962
|
onChange,
|
|
4325
4963
|
value,
|
|
4326
4964
|
step
|
|
4327
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
4965
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
4966
|
+
Input,
|
|
4967
|
+
{
|
|
4968
|
+
type: "number",
|
|
4969
|
+
step,
|
|
4970
|
+
value,
|
|
4971
|
+
onChange: (event) => {
|
|
4972
|
+
const inputValue = event.target.value;
|
|
4973
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4974
|
+
if (onChange) {
|
|
4975
|
+
const syntheticEvent = {
|
|
4976
|
+
...event,
|
|
4977
|
+
target: {
|
|
4978
|
+
...event.target,
|
|
4979
|
+
value: newValue
|
|
4980
|
+
}
|
|
4981
|
+
};
|
|
4982
|
+
onChange(syntheticEvent);
|
|
4983
|
+
}
|
|
4984
|
+
}
|
|
4985
|
+
}
|
|
4986
|
+
);
|
|
4328
4987
|
function useCMS() {
|
|
4329
4988
|
return useCMS$1();
|
|
4330
4989
|
}
|
|
@@ -4433,7 +5092,7 @@ const ImageLoadingIndicator = () => /* @__PURE__ */ React.createElement("div", {
|
|
|
4433
5092
|
function cn(...inputs) {
|
|
4434
5093
|
return twMerge(clsx(inputs));
|
|
4435
5094
|
}
|
|
4436
|
-
const buttonVariants
|
|
5095
|
+
const buttonVariants = cva(
|
|
4437
5096
|
"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",
|
|
4438
5097
|
{
|
|
4439
5098
|
variants: {
|
|
@@ -4459,7 +5118,7 @@ const Button = React.forwardRef(
|
|
|
4459
5118
|
return /* @__PURE__ */ React.createElement(
|
|
4460
5119
|
Comp,
|
|
4461
5120
|
{
|
|
4462
|
-
className: cn(buttonVariants
|
|
5121
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
4463
5122
|
ref,
|
|
4464
5123
|
...props
|
|
4465
5124
|
}
|
|
@@ -5125,10 +5784,11 @@ const ItemDeleteButton = ({ onClick, disabled = false }) => {
|
|
|
5125
5784
|
return /* @__PURE__ */ React__default.createElement(
|
|
5126
5785
|
"button",
|
|
5127
5786
|
{
|
|
5128
|
-
|
|
5787
|
+
type: "button",
|
|
5788
|
+
className: `w-8 px-1 py-2.5 flex items-center justify-center text-gray-200 hover:opacity-100 opacity-30 hover:bg-gray-50 ${disabled && "pointer-events-none opacity-30 cursor-not-allowed"}`,
|
|
5129
5789
|
onClick
|
|
5130
5790
|
},
|
|
5131
|
-
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5791
|
+
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5132
5792
|
);
|
|
5133
5793
|
};
|
|
5134
5794
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -5158,7 +5818,7 @@ const BlockSelector = ({
|
|
|
5158
5818
|
return template.label ? template.label.toLowerCase().includes(filter.toLowerCase()) || name.toLowerCase().includes(filter.toLowerCase()) : name.toLowerCase().includes(filter.toLowerCase());
|
|
5159
5819
|
});
|
|
5160
5820
|
}, [filter]);
|
|
5161
|
-
return /* @__PURE__ */ React.createElement(Popover$
|
|
5821
|
+
return /* @__PURE__ */ React.createElement(Popover$3, null, ({ open: open2 }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PopoverButton, { as: "span" }, /* @__PURE__ */ React.createElement(
|
|
5162
5822
|
IconButton,
|
|
5163
5823
|
{
|
|
5164
5824
|
variant: open2 ? "secondary" : "primary",
|
|
@@ -5206,27 +5866,35 @@ const BlockSelector = ({
|
|
|
5206
5866
|
))))
|
|
5207
5867
|
))));
|
|
5208
5868
|
};
|
|
5209
|
-
const Group =
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5869
|
+
const Group = wrapFieldWithNoHeader(
|
|
5870
|
+
({ tinaForm, field }) => {
|
|
5871
|
+
const cms = useCMS$1();
|
|
5872
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5873
|
+
Header,
|
|
5874
|
+
{
|
|
5875
|
+
onClick: () => {
|
|
5876
|
+
const state = tinaForm.finalForm.getState();
|
|
5877
|
+
if (state.invalid === true) {
|
|
5878
|
+
cms.alerts.error("Cannot navigate away from an invalid form.");
|
|
5879
|
+
return;
|
|
5880
|
+
}
|
|
5881
|
+
cms.dispatch({
|
|
5882
|
+
type: "forms:set-active-field-name",
|
|
5883
|
+
value: { formId: tinaForm.id, fieldName: field.name }
|
|
5884
|
+
});
|
|
5220
5885
|
}
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5886
|
+
},
|
|
5887
|
+
field.label || field.name,
|
|
5888
|
+
field.description && /* @__PURE__ */ React.createElement(
|
|
5889
|
+
"span",
|
|
5890
|
+
{
|
|
5891
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0`,
|
|
5892
|
+
dangerouslySetInnerHTML: { __html: field.description }
|
|
5893
|
+
}
|
|
5894
|
+
)
|
|
5895
|
+
));
|
|
5896
|
+
}
|
|
5897
|
+
);
|
|
5230
5898
|
const Header = ({ onClick, children }) => {
|
|
5231
5899
|
return /* @__PURE__ */ React.createElement("div", { className: "pt-1 mb-5" }, /* @__PURE__ */ React.createElement(
|
|
5232
5900
|
"button",
|
|
@@ -7392,7 +8060,10 @@ const DateField = wrapFieldsWithMeta(
|
|
|
7392
8060
|
ReactDateTimeWithStyles,
|
|
7393
8061
|
{
|
|
7394
8062
|
value: input.value,
|
|
7395
|
-
onChange:
|
|
8063
|
+
onChange: (value) => {
|
|
8064
|
+
const newValue = value === "" ? void 0 : value;
|
|
8065
|
+
input.onChange(newValue);
|
|
8066
|
+
},
|
|
7396
8067
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
7397
8068
|
timeFormat: timeFormat || false,
|
|
7398
8069
|
inputProps: { className: textFieldClasses },
|
|
@@ -9723,7 +10394,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
9723
10394
|
"Event Log"
|
|
9724
10395
|
));
|
|
9725
10396
|
};
|
|
9726
|
-
const version = "2.
|
|
10397
|
+
const version = "2.5.1";
|
|
9727
10398
|
const Nav = ({
|
|
9728
10399
|
isLocalMode,
|
|
9729
10400
|
className = "",
|
|
@@ -12254,15 +12925,14 @@ const FormBuilder = ({
|
|
|
12254
12925
|
fields: fieldGroup.fields
|
|
12255
12926
|
}
|
|
12256
12927
|
) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null)
|
|
12257
|
-
)), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12928
|
+
)), !hideFooter && /* @__PURE__ */ React.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.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
|
|
12258
12929
|
ResetForm,
|
|
12259
12930
|
{
|
|
12260
12931
|
pristine,
|
|
12261
12932
|
reset: async () => {
|
|
12262
12933
|
finalForm.reset();
|
|
12263
12934
|
await tinaForm.reset();
|
|
12264
|
-
}
|
|
12265
|
-
style: { flexGrow: 1 }
|
|
12935
|
+
}
|
|
12266
12936
|
},
|
|
12267
12937
|
tinaForm.buttons.reset
|
|
12268
12938
|
), /* @__PURE__ */ React.createElement(
|
|
@@ -12271,8 +12941,7 @@ const FormBuilder = ({
|
|
|
12271
12941
|
onClick: safeHandleSubmit,
|
|
12272
12942
|
disabled: !canSubmit,
|
|
12273
12943
|
busy: submitting,
|
|
12274
|
-
variant: "primary"
|
|
12275
|
-
style: { flexGrow: 3 }
|
|
12944
|
+
variant: "primary"
|
|
12276
12945
|
},
|
|
12277
12946
|
submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
|
|
12278
12947
|
!submitting && tinaForm.buttons.save
|
|
@@ -12790,7 +13459,7 @@ const EmbedNestedForm = ({
|
|
|
12790
13459
|
);
|
|
12791
13460
|
};
|
|
12792
13461
|
const DotMenu = ({ onOpen, onRemove }) => {
|
|
12793
|
-
return /* @__PURE__ */ React__default.createElement(Popover$
|
|
13462
|
+
return /* @__PURE__ */ React__default.createElement(Popover$3, { as: "span", className: "-ml-px relative block" }, /* @__PURE__ */ React__default.createElement(
|
|
12794
13463
|
PopoverButton,
|
|
12795
13464
|
{
|
|
12796
13465
|
as: "span",
|
|
@@ -13230,13 +13899,26 @@ const plugins = [
|
|
|
13230
13899
|
createUnderlinePlugin(),
|
|
13231
13900
|
createCodePlugin(),
|
|
13232
13901
|
createListPlugin(),
|
|
13233
|
-
createIndentPlugin(),
|
|
13234
13902
|
createIndentListPlugin(),
|
|
13235
13903
|
createHorizontalRulePlugin(),
|
|
13236
13904
|
// Allows us to do things like copy/paste, remembering the state of the element (like mdx)
|
|
13237
13905
|
createNodeIdPlugin(),
|
|
13238
|
-
createSlashPlugin()
|
|
13906
|
+
createSlashPlugin(),
|
|
13907
|
+
createTablePlugin()
|
|
13239
13908
|
];
|
|
13909
|
+
const unsupportedItemsInTable = /* @__PURE__ */ new Set([
|
|
13910
|
+
"Code Block",
|
|
13911
|
+
"Unordered List",
|
|
13912
|
+
"Ordered List",
|
|
13913
|
+
"Quote",
|
|
13914
|
+
"Mermaid",
|
|
13915
|
+
"Heading 1",
|
|
13916
|
+
"Heading 2",
|
|
13917
|
+
"Heading 3",
|
|
13918
|
+
"Heading 4",
|
|
13919
|
+
"Heading 5",
|
|
13920
|
+
"Heading 6"
|
|
13921
|
+
]);
|
|
13240
13922
|
const isNodeActive = (editor, type) => {
|
|
13241
13923
|
const pluginType = getPluginType(editor, type);
|
|
13242
13924
|
return !!(editor == null ? void 0 : editor.selection) && someNode(editor, { match: { type: pluginType } });
|
|
@@ -13421,24 +14103,6 @@ const Editor = React__default.forwardRef(
|
|
|
13421
14103
|
}
|
|
13422
14104
|
);
|
|
13423
14105
|
Editor.displayName = "Editor";
|
|
13424
|
-
const separatorVariants = cva("shrink-0 bg-border", {
|
|
13425
|
-
defaultVariants: {
|
|
13426
|
-
orientation: "horizontal"
|
|
13427
|
-
},
|
|
13428
|
-
variants: {
|
|
13429
|
-
orientation: {
|
|
13430
|
-
horizontal: "h-px w-full",
|
|
13431
|
-
vertical: "h-full w-px"
|
|
13432
|
-
}
|
|
13433
|
-
}
|
|
13434
|
-
});
|
|
13435
|
-
const Separator = withVariants(
|
|
13436
|
-
withProps(SeparatorPrimitive.Root, {
|
|
13437
|
-
decorative: true,
|
|
13438
|
-
orientation: "horizontal"
|
|
13439
|
-
}),
|
|
13440
|
-
separatorVariants
|
|
13441
|
-
);
|
|
13442
14106
|
const TooltipProvider = TooltipPrimitive.Provider;
|
|
13443
14107
|
const Tooltip = TooltipPrimitive.Root;
|
|
13444
14108
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -13447,7 +14111,7 @@ const TooltipContent = withCn(
|
|
|
13447
14111
|
withProps(TooltipPrimitive.Content, {
|
|
13448
14112
|
sideOffset: 4
|
|
13449
14113
|
}),
|
|
13450
|
-
"z-
|
|
14114
|
+
"z-[9999] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md"
|
|
13451
14115
|
);
|
|
13452
14116
|
function withTooltip(Component2) {
|
|
13453
14117
|
return React__default.forwardRef(function ExtendComponent({ tooltip, tooltipContentProps, tooltipProps, ...props }, ref) {
|
|
@@ -13573,140 +14237,41 @@ const FixedToolbar = withCn(
|
|
|
13573
14237
|
Toolbar,
|
|
13574
14238
|
"p-1 sticky left-0 top-0 z-50 w-full justify-between overflow-x-auto border border-border bg-background"
|
|
13575
14239
|
);
|
|
13576
|
-
const
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
const IndentListToolbarButton = withRef(({ nodeType = ELEMENT_UL }, ref) => {
|
|
13582
|
-
const editor = useEditorState();
|
|
13583
|
-
const state = useListToolbarButtonState({ nodeType });
|
|
13584
|
-
const { props } = useListToolbarButton(state);
|
|
13585
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
13586
|
-
ToolbarButton,
|
|
13587
|
-
{
|
|
13588
|
-
ref,
|
|
13589
|
-
tooltip: nodeType === ELEMENT_UL ? "Bulleted List" : "Numbered List",
|
|
13590
|
-
...props,
|
|
13591
|
-
onClick: (e) => {
|
|
13592
|
-
e.preventDefault();
|
|
13593
|
-
e.stopPropagation();
|
|
13594
|
-
toggleList(editor, { type: nodeType });
|
|
13595
|
-
}
|
|
13596
|
-
},
|
|
13597
|
-
nodeType === ELEMENT_UL ? /* @__PURE__ */ React__default.createElement(Icons.ul, null) : /* @__PURE__ */ React__default.createElement(Icons.ol, null)
|
|
13598
|
-
);
|
|
13599
|
-
});
|
|
13600
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
13601
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
13602
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
13603
|
-
withRef(({ children, className, inset, ...props }, ref) => /* @__PURE__ */ React__default.createElement(
|
|
13604
|
-
DropdownMenuPrimitive.SubTrigger,
|
|
13605
|
-
{
|
|
13606
|
-
className: cn$1(
|
|
13607
|
-
"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",
|
|
13608
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
13609
|
-
inset && "pl-8",
|
|
13610
|
-
className
|
|
13611
|
-
),
|
|
13612
|
-
ref,
|
|
13613
|
-
...props
|
|
13614
|
-
},
|
|
13615
|
-
children,
|
|
13616
|
-
/* @__PURE__ */ React__default.createElement(Icons.chevronRight, { className: "ml-auto size-4" })
|
|
13617
|
-
));
|
|
13618
|
-
withCn(
|
|
13619
|
-
DropdownMenuPrimitive.SubContent,
|
|
13620
|
-
"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"
|
|
13621
|
-
);
|
|
13622
|
-
const DropdownMenuContentVariants = withProps(DropdownMenuPrimitive.Content, {
|
|
13623
|
-
className: cn$1(
|
|
13624
|
-
"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"
|
|
13625
|
-
),
|
|
13626
|
-
sideOffset: 4
|
|
13627
|
-
});
|
|
13628
|
-
const DropdownMenuContent = withRef(({ ...props }, ref) => /* @__PURE__ */ React__default.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(DropdownMenuContentVariants, { ref, ...props })));
|
|
13629
|
-
const menuItemVariants = cva(
|
|
13630
|
-
cn$1(
|
|
13631
|
-
"relative flex h-9 cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",
|
|
13632
|
-
"focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
13633
|
-
),
|
|
13634
|
-
{
|
|
13635
|
-
variants: {
|
|
13636
|
-
inset: {
|
|
13637
|
-
true: "pl-8"
|
|
14240
|
+
const useResize = (ref, callback) => {
|
|
14241
|
+
React__default.useEffect(() => {
|
|
14242
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
14243
|
+
for (const entry of entries) {
|
|
14244
|
+
callback(entry);
|
|
13638
14245
|
}
|
|
14246
|
+
});
|
|
14247
|
+
if (ref.current) {
|
|
14248
|
+
resizeObserver.observe(ref.current);
|
|
13639
14249
|
}
|
|
13640
|
-
|
|
13641
|
-
);
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
ref,
|
|
13656
|
-
...props
|
|
13657
|
-
},
|
|
13658
|
-
/* @__PURE__ */ React__default.createElement("span", { className: "absolute left-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React__default.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React__default.createElement(Icons.check, { className: "size-4" }))),
|
|
13659
|
-
children
|
|
13660
|
-
));
|
|
13661
|
-
const DropdownMenuRadioItem = withRef(({ children, className, hideIcon, ...props }, ref) => /* @__PURE__ */ React__default.createElement(
|
|
13662
|
-
DropdownMenuPrimitive.RadioItem,
|
|
13663
|
-
{
|
|
13664
|
-
className: cn$1(
|
|
13665
|
-
"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",
|
|
13666
|
-
"h-9 cursor-pointer px-2 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground",
|
|
13667
|
-
className
|
|
13668
|
-
),
|
|
13669
|
-
ref,
|
|
13670
|
-
...props
|
|
13671
|
-
},
|
|
13672
|
-
!hideIcon && /* @__PURE__ */ React__default.createElement("span", { className: "absolute right-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React__default.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React__default.createElement(Icons.check, { className: "size-4" }))),
|
|
14250
|
+
return () => resizeObserver.disconnect();
|
|
14251
|
+
}, [ref.current]);
|
|
14252
|
+
};
|
|
14253
|
+
const STANDARD_ICON_WIDTH = 32;
|
|
14254
|
+
const HEADING_ICON_WITH_TEXT = 127;
|
|
14255
|
+
const HEADING_ICON_ONLY = 58;
|
|
14256
|
+
const EMBED_ICON_WIDTH = 78;
|
|
14257
|
+
const CONTAINER_MD_BREAKPOINT = 448;
|
|
14258
|
+
const FLOAT_BUTTON_WIDTH = 25;
|
|
14259
|
+
const HEADING_LABEL = "Headings";
|
|
14260
|
+
const ToolbarContext = createContext(void 0);
|
|
14261
|
+
const ToolbarProvider = ({
|
|
14262
|
+
tinaForm,
|
|
14263
|
+
templates,
|
|
14264
|
+
overrides,
|
|
13673
14265
|
children
|
|
13674
|
-
)
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
}
|
|
13682
|
-
}
|
|
14266
|
+
}) => {
|
|
14267
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarContext.Provider, { value: { tinaForm, templates, overrides } }, children);
|
|
14268
|
+
};
|
|
14269
|
+
const useToolbarContext = () => {
|
|
14270
|
+
const context = useContext(ToolbarContext);
|
|
14271
|
+
if (!context) {
|
|
14272
|
+
throw new Error("useToolbarContext must be used within a ToolbarProvider");
|
|
13683
14273
|
}
|
|
13684
|
-
|
|
13685
|
-
const DropdownMenuLabel = withVariants(
|
|
13686
|
-
DropdownMenuPrimitive.Label,
|
|
13687
|
-
dropdownMenuLabelVariants,
|
|
13688
|
-
["inset"]
|
|
13689
|
-
);
|
|
13690
|
-
const DropdownMenuSeparator = withCn(
|
|
13691
|
-
DropdownMenuPrimitive.Separator,
|
|
13692
|
-
"-mx-1 my-1 h-px bg-muted"
|
|
13693
|
-
);
|
|
13694
|
-
withCn(
|
|
13695
|
-
createPrimitiveElement("span"),
|
|
13696
|
-
"ml-auto text-xs tracking-widest opacity-60"
|
|
13697
|
-
);
|
|
13698
|
-
const useOpenState = () => {
|
|
13699
|
-
const [open2, setOpen] = useState(false);
|
|
13700
|
-
const onOpenChange = useCallback(
|
|
13701
|
-
(_value = !open2) => {
|
|
13702
|
-
setOpen(_value);
|
|
13703
|
-
},
|
|
13704
|
-
[open2]
|
|
13705
|
-
);
|
|
13706
|
-
return {
|
|
13707
|
-
onOpenChange,
|
|
13708
|
-
open: open2
|
|
13709
|
-
};
|
|
14274
|
+
return context;
|
|
13710
14275
|
};
|
|
13711
14276
|
const items$1 = [
|
|
13712
14277
|
{
|
|
@@ -13772,7 +14337,9 @@ function HeadingsMenu(props) {
|
|
|
13772
14337
|
return allNodesMatchInitialNodeType ? initialNodeType : ELEMENT_PARAGRAPH$1;
|
|
13773
14338
|
}, []);
|
|
13774
14339
|
const editor = useEditorRef();
|
|
14340
|
+
const editorState = useEditorState();
|
|
13775
14341
|
const openState = useOpenState();
|
|
14342
|
+
const userInTable = helpers.isNodeActive(editorState, ELEMENT_TABLE$1);
|
|
13776
14343
|
const selectedItem = items$1.find((item) => item.value === value) ?? defaultItem$1;
|
|
13777
14344
|
const { icon: SelectedItemIcon, label: selectedItemLabel } = selectedItem;
|
|
13778
14345
|
return /* @__PURE__ */ React__default.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -13796,7 +14363,12 @@ function HeadingsMenu(props) {
|
|
|
13796
14363
|
},
|
|
13797
14364
|
value
|
|
13798
14365
|
},
|
|
13799
|
-
items$1.
|
|
14366
|
+
items$1.filter((item) => {
|
|
14367
|
+
if (userInTable) {
|
|
14368
|
+
return !unsupportedItemsInTable.has(item.label);
|
|
14369
|
+
}
|
|
14370
|
+
return true;
|
|
14371
|
+
}).map(({ icon: Icon, label, value: itemValue }) => /* @__PURE__ */ React__default.createElement(
|
|
13800
14372
|
DropdownMenuRadioItem,
|
|
13801
14373
|
{
|
|
13802
14374
|
className: "min-w-[180px]",
|
|
@@ -13808,42 +14380,6 @@ function HeadingsMenu(props) {
|
|
|
13808
14380
|
))
|
|
13809
14381
|
)));
|
|
13810
14382
|
}
|
|
13811
|
-
const LinkToolbarButton = withRef((rest, ref) => {
|
|
13812
|
-
const state = useLinkToolbarButtonState();
|
|
13813
|
-
const { props } = useLinkToolbarButton(state);
|
|
13814
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...props, ...rest }, /* @__PURE__ */ React__default.createElement(Icons.link, null));
|
|
13815
|
-
});
|
|
13816
|
-
const useBlockQuoteToolbarButtonState = () => {
|
|
13817
|
-
const editor = useEditorState();
|
|
13818
|
-
const isBlockActive = () => helpers.isNodeActive(editor, ELEMENT_BLOCKQUOTE$1);
|
|
13819
|
-
return {
|
|
13820
|
-
pressed: isBlockActive()
|
|
13821
|
-
};
|
|
13822
|
-
};
|
|
13823
|
-
const useBlockQuoteToolbarButton = (state) => {
|
|
13824
|
-
const editor = useEditorState();
|
|
13825
|
-
const onClick = () => {
|
|
13826
|
-
toggleNodeType(editor, {
|
|
13827
|
-
activeType: ELEMENT_BLOCKQUOTE$1
|
|
13828
|
-
});
|
|
13829
|
-
};
|
|
13830
|
-
const onMouseDown = (e) => {
|
|
13831
|
-
e.preventDefault();
|
|
13832
|
-
e.stopPropagation();
|
|
13833
|
-
};
|
|
13834
|
-
return {
|
|
13835
|
-
props: {
|
|
13836
|
-
onClick,
|
|
13837
|
-
onMouseDown,
|
|
13838
|
-
pressed: state.pressed
|
|
13839
|
-
}
|
|
13840
|
-
};
|
|
13841
|
-
};
|
|
13842
|
-
const QuoteToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
13843
|
-
const state = useBlockQuoteToolbarButtonState();
|
|
13844
|
-
const { props } = useBlockQuoteToolbarButton(state);
|
|
13845
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.quote, null));
|
|
13846
|
-
});
|
|
13847
14383
|
const useCodeBlockToolbarButtonState = () => {
|
|
13848
14384
|
const editor = useEditorState();
|
|
13849
14385
|
const isBlockActive = () => helpers.isNodeActive(editor, ELEMENT_CODE_BLOCK$1);
|
|
@@ -13905,6 +14441,116 @@ const ImageToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
|
13905
14441
|
const { props } = useImageToolbarButton(state);
|
|
13906
14442
|
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.image, null));
|
|
13907
14443
|
});
|
|
14444
|
+
const IndentListToolbarButton = withRef(({ nodeType = ELEMENT_UL }, ref) => {
|
|
14445
|
+
const editor = useEditorState();
|
|
14446
|
+
const state = useListToolbarButtonState({ nodeType });
|
|
14447
|
+
const { props } = useListToolbarButton(state);
|
|
14448
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14449
|
+
ToolbarButton,
|
|
14450
|
+
{
|
|
14451
|
+
ref,
|
|
14452
|
+
tooltip: nodeType === ELEMENT_UL ? "Bulleted List" : "Numbered List",
|
|
14453
|
+
...props,
|
|
14454
|
+
onClick: (e) => {
|
|
14455
|
+
e.preventDefault();
|
|
14456
|
+
e.stopPropagation();
|
|
14457
|
+
toggleList(editor, { type: nodeType });
|
|
14458
|
+
}
|
|
14459
|
+
},
|
|
14460
|
+
nodeType === ELEMENT_UL ? /* @__PURE__ */ React__default.createElement(Icons.ul, null) : /* @__PURE__ */ React__default.createElement(Icons.ol, null)
|
|
14461
|
+
);
|
|
14462
|
+
});
|
|
14463
|
+
const LinkToolbarButton = withRef((rest, ref) => {
|
|
14464
|
+
const state = useLinkToolbarButtonState();
|
|
14465
|
+
const { props } = useLinkToolbarButton(state);
|
|
14466
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...props, ...rest }, /* @__PURE__ */ React__default.createElement(Icons.link, null));
|
|
14467
|
+
});
|
|
14468
|
+
const MarkToolbarButton = withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
14469
|
+
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
14470
|
+
const { props } = useMarkToolbarButton(state);
|
|
14471
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest });
|
|
14472
|
+
});
|
|
14473
|
+
const useMermaidToolbarButtonState = () => {
|
|
14474
|
+
const editor = useEditorState();
|
|
14475
|
+
const isBlockActive = () => helpers.isNodeActive(editor, ELEMENT_MERMAID);
|
|
14476
|
+
return {
|
|
14477
|
+
pressed: isBlockActive()
|
|
14478
|
+
};
|
|
14479
|
+
};
|
|
14480
|
+
const useMermaidToolbarButton = (state) => {
|
|
14481
|
+
const editor = useEditorState();
|
|
14482
|
+
const onClick = () => {
|
|
14483
|
+
insertEmptyElement(editor, ELEMENT_MERMAID, {
|
|
14484
|
+
nextBlock: true,
|
|
14485
|
+
select: true
|
|
14486
|
+
});
|
|
14487
|
+
};
|
|
14488
|
+
const onMouseDown = (e) => {
|
|
14489
|
+
e.preventDefault();
|
|
14490
|
+
e.stopPropagation();
|
|
14491
|
+
};
|
|
14492
|
+
return {
|
|
14493
|
+
props: {
|
|
14494
|
+
onClick,
|
|
14495
|
+
onMouseDown,
|
|
14496
|
+
pressed: state.pressed
|
|
14497
|
+
}
|
|
14498
|
+
};
|
|
14499
|
+
};
|
|
14500
|
+
const MermaidToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14501
|
+
const state = useMermaidToolbarButtonState();
|
|
14502
|
+
const { props } = useMermaidToolbarButton(state);
|
|
14503
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Mermaid", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.mermaid, null));
|
|
14504
|
+
});
|
|
14505
|
+
function OverflowMenu({
|
|
14506
|
+
children,
|
|
14507
|
+
...props
|
|
14508
|
+
}) {
|
|
14509
|
+
const openState = useOpenState();
|
|
14510
|
+
return /* @__PURE__ */ React__default.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
|
|
14511
|
+
ToolbarButton,
|
|
14512
|
+
{
|
|
14513
|
+
showArrow: false,
|
|
14514
|
+
"data-testid": "rich-text-editor-overflow-menu-button",
|
|
14515
|
+
className: "lg:min-w-[130px]",
|
|
14516
|
+
isDropdown: true,
|
|
14517
|
+
pressed: openState.open,
|
|
14518
|
+
tooltip: "Headings"
|
|
14519
|
+
},
|
|
14520
|
+
/* @__PURE__ */ React__default.createElement(Icons.overflow, { className: "size-5" })
|
|
14521
|
+
)), /* @__PURE__ */ React__default.createElement(DropdownMenuContent, { align: "start", className: "min-w-0 flex flex-grow" }, children));
|
|
14522
|
+
}
|
|
14523
|
+
const useBlockQuoteToolbarButtonState = () => {
|
|
14524
|
+
const editor = useEditorState();
|
|
14525
|
+
const isBlockActive = () => helpers.isNodeActive(editor, ELEMENT_BLOCKQUOTE$1);
|
|
14526
|
+
return {
|
|
14527
|
+
pressed: isBlockActive()
|
|
14528
|
+
};
|
|
14529
|
+
};
|
|
14530
|
+
const useBlockQuoteToolbarButton = (state) => {
|
|
14531
|
+
const editor = useEditorState();
|
|
14532
|
+
const onClick = () => {
|
|
14533
|
+
toggleNodeType(editor, {
|
|
14534
|
+
activeType: ELEMENT_BLOCKQUOTE$1
|
|
14535
|
+
});
|
|
14536
|
+
};
|
|
14537
|
+
const onMouseDown = (e) => {
|
|
14538
|
+
e.preventDefault();
|
|
14539
|
+
e.stopPropagation();
|
|
14540
|
+
};
|
|
14541
|
+
return {
|
|
14542
|
+
props: {
|
|
14543
|
+
onClick,
|
|
14544
|
+
onMouseDown,
|
|
14545
|
+
pressed: state.pressed
|
|
14546
|
+
}
|
|
14547
|
+
};
|
|
14548
|
+
};
|
|
14549
|
+
const QuoteToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14550
|
+
const state = useBlockQuoteToolbarButtonState();
|
|
14551
|
+
const { props } = useBlockQuoteToolbarButton(state);
|
|
14552
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.quote, null));
|
|
14553
|
+
});
|
|
13908
14554
|
const useRawMarkdownToolbarButton = () => {
|
|
13909
14555
|
const { setRawMode } = useEditorContext();
|
|
13910
14556
|
const onMouseDown = (e) => {
|
|
@@ -13919,31 +14565,123 @@ const useRawMarkdownToolbarButton = () => {
|
|
|
13919
14565
|
};
|
|
13920
14566
|
const RawMarkdownToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
13921
14567
|
const { props } = useRawMarkdownToolbarButton();
|
|
13922
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
14568
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14569
|
+
ToolbarButton,
|
|
14570
|
+
{
|
|
14571
|
+
ref,
|
|
14572
|
+
tooltip: "Link",
|
|
14573
|
+
...rest,
|
|
14574
|
+
...props,
|
|
14575
|
+
"data-testid": "markdown-button"
|
|
14576
|
+
},
|
|
14577
|
+
/* @__PURE__ */ React__default.createElement(Icons.raw, null)
|
|
14578
|
+
);
|
|
13923
14579
|
});
|
|
13924
|
-
|
|
13925
|
-
const
|
|
13926
|
-
|
|
13927
|
-
|
|
13928
|
-
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
|
|
13932
|
-
|
|
13933
|
-
const
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
};
|
|
14580
|
+
function TableDropdownMenu(props) {
|
|
14581
|
+
const tableSelected = useEditorSelector(
|
|
14582
|
+
(editor2) => someNode(editor2, { match: { type: ELEMENT_TABLE$1 } }),
|
|
14583
|
+
[]
|
|
14584
|
+
);
|
|
14585
|
+
const [enableDeleteColumn, enableDeleteRow] = useEditorSelector((editor2) => {
|
|
14586
|
+
const tableNodeEntry = findNode(editor2, { match: { type: ELEMENT_TABLE$1 } });
|
|
14587
|
+
if (!tableNodeEntry)
|
|
14588
|
+
return [false, false];
|
|
14589
|
+
const [tableNode] = tableNodeEntry;
|
|
14590
|
+
if (!isElement(tableNode))
|
|
14591
|
+
return [false, false];
|
|
14592
|
+
const columnCount = getTableColumnCount(tableNode);
|
|
14593
|
+
const rowCount = tableNode.children.length;
|
|
14594
|
+
return [columnCount > 1, rowCount > 1];
|
|
14595
|
+
}, []);
|
|
14596
|
+
const editor = useEditorRef();
|
|
14597
|
+
const openState = useOpenState();
|
|
14598
|
+
return /* @__PURE__ */ React__default.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(ToolbarButton, { isDropdown: true, pressed: openState.open, tooltip: "Table" }, /* @__PURE__ */ React__default.createElement(Icons.table, null))), /* @__PURE__ */ React__default.createElement(
|
|
14599
|
+
DropdownMenuContent,
|
|
14600
|
+
{
|
|
14601
|
+
align: "start",
|
|
14602
|
+
className: "flex w-[180px] min-w-0 flex-col gap-0.5"
|
|
14603
|
+
},
|
|
14604
|
+
/* @__PURE__ */ React__default.createElement(
|
|
14605
|
+
DropdownMenuItem,
|
|
14606
|
+
{
|
|
14607
|
+
className: "min-w-[180px]",
|
|
14608
|
+
disabled: tableSelected,
|
|
14609
|
+
onSelect: () => {
|
|
14610
|
+
insertTable(editor);
|
|
14611
|
+
focusEditor(editor);
|
|
14612
|
+
}
|
|
14613
|
+
},
|
|
14614
|
+
/* @__PURE__ */ React__default.createElement(Icons.add, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14615
|
+
"Insert table"
|
|
14616
|
+
),
|
|
14617
|
+
/* @__PURE__ */ React__default.createElement(
|
|
14618
|
+
DropdownMenuItem,
|
|
14619
|
+
{
|
|
14620
|
+
className: "min-w-[180px]",
|
|
14621
|
+
disabled: !tableSelected,
|
|
14622
|
+
onSelect: () => {
|
|
14623
|
+
deleteTable(editor);
|
|
14624
|
+
focusEditor(editor);
|
|
14625
|
+
}
|
|
14626
|
+
},
|
|
14627
|
+
/* @__PURE__ */ React__default.createElement(Icons.minus, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14628
|
+
"Delete table"
|
|
14629
|
+
),
|
|
14630
|
+
/* @__PURE__ */ React__default.createElement(DropdownMenuSub, null, /* @__PURE__ */ React__default.createElement(DropdownMenuSubTrigger, { disabled: !tableSelected }, /* @__PURE__ */ React__default.createElement(Icons.column, { className: iconVariants({ variant: "menuItem" }) }), /* @__PURE__ */ React__default.createElement("span", null, "Column")), /* @__PURE__ */ React__default.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React__default.createElement(
|
|
14631
|
+
DropdownMenuItem,
|
|
14632
|
+
{
|
|
14633
|
+
className: "min-w-[180px]",
|
|
14634
|
+
disabled: !tableSelected,
|
|
14635
|
+
onSelect: () => {
|
|
14636
|
+
insertTableColumn(editor);
|
|
14637
|
+
focusEditor(editor);
|
|
14638
|
+
}
|
|
14639
|
+
},
|
|
14640
|
+
/* @__PURE__ */ React__default.createElement(Icons.add, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14641
|
+
"Insert column after"
|
|
14642
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
14643
|
+
DropdownMenuItem,
|
|
14644
|
+
{
|
|
14645
|
+
className: "min-w-[180px]",
|
|
14646
|
+
disabled: !enableDeleteColumn,
|
|
14647
|
+
onSelect: () => {
|
|
14648
|
+
deleteColumn(editor);
|
|
14649
|
+
focusEditor(editor);
|
|
14650
|
+
}
|
|
14651
|
+
},
|
|
14652
|
+
/* @__PURE__ */ React__default.createElement(Icons.minus, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14653
|
+
"Delete column"
|
|
14654
|
+
))),
|
|
14655
|
+
/* @__PURE__ */ React__default.createElement(DropdownMenuSub, null, /* @__PURE__ */ React__default.createElement(DropdownMenuSubTrigger, { disabled: !tableSelected }, /* @__PURE__ */ React__default.createElement(Icons.row, { className: iconVariants({ variant: "menuItem" }) }), /* @__PURE__ */ React__default.createElement("span", null, "Row")), /* @__PURE__ */ React__default.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React__default.createElement(
|
|
14656
|
+
DropdownMenuItem,
|
|
14657
|
+
{
|
|
14658
|
+
className: "min-w-[180px]",
|
|
14659
|
+
disabled: !tableSelected,
|
|
14660
|
+
onSelect: () => {
|
|
14661
|
+
insertTableRow(editor);
|
|
14662
|
+
focusEditor(editor);
|
|
14663
|
+
}
|
|
14664
|
+
},
|
|
14665
|
+
/* @__PURE__ */ React__default.createElement(Icons.add, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14666
|
+
"Insert row after"
|
|
14667
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
14668
|
+
DropdownMenuItem,
|
|
14669
|
+
{
|
|
14670
|
+
className: "min-w-[180px]",
|
|
14671
|
+
disabled: !enableDeleteRow,
|
|
14672
|
+
onSelect: () => {
|
|
14673
|
+
deleteRow(editor);
|
|
14674
|
+
focusEditor(editor);
|
|
14675
|
+
}
|
|
14676
|
+
},
|
|
14677
|
+
/* @__PURE__ */ React__default.createElement(Icons.minus, { className: iconVariants({ variant: "menuItem" }) }),
|
|
14678
|
+
"Delete row"
|
|
14679
|
+
)))
|
|
14680
|
+
));
|
|
14681
|
+
}
|
|
13940
14682
|
function TemplatesToolbarButton() {
|
|
13941
14683
|
const { templates } = useToolbarContext();
|
|
13942
|
-
const showEmbed = templates.length > 0;
|
|
13943
14684
|
const editor = useEditorState();
|
|
13944
|
-
if (!showEmbed) {
|
|
13945
|
-
return null;
|
|
13946
|
-
}
|
|
13947
14685
|
return /* @__PURE__ */ React__default.createElement(EmbedButton, { templates, editor });
|
|
13948
14686
|
}
|
|
13949
14687
|
const EmbedButton = ({ editor, templates }) => {
|
|
@@ -13984,100 +14722,112 @@ const EmbedButton = ({ editor, templates }) => {
|
|
|
13984
14722
|
template.label || template.name
|
|
13985
14723
|
))));
|
|
13986
14724
|
};
|
|
13987
|
-
const ICON_WIDTH = 32;
|
|
13988
|
-
const EMBED_ICON_WIDTH = 78;
|
|
13989
|
-
const MD_BREAKPOINT = 768;
|
|
13990
|
-
const useResize = (ref, callback) => {
|
|
13991
|
-
React__default.useEffect(() => {
|
|
13992
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
13993
|
-
for (const entry of entries) {
|
|
13994
|
-
callback(entry);
|
|
13995
|
-
}
|
|
13996
|
-
});
|
|
13997
|
-
if (ref.current) {
|
|
13998
|
-
resizeObserver.observe(ref.current);
|
|
13999
|
-
}
|
|
14000
|
-
return () => resizeObserver.disconnect();
|
|
14001
|
-
}, [ref.current]);
|
|
14002
|
-
};
|
|
14003
|
-
function OverflowMenu({
|
|
14004
|
-
children,
|
|
14005
|
-
...props
|
|
14006
|
-
}) {
|
|
14007
|
-
const openState = useOpenState();
|
|
14008
|
-
return /* @__PURE__ */ React__default.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
|
|
14009
|
-
ToolbarButton,
|
|
14010
|
-
{
|
|
14011
|
-
showArrow: false,
|
|
14012
|
-
className: "lg:min-w-[130px]",
|
|
14013
|
-
isDropdown: true,
|
|
14014
|
-
pressed: openState.open,
|
|
14015
|
-
tooltip: "Headings"
|
|
14016
|
-
},
|
|
14017
|
-
/* @__PURE__ */ React__default.createElement(Icons.overflow, { className: "size-5" })
|
|
14018
|
-
)), /* @__PURE__ */ React__default.createElement(DropdownMenuContent, { align: "start", className: "min-w-0 flex flex-grow" }, children));
|
|
14019
|
-
}
|
|
14020
14725
|
const toolbarItems = {
|
|
14021
14726
|
heading: {
|
|
14022
|
-
label:
|
|
14727
|
+
label: HEADING_LABEL,
|
|
14728
|
+
width: (paragraphIconExists) => paragraphIconExists ? HEADING_ICON_WITH_TEXT : HEADING_ICON_ONLY,
|
|
14729
|
+
// Dynamically handle width based on paragraph icon
|
|
14023
14730
|
Component: /* @__PURE__ */ React__default.createElement(ToolbarGroup, { noSeparator: true }, /* @__PURE__ */ React__default.createElement(HeadingsMenu, null))
|
|
14024
14731
|
},
|
|
14025
14732
|
link: {
|
|
14026
14733
|
label: "Link",
|
|
14734
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14027
14735
|
Component: /* @__PURE__ */ React__default.createElement(LinkToolbarButton, null)
|
|
14028
14736
|
},
|
|
14029
14737
|
image: {
|
|
14030
14738
|
label: "Image",
|
|
14739
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14031
14740
|
Component: /* @__PURE__ */ React__default.createElement(ImageToolbarButton, null)
|
|
14032
14741
|
},
|
|
14033
14742
|
quote: {
|
|
14034
14743
|
label: "Quote",
|
|
14744
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14035
14745
|
Component: /* @__PURE__ */ React__default.createElement(QuoteToolbarButton, { tooltip: "Quote Quote (⌘+⇧+.)" })
|
|
14036
14746
|
},
|
|
14037
14747
|
ul: {
|
|
14038
14748
|
label: "Unordered List",
|
|
14749
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14039
14750
|
Component: /* @__PURE__ */ React__default.createElement(IndentListToolbarButton, { nodeType: ELEMENT_UL })
|
|
14040
14751
|
},
|
|
14041
14752
|
ol: {
|
|
14042
14753
|
label: "Ordered List",
|
|
14754
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14043
14755
|
Component: /* @__PURE__ */ React__default.createElement(IndentListToolbarButton, { nodeType: ELEMENT_OL })
|
|
14044
14756
|
},
|
|
14045
14757
|
bold: {
|
|
14046
14758
|
label: "Bold",
|
|
14759
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14047
14760
|
Component: /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: MARK_BOLD }, /* @__PURE__ */ React__default.createElement(Icons.bold, null))
|
|
14048
14761
|
},
|
|
14049
14762
|
italic: {
|
|
14050
14763
|
label: "Italic",
|
|
14764
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14051
14765
|
Component: /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: MARK_ITALIC }, /* @__PURE__ */ React__default.createElement(Icons.italic, null))
|
|
14052
14766
|
},
|
|
14053
14767
|
code: {
|
|
14054
14768
|
label: "Code",
|
|
14769
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14055
14770
|
Component: /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: MARK_CODE }, /* @__PURE__ */ React__default.createElement(Icons.code, null))
|
|
14056
14771
|
},
|
|
14057
14772
|
codeBlock: {
|
|
14058
14773
|
label: "Code Block",
|
|
14774
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14059
14775
|
Component: /* @__PURE__ */ React__default.createElement(CodeBlockToolbarButton, null)
|
|
14060
14776
|
},
|
|
14777
|
+
mermaid: {
|
|
14778
|
+
label: "Mermaid",
|
|
14779
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14780
|
+
Component: /* @__PURE__ */ React__default.createElement(MermaidToolbarButton, null)
|
|
14781
|
+
},
|
|
14782
|
+
table: {
|
|
14783
|
+
label: "Table",
|
|
14784
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14785
|
+
Component: /* @__PURE__ */ React__default.createElement(TableDropdownMenu, null)
|
|
14786
|
+
},
|
|
14061
14787
|
raw: {
|
|
14062
14788
|
label: "Raw Markdown",
|
|
14789
|
+
width: () => STANDARD_ICON_WIDTH,
|
|
14063
14790
|
Component: /* @__PURE__ */ React__default.createElement(RawMarkdownToolbarButton, null)
|
|
14064
14791
|
},
|
|
14065
14792
|
embed: {
|
|
14066
14793
|
label: "Templates",
|
|
14794
|
+
width: () => EMBED_ICON_WIDTH,
|
|
14067
14795
|
Component: /* @__PURE__ */ React__default.createElement(TemplatesToolbarButton, null)
|
|
14068
14796
|
}
|
|
14069
14797
|
};
|
|
14070
14798
|
function FixedToolbarButtons() {
|
|
14071
14799
|
const toolbarRef = React__default.useRef(null);
|
|
14072
14800
|
const [itemsShown, setItemsShown] = React__default.useState(11);
|
|
14073
|
-
const { overrides } = useToolbarContext();
|
|
14801
|
+
const { overrides, templates } = useToolbarContext();
|
|
14802
|
+
const showEmbedButton = templates.length > 0;
|
|
14803
|
+
let items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14804
|
+
if (!showEmbedButton) {
|
|
14805
|
+
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14806
|
+
}
|
|
14807
|
+
const editorState = useEditorState();
|
|
14808
|
+
const userInTable = helpers.isNodeActive(editorState, ELEMENT_TABLE);
|
|
14809
|
+
if (userInTable) {
|
|
14810
|
+
items2 = items2.filter((item) => !unsupportedItemsInTable.has(item.label));
|
|
14811
|
+
}
|
|
14074
14812
|
useResize(toolbarRef, (entry) => {
|
|
14075
14813
|
const width = entry.target.getBoundingClientRect().width;
|
|
14076
|
-
const
|
|
14077
|
-
const
|
|
14078
|
-
|
|
14814
|
+
const headingButton = items2.find((item) => item.label === HEADING_LABEL);
|
|
14815
|
+
const headingWidth = headingButton ? headingButton.width(width > CONTAINER_MD_BREAKPOINT) : 0;
|
|
14816
|
+
const availableWidth = width - headingWidth - FLOAT_BUTTON_WIDTH;
|
|
14817
|
+
const { itemFitCount } = items2.reduce(
|
|
14818
|
+
(acc, item) => {
|
|
14819
|
+
if (item.label !== HEADING_LABEL && acc.totalItemsWidth + item.width() <= availableWidth) {
|
|
14820
|
+
return {
|
|
14821
|
+
totalItemsWidth: acc.totalItemsWidth + item.width(),
|
|
14822
|
+
itemFitCount: acc.itemFitCount + 1
|
|
14823
|
+
};
|
|
14824
|
+
}
|
|
14825
|
+
return acc;
|
|
14826
|
+
},
|
|
14827
|
+
{ totalItemsWidth: 0, itemFitCount: 1 }
|
|
14828
|
+
);
|
|
14829
|
+
setItemsShown(itemFitCount);
|
|
14079
14830
|
});
|
|
14080
|
-
const toolbarItemsArray = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14081
14831
|
return /* @__PURE__ */ React__default.createElement("div", { className: "w-full overflow-hidden @container/toolbar", ref: toolbarRef }, /* @__PURE__ */ React__default.createElement(
|
|
14082
14832
|
"div",
|
|
14083
14833
|
{
|
|
@@ -14086,7 +14836,7 @@ function FixedToolbarButtons() {
|
|
|
14086
14836
|
transform: "translateX(calc(-1px))"
|
|
14087
14837
|
}
|
|
14088
14838
|
},
|
|
14089
|
-
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null,
|
|
14839
|
+
/* @__PURE__ */ React__default.createElement(React__default.Fragment, null, items2.slice(0, itemsShown).map((item) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: item.label }, item.Component)), items2.length > itemsShown && /* @__PURE__ */ React__default.createElement(OverflowMenu, null, items2.slice(itemsShown).flatMap((c) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: c.label }, c.Component))))
|
|
14090
14840
|
));
|
|
14091
14841
|
}
|
|
14092
14842
|
const FloatingToolbar = withRef(({ children, state, ...props }, componentRef) => {
|
|
@@ -14201,6 +14951,10 @@ function TurnIntoDropdownMenu(props) {
|
|
|
14201
14951
|
const openState = useOpenState();
|
|
14202
14952
|
const selectedItem = items.find((item) => item.value === value) ?? defaultItem;
|
|
14203
14953
|
const { icon: SelectedItemIcon, label: selectedItemLabel } = selectedItem;
|
|
14954
|
+
const editorState = useEditorState();
|
|
14955
|
+
const userInTable = helpers.isNodeActive(editorState, ELEMENT_TABLE$1);
|
|
14956
|
+
if (userInTable)
|
|
14957
|
+
return null;
|
|
14204
14958
|
return /* @__PURE__ */ React__default.createElement(DropdownMenu, { modal: false, ...openState, ...props }, /* @__PURE__ */ React__default.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
|
|
14205
14959
|
ToolbarButton,
|
|
14206
14960
|
{
|
|
@@ -14242,49 +14996,6 @@ function TurnIntoDropdownMenu(props) {
|
|
|
14242
14996
|
function FloatingToolbarButtons() {
|
|
14243
14997
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TurnIntoDropdownMenu, null));
|
|
14244
14998
|
}
|
|
14245
|
-
const buttonVariants = cva(
|
|
14246
|
-
"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",
|
|
14247
|
-
{
|
|
14248
|
-
defaultVariants: {
|
|
14249
|
-
size: "default",
|
|
14250
|
-
variant: "default"
|
|
14251
|
-
},
|
|
14252
|
-
variants: {
|
|
14253
|
-
isMenu: {
|
|
14254
|
-
true: "h-auto w-full cursor-pointer justify-start"
|
|
14255
|
-
},
|
|
14256
|
-
size: {
|
|
14257
|
-
default: "h-10 px-4 py-2",
|
|
14258
|
-
icon: "size-10",
|
|
14259
|
-
lg: "h-11 rounded-md px-8",
|
|
14260
|
-
none: "",
|
|
14261
|
-
sm: "h-9 rounded-md px-3",
|
|
14262
|
-
sms: "size-9 rounded-md px-0",
|
|
14263
|
-
xs: "h-8 rounded-md px-3"
|
|
14264
|
-
},
|
|
14265
|
-
variant: {
|
|
14266
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
14267
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
14268
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14269
|
-
inlineLink: "text-base text-primary underline underline-offset-4",
|
|
14270
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
14271
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14272
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80"
|
|
14273
|
-
}
|
|
14274
|
-
}
|
|
14275
|
-
}
|
|
14276
|
-
);
|
|
14277
|
-
withRef(({ asChild = false, className, isMenu, size, variant, ...props }, ref) => {
|
|
14278
|
-
const Comp = asChild ? Slot : "button";
|
|
14279
|
-
return /* @__PURE__ */ React.createElement(
|
|
14280
|
-
Comp,
|
|
14281
|
-
{
|
|
14282
|
-
className: cn$1(buttonVariants({ className, isMenu, size, variant })),
|
|
14283
|
-
ref,
|
|
14284
|
-
...props
|
|
14285
|
-
}
|
|
14286
|
-
);
|
|
14287
|
-
});
|
|
14288
14999
|
const inputVariants = cva(
|
|
14289
15000
|
"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",
|
|
14290
15001
|
{
|
|
@@ -14305,22 +15016,6 @@ const inputVariants = cva(
|
|
|
14305
15016
|
}
|
|
14306
15017
|
);
|
|
14307
15018
|
withVariants("input", inputVariants, ["variant", "h"]);
|
|
14308
|
-
const popoverVariants = cva(
|
|
14309
|
-
"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"
|
|
14310
|
-
);
|
|
14311
|
-
withRef(
|
|
14312
|
-
({ align = "center", className, sideOffset = 4, style, ...props }, ref) => /* @__PURE__ */ React.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
|
|
14313
|
-
PopoverPrimitive.Content,
|
|
14314
|
-
{
|
|
14315
|
-
align,
|
|
14316
|
-
className: cn$1(popoverVariants(), className),
|
|
14317
|
-
ref,
|
|
14318
|
-
sideOffset,
|
|
14319
|
-
style: { zIndex: 1e3, ...style },
|
|
14320
|
-
...props
|
|
14321
|
-
}
|
|
14322
|
-
))
|
|
14323
|
-
);
|
|
14324
15019
|
const floatingOptions = {
|
|
14325
15020
|
middleware: [
|
|
14326
15021
|
offset(12),
|
|
@@ -14380,7 +15075,7 @@ function LinkFloatingToolbar({ state }) {
|
|
|
14380
15075
|
const editContent = editState.isEditing ? input : /* @__PURE__ */ React__default.createElement("div", { className: "box-content flex h-9 items-center gap-1" }, /* @__PURE__ */ React__default.createElement(
|
|
14381
15076
|
"button",
|
|
14382
15077
|
{
|
|
14383
|
-
className: buttonVariants({ size: "sm", variant: "ghost" }),
|
|
15078
|
+
className: buttonVariants$1({ size: "sm", variant: "ghost" }),
|
|
14384
15079
|
type: "button",
|
|
14385
15080
|
...editButtonProps
|
|
14386
15081
|
},
|
|
@@ -14388,7 +15083,7 @@ function LinkFloatingToolbar({ state }) {
|
|
|
14388
15083
|
), /* @__PURE__ */ React__default.createElement(Separator, { orientation: "vertical" }), /* @__PURE__ */ React__default.createElement(
|
|
14389
15084
|
LinkOpenButton,
|
|
14390
15085
|
{
|
|
14391
|
-
className: buttonVariants({
|
|
15086
|
+
className: buttonVariants$1({
|
|
14392
15087
|
size: "sms",
|
|
14393
15088
|
variant: "ghost"
|
|
14394
15089
|
})
|
|
@@ -14397,7 +15092,7 @@ function LinkFloatingToolbar({ state }) {
|
|
|
14397
15092
|
), /* @__PURE__ */ React__default.createElement(Separator, { orientation: "vertical" }), /* @__PURE__ */ React__default.createElement(
|
|
14398
15093
|
"button",
|
|
14399
15094
|
{
|
|
14400
|
-
className: buttonVariants({
|
|
15095
|
+
className: buttonVariants$1({
|
|
14401
15096
|
size: "sms",
|
|
14402
15097
|
variant: "ghost"
|
|
14403
15098
|
}),
|
|
@@ -14471,6 +15166,7 @@ const RichEditor = (props) => {
|
|
|
14471
15166
|
createMdxBlockPlugin(),
|
|
14472
15167
|
createMdxInlinePlugin(),
|
|
14473
15168
|
createImgPlugin(),
|
|
15169
|
+
createMermaidPlugin(),
|
|
14474
15170
|
createInvalidMarkdownPlugin(),
|
|
14475
15171
|
createLinkPlugin({
|
|
14476
15172
|
options: {
|
|
@@ -29478,6 +30174,7 @@ class TinaAdminApi {
|
|
|
29478
30174
|
relativePath
|
|
29479
30175
|
filename
|
|
29480
30176
|
extension
|
|
30177
|
+
hasReferences
|
|
29481
30178
|
}
|
|
29482
30179
|
}
|
|
29483
30180
|
}
|
|
@@ -29569,6 +30266,9 @@ class TinaAdminApi {
|
|
|
29569
30266
|
document(collection:$collection, relativePath:$relativePath) {
|
|
29570
30267
|
... on Document {
|
|
29571
30268
|
_values
|
|
30269
|
+
_sys {
|
|
30270
|
+
hasReferences
|
|
30271
|
+
}
|
|
29572
30272
|
}
|
|
29573
30273
|
}
|
|
29574
30274
|
}`;
|
|
@@ -31295,6 +31995,23 @@ const CollectionListPage = () => {
|
|
|
31295
31995
|
DeleteModal,
|
|
31296
31996
|
{
|
|
31297
31997
|
filename: vars.relativePath,
|
|
31998
|
+
checkRefsFunc: async () => {
|
|
31999
|
+
var _a2, _b2;
|
|
32000
|
+
try {
|
|
32001
|
+
const doc = await admin.fetchDocument(
|
|
32002
|
+
collection.name,
|
|
32003
|
+
vars.relativePath,
|
|
32004
|
+
true
|
|
32005
|
+
);
|
|
32006
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
32007
|
+
} catch (error) {
|
|
32008
|
+
cms.alerts.error(
|
|
32009
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
32010
|
+
);
|
|
32011
|
+
console.error(error);
|
|
32012
|
+
throw error;
|
|
32013
|
+
}
|
|
32014
|
+
},
|
|
31298
32015
|
deleteFunc: async () => {
|
|
31299
32016
|
try {
|
|
31300
32017
|
await admin.deleteDocument(vars);
|
|
@@ -31303,6 +32020,12 @@ const CollectionListPage = () => {
|
|
|
31303
32020
|
);
|
|
31304
32021
|
reFetchCollection();
|
|
31305
32022
|
} catch (error) {
|
|
32023
|
+
if (error.message.indexOf("has references")) {
|
|
32024
|
+
cms.alerts.error(
|
|
32025
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32026
|
+
);
|
|
32027
|
+
return;
|
|
32028
|
+
}
|
|
31306
32029
|
cms.alerts.warn(
|
|
31307
32030
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31308
32031
|
);
|
|
@@ -31354,6 +32077,12 @@ const CollectionListPage = () => {
|
|
|
31354
32077
|
cms.alerts.info("Document was successfully renamed");
|
|
31355
32078
|
reFetchCollection();
|
|
31356
32079
|
} catch (error) {
|
|
32080
|
+
if (error.message.indexOf("has references")) {
|
|
32081
|
+
cms.alerts.error(
|
|
32082
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32083
|
+
);
|
|
32084
|
+
return;
|
|
32085
|
+
}
|
|
31357
32086
|
cms.alerts.warn(
|
|
31358
32087
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
31359
32088
|
);
|
|
@@ -31827,8 +32556,19 @@ const Breadcrumb = ({ folder, navigate, collectionName }) => {
|
|
|
31827
32556
|
const NoDocumentsPlaceholder = () => {
|
|
31828
32557
|
return /* @__PURE__ */ React__default.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
31829
32558
|
};
|
|
31830
|
-
const DeleteModal = ({
|
|
31831
|
-
|
|
32559
|
+
const DeleteModal = ({
|
|
32560
|
+
close: close2,
|
|
32561
|
+
deleteFunc,
|
|
32562
|
+
checkRefsFunc,
|
|
32563
|
+
filename
|
|
32564
|
+
}) => {
|
|
32565
|
+
const [hasRefs, setHasRefs] = React__default.useState();
|
|
32566
|
+
useEffect(() => {
|
|
32567
|
+
checkRefsFunc().then((result) => {
|
|
32568
|
+
setHasRefs(result);
|
|
32569
|
+
});
|
|
32570
|
+
}, [filename, checkRefsFunc]);
|
|
32571
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__default.createElement(
|
|
31832
32572
|
Button$1,
|
|
31833
32573
|
{
|
|
31834
32574
|
style: { flexGrow: 3 },
|
|
@@ -33190,5 +33930,6 @@ export {
|
|
|
33190
33930
|
useScreenPlugin,
|
|
33191
33931
|
useTinaAuthRedirect,
|
|
33192
33932
|
wrapFieldWithError,
|
|
33933
|
+
wrapFieldWithNoHeader,
|
|
33193
33934
|
wrapFieldsWithMeta
|
|
33194
33935
|
};
|