tinacms 2.2.8 → 2.3.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.
Files changed (28) hide show
  1. package/dist/client.js +1 -1
  2. package/dist/client.mjs +1 -1
  3. package/dist/index.js +1553 -901
  4. package/dist/index.mjs +1522 -866
  5. package/dist/rich-text/index.d.ts +3 -0
  6. package/dist/rich-text/index.js +45 -12
  7. package/dist/rich-text/index.mjs +45 -12
  8. package/dist/toolkit/fields/components/reference/index.d.ts +1 -28
  9. package/dist/toolkit/fields/components/reference/model/reference-field-props.d.ts +2 -0
  10. package/dist/toolkit/fields/components/reference/utils/fetch-options-query-builder.d.ts +5 -0
  11. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/fixed-toolbar-buttons.d.ts +0 -4
  12. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -0
  13. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +11 -0
  14. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +20 -0
  15. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +39 -0
  16. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +27 -0
  17. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-dropdown-menu.d.ts +3 -0
  18. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +14 -0
  19. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +13 -0
  20. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/text-area.d.ts +5 -0
  21. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +1 -0
  22. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +2 -0
  23. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +4 -2
  24. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +58 -0
  25. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +7 -3
  26. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +1 -1
  27. package/dist/toolkit/fields/plugins/reference-field-plugin.d.ts +2 -2
  28. package/package.json +8 -6
@@ -65,6 +65,9 @@ type BaseComponents = {
65
65
  lang?: string;
66
66
  value: string;
67
67
  };
68
+ mermaid?: {
69
+ value: string;
70
+ };
68
71
  img?: {
69
72
  url: string;
70
73
  caption?: string;
@@ -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 "code_block":
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 rows = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
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 TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
156
- const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
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 TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
159
- const align = ((_f = child.props) == null ? void 0 : _f.align) || [];
160
- return /* @__PURE__ */ React.createElement(TableComponent, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent, null, header.tableCells.map((c, i) => {
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: align[i], ...props2 })
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, rows.map((row, i) => {
173
+ }))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
172
174
  var _a2;
173
- return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
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(TdComponent, { align: align[i2], ...props2 })
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":
@@ -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 "code_block":
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 rows = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
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 TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
153
- const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
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 TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
156
- const align = ((_f = child.props) == null ? void 0 : _f.align) || [];
157
- return /* @__PURE__ */ React.createElement(TableComponent, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent, null, header.tableCells.map((c, i) => {
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: align[i], ...props2 })
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, rows.map((row, i) => {
170
+ }))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
169
171
  var _a2;
170
- return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
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(TdComponent, { align: align[i2], ...props2 })
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":
@@ -1,30 +1,3 @@
1
1
  import * as React from 'react';
2
- type Option = {
3
- value: string;
4
- label: string;
5
- };
6
- type ReferenceFieldOptions = {
7
- optionComponent?: OptionComponent;
8
- experimental___filter?: (list: Array<any>, searchQuery: string) => Array<any>;
9
- };
10
- type OptionComponent = (props: unknown, _sys: InternalSys) => React.ReactElement | string;
11
- export interface InternalSys {
12
- filename: string;
13
- path: string;
14
- }
15
- export interface ReferenceFieldProps extends ReferenceFieldOptions {
16
- label?: string;
17
- name: string;
18
- component: string;
19
- collections: string[];
20
- options: (Option | string)[];
21
- }
22
- export interface ReferenceProps {
23
- name: string;
24
- input: any;
25
- field: ReferenceFieldProps;
26
- disabled?: boolean;
27
- options?: (Option | string)[];
28
- }
2
+ import { ReferenceProps } from './model/reference-props';
29
3
  export declare const Reference: React.FC<ReferenceProps>;
30
- export {};
@@ -1,3 +1,4 @@
1
+ import { CollectionFilters } from '../utils/fetch-options-query-builder';
1
2
  export type Option = {
2
3
  value: string;
3
4
  label: string;
@@ -10,6 +11,7 @@ export interface InternalSys {
10
11
  type ReferenceFieldOptions = {
11
12
  optionComponent?: OptionComponent;
12
13
  experimental___filter?: (list: Array<any>, searchQuery: string) => Array<any>;
14
+ collectionFilter?: CollectionFilters;
13
15
  };
14
16
  export interface ReferenceFieldProps extends ReferenceFieldOptions {
15
17
  label?: string;
@@ -0,0 +1,5 @@
1
+ export type FilterValue = string[] | string;
2
+ export type CollectionFilters = Record<string, FilterValue> | (() => Record<string, FilterValue>);
3
+ export declare const filterQueryBuilder: (fieldFilterConfig: FilterValue, collection: string) => {
4
+ [x: string]: Record<string, Record<string, FilterValue>>;
5
+ };
@@ -1,6 +1,2 @@
1
1
  import React from 'react';
2
- export type ToolbarItem = {
3
- label: string;
4
- Component: React.ReactNode;
5
- };
6
2
  export default function FixedToolbarButtons(): React.JSX.Element;
@@ -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>>;
@@ -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>>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';
3
+ export declare function TableDropdownMenu(props: DropdownMenuProps): React.JSX.Element;
@@ -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>>;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
3
+ }
4
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
5
+ export { Textarea };
@@ -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
- export declare const CodeBlock: ({ attributes, editor, element, language: restrictLanguage, ...props }: {
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 ICON_WIDTH = 32;
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 HEADING = 138;
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;
@@ -1,8 +1,8 @@
1
- export declare const ReferenceField: (props: import("./wrap-field-with-meta").InputFieldType<import("../components/reference").ReferenceProps, {}>) => import("react").JSX.Element;
1
+ export declare const ReferenceField: (props: import("./wrap-field-with-meta").InputFieldType<import("../components/reference/model/reference-props").ReferenceProps, {}>) => import("react").JSX.Element;
2
2
  export declare const ReferenceFieldPlugin: {
3
3
  name: string;
4
4
  type: string;
5
- Component: (props: import("./wrap-field-with-meta").InputFieldType<import("../components/reference").ReferenceProps, {}>) => import("react").JSX.Element;
5
+ Component: (props: import("./wrap-field-with-meta").InputFieldType<import("../components/reference/model/reference-props").ReferenceProps, {}>) => import("react").JSX.Element;
6
6
  parse: (value?: string) => string;
7
7
  validate(value: any, values: any, meta: any, field: any): string;
8
8
  };