tinacms 2.10.1 → 3.0.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 (41) hide show
  1. package/dist/__vite-browser-external-d06ac358.js +4 -0
  2. package/dist/admin/api.d.ts +1 -1
  3. package/dist/client.js +131 -185
  4. package/dist/index.js +118242 -118350
  5. package/dist/internalClient/index.d.ts +1 -1
  6. package/dist/{node-cache-5e8db9f0.mjs → node-cache-c9558e1e.js} +5 -5
  7. package/dist/react.js +210 -213
  8. package/dist/rich-text/index.js +234 -237
  9. package/dist/rich-text/prism.js +16 -18
  10. package/dist/rich-text/static.js +229 -232
  11. package/dist/toolkit/components/ui/button.d.ts +11 -0
  12. package/dist/toolkit/components/ui/calendar.d.ts +8 -0
  13. package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
  14. package/dist/toolkit/components/ui/input.d.ts +3 -0
  15. package/dist/toolkit/components/ui/popover.d.ts +7 -0
  16. package/dist/toolkit/components/ui/select.d.ts +13 -0
  17. package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
  18. package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
  19. package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
  20. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +1 -1
  21. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +1 -1
  22. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +1 -1
  23. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +2 -2
  24. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +1 -1
  25. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +1 -1
  26. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +2 -2
  27. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +1 -1
  28. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +1 -1
  29. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +1 -1
  30. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +18 -18
  31. package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
  32. package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
  33. package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
  34. package/package.json +20 -43
  35. package/dist/client.mjs +0 -132
  36. package/dist/index.mjs +0 -123232
  37. package/dist/react.mjs +0 -254
  38. package/dist/rich-text/index.mjs +0 -256
  39. package/dist/rich-text/prism.mjs +0 -16
  40. package/dist/rich-text/static.mjs +0 -243
  41. package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
@@ -1,246 +1,243 @@
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 StaticTinaMarkdown = ({
6
- content,
7
- components = {}
8
- }) => {
9
- if (!content) {
10
- return null;
11
- }
12
- const nodes = Array.isArray(content) ? content : content.children;
13
- if (!nodes) {
14
- return null;
15
- }
16
- return /* @__PURE__ */ React.createElement(React.Fragment, null, nodes.map((child, index) => {
17
- return /* @__PURE__ */ React.createElement(Node, { components, key: index, child });
18
- }));
19
- };
20
- const Leaf = (props) => {
21
- let el = /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
22
- if (props.components.text) {
23
- const Component = props.components.text;
24
- el = /* @__PURE__ */ React.createElement(Component, null, props.text);
25
- }
26
- if (props.bold) {
27
- const Component = props.components.bold || "strong";
28
- el = /* @__PURE__ */ React.createElement(Component, null, el);
29
- }
30
- if (props.italic) {
31
- const Component = props.components.italic || "em";
32
- el = /* @__PURE__ */ React.createElement(Component, null, el);
33
- }
34
- if (props.underline) {
35
- const Component = props.components.underline || "u";
36
- el = /* @__PURE__ */ React.createElement(Component, null, el);
37
- }
38
- if (props.strikethrough) {
39
- const Component = props.components.strikethrough || "s";
40
- el = /* @__PURE__ */ React.createElement(Component, null, el);
41
- }
42
- if (props.code) {
43
- const Component = props.components.code || "code";
44
- el = /* @__PURE__ */ React.createElement(Component, null, el);
45
- }
46
- return el;
47
- };
48
- const Node = ({
49
- components,
50
- child
51
- }) => {
52
- var _a, _b, _c, _d, _e, _f, _g;
53
- const { children, ...props } = child;
54
- switch (child.type) {
55
- case "h1":
56
- case "h2":
57
- case "h3":
58
- case "h4":
59
- case "h5":
60
- case "h6":
61
- case "p":
62
- case "ol":
63
- case "ul":
64
- case "li":
65
- if (components[child.type]) {
66
- const Component2 = components[child.type];
67
- return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
68
- }
69
- return React.createElement(child.type, {
70
- children: /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children })
71
- });
72
- case "blockquote":
73
- const BlockquoteComponent = components.blockquote || components.block_quote;
74
- if (BlockquoteComponent) {
75
- return /* @__PURE__ */ React.createElement(BlockquoteComponent, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
76
- }
77
- return React.createElement("blockquote", {
78
- children: /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children })
79
- });
80
- case "lic":
81
- if (components.lic) {
82
- const Component2 = components.lic;
83
- return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
84
- }
85
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
86
- StaticTinaMarkdown,
87
- {
88
- components,
89
- content: child.children
90
- }
91
- ));
92
- case "img":
93
- if (components[child.type]) {
94
- const Component2 = components[child.type];
95
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
1
+ import React from "react";
2
+ const StaticTinaMarkdown = ({
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(Node, { components, key: index, child });
15
+ }));
16
+ };
17
+ const Leaf = (props) => {
18
+ let el = /* @__PURE__ */ React.createElement(React.Fragment, null, props.text);
19
+ if (props.components.text) {
20
+ const Component = props.components.text;
21
+ el = /* @__PURE__ */ React.createElement(Component, null, props.text);
22
+ }
23
+ if (props.bold) {
24
+ const Component = props.components.bold || "strong";
25
+ el = /* @__PURE__ */ React.createElement(Component, null, el);
26
+ }
27
+ if (props.italic) {
28
+ const Component = props.components.italic || "em";
29
+ el = /* @__PURE__ */ React.createElement(Component, null, el);
30
+ }
31
+ if (props.underline) {
32
+ const Component = props.components.underline || "u";
33
+ el = /* @__PURE__ */ React.createElement(Component, null, el);
34
+ }
35
+ if (props.strikethrough) {
36
+ const Component = props.components.strikethrough || "s";
37
+ el = /* @__PURE__ */ React.createElement(Component, null, el);
38
+ }
39
+ if (props.code) {
40
+ const Component = props.components.code || "code";
41
+ el = /* @__PURE__ */ React.createElement(Component, null, el);
42
+ }
43
+ return el;
44
+ };
45
+ const Node = ({
46
+ components,
47
+ child
48
+ }) => {
49
+ var _a, _b, _c, _d, _e, _f, _g;
50
+ const { children, ...props } = child;
51
+ switch (child.type) {
52
+ case "h1":
53
+ case "h2":
54
+ case "h3":
55
+ case "h4":
56
+ case "h5":
57
+ case "h6":
58
+ case "p":
59
+ case "ol":
60
+ case "ul":
61
+ case "li":
62
+ if (components[child.type]) {
63
+ const Component2 = components[child.type];
64
+ return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
65
+ }
66
+ return React.createElement(child.type, {
67
+ children: /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children })
68
+ });
69
+ case "blockquote":
70
+ const BlockquoteComponent = components.blockquote || components.block_quote;
71
+ if (BlockquoteComponent) {
72
+ return /* @__PURE__ */ React.createElement(BlockquoteComponent, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
73
+ }
74
+ return React.createElement("blockquote", {
75
+ children: /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children })
76
+ });
77
+ case "lic":
78
+ if (components.lic) {
79
+ const Component2 = components.lic;
80
+ return /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
81
+ }
82
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
83
+ StaticTinaMarkdown,
84
+ {
85
+ components,
86
+ content: child.children
96
87
  }
97
- return /* @__PURE__ */ React.createElement("img", { src: child.url, alt: child.alt });
98
- case "a":
99
- if (components[child.type]) {
100
- const Component2 = components[child.type];
101
- return (
88
+ ));
89
+ case "img":
90
+ if (components[child.type]) {
91
+ const Component2 = components[child.type];
92
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
93
+ }
94
+ return /* @__PURE__ */ React.createElement("img", { src: child.url, alt: child.alt });
95
+ case "a":
96
+ if (components[child.type]) {
97
+ const Component2 = components[child.type];
98
+ return (
99
+ //@ts-ignore Same issue with TinaMarkdown
100
+ /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }))
101
+ );
102
+ }
103
+ return /* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
104
+ case "code_block": {
105
+ let codeString = "";
106
+ if (Array.isArray(child.children)) {
107
+ codeString = child.children.map(
108
+ (line) => Array.isArray(line.children) ? line.children.map((t) => t.text).join("") : ""
109
+ ).join("\n");
110
+ } else if (typeof child.value === "string") {
111
+ codeString = child.value;
112
+ }
113
+ if (components[child.type]) {
114
+ const Component2 = components[child.type];
115
+ return /* @__PURE__ */ React.createElement(Component2, { ...props, value: codeString });
116
+ }
117
+ return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, codeString));
118
+ }
119
+ case "hr":
120
+ if (components[child.type]) {
121
+ const Component2 = components[child.type];
122
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
123
+ }
124
+ return /* @__PURE__ */ React.createElement("hr", null);
125
+ case "break":
126
+ if (components[child.type]) {
127
+ const Component2 = components[child.type];
128
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
129
+ }
130
+ return /* @__PURE__ */ React.createElement("br", null);
131
+ case "text":
132
+ return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
133
+ case "mdxJsxTextElement":
134
+ case "mdxJsxFlowElement":
135
+ const Component = components[child.name];
136
+ if (Component) {
137
+ const props2 = child.props ? child.props : {};
138
+ return /* @__PURE__ */ React.createElement(Component, { ...props2 });
139
+ } else {
140
+ if (child.name === "table") {
141
+ const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
142
+ const rows2 = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
143
+ const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
144
+ const TableComponent2 = (
102
145
  //@ts-ignore Same issue with TinaMarkdown
103
- /* @__PURE__ */ React.createElement(Component2, { ...props }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }))
146
+ components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }))
104
147
  );
105
- }
106
- return /* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(StaticTinaMarkdown, { components, content: children }));
107
- case "code_block": {
108
- let codeString = "";
109
- if (Array.isArray(child.children)) {
110
- codeString = child.children.map(
111
- (line) => Array.isArray(line.children) ? line.children.map((t) => t.text).join("") : ""
112
- ).join("\n");
113
- } else if (typeof child.value === "string") {
114
- codeString = child.value;
115
- }
116
- if (components[child.type]) {
117
- const Component2 = components[child.type];
118
- return /* @__PURE__ */ React.createElement(Component2, { ...props, value: codeString });
119
- }
120
- return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, codeString));
121
- }
122
- case "hr":
123
- if (components[child.type]) {
124
- const Component2 = components[child.type];
125
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
126
- }
127
- return /* @__PURE__ */ React.createElement("hr", null);
128
- case "break":
129
- if (components[child.type]) {
130
- const Component2 = components[child.type];
131
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
132
- }
133
- return /* @__PURE__ */ React.createElement("br", null);
134
- case "text":
135
- return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
136
- case "mdxJsxTextElement":
137
- case "mdxJsxFlowElement":
138
- const Component = components[child.name];
139
- if (Component) {
140
- const props2 = child.props ? child.props : {};
141
- return /* @__PURE__ */ React.createElement(Component, { ...props2 });
142
- } else {
143
- if (child.name === "table") {
144
- const firstRowHeader = (_a = child.props) == null ? void 0 : _a.firstRowHeader;
145
- const rows2 = (firstRowHeader ? (_b = child.props) == null ? void 0 : _b.tableRows.filter((_, i) => i !== 0) : (_c = child.props) == null ? void 0 : _c.tableRows) || [];
146
- const header = (_e = (_d = child.props) == null ? void 0 : _d.tableRows) == null ? void 0 : _e.at(0);
147
- const TableComponent2 = (
148
- //@ts-ignore Same issue with TinaMarkdown
149
- components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { ...props2 }))
150
- );
151
- const TrComponent2 = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
152
- const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
153
- const TdComponent2 = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
154
- const align2 = ((_f = child.props) == null ? void 0 : _f.align) || [];
155
- return (
156
- //@ts-ignore Same issue with TinaMarkdown
157
- /* @__PURE__ */ React.createElement(TableComponent2, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent2, null, header.tableCells.map((c, i) => {
148
+ const TrComponent2 = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
149
+ const ThComponent = components["th"] || ((props2) => /* @__PURE__ */ React.createElement("th", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
150
+ const TdComponent2 = components["td"] || ((props2) => /* @__PURE__ */ React.createElement("td", { style: { textAlign: (props2 == null ? void 0 : props2.align) || "auto" }, ...props2 }));
151
+ const align2 = ((_f = child.props) == null ? void 0 : _f.align) || [];
152
+ return (
153
+ //@ts-ignore Same issue with TinaMarkdown
154
+ /* @__PURE__ */ React.createElement(TableComponent2, null, firstRowHeader && /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement(TrComponent2, null, header.tableCells.map((c, i) => {
155
+ return /* @__PURE__ */ React.createElement(
156
+ StaticTinaMarkdown,
157
+ {
158
+ key: i,
159
+ components: {
160
+ p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align2[i], ...props2 })
161
+ },
162
+ content: c.value
163
+ }
164
+ );
165
+ }))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
166
+ var _a2;
167
+ return /* @__PURE__ */ React.createElement(TrComponent2, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
158
168
  return /* @__PURE__ */ React.createElement(
159
169
  StaticTinaMarkdown,
160
170
  {
161
- key: i,
171
+ key: i2,
162
172
  components: {
163
- p: (props2) => /* @__PURE__ */ React.createElement(ThComponent, { align: align2[i], ...props2 })
173
+ p: (props2) => /* @__PURE__ */ React.createElement(TdComponent2, { align: align2[i2], ...props2 })
164
174
  },
165
175
  content: c.value
166
176
  }
167
177
  );
168
- }))), /* @__PURE__ */ React.createElement("tbody", null, rows2.map((row, i) => {
169
- var _a2;
170
- return /* @__PURE__ */ React.createElement(TrComponent2, { key: i }, (_a2 = row == null ? void 0 : row.tableCells) == null ? void 0 : _a2.map((c, i2) => {
171
- return /* @__PURE__ */ React.createElement(
172
- StaticTinaMarkdown,
173
- {
174
- key: i2,
175
- components: {
176
- p: (props2) => /* @__PURE__ */ React.createElement(TdComponent2, { align: align2[i2], ...props2 })
177
- },
178
- content: c.value
179
- }
180
- );
181
- }));
182
- })))
183
- );
184
- }
185
- const ComponentMissing = components["component_missing"];
186
- if (ComponentMissing) {
187
- return /* @__PURE__ */ React.createElement(ComponentMissing, { name: child.name });
188
- } else {
189
- return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
190
- }
178
+ }));
179
+ })))
180
+ );
191
181
  }
192
- case "table":
193
- const rows = child.children || [];
194
- const TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { style: { border: "1px solid #EDECF3" }, ...props2 }));
195
- const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
196
- const TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement(
197
- "td",
198
- {
199
- style: {
200
- textAlign: (props2 == null ? void 0 : props2.align) || "auto",
201
- border: "1px solid #EDECF3",
202
- padding: "0.25rem"
203
- },
204
- ...props2
205
- }
206
- ));
207
- const align = ((_g = child.props) == null ? void 0 : _g.align) || [];
208
- return (
209
- //@ts-ignore Same issue with TinaMarkdown
210
- /* @__PURE__ */ React.createElement(TableComponent, null, /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => {
211
- var _a2;
212
- return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row.children) == null ? void 0 : _a2.map((cell, i2) => {
213
- return /* @__PURE__ */ React.createElement(
214
- StaticTinaMarkdown,
215
- {
216
- key: i2,
217
- components: {
218
- p: (props2) => /* @__PURE__ */ React.createElement(TdComponent, { align: align[i2], ...props2 })
219
- },
220
- content: cell.children
221
- }
222
- );
223
- }));
224
- })))
225
- );
226
- case "maybe_mdx":
227
- return null;
228
- case "html":
229
- case "html_inline":
230
- if (components[child.type]) {
231
- const Component2 = components[child.type];
232
- return /* @__PURE__ */ React.createElement(Component2, { ...props });
182
+ const ComponentMissing = components["component_missing"];
183
+ if (ComponentMissing) {
184
+ return /* @__PURE__ */ React.createElement(ComponentMissing, { name: child.name });
185
+ } else {
186
+ return /* @__PURE__ */ React.createElement("span", null, `No component provided for ${child.name}`);
233
187
  }
234
- return child.value;
235
- case "invalid_markdown":
236
- return /* @__PURE__ */ React.createElement("pre", null, child.value);
237
- default:
238
- if (typeof child.text === "string") {
239
- return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
188
+ }
189
+ case "table":
190
+ const rows = child.children || [];
191
+ const TableComponent = components["table"] || ((props2) => /* @__PURE__ */ React.createElement("table", { style: { border: "1px solid #EDECF3" }, ...props2 }));
192
+ const TrComponent = components["tr"] || ((props2) => /* @__PURE__ */ React.createElement("tr", { ...props2 }));
193
+ const TdComponent = components["td"] || ((props2) => /* @__PURE__ */ React.createElement(
194
+ "td",
195
+ {
196
+ style: {
197
+ textAlign: (props2 == null ? void 0 : props2.align) || "auto",
198
+ border: "1px solid #EDECF3",
199
+ padding: "0.25rem"
200
+ },
201
+ ...props2
240
202
  }
241
- return null;
242
- }
243
- };
244
- exports2.StaticTinaMarkdown = StaticTinaMarkdown;
245
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
246
- });
203
+ ));
204
+ const align = ((_g = child.props) == null ? void 0 : _g.align) || [];
205
+ return (
206
+ //@ts-ignore Same issue with TinaMarkdown
207
+ /* @__PURE__ */ React.createElement(TableComponent, null, /* @__PURE__ */ React.createElement("tbody", null, rows.map((row, i) => {
208
+ var _a2;
209
+ return /* @__PURE__ */ React.createElement(TrComponent, { key: i }, (_a2 = row.children) == null ? void 0 : _a2.map((cell, i2) => {
210
+ return /* @__PURE__ */ React.createElement(
211
+ StaticTinaMarkdown,
212
+ {
213
+ key: i2,
214
+ components: {
215
+ p: (props2) => /* @__PURE__ */ React.createElement(TdComponent, { align: align[i2], ...props2 })
216
+ },
217
+ content: cell.children
218
+ }
219
+ );
220
+ }));
221
+ })))
222
+ );
223
+ case "maybe_mdx":
224
+ return null;
225
+ case "html":
226
+ case "html_inline":
227
+ if (components[child.type]) {
228
+ const Component2 = components[child.type];
229
+ return /* @__PURE__ */ React.createElement(Component2, { ...props });
230
+ }
231
+ return child.value;
232
+ case "invalid_markdown":
233
+ return /* @__PURE__ */ React.createElement("pre", null, child.value);
234
+ default:
235
+ if (typeof child.text === "string") {
236
+ return /* @__PURE__ */ React.createElement(Leaf, { components, ...child });
237
+ }
238
+ return null;
239
+ }
240
+ };
241
+ export {
242
+ StaticTinaMarkdown
243
+ };
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const buttonVariants: (props?: {
4
+ variant?: "default" | "link" | "secondary" | "ghost" | "destructive" | "outline";
5
+ size?: "default" | "icon" | "sm" | "lg";
6
+ } & import("class-variance-authority/types").ClassProp) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ asChild?: boolean;
9
+ }
10
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export { Button, buttonVariants };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { DayButton, DayPicker } from 'react-day-picker';
3
+ import { Button } from './button';
4
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
5
+ buttonVariant?: React.ComponentProps<typeof Button>['variant'];
6
+ }): React.JSX.Element;
7
+ declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): React.JSX.Element;
8
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,111 @@
1
+ import 'moment-timezone';
2
+ import * as React from 'react';
3
+ import { DayPickerProps } from 'react-day-picker';
4
+ type TimePickerType = 'minutes' | 'seconds' | 'hours' | '12hours';
5
+ type Period = 'AM' | 'PM';
6
+ declare const formatCurrentDate: ({ dateFormat, timeFormat, displayDate, }: {
7
+ dateFormat?: string;
8
+ timeFormat?: string;
9
+ displayDate: Date;
10
+ }) => string;
11
+ interface TimePickerInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
12
+ picker: TimePickerType;
13
+ date?: Date | null;
14
+ onDateChange?: (date: Date | undefined) => void;
15
+ period?: Period;
16
+ onRightFocus?: () => void;
17
+ onLeftFocus?: () => void;
18
+ }
19
+ declare const TimePickerInput: React.ForwardRefExoticComponent<TimePickerInputProps & React.RefAttributes<HTMLInputElement>>;
20
+ interface TimePickerProps {
21
+ date?: Date | null;
22
+ onChange?: (date: Date | undefined) => void;
23
+ hourCycle?: 12 | 24;
24
+ /**
25
+ * Determines the smallest unit that is displayed in the datetime picker.
26
+ * Default is 'second'.
27
+ * */
28
+ granularity?: Granularity;
29
+ }
30
+ interface TimePickerRef {
31
+ minuteRef: HTMLInputElement | null;
32
+ hourRef: HTMLInputElement | null;
33
+ secondRef: HTMLInputElement | null;
34
+ }
35
+ declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<TimePickerRef>>;
36
+ type Granularity = 'day' | 'hour' | 'minute' | 'second';
37
+ type DateTimePickerProps = {
38
+ value?: Date;
39
+ onChange?: (date: Date | undefined) => void;
40
+ disabled?: boolean;
41
+ dateFormat?: string;
42
+ timeFormat?: string;
43
+ /** showing `AM/PM` or not. */
44
+ hourCycle?: 12 | 24;
45
+ placeholder?: string;
46
+ /**
47
+ * The year range will be: `This year + yearRange` and `this year - yearRange`.
48
+ * Default is 50.
49
+ * For example:
50
+ * This year is 2024, The year dropdown will be 1974 to 2024 which is generated by `2024 - 50 = 1974` and `2024 + 50 = 2074`.
51
+ * */
52
+ yearRange?: number;
53
+ /**
54
+ * The format is derived from the `date-fns` documentation.
55
+ * @reference https://date-fns.org/v3.6.0/docs/format
56
+ **/
57
+ displayFormat?: {
58
+ hour24?: string;
59
+ hour12?: string;
60
+ };
61
+ /**
62
+ * The granularity prop allows you to control the smallest unit that is displayed by DateTimePicker.
63
+ * By default, the value is `second` which shows all time inputs.
64
+ **/
65
+ granularity?: Granularity;
66
+ className?: string;
67
+ /**
68
+ * Show the default month and time when popup the calendar. Default is the current Date().
69
+ **/
70
+ defaultPopupValue?: Date;
71
+ } & Pick<DayPickerProps, 'locale' | 'weekStartsOn' | 'showWeekNumber' | 'showOutsideDays'>;
72
+ type DateTimePickerRef = {
73
+ value?: Date;
74
+ } & Omit<HTMLInputElement, 'value'>;
75
+ declare const DateTimePicker: React.ForwardRefExoticComponent<{
76
+ value?: Date;
77
+ onChange?: (date: Date | undefined) => void;
78
+ disabled?: boolean;
79
+ dateFormat?: string;
80
+ timeFormat?: string;
81
+ /** showing `AM/PM` or not. */
82
+ hourCycle?: 12 | 24;
83
+ placeholder?: string;
84
+ /**
85
+ * The year range will be: `This year + yearRange` and `this year - yearRange`.
86
+ * Default is 50.
87
+ * For example:
88
+ * This year is 2024, The year dropdown will be 1974 to 2024 which is generated by `2024 - 50 = 1974` and `2024 + 50 = 2074`.
89
+ * */
90
+ yearRange?: number;
91
+ /**
92
+ * The format is derived from the `date-fns` documentation.
93
+ * @reference https://date-fns.org/v3.6.0/docs/format
94
+ **/
95
+ displayFormat?: {
96
+ hour24?: string;
97
+ hour12?: string;
98
+ };
99
+ /**
100
+ * The granularity prop allows you to control the smallest unit that is displayed by DateTimePicker.
101
+ * By default, the value is `second` which shows all time inputs.
102
+ **/
103
+ granularity?: Granularity;
104
+ className?: string;
105
+ /**
106
+ * Show the default month and time when popup the calendar. Default is the current Date().
107
+ **/
108
+ defaultPopupValue?: Date;
109
+ } & Pick<DayPickerProps, "showOutsideDays" | "showWeekNumber" | "locale" | "weekStartsOn"> & React.RefAttributes<Partial<DateTimePickerRef>>>;
110
+ export { DateTimePicker, TimePickerInput, TimePicker, formatCurrentDate };
111
+ export type { TimePickerType, DateTimePickerProps, DateTimePickerRef };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
3
+ export { Input };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };