tinacms 2.7.0 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +72 -45
- package/dist/index.mjs +74 -47
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +17 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -9292,9 +9292,7 @@ flowchart TD
|
|
|
9292
9292
|
const encodeUrlIfNeeded = (url) => {
|
|
9293
9293
|
if (url) {
|
|
9294
9294
|
try {
|
|
9295
|
-
|
|
9296
|
-
parsed.pathname = parsed.pathname.split("/").filter((part) => part !== "").map(encodeURIComponent).join("/");
|
|
9297
|
-
return parsed.toString();
|
|
9295
|
+
return new URL(url).toString();
|
|
9298
9296
|
} catch (e) {
|
|
9299
9297
|
return url;
|
|
9300
9298
|
}
|
|
@@ -10195,7 +10193,7 @@ flowchart TD
|
|
|
10195
10193
|
"Event Log"
|
|
10196
10194
|
));
|
|
10197
10195
|
};
|
|
10198
|
-
const version = "2.7.
|
|
10196
|
+
const version = "2.7.2";
|
|
10199
10197
|
const Nav = ({
|
|
10200
10198
|
isLocalMode,
|
|
10201
10199
|
className = "",
|
|
@@ -10831,7 +10829,7 @@ flowchart TD
|
|
|
10831
10829
|
className: "h-5 w-auto -mx-1 text-blue-500",
|
|
10832
10830
|
stroke: "currentColor",
|
|
10833
10831
|
fill: "currentColor",
|
|
10834
|
-
|
|
10832
|
+
strokeWidth: "0",
|
|
10835
10833
|
viewBox: "0 0 24 24",
|
|
10836
10834
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10837
10835
|
},
|
|
@@ -13548,6 +13546,11 @@ flowchart TD
|
|
|
13548
13546
|
mode: "mark",
|
|
13549
13547
|
type: plate.MARK_CODE,
|
|
13550
13548
|
match: "`"
|
|
13549
|
+
},
|
|
13550
|
+
{
|
|
13551
|
+
mode: "mark",
|
|
13552
|
+
type: plate.MARK_STRIKETHROUGH,
|
|
13553
|
+
match: ["~~", "~"]
|
|
13551
13554
|
}
|
|
13552
13555
|
];
|
|
13553
13556
|
const autoformatRules = [
|
|
@@ -13689,17 +13692,14 @@ flowchart TD
|
|
|
13689
13692
|
})
|
|
13690
13693
|
];
|
|
13691
13694
|
const plugins = [
|
|
13695
|
+
plate.createBasicMarksPlugin(),
|
|
13692
13696
|
plate.createHeadingPlugin(),
|
|
13693
13697
|
plate.createParagraphPlugin(),
|
|
13694
13698
|
createCodeBlockPlugin(),
|
|
13695
13699
|
createHTMLBlockPlugin(),
|
|
13696
13700
|
createHTMLInlinePlugin(),
|
|
13697
13701
|
plate.createBlockquotePlugin(),
|
|
13698
|
-
plate.createBoldPlugin(),
|
|
13699
|
-
plate.createStrikethroughPlugin(),
|
|
13700
|
-
plate.createItalicPlugin(),
|
|
13701
13702
|
plate.createUnderlinePlugin(),
|
|
13702
|
-
plate.createCodePlugin(),
|
|
13703
13703
|
plate.createListPlugin(),
|
|
13704
13704
|
plate.createIndentListPlugin(),
|
|
13705
13705
|
plate.createHorizontalRulePlugin(),
|
|
@@ -14209,7 +14209,7 @@ flowchart TD
|
|
|
14209
14209
|
const CodeBlockToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14210
14210
|
const state = useCodeBlockToolbarButtonState();
|
|
14211
14211
|
const { props } = useCodeBlockToolbarButton(state);
|
|
14212
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "
|
|
14212
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Code Block", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.codeBlock, null));
|
|
14213
14213
|
});
|
|
14214
14214
|
const useImageToolbarButtonState = () => {
|
|
14215
14215
|
const editor = plateCommon.useEditorState();
|
|
@@ -14241,36 +14241,54 @@ flowchart TD
|
|
|
14241
14241
|
const ImageToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14242
14242
|
const state = useImageToolbarButtonState();
|
|
14243
14243
|
const { props } = useImageToolbarButton(state);
|
|
14244
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "
|
|
14245
|
-
});
|
|
14246
|
-
const IndentListToolbarButton = cn$1.withRef(({ nodeType = plate.ELEMENT_UL }, ref) => {
|
|
14247
|
-
const editor = plateCommon.useEditorState();
|
|
14248
|
-
const state = plate.useListToolbarButtonState({ nodeType });
|
|
14249
|
-
const { props } = plate.useListToolbarButton(state);
|
|
14250
|
-
return /* @__PURE__ */ React.createElement(
|
|
14251
|
-
ToolbarButton,
|
|
14252
|
-
{
|
|
14253
|
-
ref,
|
|
14254
|
-
tooltip: nodeType === plate.ELEMENT_UL ? "Bulleted List" : "Numbered List",
|
|
14255
|
-
...props,
|
|
14256
|
-
onClick: (e) => {
|
|
14257
|
-
e.preventDefault();
|
|
14258
|
-
e.stopPropagation();
|
|
14259
|
-
plate.toggleList(editor, { type: nodeType });
|
|
14260
|
-
}
|
|
14261
|
-
},
|
|
14262
|
-
nodeType === plate.ELEMENT_UL ? /* @__PURE__ */ React.createElement(Icons.ul, null) : /* @__PURE__ */ React.createElement(Icons.ol, null)
|
|
14263
|
-
);
|
|
14244
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Image", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.image, null));
|
|
14264
14245
|
});
|
|
14246
|
+
const UnorderedListToolbarButton = cn$1.withRef(
|
|
14247
|
+
(props, ref) => {
|
|
14248
|
+
const editor = plateCommon.useEditorState();
|
|
14249
|
+
const state = plate.useListToolbarButtonState({ nodeType: plate.ELEMENT_UL });
|
|
14250
|
+
const { props: buttonProps } = plate.useListToolbarButton(state);
|
|
14251
|
+
return /* @__PURE__ */ React.createElement(
|
|
14252
|
+
ToolbarButton,
|
|
14253
|
+
{
|
|
14254
|
+
ref,
|
|
14255
|
+
tooltip: "Bulleted List",
|
|
14256
|
+
...buttonProps,
|
|
14257
|
+
onClick: (e) => {
|
|
14258
|
+
e.preventDefault();
|
|
14259
|
+
e.stopPropagation();
|
|
14260
|
+
plate.toggleList(editor, { type: plate.ELEMENT_UL });
|
|
14261
|
+
}
|
|
14262
|
+
},
|
|
14263
|
+
/* @__PURE__ */ React.createElement(Icons.ul, null)
|
|
14264
|
+
);
|
|
14265
|
+
}
|
|
14266
|
+
);
|
|
14267
|
+
const OrderedListToolbarButton = cn$1.withRef(
|
|
14268
|
+
(props, ref) => {
|
|
14269
|
+
const editor = plateCommon.useEditorState();
|
|
14270
|
+
const state = plate.useListToolbarButtonState({ nodeType: plate.ELEMENT_OL });
|
|
14271
|
+
const { props: buttonProps } = plate.useListToolbarButton(state);
|
|
14272
|
+
return /* @__PURE__ */ React.createElement(
|
|
14273
|
+
ToolbarButton,
|
|
14274
|
+
{
|
|
14275
|
+
ref,
|
|
14276
|
+
tooltip: "Numbered List",
|
|
14277
|
+
...buttonProps,
|
|
14278
|
+
onClick: (e) => {
|
|
14279
|
+
e.preventDefault();
|
|
14280
|
+
e.stopPropagation();
|
|
14281
|
+
plate.toggleList(editor, { type: plate.ELEMENT_OL });
|
|
14282
|
+
}
|
|
14283
|
+
},
|
|
14284
|
+
/* @__PURE__ */ React.createElement(Icons.ol, null)
|
|
14285
|
+
);
|
|
14286
|
+
}
|
|
14287
|
+
);
|
|
14265
14288
|
const LinkToolbarButton = cn$1.withRef((rest, ref) => {
|
|
14266
14289
|
const state = plateLink.useLinkToolbarButtonState();
|
|
14267
14290
|
const { props } = plateLink.useLinkToolbarButton(state);
|
|
14268
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link"
|
|
14269
|
-
});
|
|
14270
|
-
const MarkToolbarButton = cn$1.withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
14271
|
-
const state = plateCommon.useMarkToolbarButtonState({ clear, nodeType });
|
|
14272
|
-
const { props } = plateCommon.useMarkToolbarButton(state);
|
|
14273
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest });
|
|
14291
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest, tooltip: "Link" }, /* @__PURE__ */ React.createElement(Icons.link, null));
|
|
14274
14292
|
});
|
|
14275
14293
|
const useMermaidToolbarButtonState = () => {
|
|
14276
14294
|
const editor = plateCommon.useEditorState();
|
|
@@ -14351,7 +14369,7 @@ flowchart TD
|
|
|
14351
14369
|
const QuoteToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14352
14370
|
const state = useBlockQuoteToolbarButtonState();
|
|
14353
14371
|
const { props } = useBlockQuoteToolbarButton(state);
|
|
14354
|
-
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "
|
|
14372
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Quote (⌘+⇧+.)", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.quote, null));
|
|
14355
14373
|
});
|
|
14356
14374
|
const useRawMarkdownToolbarButton = () => {
|
|
14357
14375
|
const { setRawMode } = useEditorContext();
|
|
@@ -14371,7 +14389,7 @@ flowchart TD
|
|
|
14371
14389
|
ToolbarButton,
|
|
14372
14390
|
{
|
|
14373
14391
|
ref,
|
|
14374
|
-
tooltip: "
|
|
14392
|
+
tooltip: "Raw Markdown",
|
|
14375
14393
|
...rest,
|
|
14376
14394
|
...props,
|
|
14377
14395
|
"data-testid": "markdown-button"
|
|
@@ -14524,6 +14542,15 @@ flowchart TD
|
|
|
14524
14542
|
template.label || template.name
|
|
14525
14543
|
))));
|
|
14526
14544
|
};
|
|
14545
|
+
const MarkToolbarButton = cn$1.withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
14546
|
+
const state = plateCommon.useMarkToolbarButtonState({ clear, nodeType });
|
|
14547
|
+
const { props } = plateCommon.useMarkToolbarButton(state);
|
|
14548
|
+
return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, ...props, ...rest });
|
|
14549
|
+
});
|
|
14550
|
+
const BoldToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: plate.MARK_BOLD }, /* @__PURE__ */ React.createElement(Icons.bold, null));
|
|
14551
|
+
const StrikethroughToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Strikethrough", nodeType: plate.MARK_STRIKETHROUGH }, /* @__PURE__ */ React.createElement(Icons.strikethrough, null));
|
|
14552
|
+
const ItalicToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: plate.MARK_ITALIC }, /* @__PURE__ */ React.createElement(Icons.italic, null));
|
|
14553
|
+
const CodeToolbarButton = () => /* @__PURE__ */ React.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: plate.MARK_CODE }, /* @__PURE__ */ React.createElement(Icons.code, null));
|
|
14527
14554
|
const toolbarItems = {
|
|
14528
14555
|
heading: {
|
|
14529
14556
|
label: HEADING_LABEL,
|
|
@@ -14544,37 +14571,37 @@ flowchart TD
|
|
|
14544
14571
|
quote: {
|
|
14545
14572
|
label: "Quote",
|
|
14546
14573
|
width: () => STANDARD_ICON_WIDTH,
|
|
14547
|
-
Component: /* @__PURE__ */ React.createElement(QuoteToolbarButton,
|
|
14574
|
+
Component: /* @__PURE__ */ React.createElement(QuoteToolbarButton, null)
|
|
14548
14575
|
},
|
|
14549
14576
|
ul: {
|
|
14550
14577
|
label: "Unordered List",
|
|
14551
14578
|
width: () => STANDARD_ICON_WIDTH,
|
|
14552
|
-
Component: /* @__PURE__ */ React.createElement(
|
|
14579
|
+
Component: /* @__PURE__ */ React.createElement(UnorderedListToolbarButton, null)
|
|
14553
14580
|
},
|
|
14554
14581
|
ol: {
|
|
14555
14582
|
label: "Ordered List",
|
|
14556
14583
|
width: () => STANDARD_ICON_WIDTH,
|
|
14557
|
-
Component: /* @__PURE__ */ React.createElement(
|
|
14584
|
+
Component: /* @__PURE__ */ React.createElement(OrderedListToolbarButton, null)
|
|
14558
14585
|
},
|
|
14559
14586
|
bold: {
|
|
14560
14587
|
label: "Bold",
|
|
14561
14588
|
width: () => STANDARD_ICON_WIDTH,
|
|
14562
|
-
Component: /* @__PURE__ */ React.createElement(
|
|
14589
|
+
Component: /* @__PURE__ */ React.createElement(BoldToolbarButton, null)
|
|
14563
14590
|
},
|
|
14564
14591
|
strikethrough: {
|
|
14565
14592
|
label: "Strikethrough",
|
|
14566
14593
|
width: () => STANDARD_ICON_WIDTH,
|
|
14567
|
-
Component: /* @__PURE__ */ React.createElement(
|
|
14594
|
+
Component: /* @__PURE__ */ React.createElement(StrikethroughToolbarButton, null)
|
|
14568
14595
|
},
|
|
14569
14596
|
italic: {
|
|
14570
14597
|
label: "Italic",
|
|
14571
14598
|
width: () => STANDARD_ICON_WIDTH,
|
|
14572
|
-
Component: /* @__PURE__ */ React.createElement(
|
|
14599
|
+
Component: /* @__PURE__ */ React.createElement(ItalicToolbarButton, null)
|
|
14573
14600
|
},
|
|
14574
14601
|
code: {
|
|
14575
14602
|
label: "Code",
|
|
14576
14603
|
width: () => STANDARD_ICON_WIDTH,
|
|
14577
|
-
Component: /* @__PURE__ */ React.createElement(
|
|
14604
|
+
Component: /* @__PURE__ */ React.createElement(CodeToolbarButton, null)
|
|
14578
14605
|
},
|
|
14579
14606
|
codeBlock: {
|
|
14580
14607
|
label: "Code Block",
|
package/dist/index.mjs
CHANGED
|
@@ -9,8 +9,8 @@ import * as React from "react";
|
|
|
9
9
|
import React__default, { useState, useCallback, useEffect, useRef, createContext, forwardRef, useContext, useMemo, startTransition } from "react";
|
|
10
10
|
import { createPortal } from "react-dom";
|
|
11
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,
|
|
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,
|
|
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, createBasicMarksPlugin, createHeadingPlugin, createParagraphPlugin, createBlockquotePlugin, createUnderlinePlugin, 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, insertEmptyElement, useMarkToolbarButtonState, useMarkToolbarButton, usePlateSelectors, useEventEditorSelectors, PortalBody, useFormInputProps, createPlugins, Plate } from "@udecode/plate-common";
|
|
14
14
|
import { ELEMENT_SLASH_INPUT, createSlashPlugin } from "@udecode/plate-slash-command";
|
|
15
15
|
import { useSelected, useReadOnly, ReactEditor } from "slate-react";
|
|
16
16
|
import { useCodeBlockElementState, useCodeSyntaxLeaf, ELEMENT_CODE_BLOCK as ELEMENT_CODE_BLOCK$1 } from "@udecode/plate-code-block";
|
|
@@ -9319,9 +9319,7 @@ class TinaMediaStore {
|
|
|
9319
9319
|
const encodeUrlIfNeeded = (url) => {
|
|
9320
9320
|
if (url) {
|
|
9321
9321
|
try {
|
|
9322
|
-
|
|
9323
|
-
parsed.pathname = parsed.pathname.split("/").filter((part) => part !== "").map(encodeURIComponent).join("/");
|
|
9324
|
-
return parsed.toString();
|
|
9322
|
+
return new URL(url).toString();
|
|
9325
9323
|
} catch (e) {
|
|
9326
9324
|
return url;
|
|
9327
9325
|
}
|
|
@@ -10222,7 +10220,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10222
10220
|
"Event Log"
|
|
10223
10221
|
));
|
|
10224
10222
|
};
|
|
10225
|
-
const version = "2.7.
|
|
10223
|
+
const version = "2.7.2";
|
|
10226
10224
|
const Nav = ({
|
|
10227
10225
|
isLocalMode,
|
|
10228
10226
|
className = "",
|
|
@@ -10858,7 +10856,7 @@ const SidebarHeader = ({
|
|
|
10858
10856
|
className: "h-5 w-auto -mx-1 text-blue-500",
|
|
10859
10857
|
stroke: "currentColor",
|
|
10860
10858
|
fill: "currentColor",
|
|
10861
|
-
|
|
10859
|
+
strokeWidth: "0",
|
|
10862
10860
|
viewBox: "0 0 24 24",
|
|
10863
10861
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10864
10862
|
},
|
|
@@ -13575,6 +13573,11 @@ const autoformatMarks = [
|
|
|
13575
13573
|
mode: "mark",
|
|
13576
13574
|
type: MARK_CODE,
|
|
13577
13575
|
match: "`"
|
|
13576
|
+
},
|
|
13577
|
+
{
|
|
13578
|
+
mode: "mark",
|
|
13579
|
+
type: MARK_STRIKETHROUGH,
|
|
13580
|
+
match: ["~~", "~"]
|
|
13578
13581
|
}
|
|
13579
13582
|
];
|
|
13580
13583
|
const autoformatRules = [
|
|
@@ -13716,17 +13719,14 @@ const plugins$1 = [
|
|
|
13716
13719
|
})
|
|
13717
13720
|
];
|
|
13718
13721
|
const plugins = [
|
|
13722
|
+
createBasicMarksPlugin(),
|
|
13719
13723
|
createHeadingPlugin(),
|
|
13720
13724
|
createParagraphPlugin(),
|
|
13721
13725
|
createCodeBlockPlugin(),
|
|
13722
13726
|
createHTMLBlockPlugin(),
|
|
13723
13727
|
createHTMLInlinePlugin(),
|
|
13724
13728
|
createBlockquotePlugin(),
|
|
13725
|
-
createBoldPlugin(),
|
|
13726
|
-
createStrikethroughPlugin(),
|
|
13727
|
-
createItalicPlugin(),
|
|
13728
13729
|
createUnderlinePlugin(),
|
|
13729
|
-
createCodePlugin(),
|
|
13730
13730
|
createListPlugin(),
|
|
13731
13731
|
createIndentListPlugin(),
|
|
13732
13732
|
createHorizontalRulePlugin(),
|
|
@@ -14236,7 +14236,7 @@ const useCodeBlockToolbarButton = (state) => {
|
|
|
14236
14236
|
const CodeBlockToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14237
14237
|
const state = useCodeBlockToolbarButtonState();
|
|
14238
14238
|
const { props } = useCodeBlockToolbarButton(state);
|
|
14239
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "
|
|
14239
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Code Block", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.codeBlock, null));
|
|
14240
14240
|
});
|
|
14241
14241
|
const useImageToolbarButtonState = () => {
|
|
14242
14242
|
const editor = useEditorState();
|
|
@@ -14268,36 +14268,54 @@ const useImageToolbarButton = (state) => {
|
|
|
14268
14268
|
const ImageToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14269
14269
|
const state = useImageToolbarButtonState();
|
|
14270
14270
|
const { props } = useImageToolbarButton(state);
|
|
14271
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "
|
|
14272
|
-
});
|
|
14273
|
-
const IndentListToolbarButton = withRef(({ nodeType = ELEMENT_UL }, ref) => {
|
|
14274
|
-
const editor = useEditorState();
|
|
14275
|
-
const state = useListToolbarButtonState({ nodeType });
|
|
14276
|
-
const { props } = useListToolbarButton(state);
|
|
14277
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
14278
|
-
ToolbarButton,
|
|
14279
|
-
{
|
|
14280
|
-
ref,
|
|
14281
|
-
tooltip: nodeType === ELEMENT_UL ? "Bulleted List" : "Numbered List",
|
|
14282
|
-
...props,
|
|
14283
|
-
onClick: (e) => {
|
|
14284
|
-
e.preventDefault();
|
|
14285
|
-
e.stopPropagation();
|
|
14286
|
-
toggleList(editor, { type: nodeType });
|
|
14287
|
-
}
|
|
14288
|
-
},
|
|
14289
|
-
nodeType === ELEMENT_UL ? /* @__PURE__ */ React__default.createElement(Icons.ul, null) : /* @__PURE__ */ React__default.createElement(Icons.ol, null)
|
|
14290
|
-
);
|
|
14271
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Image", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.image, null));
|
|
14291
14272
|
});
|
|
14273
|
+
const UnorderedListToolbarButton = withRef(
|
|
14274
|
+
(props, ref) => {
|
|
14275
|
+
const editor = useEditorState();
|
|
14276
|
+
const state = useListToolbarButtonState({ nodeType: ELEMENT_UL });
|
|
14277
|
+
const { props: buttonProps } = useListToolbarButton(state);
|
|
14278
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14279
|
+
ToolbarButton,
|
|
14280
|
+
{
|
|
14281
|
+
ref,
|
|
14282
|
+
tooltip: "Bulleted List",
|
|
14283
|
+
...buttonProps,
|
|
14284
|
+
onClick: (e) => {
|
|
14285
|
+
e.preventDefault();
|
|
14286
|
+
e.stopPropagation();
|
|
14287
|
+
toggleList(editor, { type: ELEMENT_UL });
|
|
14288
|
+
}
|
|
14289
|
+
},
|
|
14290
|
+
/* @__PURE__ */ React__default.createElement(Icons.ul, null)
|
|
14291
|
+
);
|
|
14292
|
+
}
|
|
14293
|
+
);
|
|
14294
|
+
const OrderedListToolbarButton = withRef(
|
|
14295
|
+
(props, ref) => {
|
|
14296
|
+
const editor = useEditorState();
|
|
14297
|
+
const state = useListToolbarButtonState({ nodeType: ELEMENT_OL });
|
|
14298
|
+
const { props: buttonProps } = useListToolbarButton(state);
|
|
14299
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14300
|
+
ToolbarButton,
|
|
14301
|
+
{
|
|
14302
|
+
ref,
|
|
14303
|
+
tooltip: "Numbered List",
|
|
14304
|
+
...buttonProps,
|
|
14305
|
+
onClick: (e) => {
|
|
14306
|
+
e.preventDefault();
|
|
14307
|
+
e.stopPropagation();
|
|
14308
|
+
toggleList(editor, { type: ELEMENT_OL });
|
|
14309
|
+
}
|
|
14310
|
+
},
|
|
14311
|
+
/* @__PURE__ */ React__default.createElement(Icons.ol, null)
|
|
14312
|
+
);
|
|
14313
|
+
}
|
|
14314
|
+
);
|
|
14292
14315
|
const LinkToolbarButton = withRef((rest, ref) => {
|
|
14293
14316
|
const state = useLinkToolbarButtonState();
|
|
14294
14317
|
const { props } = useLinkToolbarButton(state);
|
|
14295
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link"
|
|
14296
|
-
});
|
|
14297
|
-
const MarkToolbarButton = withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
14298
|
-
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
14299
|
-
const { props } = useMarkToolbarButton(state);
|
|
14300
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest });
|
|
14318
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest, tooltip: "Link" }, /* @__PURE__ */ React__default.createElement(Icons.link, null));
|
|
14301
14319
|
});
|
|
14302
14320
|
const useMermaidToolbarButtonState = () => {
|
|
14303
14321
|
const editor = useEditorState();
|
|
@@ -14378,7 +14396,7 @@ const useBlockQuoteToolbarButton = (state) => {
|
|
|
14378
14396
|
const QuoteToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14379
14397
|
const state = useBlockQuoteToolbarButtonState();
|
|
14380
14398
|
const { props } = useBlockQuoteToolbarButton(state);
|
|
14381
|
-
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "
|
|
14399
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Quote (⌘+⇧+.)", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.quote, null));
|
|
14382
14400
|
});
|
|
14383
14401
|
const useRawMarkdownToolbarButton = () => {
|
|
14384
14402
|
const { setRawMode } = useEditorContext();
|
|
@@ -14398,7 +14416,7 @@ const RawMarkdownToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
|
14398
14416
|
ToolbarButton,
|
|
14399
14417
|
{
|
|
14400
14418
|
ref,
|
|
14401
|
-
tooltip: "
|
|
14419
|
+
tooltip: "Raw Markdown",
|
|
14402
14420
|
...rest,
|
|
14403
14421
|
...props,
|
|
14404
14422
|
"data-testid": "markdown-button"
|
|
@@ -14551,6 +14569,15 @@ const EmbedButton = ({ editor, templates }) => {
|
|
|
14551
14569
|
template.label || template.name
|
|
14552
14570
|
))));
|
|
14553
14571
|
};
|
|
14572
|
+
const MarkToolbarButton = withRef(({ clear, nodeType, ...rest }, ref) => {
|
|
14573
|
+
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
14574
|
+
const { props } = useMarkToolbarButton(state);
|
|
14575
|
+
return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, ...props, ...rest });
|
|
14576
|
+
});
|
|
14577
|
+
const BoldToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Bold (⌘+B)", nodeType: MARK_BOLD }, /* @__PURE__ */ React__default.createElement(Icons.bold, null));
|
|
14578
|
+
const StrikethroughToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Strikethrough", nodeType: MARK_STRIKETHROUGH }, /* @__PURE__ */ React__default.createElement(Icons.strikethrough, null));
|
|
14579
|
+
const ItalicToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Italic (⌘+I)", nodeType: MARK_ITALIC }, /* @__PURE__ */ React__default.createElement(Icons.italic, null));
|
|
14580
|
+
const CodeToolbarButton = () => /* @__PURE__ */ React__default.createElement(MarkToolbarButton, { tooltip: "Code (⌘+E)", nodeType: MARK_CODE }, /* @__PURE__ */ React__default.createElement(Icons.code, null));
|
|
14554
14581
|
const toolbarItems = {
|
|
14555
14582
|
heading: {
|
|
14556
14583
|
label: HEADING_LABEL,
|
|
@@ -14571,37 +14598,37 @@ const toolbarItems = {
|
|
|
14571
14598
|
quote: {
|
|
14572
14599
|
label: "Quote",
|
|
14573
14600
|
width: () => STANDARD_ICON_WIDTH,
|
|
14574
|
-
Component: /* @__PURE__ */ React__default.createElement(QuoteToolbarButton,
|
|
14601
|
+
Component: /* @__PURE__ */ React__default.createElement(QuoteToolbarButton, null)
|
|
14575
14602
|
},
|
|
14576
14603
|
ul: {
|
|
14577
14604
|
label: "Unordered List",
|
|
14578
14605
|
width: () => STANDARD_ICON_WIDTH,
|
|
14579
|
-
Component: /* @__PURE__ */ React__default.createElement(
|
|
14606
|
+
Component: /* @__PURE__ */ React__default.createElement(UnorderedListToolbarButton, null)
|
|
14580
14607
|
},
|
|
14581
14608
|
ol: {
|
|
14582
14609
|
label: "Ordered List",
|
|
14583
14610
|
width: () => STANDARD_ICON_WIDTH,
|
|
14584
|
-
Component: /* @__PURE__ */ React__default.createElement(
|
|
14611
|
+
Component: /* @__PURE__ */ React__default.createElement(OrderedListToolbarButton, null)
|
|
14585
14612
|
},
|
|
14586
14613
|
bold: {
|
|
14587
14614
|
label: "Bold",
|
|
14588
14615
|
width: () => STANDARD_ICON_WIDTH,
|
|
14589
|
-
Component: /* @__PURE__ */ React__default.createElement(
|
|
14616
|
+
Component: /* @__PURE__ */ React__default.createElement(BoldToolbarButton, null)
|
|
14590
14617
|
},
|
|
14591
14618
|
strikethrough: {
|
|
14592
14619
|
label: "Strikethrough",
|
|
14593
14620
|
width: () => STANDARD_ICON_WIDTH,
|
|
14594
|
-
Component: /* @__PURE__ */ React__default.createElement(
|
|
14621
|
+
Component: /* @__PURE__ */ React__default.createElement(StrikethroughToolbarButton, null)
|
|
14595
14622
|
},
|
|
14596
14623
|
italic: {
|
|
14597
14624
|
label: "Italic",
|
|
14598
14625
|
width: () => STANDARD_ICON_WIDTH,
|
|
14599
|
-
Component: /* @__PURE__ */ React__default.createElement(
|
|
14626
|
+
Component: /* @__PURE__ */ React__default.createElement(ItalicToolbarButton, null)
|
|
14600
14627
|
},
|
|
14601
14628
|
code: {
|
|
14602
14629
|
label: "Code",
|
|
14603
14630
|
width: () => STANDARD_ICON_WIDTH,
|
|
14604
|
-
Component: /* @__PURE__ */ React__default.createElement(
|
|
14631
|
+
Component: /* @__PURE__ */ React__default.createElement(CodeToolbarButton, null)
|
|
14605
14632
|
},
|
|
14606
14633
|
codeBlock: {
|
|
14607
14634
|
label: "Code Block",
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare const IndentListToolbarButton: React.ForwardRefExoticComponent<{
|
|
4
|
-
nodeType?: typeof ELEMENT_UL | typeof ELEMENT_OL;
|
|
5
|
-
} & Omit<Omit<{
|
|
2
|
+
export declare const UnorderedListToolbarButton: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
6
3
|
tooltip?: React.ReactNode;
|
|
7
4
|
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
8
5
|
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
@@ -16,4 +13,19 @@ export declare const IndentListToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
16
13
|
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
17
14
|
size?: "default" | "sm" | "lg";
|
|
18
15
|
variant?: "default" | "outline";
|
|
19
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">,
|
|
16
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, never> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const OrderedListToolbarButton: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
18
|
+
tooltip?: React.ReactNode;
|
|
19
|
+
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
20
|
+
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
21
|
+
} & Omit<{
|
|
22
|
+
isDropdown?: boolean;
|
|
23
|
+
pressed?: boolean;
|
|
24
|
+
showArrow?: boolean;
|
|
25
|
+
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
26
|
+
size?: "default" | "sm" | "lg";
|
|
27
|
+
variant?: "default" | "outline";
|
|
28
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
29
|
+
size?: "default" | "sm" | "lg";
|
|
30
|
+
variant?: "default" | "outline";
|
|
31
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, never> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
tooltip?: React.ReactNode;
|
|
7
|
-
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
8
|
-
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
9
|
-
} & Omit<{
|
|
10
|
-
isDropdown?: boolean;
|
|
11
|
-
pressed?: boolean;
|
|
12
|
-
showArrow?: boolean;
|
|
13
|
-
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
14
|
-
size?: "default" | "sm" | "lg";
|
|
15
|
-
variant?: "default" | "outline";
|
|
16
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
17
|
-
size?: "default" | "sm" | "lg";
|
|
18
|
-
variant?: "default" | "outline";
|
|
19
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, "clear" | "nodeType"> & React.RefAttributes<HTMLButtonElement>>;
|
|
2
|
+
export declare const BoldToolbarButton: () => React.JSX.Element;
|
|
3
|
+
export declare const StrikethroughToolbarButton: () => React.JSX.Element;
|
|
4
|
+
export declare const ItalicToolbarButton: () => React.JSX.Element;
|
|
5
|
+
export declare const CodeToolbarButton: () => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -129,9 +129,9 @@
|
|
|
129
129
|
"webfontloader": "1.6.28",
|
|
130
130
|
"yup": "^1.6.1",
|
|
131
131
|
"zod": "^3.24.2",
|
|
132
|
-
"@tinacms/mdx": "1.6.
|
|
133
|
-
"@tinacms/schema-tools": "1.7.
|
|
134
|
-
"@tinacms/search": "1.0.
|
|
132
|
+
"@tinacms/mdx": "1.6.1",
|
|
133
|
+
"@tinacms/schema-tools": "1.7.2",
|
|
134
|
+
"@tinacms/search": "1.0.41"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@graphql-tools/utils": "^10.8.1",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"typescript": "^5.7.3",
|
|
165
165
|
"vite": "^5.4.14",
|
|
166
166
|
"vitest": "^2.1.9",
|
|
167
|
-
"@tinacms/scripts": "1.3.
|
|
167
|
+
"@tinacms/scripts": "1.3.3"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"react": ">=16.14.0",
|