tinacms 3.8.2 → 3.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +282 -286
- package/dist/toolkit/components/media/index.d.ts +1 -1
- package/dist/toolkit/components/media/utils.d.ts +8 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/heading-items.d.ts +15 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-block.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +171 -165
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +3 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +10 -1
- package/dist/toolkit/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -3,4 +3,4 @@ export { ListMediaItem, GridMediaItem } from './media-item';
|
|
|
3
3
|
export { Breadcrumb } from './breadcrumb';
|
|
4
4
|
export { CursorPaginator } from './pagination';
|
|
5
5
|
export type { MediaPaginatorProps } from './pagination';
|
|
6
|
-
export { DEFAULT_MEDIA_UPLOAD_TYPES } from './utils';
|
|
6
|
+
export { DEFAULT_MEDIA_UPLOAD_TYPES, sanitizeFilename } from './utils';
|
|
@@ -3,3 +3,11 @@ export declare const dropzoneAcceptFromString: (str: string) => any;
|
|
|
3
3
|
export declare const isImage: (filename: string) => boolean;
|
|
4
4
|
export declare const isVideo: (filename: string) => boolean;
|
|
5
5
|
export declare const absoluteImgURL: (str: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Normalizes filenames to NFC and replaces characters that are unsafe for
|
|
8
|
+
* URLs or common filesystems with a hyphen, while preserving the extension.
|
|
9
|
+
*
|
|
10
|
+
* Example: `image-a\u0308.jpg` becomes `image-ä.jpg`,
|
|
11
|
+
* so URLs use `%C3%A4` instead of the decomposed `%CC%88` sequence.
|
|
12
|
+
*/
|
|
13
|
+
export declare const sanitizeFilename: (filename: string) => string;
|
package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/heading-items.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentType, SVGProps } from 'react';
|
|
2
|
+
import { type HeadingLevel } from '@tinacms/schema-tools';
|
|
3
|
+
export type HeadingItemIcon = ComponentType<SVGProps<SVGSVGElement>>;
|
|
4
|
+
export interface HeadingMenuItem {
|
|
5
|
+
description: string;
|
|
6
|
+
icon: HeadingItemIcon;
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const headingItemsByLevel: Record<HeadingLevel, HeadingMenuItem>;
|
|
11
|
+
export declare const paragraphItem: HeadingMenuItem;
|
|
12
|
+
/** Looks up the menu item for any block value. Returns `undefined`
|
|
13
|
+
* for non-heading values so callers can fall back as they see fit
|
|
14
|
+
* (e.g. to `paragraphItem` for the dropdown trigger label). */
|
|
15
|
+
export declare const getHeadingItem: (value: string) => HeadingMenuItem | undefined;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { AutoformatRule } from '@udecode/plate-autoformat';
|
|
2
|
+
import { type HeadingLevel } from '@tinacms/schema-tools';
|
|
3
|
+
export declare const getAutoformatBlocks: (headingLevels?: readonly HeadingLevel[]) => AutoformatRule[];
|
|
2
4
|
export declare const autoformatBlocks: AutoformatRule[];
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { AutoformatRule } from '@udecode/plate-autoformat';
|
|
3
3
|
import { ListStyleType } from '@udecode/plate-indent-list';
|
|
4
4
|
import { createLowlight } from 'lowlight';
|
|
5
|
+
import type { HeadingLevel } from '@tinacms/schema-tools';
|
|
5
6
|
export declare const HANDLES_MDX: ("h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p")[];
|
|
6
7
|
export declare const viewPlugins: readonly [import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"basicMarks", {}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"underline", {}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"highlight", {}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"heading", {
|
|
7
8
|
levels?: import("@udecode/plate-heading").HeadingLevel | import("@udecode/plate-heading").HeadingLevel[];
|
|
@@ -9,11 +10,152 @@ export declare const viewPlugins: readonly [import("@udecode/plate/react").Plate
|
|
|
9
10
|
defaultLanguage?: string | null;
|
|
10
11
|
lowlight?: ReturnType<typeof createLowlight> | null;
|
|
11
12
|
}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"blockquote", {}, {}, {}, {}>>];
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
13
|
+
export interface CreateEditorPluginsOptions {
|
|
14
|
+
/** Heading levels exposed via markdown autoformat shortcuts (`# `, `## `, …).
|
|
15
|
+
* Omit to allow all levels 1-6. */
|
|
16
|
+
headingLevels?: readonly HeadingLevel[];
|
|
17
|
+
}
|
|
18
|
+
export declare const createEditorPlugins: ({ headingLevels, }?: CreateEditorPluginsOptions) => (import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"code_block", {
|
|
19
|
+
defaultLanguage?: string | null;
|
|
20
|
+
lowlight?: ReturnType<typeof createLowlight> | null;
|
|
21
|
+
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"table", {
|
|
22
|
+
_cellIndices: Record<string, {
|
|
23
|
+
col: number;
|
|
24
|
+
row: number;
|
|
25
|
+
}>;
|
|
26
|
+
selectedCells: import("@udecode/plate").TElement[] | null;
|
|
27
|
+
selectedTables: import("@udecode/plate").TElement[] | null;
|
|
28
|
+
disableExpandOnInsert?: boolean;
|
|
29
|
+
disableMarginLeft?: boolean;
|
|
30
|
+
disableMerge?: boolean;
|
|
31
|
+
enableUnsetSingleColSize?: boolean;
|
|
32
|
+
initialTableWidth?: number;
|
|
33
|
+
minColumnWidth?: number;
|
|
34
|
+
}, {
|
|
35
|
+
create: {
|
|
36
|
+
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyTableNodeOptions) => import("@udecode/plate-table").TTableElement>;
|
|
37
|
+
tableCell: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { children, header, row }?: import("@udecode/plate-table").CreateCellOptions) => {
|
|
38
|
+
children: import("@udecode/plate").Descendant[];
|
|
39
|
+
type: string;
|
|
40
|
+
}>;
|
|
41
|
+
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyRowNodeOptions) => {
|
|
42
|
+
children: {
|
|
43
|
+
children: import("@udecode/plate").Descendant[];
|
|
44
|
+
type: string;
|
|
45
|
+
}[];
|
|
46
|
+
type: string;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
table: {
|
|
50
|
+
getCellBorders: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, defaultBorder, element, }: {
|
|
51
|
+
element: import("@udecode/plate-table").TTableCellElement;
|
|
52
|
+
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
53
|
+
defaultBorder?: import("@udecode/plate-table").BorderStyle;
|
|
54
|
+
}) => import("@udecode/plate-table").BorderStylesDefault>;
|
|
55
|
+
getCellSize: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, colSizes, element, rowSize, }: {
|
|
56
|
+
element: import("@udecode/plate-table").TTableCellElement;
|
|
57
|
+
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
58
|
+
colSizes?: number[];
|
|
59
|
+
rowSize?: number;
|
|
60
|
+
}) => {
|
|
61
|
+
minHeight: number | undefined;
|
|
62
|
+
width: number;
|
|
63
|
+
}>;
|
|
64
|
+
getColSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
65
|
+
getRowSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
66
|
+
getCellChildren: (cell: import("@udecode/plate-table").TTableCellElement) => import("@udecode/plate").Descendant[];
|
|
67
|
+
};
|
|
68
|
+
} & {
|
|
69
|
+
create: {
|
|
70
|
+
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyTableNodeOptions) => import("@udecode/plate-table").TTableElement>;
|
|
71
|
+
tableCell: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { children, header, row }?: import("@udecode/plate-table").CreateCellOptions) => {
|
|
72
|
+
children: import("@udecode/plate").Descendant[];
|
|
73
|
+
type: string;
|
|
74
|
+
}>;
|
|
75
|
+
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyRowNodeOptions) => {
|
|
76
|
+
children: {
|
|
77
|
+
children: import("@udecode/plate").Descendant[];
|
|
78
|
+
type: string;
|
|
79
|
+
}[];
|
|
80
|
+
type: string;
|
|
81
|
+
}>;
|
|
82
|
+
};
|
|
83
|
+
table: {
|
|
84
|
+
getCellBorders: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, defaultBorder, element, }: {
|
|
85
|
+
element: import("@udecode/plate-table").TTableCellElement;
|
|
86
|
+
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
87
|
+
defaultBorder?: import("@udecode/plate-table").BorderStyle;
|
|
88
|
+
}) => import("@udecode/plate-table").BorderStylesDefault>;
|
|
89
|
+
getCellSize: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, colSizes, element, rowSize, }: {
|
|
90
|
+
element: import("@udecode/plate-table").TTableCellElement;
|
|
91
|
+
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
92
|
+
colSizes?: number[];
|
|
93
|
+
rowSize?: number;
|
|
94
|
+
}) => {
|
|
95
|
+
minHeight: number | undefined;
|
|
96
|
+
width: number;
|
|
97
|
+
}>;
|
|
98
|
+
getColSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
99
|
+
getRowSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
100
|
+
getCellChildren: (cell: import("@udecode/plate-table").TTableCellElement) => import("@udecode/plate").Descendant[];
|
|
101
|
+
};
|
|
102
|
+
}, {
|
|
103
|
+
insert: {
|
|
104
|
+
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount }?: import("@udecode/plate-table").GetEmptyTableNodeOptions, { select: shouldSelect, ...options }?: import("@udecode/plate").InsertNodesOptions) => void>;
|
|
105
|
+
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
106
|
+
at?: import("@udecode/plate").Path;
|
|
107
|
+
before?: boolean;
|
|
108
|
+
fromCell?: import("@udecode/plate").Path;
|
|
109
|
+
header?: boolean;
|
|
110
|
+
select?: boolean;
|
|
111
|
+
}) => void>;
|
|
112
|
+
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
113
|
+
at?: import("@udecode/plate").Path;
|
|
114
|
+
before?: boolean;
|
|
115
|
+
fromRow?: import("@udecode/plate").Path;
|
|
116
|
+
header?: boolean;
|
|
117
|
+
select?: boolean;
|
|
118
|
+
}) => void>;
|
|
119
|
+
};
|
|
120
|
+
remove: {
|
|
121
|
+
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
122
|
+
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
123
|
+
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
124
|
+
};
|
|
125
|
+
table: {
|
|
126
|
+
merge: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
127
|
+
split: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
128
|
+
};
|
|
129
|
+
} & {
|
|
130
|
+
insert: {
|
|
131
|
+
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount }?: import("@udecode/plate-table").GetEmptyTableNodeOptions, { select: shouldSelect, ...options }?: import("@udecode/plate").InsertNodesOptions) => void>;
|
|
132
|
+
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
133
|
+
at?: import("@udecode/plate").Path;
|
|
134
|
+
before?: boolean;
|
|
135
|
+
fromCell?: import("@udecode/plate").Path;
|
|
136
|
+
header?: boolean;
|
|
137
|
+
select?: boolean;
|
|
138
|
+
}) => void>;
|
|
139
|
+
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
140
|
+
at?: import("@udecode/plate").Path;
|
|
141
|
+
before?: boolean;
|
|
142
|
+
fromRow?: import("@udecode/plate").Path;
|
|
143
|
+
header?: boolean;
|
|
144
|
+
select?: boolean;
|
|
145
|
+
}) => void>;
|
|
146
|
+
};
|
|
147
|
+
remove: {
|
|
148
|
+
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
149
|
+
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
150
|
+
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
151
|
+
};
|
|
152
|
+
table: {
|
|
153
|
+
merge: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
154
|
+
split: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
155
|
+
};
|
|
156
|
+
}, {
|
|
157
|
+
cellIndices?: (id: string) => import("@udecode/plate-table").CellIndices;
|
|
158
|
+
}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"p", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"blockquote", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"a", {
|
|
17
159
|
allowedSchemes?: string[];
|
|
18
160
|
dangerouslySkipSanitization?: boolean;
|
|
19
161
|
defaultLinkAttributes?: React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
@@ -337,12 +479,29 @@ export declare const editorPlugins: readonly [import("@udecode/plate/react").Pla
|
|
|
337
479
|
};
|
|
338
480
|
}, {}, {
|
|
339
481
|
isOpen?: (editorId: string) => boolean;
|
|
340
|
-
}
|
|
482
|
+
}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"highlight", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"underline", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"hr", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"img", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"mdxJsxTextElement", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"mdxJsxFlowElement", {}, {}, {}, {}>> | import("@udecode/plate").SlatePlugin<import("@udecode/plate").PluginConfig<"trailingBlock", {
|
|
483
|
+
type: string;
|
|
484
|
+
} & {
|
|
485
|
+
level?: number;
|
|
486
|
+
type?: string;
|
|
487
|
+
} & import("@udecode/plate").QueryNodeOptions, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"autoformat", {
|
|
488
|
+
enableUndoOnDelete?: boolean;
|
|
489
|
+
rules?: AutoformatRule[];
|
|
490
|
+
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"exitBreak", {
|
|
491
|
+
rules?: import("node_modules/@udecode/plate-break/dist/BaseSoftBreakPlugin-CeLtcSTo").E[];
|
|
492
|
+
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"resetNode", {
|
|
493
|
+
disableEditorReset?: boolean;
|
|
494
|
+
disableFirstBlockReset?: boolean;
|
|
495
|
+
rules?: import("@udecode/plate-reset-node").ResetNodePluginRule[];
|
|
496
|
+
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"softBreak", {
|
|
497
|
+
rules?: import("node_modules/@udecode/plate-break/dist/BaseSoftBreakPlugin-CeLtcSTo").b[];
|
|
498
|
+
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"invalid_markdown", {
|
|
499
|
+
isElement: boolean;
|
|
500
|
+
isVoid: boolean;
|
|
501
|
+
isInline: boolean;
|
|
502
|
+
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"floating-toolbar", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"html", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"html_inline", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"blockquote-enter-break", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"break", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"basicMarks", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"heading", {
|
|
341
503
|
levels?: import("@udecode/plate-heading").HeadingLevel | import("@udecode/plate-heading").HeadingLevel[];
|
|
342
|
-
}, {}, {}, {}
|
|
343
|
-
defaultLanguage?: string | null;
|
|
344
|
-
lowlight?: ReturnType<typeof createLowlight> | null;
|
|
345
|
-
}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"blockquote", {}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"list", {
|
|
504
|
+
}, {}, {}, {}>> | import("@udecode/plate").SlatePlugin<import("@udecode/plate").PluginConfig<"WITH_CORRECT_NODE_BEHAVIOR", {}, {}, {}, {}>> | import("@udecode/plate").SlatePlugin<import("@udecode/plate").PluginConfig<"CLEAR_HIGHLIGHT_ON_ENTER", {}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"list", {
|
|
346
505
|
enableResetOnShiftTab?: boolean;
|
|
347
506
|
validLiChildrenTypes?: string[];
|
|
348
507
|
}, {}, {
|
|
@@ -355,7 +514,7 @@ export declare const editorPlugins: readonly [import("@udecode/plate/react").Pla
|
|
|
355
514
|
}) => boolean);
|
|
356
515
|
numberedList: (() => boolean) & (() => boolean);
|
|
357
516
|
};
|
|
358
|
-
}, {}
|
|
517
|
+
}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"listStyleType", {
|
|
359
518
|
getSiblingIndentListOptions?: import("@udecode/plate-indent-list").GetSiblingIndentListOptions<import("@udecode/plate").TElement>;
|
|
360
519
|
listStyleTypes?: Record<string, {
|
|
361
520
|
type: string;
|
|
@@ -364,157 +523,4 @@ export declare const editorPlugins: readonly [import("@udecode/plate/react").Pla
|
|
|
364
523
|
markerComponent?: React.FC<Omit<import("@udecode/plate").SlateRenderElementProps, "children">>;
|
|
365
524
|
}>;
|
|
366
525
|
getListStyleType?: (element: HTMLElement) => ListStyleType;
|
|
367
|
-
}, {}, {}, {}
|
|
368
|
-
_cellIndices: Record<string, {
|
|
369
|
-
col: number;
|
|
370
|
-
row: number;
|
|
371
|
-
}>;
|
|
372
|
-
selectedCells: import("@udecode/plate").TElement[] | null;
|
|
373
|
-
selectedTables: import("@udecode/plate").TElement[] | null;
|
|
374
|
-
disableExpandOnInsert?: boolean;
|
|
375
|
-
disableMarginLeft?: boolean;
|
|
376
|
-
disableMerge?: boolean;
|
|
377
|
-
enableUnsetSingleColSize?: boolean;
|
|
378
|
-
initialTableWidth?: number;
|
|
379
|
-
minColumnWidth?: number;
|
|
380
|
-
}, {
|
|
381
|
-
create: {
|
|
382
|
-
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyTableNodeOptions) => import("@udecode/plate-table").TTableElement>;
|
|
383
|
-
tableCell: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { children, header, row }?: import("@udecode/plate-table").CreateCellOptions) => {
|
|
384
|
-
children: import("@udecode/plate").Descendant[];
|
|
385
|
-
type: string;
|
|
386
|
-
}>;
|
|
387
|
-
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyRowNodeOptions) => {
|
|
388
|
-
children: {
|
|
389
|
-
children: import("@udecode/plate").Descendant[];
|
|
390
|
-
type: string;
|
|
391
|
-
}[];
|
|
392
|
-
type: string;
|
|
393
|
-
}>;
|
|
394
|
-
};
|
|
395
|
-
table: {
|
|
396
|
-
getCellBorders: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, defaultBorder, element, }: {
|
|
397
|
-
element: import("@udecode/plate-table").TTableCellElement;
|
|
398
|
-
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
399
|
-
defaultBorder?: import("@udecode/plate-table").BorderStyle;
|
|
400
|
-
}) => import("@udecode/plate-table").BorderStylesDefault>;
|
|
401
|
-
getCellSize: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, colSizes, element, rowSize, }: {
|
|
402
|
-
element: import("@udecode/plate-table").TTableCellElement;
|
|
403
|
-
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
404
|
-
colSizes?: number[];
|
|
405
|
-
rowSize?: number;
|
|
406
|
-
}) => {
|
|
407
|
-
minHeight: number | undefined;
|
|
408
|
-
width: number;
|
|
409
|
-
}>;
|
|
410
|
-
getColSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
411
|
-
getRowSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
412
|
-
getCellChildren: (cell: import("@udecode/plate-table").TTableCellElement) => import("@udecode/plate").Descendant[];
|
|
413
|
-
};
|
|
414
|
-
} & {
|
|
415
|
-
create: {
|
|
416
|
-
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyTableNodeOptions) => import("@udecode/plate-table").TTableElement>;
|
|
417
|
-
tableCell: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { children, header, row }?: import("@udecode/plate-table").CreateCellOptions) => {
|
|
418
|
-
children: import("@udecode/plate").Descendant[];
|
|
419
|
-
type: string;
|
|
420
|
-
}>;
|
|
421
|
-
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, ...cellOptions }?: import("@udecode/plate-table").GetEmptyRowNodeOptions) => {
|
|
422
|
-
children: {
|
|
423
|
-
children: import("@udecode/plate").Descendant[];
|
|
424
|
-
type: string;
|
|
425
|
-
}[];
|
|
426
|
-
type: string;
|
|
427
|
-
}>;
|
|
428
|
-
};
|
|
429
|
-
table: {
|
|
430
|
-
getCellBorders: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, defaultBorder, element, }: {
|
|
431
|
-
element: import("@udecode/plate-table").TTableCellElement;
|
|
432
|
-
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
433
|
-
defaultBorder?: import("@udecode/plate-table").BorderStyle;
|
|
434
|
-
}) => import("@udecode/plate-table").BorderStylesDefault>;
|
|
435
|
-
getCellSize: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { cellIndices, colSizes, element, rowSize, }: {
|
|
436
|
-
element: import("@udecode/plate-table").TTableCellElement;
|
|
437
|
-
cellIndices?: import("@udecode/plate-table").CellIndices;
|
|
438
|
-
colSizes?: number[];
|
|
439
|
-
rowSize?: number;
|
|
440
|
-
}) => {
|
|
441
|
-
minHeight: number | undefined;
|
|
442
|
-
width: number;
|
|
443
|
-
}>;
|
|
444
|
-
getColSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
445
|
-
getRowSpan: (cellElem: import("@udecode/plate-table").TTableCellElement) => number;
|
|
446
|
-
getCellChildren: (cell: import("@udecode/plate-table").TTableCellElement) => import("@udecode/plate").Descendant[];
|
|
447
|
-
};
|
|
448
|
-
}, {
|
|
449
|
-
insert: {
|
|
450
|
-
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount }?: import("@udecode/plate-table").GetEmptyTableNodeOptions, { select: shouldSelect, ...options }?: import("@udecode/plate").InsertNodesOptions) => void>;
|
|
451
|
-
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
452
|
-
at?: import("@udecode/plate").Path;
|
|
453
|
-
before?: boolean;
|
|
454
|
-
fromCell?: import("@udecode/plate").Path;
|
|
455
|
-
header?: boolean;
|
|
456
|
-
select?: boolean;
|
|
457
|
-
}) => void>;
|
|
458
|
-
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
459
|
-
at?: import("@udecode/plate").Path;
|
|
460
|
-
before?: boolean;
|
|
461
|
-
fromRow?: import("@udecode/plate").Path;
|
|
462
|
-
header?: boolean;
|
|
463
|
-
select?: boolean;
|
|
464
|
-
}) => void>;
|
|
465
|
-
};
|
|
466
|
-
remove: {
|
|
467
|
-
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
468
|
-
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
469
|
-
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
470
|
-
};
|
|
471
|
-
table: {
|
|
472
|
-
merge: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
473
|
-
split: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
474
|
-
};
|
|
475
|
-
} & {
|
|
476
|
-
insert: {
|
|
477
|
-
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, { colCount, header, rowCount }?: import("@udecode/plate-table").GetEmptyTableNodeOptions, { select: shouldSelect, ...options }?: import("@udecode/plate").InsertNodesOptions) => void>;
|
|
478
|
-
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
479
|
-
at?: import("@udecode/plate").Path;
|
|
480
|
-
before?: boolean;
|
|
481
|
-
fromCell?: import("@udecode/plate").Path;
|
|
482
|
-
header?: boolean;
|
|
483
|
-
select?: boolean;
|
|
484
|
-
}) => void>;
|
|
485
|
-
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor, options?: {
|
|
486
|
-
at?: import("@udecode/plate").Path;
|
|
487
|
-
before?: boolean;
|
|
488
|
-
fromRow?: import("@udecode/plate").Path;
|
|
489
|
-
header?: boolean;
|
|
490
|
-
select?: boolean;
|
|
491
|
-
}) => void>;
|
|
492
|
-
};
|
|
493
|
-
remove: {
|
|
494
|
-
table: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
495
|
-
tableColumn: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
496
|
-
tableRow: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
497
|
-
};
|
|
498
|
-
table: {
|
|
499
|
-
merge: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
500
|
-
split: import("@udecode/plate").OmitFirst<(editor: import("@udecode/plate").SlateEditor) => void>;
|
|
501
|
-
};
|
|
502
|
-
}, {
|
|
503
|
-
cellIndices?: (id: string) => import("@udecode/plate-table").CellIndices;
|
|
504
|
-
}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"slash_command", import("@udecode/plate-combobox").TriggerComboboxPluginOptions, {}, {}, {}>>, import("@udecode/plate").SlatePlugin<import("@udecode/plate").PluginConfig<"trailingBlock", {
|
|
505
|
-
type: string;
|
|
506
|
-
} & {
|
|
507
|
-
level?: number;
|
|
508
|
-
type?: string;
|
|
509
|
-
} & import("@udecode/plate").QueryNodeOptions, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"break", {}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"floating-toolbar", {}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"autoformat", {
|
|
510
|
-
enableUndoOnDelete?: boolean;
|
|
511
|
-
rules?: AutoformatRule[];
|
|
512
|
-
}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"exitBreak", {
|
|
513
|
-
rules?: import("node_modules/@udecode/plate-break/dist/BaseSoftBreakPlugin-CeLtcSTo").E[];
|
|
514
|
-
}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"resetNode", {
|
|
515
|
-
disableEditorReset?: boolean;
|
|
516
|
-
disableFirstBlockReset?: boolean;
|
|
517
|
-
rules?: import("@udecode/plate-reset-node").ResetNodePluginRule[];
|
|
518
|
-
}, {}, {}, {}>>, import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"softBreak", {
|
|
519
|
-
rules?: import("node_modules/@udecode/plate-break/dist/BaseSoftBreakPlugin-CeLtcSTo").b[];
|
|
520
|
-
}, {}, {}, {}>>];
|
|
526
|
+
}, {}, {}, {}>> | import("@udecode/plate").SlatePlugin<import("@udecode/plate-node-id").NodeIdConfig> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"slash_command", import("@udecode/plate-combobox").TriggerComboboxPluginOptions, {}, {}, {}>>)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ToolbarOverrideType } from '@tinacms/schema-tools';
|
|
2
|
-
export type { ToolbarOverrideType };
|
|
1
|
+
import type { HeadingLevel, ToolbarOverrideType } from '@tinacms/schema-tools';
|
|
2
|
+
export type { HeadingLevel, ToolbarOverrideType };
|
|
3
3
|
export declare const STANDARD_ICON_WIDTH = 32;
|
|
4
4
|
export declare const HEADING_ICON_WITH_TEXT = 127;
|
|
5
5
|
export declare const HEADING_ICON_ONLY = 58;
|
|
@@ -10,4 +10,5 @@ export declare const HEADING_LABEL = "Headings";
|
|
|
10
10
|
export type ToolbarOverrides = {
|
|
11
11
|
toolbar?: ToolbarOverrideType[];
|
|
12
12
|
showFloatingToolbar?: boolean;
|
|
13
|
+
headingLevels?: HeadingLevel[];
|
|
13
14
|
};
|
|
@@ -2,13 +2,22 @@ import React from 'react';
|
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import type { Form } from '../../../../../forms';
|
|
4
4
|
import type { MdxTemplate } from '../types';
|
|
5
|
+
import { type HeadingLevel } from '@tinacms/schema-tools';
|
|
5
6
|
import type { ToolbarOverrides, ToolbarOverrideType } from './toolbar-overrides';
|
|
6
7
|
interface ToolbarContextProps {
|
|
7
8
|
tinaForm: Form;
|
|
8
9
|
templates: MdxTemplate[];
|
|
9
10
|
overrides: ToolbarOverrideType[] | ToolbarOverrides;
|
|
11
|
+
headingLevels: readonly HeadingLevel[];
|
|
12
|
+
/**
|
|
13
|
+
* True when the schema explicitly sets `overrides.headingLevels`
|
|
14
|
+
* (including an explicit empty array, which means "no headings").
|
|
15
|
+
* Lets consumers (e.g. the slash menu) distinguish "user opted in"
|
|
16
|
+
* from "use the legacy default" without re-deriving the check.
|
|
17
|
+
*/
|
|
18
|
+
headingLevelsConfigured: boolean;
|
|
10
19
|
}
|
|
11
|
-
interface ToolbarProviderProps extends ToolbarContextProps {
|
|
20
|
+
interface ToolbarProviderProps extends Omit<ToolbarContextProps, 'headingLevels' | 'headingLevelsConfigured'> {
|
|
12
21
|
children: ReactNode;
|
|
13
22
|
}
|
|
14
23
|
export declare const ToolbarProvider: React.FC<ToolbarProviderProps>;
|
package/dist/toolkit/index.d.ts
CHANGED
|
@@ -37,4 +37,4 @@ export { TinaUI } from './components/tina-ui';
|
|
|
37
37
|
export type { TinaUIProps } from './components/tina-ui';
|
|
38
38
|
export { useLocalStorage } from './hooks/use-local-storage';
|
|
39
39
|
export { CursorPaginator } from './components/media/pagination';
|
|
40
|
-
export { DEFAULT_MEDIA_UPLOAD_TYPES } from './components/media';
|
|
40
|
+
export { DEFAULT_MEDIA_UPLOAD_TYPES, sanitizeFilename, } from './components/media';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "tinacms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"typings": "dist/index.d.ts",
|
|
5
|
-
"version": "3.8.
|
|
5
|
+
"version": "3.8.4",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
"yup": "^1.6.1",
|
|
119
119
|
"zod": "^3.24.2",
|
|
120
120
|
"@tinacms/bridge": "0.3.0",
|
|
121
|
-
"@tinacms/mdx": "2.1.
|
|
122
|
-
"@tinacms/schema-tools": "2.8.
|
|
123
|
-
"@tinacms/search": "1.2.
|
|
121
|
+
"@tinacms/mdx": "2.1.6",
|
|
122
|
+
"@tinacms/schema-tools": "2.8.1",
|
|
123
|
+
"@tinacms/search": "1.2.17"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
126
|
"@graphql-tools/utils": "^10.8.1",
|