tinacms 0.0.0-d94de9b-20250707010010 → 0.0.0-db7231c-20251216055550

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 (149) hide show
  1. package/dist/admin/api.d.ts +4 -1
  2. package/dist/auth/AuthModal.d.ts +1 -4
  3. package/dist/auth/TinaCloudProvider.d.ts +0 -1
  4. package/dist/cache/node-cache.d.ts +6 -2
  5. package/dist/client.js +240 -181
  6. package/dist/index.js +122119 -34419
  7. package/dist/internalClient/index.d.ts +20 -1
  8. package/dist/react.js +210 -213
  9. package/dist/rich-text/index.d.ts +6 -0
  10. package/dist/rich-text/index.js +234 -224
  11. package/dist/rich-text/prism.js +16 -18
  12. package/dist/rich-text/static.d.ts +6 -0
  13. package/dist/rich-text/static.js +229 -225
  14. package/dist/tina-cms.d.ts +1 -1
  15. package/dist/toolkit/components/ProgressBar.d.ts +11 -0
  16. package/dist/toolkit/components/media/media-item.d.ts +10 -0
  17. package/dist/toolkit/components/ui/button.d.ts +11 -0
  18. package/dist/toolkit/components/ui/calendar.d.ts +8 -0
  19. package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
  20. package/dist/toolkit/components/ui/input.d.ts +3 -0
  21. package/dist/toolkit/components/ui/popover.d.ts +7 -0
  22. package/dist/toolkit/components/ui/select.d.ts +13 -0
  23. package/dist/toolkit/fields/components/color-picker/block-widget.d.ts +3 -0
  24. package/dist/toolkit/fields/components/color-picker/color-input.d.ts +35 -0
  25. package/dist/toolkit/fields/components/color-picker/color-picker.d.ts +6 -2
  26. package/dist/toolkit/fields/components/color-picker/color-utils.d.ts +37 -0
  27. package/dist/toolkit/fields/components/color-picker/sketch-widget.d.ts +3 -0
  28. package/dist/toolkit/fields/components/reference/components/button.d.ts +1 -1
  29. package/dist/toolkit/fields/components/reference/components/command.d.ts +21 -33
  30. package/dist/toolkit/fields/components/select.d.ts +1 -1
  31. package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
  32. package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
  33. package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +1 -0
  34. package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
  35. package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
  36. package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -1
  37. package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -0
  38. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +20 -18
  39. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +14 -10
  40. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +5 -5
  41. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +17 -0
  42. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/error-message.d.ts +6 -0
  43. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-combobox.d.ts +6 -0
  44. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-toolbar-button.d.ts +6 -6
  45. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-leaf.d.ts +2 -11
  46. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +14 -10
  47. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-syntax-leaf.d.ts +2 -11
  48. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +112 -0
  49. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dialog.d.ts +12 -0
  50. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dropdown-menu.d.ts +10 -10
  51. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/floating-toolbar.d.ts +2 -2
  52. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-element.d.ts +3 -0
  53. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-toolbar-button.d.ts +18 -0
  54. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -1
  55. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/image-toolbar-button.d.ts +6 -6
  56. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +6 -19
  57. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/inline-combobox.d.ts +1 -1
  58. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/input.d.ts +3 -3
  59. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-element.d.ts +4 -11
  60. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-floating-toolbar.d.ts +4 -5
  61. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-toolbar-button.d.ts +4 -4
  62. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +28 -11
  63. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +3 -10
  64. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +6 -8
  65. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +15 -0
  66. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/popover.d.ts +7 -2
  67. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/quote-toolbar-button.d.ts +6 -6
  68. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/raw-markdown-toolbar-button.d.ts +6 -6
  69. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +24 -21
  70. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/separator.d.ts +2 -2
  71. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +15 -11
  72. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/block-selection.d.ts +6 -0
  73. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +33 -0
  74. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/{table-dropdown-menu.d.ts → table/table-dropdown-menu.d.ts} +1 -0
  75. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +20 -0
  76. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +15 -0
  77. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/toolbar.d.ts +7 -7
  78. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +10 -0
  79. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-state.d.ts +22 -0
  80. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/hooks/use-create-editor.d.ts +6 -0
  81. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-block.d.ts +1 -1
  82. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-lists.d.ts +1 -1
  83. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-marks.d.ts +1 -1
  84. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-utils.d.ts +3 -5
  85. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +11 -6
  86. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +18 -2
  87. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/index.d.ts +0 -1
  88. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-html-block/index.d.ts +6 -0
  89. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/index.d.ts +2 -2
  90. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-invalid-markdown-plugin/index.d.ts +5 -5
  91. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +7 -4
  92. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/index.d.ts +3 -5
  93. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +520 -0
  94. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +262 -207
  95. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/floating-toolbar-plugin.d.ts +1 -0
  96. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +1 -1
  97. package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
  98. package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
  99. package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
  100. package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
  101. package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +17 -0
  102. package/dist/toolkit/form-builder/form-builder.d.ts +0 -11
  103. package/dist/toolkit/form-builder/index.d.ts +1 -0
  104. package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
  105. package/dist/toolkit/icons/index.d.ts +1 -0
  106. package/dist/toolkit/index.d.ts +1 -1
  107. package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +3 -1
  108. package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
  109. package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
  110. package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
  111. package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
  112. package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
  113. package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
  114. package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
  115. package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
  116. package/dist/toolkit/react-sidebar/components/nav.d.ts +3 -2
  117. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +26 -1
  118. package/dist/toolkit/react-sidebar/index.d.ts +3 -0
  119. package/dist/toolkit/styles/button.d.ts +1 -1
  120. package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
  121. package/dist/toolkit/styles/index.d.ts +1 -0
  122. package/dist/unifiedClient/index.d.ts +1 -1
  123. package/dist/utils/index.d.ts +1 -0
  124. package/package.json +56 -87
  125. package/dist/admin/pages/IndexingPage.d.ts +0 -2
  126. package/dist/client.mjs +0 -132
  127. package/dist/index.mjs +0 -35827
  128. package/dist/node-cache-5e8db9f0.mjs +0 -63
  129. package/dist/react.mjs +0 -254
  130. package/dist/rich-text/index.mjs +0 -243
  131. package/dist/rich-text/prism.mjs +0 -16
  132. package/dist/rich-text/static.mjs +0 -236
  133. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-element.d.ts +0 -11
  134. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +0 -27
  135. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +0 -14
  136. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +0 -13
  137. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/with-correct-void-behavior.d.ts +0 -8
  138. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-code-block/index.d.ts +0 -3
  139. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts +0 -15
  140. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +0 -2
  141. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/create-soft-break-plugin.d.ts +0 -7
  142. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/index.d.ts +0 -6
  143. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/on-key-down-soft-break.d.ts +0 -5
  144. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/types.d.ts +0 -11
  145. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +0 -11
  146. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/insert-empty-block.d.ts +0 -2
  147. package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
  148. package/dist/toolkit/react-sidebar/components/alert.d.ts +0 -5
  149. /package/dist/admin/components/{Sidebar.d.ts → AdminNav.d.ts} +0 -0
@@ -1,246 +1,256 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react")) : typeof define === "function" && define.amd ? define(["exports", "react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP));
3
- })(this, function(exports2, React) {
4
- "use strict";
5
- const TinaMarkdown = ({
6
- content,
7
- components = {}
8
- }) => {
9
- if (!content) {
10
- return null;
1
+ import React from "react";
2
+ const TinaMarkdown = ({
3
+ content,
4
+ components = {}
5
+ }) => {
6
+ if (!content) {
7
+ return null;
8
+ }
9
+ const nodes = Array.isArray(content) ? content : content.children;
10
+ if (!nodes) {
11
+ return null;
12
+ }
13
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, nodes.map((child, index) => {
14
+ return /* @__PURE__ */ React.createElement(MemoNode, { components, key: index, child });
15
+ }));
16
+ };
17
+ const Leaf = (props) => {
18
+ if (props.bold) {
19
+ const { bold, ...rest } = props;
20
+ if (props.components.bold) {
21
+ const Component = props.components.bold;
22
+ return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
11
23
  }
12
- const nodes = Array.isArray(content) ? content : content.children;
13
- if (!nodes) {
14
- return null;
24
+ return /* @__PURE__ */ React.createElement("strong", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
25
+ }
26
+ if (props.italic) {
27
+ const { italic, ...rest } = props;
28
+ if (props.components.italic) {
29
+ const Component = props.components.italic;
30
+ return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
15
31
  }
16
- return /* @__PURE__ */ React.createElement(React.Fragment, null, nodes.map((child, index) => {
17
- return /* @__PURE__ */ React.createElement(MemoNode, { components, key: index, child });
18
- }));
19
- };
20
- const Leaf = (props) => {
21
- if (props.bold) {
22
- const { bold, ...rest } = props;
23
- if (props.components.bold) {
24
- const Component = props.components.bold;
25
- return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
26
- }
27
- return /* @__PURE__ */ React.createElement("strong", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
32
+ return /* @__PURE__ */ React.createElement("em", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
33
+ }
34
+ if (props.underline) {
35
+ const { underline, ...rest } = props;
36
+ if (props.components.underline) {
37
+ const Component = props.components.underline;
38
+ return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
28
39
  }
29
- if (props.italic) {
30
- const { italic, ...rest } = props;
31
- if (props.components.italic) {
32
- const Component = props.components.italic;
33
- return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
34
- }
35
- return /* @__PURE__ */ React.createElement("em", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
40
+ return /* @__PURE__ */ React.createElement("u", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
41
+ }
42
+ if (props.strikethrough) {
43
+ const { strikethrough, ...rest } = props;
44
+ if (props.components.strikethrough) {
45
+ const Component = props.components.strikethrough;
46
+ return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
36
47
  }
37
- if (props.underline) {
38
- const { underline, ...rest } = props;
39
- if (props.components.underline) {
40
- const Component = props.components.underline;
41
- return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
42
- }
43
- return /* @__PURE__ */ React.createElement("u", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
48
+ return /* @__PURE__ */ React.createElement("s", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
49
+ }
50
+ if (props.code) {
51
+ const { code, ...rest } = props;
52
+ if (props.components.code) {
53
+ const Component = props.components.code;
54
+ return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
44
55
  }
45
- if (props.strikethrough) {
46
- const { strikethrough, ...rest } = props;
47
- if (props.components.strikethrough) {
48
- const Component = props.components.strikethrough;
49
- return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
56
+ return /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
57
+ }
58
+ if (props.components.text) {
59
+ const Component = props.components.text;
60
+ return /* @__PURE__ */ React.createElement(Component, null, props.text);
61
+ }
62
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
63
+ };
64
+ const MemoNode = (props) => {
65
+ const MNode = React.useMemo(
66
+ () => /* @__PURE__ */ React.createElement(Node, { ...props }),
67
+ [JSON.stringify(props)]
68
+ );
69
+ return MNode;
70
+ };
71
+ const Node = ({ components, child }) => {
72
+ var _a, _b, _c, _d, _e, _f, _g;
73
+ const { children, ...props } = child;
74
+ switch (child.type) {
75
+ case "h1":
76
+ case "h2":
77
+ case "h3":
78
+ case "h4":
79
+ case "h5":
80
+ case "h6":
81
+ case "p":
82
+ case "ol":
83
+ case "ul":
84
+ case "li":
85
+ if (components[child.type]) {
86
+ const Component2 = components[child.type];
87
+ return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
50
88
  }
51
- return /* @__PURE__ */ React.createElement("s", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
52
- }
53
- if (props.code) {
54
- const { code, ...rest } = props;
55
- if (props.components.code) {
56
- const Component = props.components.code;
57
- return /* @__PURE__ */ React.createElement(Component, null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
89
+ return React.createElement(child.type, {
90
+ children: /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children })
91
+ });
92
+ case "lic":
93
+ if (components.lic) {
94
+ const Component2 = components.lic;
95
+ return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
58
96
  }
59
- return /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement(Leaf, { ...rest }));
60
- }
61
- if (props.components.text) {
62
- const Component = props.components.text;
63
- return /* @__PURE__ */ React.createElement(Component, null, props.text);
64
- }
65
- return /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
66
- };
67
- const MemoNode = (props) => {
68
- const MNode = React.useMemo(
69
- () => /* @__PURE__ */ React.createElement(Node, { ...props }),
70
- [JSON.stringify(props)]
71
- );
72
- return MNode;
73
- };
74
- const Node = ({ components, child }) => {
75
- var _a, _b, _c, _d, _e, _f, _g;
76
- const { children, ...props } = child;
77
- switch (child.type) {
78
- case "h1":
79
- case "h2":
80
- case "h3":
81
- case "h4":
82
- case "h5":
83
- case "h6":
84
- case "p":
85
- case "blockquote":
86
- case "ol":
87
- case "ul":
88
- case "li":
89
- if (components[child.type]) {
90
- const Component2 = components[child.type];
91
- return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
92
- }
93
- return React.createElement(child.type, {
94
- children: /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children })
95
- });
96
- case "lic":
97
- if (components.lic) {
98
- const Component2 = components.lic;
99
- return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
100
- }
101
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: child.children }));
102
- case "img":
103
- if (components[child.type]) {
104
- const Component2 = components[child.type];
105
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
106
- }
107
- return /* @__PURE__ */ React.createElement("img", { src: child.url, alt: child.alt });
108
- case "a":
109
- if (components[child.type]) {
110
- const Component2 = components[child.type];
111
- return (
112
- // @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
113
- /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
114
- );
115
- }
97
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: child.children }));
98
+ case "blockquote":
99
+ const BlockquoteComponent = components.blockquote || components.block_quote;
100
+ if (BlockquoteComponent) {
101
+ return /* @__PURE__ */ React.createElement(BlockquoteComponent, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }));
102
+ }
103
+ return React.createElement("blockquote", {
104
+ children: /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children })
105
+ });
106
+ case "img":
107
+ if (components[child.type]) {
108
+ const Component2 = components[child.type];
109
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
110
+ }
111
+ return /* @__PURE__ */ React.createElement("img", { src: child.url, alt: child.alt });
112
+ case "a":
113
+ if (components[child.type]) {
114
+ const Component2 = components[child.type];
116
115
  return (
117
116
  // @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
118
- /* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
117
+ /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
119
118
  );
120
- case "mermaid":
121
- case "code_block": {
122
- const value = child.value;
123
- if (components[child.type]) {
124
- const Component2 = components[child.type];
125
- return (
126
- // @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
127
- /* @__PURE__ */ React.createElement(Component2, { ...props })
128
- );
129
- }
130
- return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, value));
131
119
  }
132
- case "hr":
133
- if (components[child.type]) {
134
- const Component2 = components[child.type];
135
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
136
- }
137
- return /* @__PURE__ */ React.createElement("hr", null);
138
- case "break":
139
- if (components[child.type]) {
140
- const Component2 = components[child.type];
141
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
142
- }
143
- return /* @__PURE__ */ React.createElement("br", null);
144
- case "text":
145
- return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
146
- case "mdxJsxTextElement":
147
- case "mdxJsxFlowElement":
148
- const Component = components[child.name];
149
- if (Component) {
150
- const props2 = child.props ? child.props : {};
151
- return /* @__PURE__ */ React.createElement(Component, { ...props2 });
152
- } else {
153
- if (child.name === "table") {
154
- const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
155
- const rows2 = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
156
- const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
157
- const TableComponent2 = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
158
- const TrComponent2 = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
159
- const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
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) => {
120
+ return (
121
+ // @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
122
+ /* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
123
+ );
124
+ case "code_block": {
125
+ let codeString = "";
126
+ if (Array.isArray(child.children)) {
127
+ codeString = child.children.map(
128
+ (line) => Array.isArray(line.children) ? line.children.map((t) => t.text).join("") : ""
129
+ ).join("\n");
130
+ } else if (typeof child.value === "string") {
131
+ codeString = child.value;
132
+ }
133
+ if (components[child.type]) {
134
+ const Component2 = components[child.type];
135
+ return (
136
+ // @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
137
+ /* @__PURE__ */ React.createElement(Component2, { ...props, value: codeString })
138
+ );
139
+ }
140
+ return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, codeString));
141
+ }
142
+ case "hr":
143
+ if (components[child.type]) {
144
+ const Component2 = components[child.type];
145
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
146
+ }
147
+ return /* @__PURE__ */ React.createElement("hr", null);
148
+ case "break":
149
+ if (components[child.type]) {
150
+ const Component2 = components[child.type];
151
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
152
+ }
153
+ return /* @__PURE__ */ React.createElement("br", null);
154
+ case "text":
155
+ return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
156
+ case "mdxJsxTextElement":
157
+ case "mdxJsxFlowElement":
158
+ const Component = components[child.name];
159
+ if (Component) {
160
+ const props2 = child.props ? child.props : {};
161
+ return /* @__PURE__ */ React.createElement(Component, { ...props2 });
162
+ } else {
163
+ if (child.name === "table") {
164
+ const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
165
+ const rows2 = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
166
+ const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
167
+ const TableComponent2 = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }));
168
+ const TrComponent2 = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
169
+ const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
170
+ const TdComponent2 = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
171
+ const align2 = ((_f = child.props) == null ? void 0 : _f.align) || [];
172
+ return /* @__PURE__ */ React.createElement(TableComponent2, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent2, null, header.tableCells.map((c, i) => {
173
+ return /* @__PURE__ */ React.createElement(
174
+ TinaMarkdown,
175
+ {
176
+ key: i,
177
+ components: {
178
+ p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align2[i], ...props2 })
179
+ },
180
+ content: c.value
181
+ }
182
+ );
183
+ }))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
184
+ var _a2;
185
+ return /* @__PURE__ */ React.createElement(TrComponent2, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
163
186
  return /* @__PURE__ */ React.createElement(
164
187
  TinaMarkdown,
165
188
  {
166
- key: i,
189
+ key: i2,
167
190
  components: {
168
- p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align2[i], ...props2 })
191
+ p: (props2) => /* @__PURE__ */ React.createElement(TdComponent2, { align: align2[i2], ...props2 })
169
192
  },
170
193
  content: c.value
171
194
  }
172
195
  );
173
- }))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
174
- var _a2;
175
- return /* @__PURE__ */ React.createElement(TrComponent2, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
176
- return /* @__PURE__ */ React.createElement(
177
- TinaMarkdown,
178
- {
179
- key: i2,
180
- components: {
181
- p: (props2) => /* @__PURE__ */ React.createElement(TdComponent2, { align: align2[i2], ...props2 })
182
- },
183
- content: c.value
184
- }
185
- );
186
- }));
187
- })));
188
- }
189
- const ComponentMissing = components["component_missing"];
190
- if (ComponentMissing) {
191
- return /* @__PURE__ */ React.createElement(ComponentMissing, { name: child.name });
192
- } else {
193
- return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
194
- }
196
+ }));
197
+ })));
195
198
  }
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
- })));
227
- case "maybe_mdx":
228
- return null;
229
- case "html":
230
- case "html_inline":
231
- if (components[child.type]) {
232
- const Component2 = components[child.type];
233
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
199
+ const ComponentMissing = components["component_missing"];
200
+ if (ComponentMissing) {
201
+ return /* @__PURE__ */ React.createElement(ComponentMissing, { name: child.name });
202
+ } else {
203
+ return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
234
204
  }
235
- return child.value;
236
- case "invalid_markdown":
237
- return /* @__PURE__ */ React.createElement("pre", null, child.value);
238
- default:
239
- if (typeof child.text === "string") {
240
- return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
205
+ }
206
+ case "table":
207
+ const rows = child.children || [];
208
+ const TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { style: { border: "1px solid #EDECF3" }, ...props2 }));
209
+ const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
210
+ const TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement(
211
+ "td",
212
+ {
213
+ style: {
214
+ textAlign: (props2 == null ? void 0 : props2.align) || "auto",
215
+ border: "1px solid #EDECF3",
216
+ padding: "0.25rem"
217
+ },
218
+ ...props2
241
219
  }
242
- }
243
- };
244
- exports2.TinaMarkdown = TinaMarkdown;
245
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
246
- });
220
+ ));
221
+ const align = ((_g = child.props) == null ? void 0 : _g.align) || [];
222
+ return /* @__PURE__ */ React.createElement(TableComponent, null, /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => {
223
+ var _a2;
224
+ return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row.children) == null ? void 0 : _a2.map((cell, i2) => {
225
+ return /* @__PURE__ */ React.createElement(
226
+ TinaMarkdown,
227
+ {
228
+ key: i2,
229
+ components: {
230
+ p: (props2) => /* @__PURE__ */ React.createElement(TdComponent, { align: align[i2], ...props2 })
231
+ },
232
+ content: cell.children
233
+ }
234
+ );
235
+ }));
236
+ })));
237
+ case "maybe_mdx":
238
+ return null;
239
+ case "html":
240
+ case "html_inline":
241
+ if (components[child.type]) {
242
+ const Component2 = components[child.type];
243
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
244
+ }
245
+ return child.value;
246
+ case "invalid_markdown":
247
+ return /* @__PURE__ */ React.createElement("pre", null, child.value);
248
+ default:
249
+ if (typeof child.text === "string") {
250
+ return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
251
+ }
252
+ }
253
+ };
254
+ export {
255
+ TinaMarkdown
256
+ };
@@ -1,18 +1,16 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("prism-react-renderer")) : typeof define === "function" && define.amd ? define(["exports", "react", "prism-react-renderer"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP));
3
- })(this, function(exports2, React, prismReactRenderer) {
4
- "use strict";
5
- const Prism = (props) => {
6
- return /* @__PURE__ */ React.createElement(
7
- prismReactRenderer.Highlight,
8
- {
9
- theme: prismReactRenderer.themes[props.theme || "github"],
10
- code: props.value || "",
11
- language: props.lang || ""
12
- },
13
- ({ className, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React.createElement("pre", { className, style }, tokens.map((line, i) => /* @__PURE__ */ React.createElement("div", { ...getLineProps({ line, key: i }) }, line.map((token, key) => /* @__PURE__ */ React.createElement("span", { ...getTokenProps({ token, key }) })))))
14
- );
15
- };
16
- exports2.Prism = Prism;
17
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
18
- });
1
+ import React from "react";
2
+ import { Highlight, themes } from "prism-react-renderer";
3
+ const Prism = (props) => {
4
+ return /* @__PURE__ */ React.createElement(
5
+ Highlight,
6
+ {
7
+ theme: themes[props.theme || "github"],
8
+ code: props.value || "",
9
+ language: props.lang || ""
10
+ },
11
+ ({ className, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React.createElement("pre", { className, style }, tokens.map((line, i) => /* @__PURE__ */ React.createElement("div", { ...getLineProps({ line, key: i }) }, line.map((token, key) => /* @__PURE__ */ React.createElement("span", { ...getTokenProps({ token, key }) })))))
12
+ );
13
+ };
14
+ export {
15
+ Prism
16
+ };
@@ -63,9 +63,15 @@ type BaseComponents = {
63
63
  lic?: {
64
64
  children: JSX.Element;
65
65
  };
66
+ /**
67
+ * @deprecated Use `blockquote` instead. This was incorrectly named and will be removed in a future version.
68
+ */
66
69
  block_quote?: {
67
70
  children: JSX.Element;
68
71
  };
72
+ blockquote?: {
73
+ children: JSX.Element;
74
+ };
69
75
  code_block?: {
70
76
  lang?: string;
71
77
  value: string;