tinacms 2.2.9 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache/node-cache.d.ts +1 -0
- package/dist/client.js +18 -16
- package/dist/client.mjs +1 -1
- package/dist/index.js +1429 -769
- package/dist/index.mjs +1410 -746
- 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 +8 -6
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
const makeCacheDir = async (dir, fs) => {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
const makeCacheDir = async (dir, fs, path, os) => {
|
|
2
|
+
const pathParts = dir.split(path.sep).filter(Boolean);
|
|
3
|
+
const cacheHash = pathParts[pathParts.length - 1];
|
|
4
|
+
const rootUser = pathParts[0];
|
|
5
5
|
let cacheDir = dir;
|
|
6
|
-
if (!fs.existsSync(path.join(path.sep,
|
|
7
|
-
cacheDir = path.join(os.tmpdir(),
|
|
6
|
+
if (!fs.existsSync(path.join(path.sep, rootUser))) {
|
|
7
|
+
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
throw new Error(`Failed to create cache directory: ${error.message}`);
|
|
8
13
|
}
|
|
9
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
10
14
|
return cacheDir;
|
|
11
15
|
};
|
|
12
16
|
const NodeCache = async (dir) => {
|
|
13
|
-
const fs =
|
|
14
|
-
const
|
|
15
|
-
const
|
|
17
|
+
const fs = require("node:fs");
|
|
18
|
+
const path = require("node:path");
|
|
19
|
+
const os = require("node:os");
|
|
20
|
+
const { createHash } = require("node:crypto");
|
|
21
|
+
const cacheDir = await makeCacheDir(dir, fs, path, os);
|
|
16
22
|
return {
|
|
17
23
|
makeKey: (key) => {
|
|
18
24
|
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
@@ -39,5 +45,6 @@ const NodeCache = async (dir) => {
|
|
|
39
45
|
};
|
|
40
46
|
};
|
|
41
47
|
export {
|
|
42
|
-
NodeCache
|
|
48
|
+
NodeCache,
|
|
49
|
+
makeCacheDir
|
|
43
50
|
};
|
package/dist/rich-text/index.js
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
return MNode;
|
|
73
73
|
};
|
|
74
74
|
const Node = ({ components, child }) => {
|
|
75
|
-
var _a, _b, _c, _d, _e, _f;
|
|
75
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
76
76
|
const { children, ...props } = child;
|
|
77
77
|
switch (child.type) {
|
|
78
78
|
case "h1":
|
|
@@ -117,7 +117,8 @@
|
|
|
117
117
|
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
118
118
|
/* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
|
|
119
119
|
);
|
|
120
|
-
case "
|
|
120
|
+
case "mermaid":
|
|
121
|
+
case "code_block": {
|
|
121
122
|
const value = child.value;
|
|
122
123
|
if (components[child.type]) {
|
|
123
124
|
const Component2 = components[child.type];
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
);
|
|
128
129
|
}
|
|
129
130
|
return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, value));
|
|
131
|
+
}
|
|
130
132
|
case "hr":
|
|
131
133
|
if (components[child.type]) {
|
|
132
134
|
const Component2 = components[child.type];
|
|
@@ -150,33 +152,33 @@
|
|
|
150
152
|
} else {
|
|
151
153
|
if (child.name === "table") {
|
|
152
154
|
const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
|
|
153
|
-
const
|
|
155
|
+
const rows2 = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
|
|
154
156
|
const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
+
const TableComponent2 = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
|
|
158
|
+
const TrComponent2 = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
|
|
157
159
|
const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
-
return /* @__PURE__ */ React.createElement(
|
|
160
|
+
const TdComponent2 = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
|
|
161
|
+
const align2 = ((_f = child.props) == null ? void 0 : _f.align) || [];
|
|
162
|
+
return /* @__PURE__ */ React.createElement(TableComponent2, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent2, null, header.tableCells.map((c, i) => {
|
|
161
163
|
return /* @__PURE__ */ React.createElement(
|
|
162
164
|
TinaMarkdown,
|
|
163
165
|
{
|
|
164
166
|
key: i,
|
|
165
167
|
components: {
|
|
166
|
-
p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align:
|
|
168
|
+
p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align2[i], ...props2 })
|
|
167
169
|
},
|
|
168
170
|
content: c.value
|
|
169
171
|
}
|
|
170
172
|
);
|
|
171
|
-
}))), /* @__PURE__ */ React.createElement("tbody", null,
|
|
173
|
+
}))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
|
|
172
174
|
var _a2;
|
|
173
|
-
return /* @__PURE__ */ React.createElement(
|
|
175
|
+
return /* @__PURE__ */ React.createElement(TrComponent2, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
|
|
174
176
|
return /* @__PURE__ */ React.createElement(
|
|
175
177
|
TinaMarkdown,
|
|
176
178
|
{
|
|
177
179
|
key: i2,
|
|
178
180
|
components: {
|
|
179
|
-
p: (props2) => /* @__PURE__ */ React.createElement(
|
|
181
|
+
p: (props2) => /* @__PURE__ */ React.createElement(TdComponent2, { align: align2[i2], ...props2 })
|
|
180
182
|
},
|
|
181
183
|
content: c.value
|
|
182
184
|
}
|
|
@@ -191,6 +193,37 @@
|
|
|
191
193
|
return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
|
|
192
194
|
}
|
|
193
195
|
}
|
|
196
|
+
case "table":
|
|
197
|
+
const rows = child.children || [];
|
|
198
|
+
const TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { style: { border: "1px solid #EDECF3" }, ...props2 }));
|
|
199
|
+
const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
|
|
200
|
+
const TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement(
|
|
201
|
+
"td",
|
|
202
|
+
{
|
|
203
|
+
style: {
|
|
204
|
+
textAlign: (props2 == null ? void 0 : props2.align) || "auto",
|
|
205
|
+
border: "1px solid #EDECF3",
|
|
206
|
+
padding: "0.25rem"
|
|
207
|
+
},
|
|
208
|
+
...props2
|
|
209
|
+
}
|
|
210
|
+
));
|
|
211
|
+
const align = ((_g = child.props) == null ? void 0 : _g.align) || [];
|
|
212
|
+
return /* @__PURE__ */ React.createElement(TableComponent, null, /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => {
|
|
213
|
+
var _a2;
|
|
214
|
+
return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row.children) == null ? void 0 : _a2.map((cell, i2) => {
|
|
215
|
+
return /* @__PURE__ */ React.createElement(
|
|
216
|
+
TinaMarkdown,
|
|
217
|
+
{
|
|
218
|
+
key: i2,
|
|
219
|
+
components: {
|
|
220
|
+
p: (props2) => /* @__PURE__ */ React.createElement(TdComponent, { align: align[i2], ...props2 })
|
|
221
|
+
},
|
|
222
|
+
content: cell.children
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
}));
|
|
226
|
+
})));
|
|
194
227
|
case "maybe_mdx":
|
|
195
228
|
return null;
|
|
196
229
|
case "html":
|
package/dist/rich-text/index.mjs
CHANGED
|
@@ -69,7 +69,7 @@ const MemoNode = (props) => {
|
|
|
69
69
|
return MNode;
|
|
70
70
|
};
|
|
71
71
|
const Node = ({ components, child }) => {
|
|
72
|
-
var _a, _b, _c, _d, _e, _f;
|
|
72
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
73
73
|
const { children, ...props } = child;
|
|
74
74
|
switch (child.type) {
|
|
75
75
|
case "h1":
|
|
@@ -114,7 +114,8 @@ const Node = ({ components, child }) => {
|
|
|
114
114
|
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
115
115
|
/* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
|
|
116
116
|
);
|
|
117
|
-
case "
|
|
117
|
+
case "mermaid":
|
|
118
|
+
case "code_block": {
|
|
118
119
|
const value = child.value;
|
|
119
120
|
if (components[child.type]) {
|
|
120
121
|
const Component2 = components[child.type];
|
|
@@ -124,6 +125,7 @@ const Node = ({ components, child }) => {
|
|
|
124
125
|
);
|
|
125
126
|
}
|
|
126
127
|
return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, value));
|
|
128
|
+
}
|
|
127
129
|
case "hr":
|
|
128
130
|
if (components[child.type]) {
|
|
129
131
|
const Component2 = components[child.type];
|
|
@@ -147,33 +149,33 @@ const Node = ({ components, child }) => {
|
|
|
147
149
|
} else {
|
|
148
150
|
if (child.name === "table") {
|
|
149
151
|
const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
|
|
150
|
-
const
|
|
152
|
+
const rows2 = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
|
|
151
153
|
const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
+
const TableComponent2 = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
|
|
155
|
+
const TrComponent2 = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
|
|
154
156
|
const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
return /* @__PURE__ */ React.createElement(
|
|
157
|
+
const TdComponent2 = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
|
|
158
|
+
const align2 = ((_f = child.props) == null ? void 0 : _f.align) || [];
|
|
159
|
+
return /* @__PURE__ */ React.createElement(TableComponent2, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent2, null, header.tableCells.map((c, i) => {
|
|
158
160
|
return /* @__PURE__ */ React.createElement(
|
|
159
161
|
TinaMarkdown,
|
|
160
162
|
{
|
|
161
163
|
key: i,
|
|
162
164
|
components: {
|
|
163
|
-
p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align:
|
|
165
|
+
p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align2[i], ...props2 })
|
|
164
166
|
},
|
|
165
167
|
content: c.value
|
|
166
168
|
}
|
|
167
169
|
);
|
|
168
|
-
}))), /* @__PURE__ */ React.createElement("tbody", null,
|
|
170
|
+
}))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
|
|
169
171
|
var _a2;
|
|
170
|
-
return /* @__PURE__ */ React.createElement(
|
|
172
|
+
return /* @__PURE__ */ React.createElement(TrComponent2, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
|
|
171
173
|
return /* @__PURE__ */ React.createElement(
|
|
172
174
|
TinaMarkdown,
|
|
173
175
|
{
|
|
174
176
|
key: i2,
|
|
175
177
|
components: {
|
|
176
|
-
p: (props2) => /* @__PURE__ */ React.createElement(
|
|
178
|
+
p: (props2) => /* @__PURE__ */ React.createElement(TdComponent2, { align: align2[i2], ...props2 })
|
|
177
179
|
},
|
|
178
180
|
content: c.value
|
|
179
181
|
}
|
|
@@ -188,6 +190,37 @@ const Node = ({ components, child }) => {
|
|
|
188
190
|
return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
|
|
189
191
|
}
|
|
190
192
|
}
|
|
193
|
+
case "table":
|
|
194
|
+
const rows = child.children || [];
|
|
195
|
+
const TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { style: { border: "1px solid #EDECF3" }, ...props2 }));
|
|
196
|
+
const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
|
|
197
|
+
const TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement(
|
|
198
|
+
"td",
|
|
199
|
+
{
|
|
200
|
+
style: {
|
|
201
|
+
textAlign: (props2 == null ? void 0 : props2.align) || "auto",
|
|
202
|
+
border: "1px solid #EDECF3",
|
|
203
|
+
padding: "0.25rem"
|
|
204
|
+
},
|
|
205
|
+
...props2
|
|
206
|
+
}
|
|
207
|
+
));
|
|
208
|
+
const align = ((_g = child.props) == null ? void 0 : _g.align) || [];
|
|
209
|
+
return /* @__PURE__ */ React.createElement(TableComponent, null, /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => {
|
|
210
|
+
var _a2;
|
|
211
|
+
return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row.children) == null ? void 0 : _a2.map((cell, i2) => {
|
|
212
|
+
return /* @__PURE__ */ React.createElement(
|
|
213
|
+
TinaMarkdown,
|
|
214
|
+
{
|
|
215
|
+
key: i2,
|
|
216
|
+
components: {
|
|
217
|
+
p: (props2) => /* @__PURE__ */ React.createElement(TdComponent, { align: align[i2], ...props2 })
|
|
218
|
+
},
|
|
219
|
+
content: cell.children
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}));
|
|
223
|
+
})));
|
|
191
224
|
case "maybe_mdx":
|
|
192
225
|
return null;
|
|
193
226
|
case "html":
|
|
@@ -33,6 +33,7 @@ export declare const Icons: {
|
|
|
33
33
|
chevronsUpDown: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
34
34
|
clear: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
35
35
|
close: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
|
+
paint: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
37
|
codeblock: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
37
38
|
color: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
38
39
|
column: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -55,6 +56,7 @@ export declare const Icons: {
|
|
|
55
56
|
kbd: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
56
57
|
lineHeight: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
57
58
|
minus: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
59
|
+
mermaid: () => React.JSX.Element;
|
|
58
60
|
more: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
59
61
|
outdent: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
60
62
|
paragraph: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const MermaidElement: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
3
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
4
|
+
} & Omit<{
|
|
5
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
6
|
+
asChild?: boolean | undefined;
|
|
7
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
8
|
+
ref?: React.Ref<any>;
|
|
9
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
10
|
+
element: import("@udecode/plate-common").TElement;
|
|
11
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PlateEditor } from '@udecode/plate-common';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const insertEmptyMermaid: (editor: PlateEditor) => void;
|
|
4
|
+
export declare const MermaidToolbarButton: React.ForwardRefExoticComponent<{
|
|
5
|
+
clear?: string | string[];
|
|
6
|
+
} & Omit<Omit<{
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
9
|
+
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
10
|
+
} & Omit<{
|
|
11
|
+
isDropdown?: boolean;
|
|
12
|
+
pressed?: boolean;
|
|
13
|
+
showArrow?: boolean;
|
|
14
|
+
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
15
|
+
size?: "default" | "sm" | "lg";
|
|
16
|
+
variant?: "default" | "outline";
|
|
17
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
18
|
+
size?: "default" | "sm" | "lg";
|
|
19
|
+
variant?: "default" | "outline";
|
|
20
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, "clear"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const mediaResizeHandleVariants: (props?: {
|
|
3
|
+
direction?: "left" | "right";
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
5
|
+
export declare const ResizeHandle: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
6
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
7
|
+
asChild?: boolean | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
options?: import("@udecode/plate-resizable").ResizeHandleOptions | undefined;
|
|
10
|
+
setProps?: ((hookProps: {
|
|
11
|
+
onMouseDown: React.MouseEventHandler<Element>;
|
|
12
|
+
onMouseOut: () => void;
|
|
13
|
+
onMouseOver: () => void;
|
|
14
|
+
onTouchEnd: () => void;
|
|
15
|
+
onTouchMove: () => void;
|
|
16
|
+
onTouchStart: React.TouchEventHandler<Element>;
|
|
17
|
+
}) => Omit<React.HTMLAttributes<HTMLDivElement>, "onResize">) | undefined;
|
|
18
|
+
state?: {
|
|
19
|
+
direction: import("@udecode/plate-resizable").ResizeDirection;
|
|
20
|
+
initialPosition: number;
|
|
21
|
+
initialSize: number;
|
|
22
|
+
isHorizontal: boolean;
|
|
23
|
+
isResizing: boolean;
|
|
24
|
+
onHover: (() => void) | undefined;
|
|
25
|
+
onHoverEnd: (() => void) | undefined;
|
|
26
|
+
onMouseDown: React.MouseEventHandler<Element> | undefined;
|
|
27
|
+
onResize: (event: import("@udecode/plate-resizable").ResizeEvent) => void;
|
|
28
|
+
onTouchStart: React.TouchEventHandler<Element> | undefined;
|
|
29
|
+
setInitialPosition: React.Dispatch<React.SetStateAction<number>>;
|
|
30
|
+
setInitialSize: React.Dispatch<React.SetStateAction<number>>;
|
|
31
|
+
setIsResizing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
32
|
+
} | undefined;
|
|
33
|
+
style?: React.CSSProperties | undefined;
|
|
34
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onResize"> & React.RefAttributes<any>, "ref">, never> & React.RefAttributes<any>>;
|
|
35
|
+
export declare const Resizable: React.ForwardRefExoticComponent<Omit<{
|
|
36
|
+
options: import("@udecode/plate-resizable").ResizableOptions;
|
|
37
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
38
|
+
align?: "center" | "left" | "right";
|
|
39
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const TableCellElement: React.ForwardRefExoticComponent<{
|
|
3
|
+
hideBorder?: boolean;
|
|
4
|
+
isHeader?: boolean;
|
|
5
|
+
} & Omit<Omit<{
|
|
6
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
7
|
+
} & Omit<{
|
|
8
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
9
|
+
asChild?: boolean | undefined;
|
|
10
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
11
|
+
ref?: React.Ref<any>;
|
|
12
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
13
|
+
element: import("@udecode/plate-common").TElement;
|
|
14
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder" | "isHeader"> & React.RefAttributes<any>>;
|
|
15
|
+
export declare const TableCellHeaderElement: React.ForwardRefExoticComponent<Omit<{
|
|
16
|
+
hideBorder?: boolean;
|
|
17
|
+
isHeader?: boolean;
|
|
18
|
+
} & Omit<Omit<{
|
|
19
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
20
|
+
} & Omit<{
|
|
21
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
22
|
+
asChild?: boolean | undefined;
|
|
23
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
24
|
+
ref?: React.Ref<any>;
|
|
25
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
26
|
+
element: import("@udecode/plate-common").TElement;
|
|
27
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder" | "isHeader"> & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
|
package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
export declare const TableBordersDropdownMenuContent: React.ForwardRefExoticComponent<Omit<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const TableFloatingToolbar: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const TableElement: React.ForwardRefExoticComponent<Omit<Omit<Omit<{
|
|
6
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
7
|
+
} & Omit<{
|
|
8
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
9
|
+
asChild?: boolean | undefined;
|
|
10
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
11
|
+
ref?: React.Ref<any>;
|
|
12
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
13
|
+
element: import("@udecode/plate-common").TElement;
|
|
14
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const TableRowElement: React.ForwardRefExoticComponent<{
|
|
3
|
+
hideBorder?: boolean;
|
|
4
|
+
} & Omit<Omit<{
|
|
5
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
6
|
+
} & Omit<{
|
|
7
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
8
|
+
asChild?: boolean | undefined;
|
|
9
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
10
|
+
ref?: React.Ref<any>;
|
|
11
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
12
|
+
element: import("@udecode/plate-common").TElement;
|
|
13
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder"> & React.RefAttributes<any>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PlateEditor } from '@udecode/plate-common';
|
|
2
2
|
export declare const plugins: any[];
|
|
3
|
+
export declare const unsupportedItemsInTable: Set<string>;
|
|
3
4
|
export declare const insertInlineElement: (editor: any, inlineElement: any) => void;
|
|
4
5
|
export declare const insertBlockElement: (editor: any, blockElement: any) => void;
|
|
5
6
|
export declare const helpers: {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ELEMENT_MERMAID = "mermaid";
|
|
2
|
+
export declare const createMermaidPlugin: <OP = import("@udecode/plate-common").AnyObject, OV extends import("@udecode/plate-common").Value = import("@udecode/plate-common").Value, OE extends import("@udecode/plate-common").PlateEditor<OV> = import("@udecode/plate-common").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>>, overrideByKey?: import("@udecode/plate-common").OverrideByKey<OV, OE>) => import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type PlateEditor, type TElement } from '@udecode/plate-common';
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const CodeBlock: ({ attributes, editor, element, language: restrictLanguage, onChangeCallback, defaultValue, ...props }: {
|
|
4
4
|
attributes: Record<string, unknown>;
|
|
5
5
|
element: TElement;
|
|
6
6
|
editor: PlateEditor;
|
|
7
7
|
language?: string;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
+
defaultValue?: unknown;
|
|
10
|
+
onChangeCallback?: (value: string) => void;
|
|
9
11
|
}) => React.JSX.Element;
|
|
@@ -60,6 +60,16 @@ export declare const Components: () => {
|
|
|
60
60
|
editor: any;
|
|
61
61
|
element: any;
|
|
62
62
|
}) => React.JSX.Element;
|
|
63
|
+
mermaid: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
64
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
65
|
+
} & Omit<{
|
|
66
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
67
|
+
asChild?: boolean | undefined;
|
|
68
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
69
|
+
ref?: React.Ref<any>;
|
|
70
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
71
|
+
element: import("@udecode/plate-common").TElement;
|
|
72
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>>;
|
|
63
73
|
blockquote: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
64
74
|
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
65
75
|
} & Omit<{
|
|
@@ -215,4 +225,52 @@ export declare const Components: () => {
|
|
|
215
225
|
element: any;
|
|
216
226
|
children: any;
|
|
217
227
|
}) => React.JSX.Element;
|
|
228
|
+
table: React.ForwardRefExoticComponent<Omit<Omit<Omit<{
|
|
229
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
230
|
+
} & Omit<{
|
|
231
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
232
|
+
asChild?: boolean | undefined;
|
|
233
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
234
|
+
ref?: React.Ref<any>;
|
|
235
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
236
|
+
element: import("@udecode/plate-common").TElement;
|
|
237
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>, "ref"> & React.RefAttributes<unknown>>;
|
|
238
|
+
tr: React.ForwardRefExoticComponent<{
|
|
239
|
+
hideBorder?: boolean;
|
|
240
|
+
} & Omit<Omit<{
|
|
241
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
242
|
+
} & Omit<{
|
|
243
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
244
|
+
asChild?: boolean | undefined;
|
|
245
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
246
|
+
ref?: React.Ref<any>;
|
|
247
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
248
|
+
element: import("@udecode/plate-common").TElement;
|
|
249
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder"> & React.RefAttributes<any>>;
|
|
250
|
+
td: React.ForwardRefExoticComponent<{
|
|
251
|
+
hideBorder?: boolean;
|
|
252
|
+
isHeader?: boolean;
|
|
253
|
+
} & Omit<Omit<{
|
|
254
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
255
|
+
} & Omit<{
|
|
256
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
257
|
+
asChild?: boolean | undefined;
|
|
258
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
259
|
+
ref?: React.Ref<any>;
|
|
260
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
261
|
+
element: import("@udecode/plate-common").TElement;
|
|
262
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder" | "isHeader"> & React.RefAttributes<any>>;
|
|
263
|
+
th: React.ForwardRefExoticComponent<Omit<{
|
|
264
|
+
hideBorder?: boolean;
|
|
265
|
+
isHeader?: boolean;
|
|
266
|
+
} & Omit<Omit<{
|
|
267
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
268
|
+
} & Omit<{
|
|
269
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
270
|
+
asChild?: boolean | undefined;
|
|
271
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
272
|
+
ref?: React.Ref<any>;
|
|
273
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
274
|
+
element: import("@udecode/plate-common").TElement;
|
|
275
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder" | "isHeader"> & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
|
|
218
276
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw' | 'embed';
|
|
2
|
-
export declare const
|
|
1
|
+
export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'mermaid' | 'raw' | 'embed' | 'table';
|
|
2
|
+
export declare const STANDARD_ICON_WIDTH = 32;
|
|
3
|
+
export declare const HEADING_ICON_WITH_TEXT = 127;
|
|
4
|
+
export declare const HEADING_ICON_ONLY = 58;
|
|
3
5
|
export declare const EMBED_ICON_WIDTH = 78;
|
|
4
|
-
export declare const
|
|
6
|
+
export declare const CONTAINER_MD_BREAKPOINT = 448;
|
|
7
|
+
export declare const FLOAT_BUTTON_WIDTH = 25;
|
|
8
|
+
export declare const HEADING_LABEL = "Headings";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import type { MdxTemplate } from '../types';
|
|
4
3
|
import type { Form } from '../../../../../forms';
|
|
4
|
+
import type { MdxTemplate } from '../types';
|
|
5
5
|
import type { ToolbarOverrideType } from './toolbar-overrides';
|
|
6
6
|
interface ToolbarContextProps {
|
|
7
7
|
tinaForm: Form;
|
|
@@ -3,6 +3,14 @@ import { FieldProps } from './field-props';
|
|
|
3
3
|
import { Form } from '../../forms';
|
|
4
4
|
export type InputFieldType<ExtraFieldProps, InputProps> = FieldProps<InputProps> & ExtraFieldProps;
|
|
5
5
|
export declare function wrapFieldsWithMeta<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* Same as wrapFieldsWithMeta but excludes the label, and description useful for fields that render their label and description
|
|
8
|
+
*/
|
|
9
|
+
export declare function wrapFieldWithNoHeader<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Same as above but excludes the label, useful for fields that have their own label
|
|
12
|
+
* @deprecated This function is deprecated and will be removed in future versions.
|
|
13
|
+
*/
|
|
6
14
|
export declare function wrapFieldWithError<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
7
15
|
interface FieldMetaProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
16
|
name: string;
|