tinacms 2.7.7 → 2.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/Page.d.ts +3 -9
- package/dist/admin/components/Sidebar.d.ts +0 -3
- package/dist/admin/components/ui/tooltip.d.ts +7 -0
- package/dist/admin/pages/CollectionCreatePage.d.ts +1 -1
- package/dist/admin/pages/CollectionListPage.d.ts +2 -2
- package/dist/admin/pages/DashboardPage.d.ts +0 -3
- package/dist/admin/pages/ScreenPage.d.ts +0 -3
- package/dist/client.js +0 -1
- package/dist/client.mjs +0 -1
- package/dist/index.js +10969 -10976
- package/dist/index.mjs +11076 -11084
- package/dist/node-cache-5e8db9f0.mjs +0 -1
- package/dist/react.d.ts +13 -6
- package/dist/react.js +58 -53
- package/dist/react.mjs +58 -53
- package/dist/rich-text/index.js +0 -1
- package/dist/rich-text/index.mjs +0 -1
- package/dist/rich-text/prism.js +0 -1
- package/dist/rich-text/prism.mjs +0 -1
- package/dist/toolkit/components/media/media-item.d.ts +1 -1
- package/dist/toolkit/components/ui/breadcrumb.d.ts +11 -0
- package/dist/toolkit/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/toolkit/fields/components/password-field.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/components/button.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/components/popover.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/model/reference-link-props.d.ts +2 -0
- package/dist/toolkit/fields/components/select.d.ts +2 -2
- package/dist/toolkit/fields/components/text-field.d.ts +1 -1
- package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +1 -1
- package/dist/toolkit/fields/plugins/list-field-meta.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/is-url.d.ts +1 -2
- package/dist/toolkit/form-builder/fields-builder.d.ts +1 -1
- package/dist/toolkit/form-builder/form-builder.d.ts +15 -5
- package/dist/toolkit/forms/field.d.ts +3 -0
- package/dist/toolkit/forms/form.d.ts +22 -3
- package/dist/toolkit/git-client/git-client.d.ts +25 -2
- package/dist/toolkit/git-client/git-file.d.ts +18 -0
- package/dist/toolkit/git-client/git-media-store.d.ts +13 -0
- package/dist/toolkit/git-client/use-git-file.d.ts +4 -0
- package/dist/toolkit/icons/Tina.d.ts +0 -5
- package/dist/toolkit/index.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +1 -0
- package/dist/toolkit/plugin-branch-switcher/index.d.ts +0 -1
- package/dist/toolkit/react-sidebar/components/alert.d.ts +5 -0
- package/dist/toolkit/react-sidebar/components/form-list.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/nav.d.ts +5 -3
- package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +0 -5
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +3 -7
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +0 -7
- package/dist/toolkit/react-sidebar/components/sync-status.d.ts +5 -8
- package/dist/toolkit/react-sidebar/index.d.ts +1 -1
- package/dist/toolkit/styles/button.d.ts +2 -2
- package/dist/toolkit/tina-state.d.ts +11 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +6 -6
- package/dist/client.js.map +0 -1
- package/dist/client.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/node-cache-5e8db9f0.mjs.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/react.mjs.map +0 -1
- package/dist/rich-text/index.js.map +0 -1
- package/dist/rich-text/index.mjs.map +0 -1
- package/dist/rich-text/prism.js.map +0 -1
- package/dist/rich-text/prism.mjs.map +0 -1
- package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +0 -2
package/dist/react.d.ts
CHANGED
|
@@ -15,16 +15,23 @@ export declare function useEditState(): {
|
|
|
15
15
|
* to signal to Tina which DOM element the field
|
|
16
16
|
* is working with.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Generate a field identifier for Tina to associate DOM elements with form fields.
|
|
20
|
+
* Format: "queryId---path.to.field" or "queryId---path.to.array.index"
|
|
21
|
+
*/
|
|
22
|
+
export declare const tinaField: <T extends {
|
|
19
23
|
_content_source?: {
|
|
20
24
|
queryId: string;
|
|
21
25
|
path: (number | string)[];
|
|
22
26
|
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
} | Record<string, unknown> | null | undefined>(object: T, property?: keyof Omit<NonNullable<T>, "__typename" | "_sys">, index?: number) => string;
|
|
28
|
+
/**
|
|
29
|
+
* FIX: This function is updated to be more robust. It explicitly checks for
|
|
30
|
+
* `null` and `String` objects to prevent them from being processed as
|
|
31
|
+
* iterable objects, which is the root cause of the "Objects are not valid
|
|
32
|
+
* as a React child" error.
|
|
33
|
+
*/
|
|
34
|
+
export declare const addMetadata: <T extends object>(id: string, obj: T, path?: (string | number)[]) => T;
|
|
28
35
|
/**
|
|
29
36
|
* This is a pretty rudimentary approach to hashing the query and variables to
|
|
30
37
|
* ensure we treat multiple queries on the page uniquely. It's possible
|
package/dist/react.js
CHANGED
|
@@ -11,17 +11,21 @@
|
|
|
11
11
|
() => hashFromQuery(stringifiedQuery),
|
|
12
12
|
[stringifiedQuery]
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const processedData = React.useMemo(() => {
|
|
15
|
+
const dataCopy = JSON.parse(JSON.stringify(props.data));
|
|
16
|
+
return addMetadata(id, dataCopy, []);
|
|
17
|
+
}, [props.data, id]);
|
|
18
|
+
const [data, setData] = React.useState(processedData);
|
|
15
19
|
const [isClient, setIsClient] = React.useState(false);
|
|
16
20
|
const [quickEditEnabled, setQuickEditEnabled] = React.useState(false);
|
|
17
21
|
const [isInTinaIframe, setIsInTinaIframe] = React.useState(false);
|
|
18
22
|
React.useEffect(() => {
|
|
19
23
|
setIsClient(true);
|
|
20
|
-
setData(
|
|
24
|
+
setData(processedData);
|
|
21
25
|
parent.postMessage({
|
|
22
26
|
type: "url-changed"
|
|
23
27
|
});
|
|
24
|
-
}, [id]);
|
|
28
|
+
}, [id, processedData]);
|
|
25
29
|
React.useEffect(() => {
|
|
26
30
|
if (quickEditEnabled) {
|
|
27
31
|
let mouseDownHandler = function(e) {
|
|
@@ -113,12 +117,18 @@
|
|
|
113
117
|
React.useEffect(() => {
|
|
114
118
|
const { experimental___selectFormByFormId, ...rest } = props;
|
|
115
119
|
parent.postMessage({ type: "open", ...rest, id }, window.location.origin);
|
|
116
|
-
|
|
120
|
+
const handleMessage = (event) => {
|
|
117
121
|
if (event.data.type === "quickEditEnabled") {
|
|
118
122
|
setQuickEditEnabled(event.data.value);
|
|
119
123
|
}
|
|
120
124
|
if (event.data.id === id && event.data.type === "updateData") {
|
|
121
|
-
|
|
125
|
+
const rawData = event.data.data;
|
|
126
|
+
const newlyProcessedData = addMetadata(
|
|
127
|
+
id,
|
|
128
|
+
JSON.parse(JSON.stringify(rawData)),
|
|
129
|
+
[]
|
|
130
|
+
);
|
|
131
|
+
setData(newlyProcessedData);
|
|
122
132
|
setIsInTinaIframe(true);
|
|
123
133
|
const anyTinaField = document.querySelector("[data-tina-field]");
|
|
124
134
|
if (anyTinaField) {
|
|
@@ -133,8 +143,10 @@
|
|
|
133
143
|
);
|
|
134
144
|
}
|
|
135
145
|
}
|
|
136
|
-
}
|
|
146
|
+
};
|
|
147
|
+
window.addEventListener("message", handleMessage);
|
|
137
148
|
return () => {
|
|
149
|
+
window.removeEventListener("message", handleMessage);
|
|
138
150
|
parent.postMessage({ type: "close", id }, window.location.origin);
|
|
139
151
|
};
|
|
140
152
|
}, [id, setQuickEditEnabled]);
|
|
@@ -156,59 +168,53 @@
|
|
|
156
168
|
return { edit };
|
|
157
169
|
}
|
|
158
170
|
const tinaField = (object, property, index) => {
|
|
159
|
-
|
|
160
|
-
if (!
|
|
171
|
+
const contentSource = object == null ? void 0 : object._content_source;
|
|
172
|
+
if (!contentSource) {
|
|
161
173
|
return "";
|
|
162
174
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
(_a = object._content_source) == null ? void 0 : _a.queryId,
|
|
167
|
-
object._content_source.path.join(".")
|
|
168
|
-
].join("---");
|
|
169
|
-
}
|
|
170
|
-
if (typeof index === "number") {
|
|
171
|
-
return [
|
|
172
|
-
(_b = object._content_source) == null ? void 0 : _b.queryId,
|
|
173
|
-
[...object._content_source.path, property, index].join(".")
|
|
174
|
-
].join("---");
|
|
175
|
-
}
|
|
176
|
-
return [
|
|
177
|
-
(_c = object._content_source) == null ? void 0 : _c.queryId,
|
|
178
|
-
[...object._content_source.path, property].join(".")
|
|
179
|
-
].join("---");
|
|
175
|
+
const { queryId, path } = contentSource;
|
|
176
|
+
if (!property) {
|
|
177
|
+
return `${queryId}---${path.join(".")}`;
|
|
180
178
|
}
|
|
181
|
-
|
|
179
|
+
const fullPath = typeof index === "number" ? [...path, property, index] : [...path, property];
|
|
180
|
+
return `${queryId}---${fullPath.join(".")}`;
|
|
182
181
|
};
|
|
183
|
-
const addMetadata = (id,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
182
|
+
const addMetadata = (id, obj, path = []) => {
|
|
183
|
+
if (obj === null) {
|
|
184
|
+
return obj;
|
|
185
|
+
}
|
|
186
|
+
if (isScalarOrUndefined(obj)) {
|
|
187
|
+
return obj;
|
|
188
|
+
}
|
|
189
|
+
if (obj instanceof String) {
|
|
190
|
+
return obj.valueOf();
|
|
191
|
+
}
|
|
192
|
+
if (Array.isArray(obj)) {
|
|
193
|
+
return obj.map(
|
|
194
|
+
(item, index) => addMetadata(id, item, [...path, index])
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
const transformedObj = {};
|
|
198
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
199
|
+
const currentPath = [...path, key];
|
|
200
|
+
if ([
|
|
201
|
+
"__typename",
|
|
202
|
+
"_sys",
|
|
203
|
+
"_internalSys",
|
|
204
|
+
"_values",
|
|
205
|
+
"_internalValues",
|
|
206
|
+
"_content_source",
|
|
207
|
+
"_tina_metadata"
|
|
208
|
+
].includes(key)) {
|
|
209
|
+
transformedObj[key] = value;
|
|
196
210
|
} else {
|
|
197
|
-
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const itemObject = value;
|
|
201
|
-
addMetadata(id, itemObject, [...path, key]);
|
|
211
|
+
transformedObj[key] = addMetadata(id, value, currentPath);
|
|
202
212
|
}
|
|
203
|
-
});
|
|
204
|
-
if ((object == null ? void 0 : object.type) === "root") {
|
|
205
|
-
return;
|
|
206
213
|
}
|
|
207
|
-
object.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
};
|
|
211
|
-
return object;
|
|
214
|
+
if (transformedObj && typeof transformedObj === "object" && "type" in transformedObj && transformedObj.type === "root") {
|
|
215
|
+
return transformedObj;
|
|
216
|
+
}
|
|
217
|
+
return { ...transformedObj, _content_source: { queryId: id, path } };
|
|
212
218
|
};
|
|
213
219
|
function isScalarOrUndefined(value) {
|
|
214
220
|
const type = typeof value;
|
|
@@ -247,4 +253,3 @@
|
|
|
247
253
|
exports2.useTina = useTina;
|
|
248
254
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
249
255
|
});
|
|
250
|
-
//# sourceMappingURL=react.js.map
|
package/dist/react.mjs
CHANGED
|
@@ -8,17 +8,21 @@ function useTina(props) {
|
|
|
8
8
|
() => hashFromQuery(stringifiedQuery),
|
|
9
9
|
[stringifiedQuery]
|
|
10
10
|
);
|
|
11
|
-
const
|
|
11
|
+
const processedData = React.useMemo(() => {
|
|
12
|
+
const dataCopy = JSON.parse(JSON.stringify(props.data));
|
|
13
|
+
return addMetadata(id, dataCopy, []);
|
|
14
|
+
}, [props.data, id]);
|
|
15
|
+
const [data, setData] = React.useState(processedData);
|
|
12
16
|
const [isClient, setIsClient] = React.useState(false);
|
|
13
17
|
const [quickEditEnabled, setQuickEditEnabled] = React.useState(false);
|
|
14
18
|
const [isInTinaIframe, setIsInTinaIframe] = React.useState(false);
|
|
15
19
|
React.useEffect(() => {
|
|
16
20
|
setIsClient(true);
|
|
17
|
-
setData(
|
|
21
|
+
setData(processedData);
|
|
18
22
|
parent.postMessage({
|
|
19
23
|
type: "url-changed"
|
|
20
24
|
});
|
|
21
|
-
}, [id]);
|
|
25
|
+
}, [id, processedData]);
|
|
22
26
|
React.useEffect(() => {
|
|
23
27
|
if (quickEditEnabled) {
|
|
24
28
|
let mouseDownHandler = function(e) {
|
|
@@ -110,12 +114,18 @@ function useTina(props) {
|
|
|
110
114
|
React.useEffect(() => {
|
|
111
115
|
const { experimental___selectFormByFormId, ...rest } = props;
|
|
112
116
|
parent.postMessage({ type: "open", ...rest, id }, window.location.origin);
|
|
113
|
-
|
|
117
|
+
const handleMessage = (event) => {
|
|
114
118
|
if (event.data.type === "quickEditEnabled") {
|
|
115
119
|
setQuickEditEnabled(event.data.value);
|
|
116
120
|
}
|
|
117
121
|
if (event.data.id === id && event.data.type === "updateData") {
|
|
118
|
-
|
|
122
|
+
const rawData = event.data.data;
|
|
123
|
+
const newlyProcessedData = addMetadata(
|
|
124
|
+
id,
|
|
125
|
+
JSON.parse(JSON.stringify(rawData)),
|
|
126
|
+
[]
|
|
127
|
+
);
|
|
128
|
+
setData(newlyProcessedData);
|
|
119
129
|
setIsInTinaIframe(true);
|
|
120
130
|
const anyTinaField = document.querySelector("[data-tina-field]");
|
|
121
131
|
if (anyTinaField) {
|
|
@@ -130,8 +140,10 @@ function useTina(props) {
|
|
|
130
140
|
);
|
|
131
141
|
}
|
|
132
142
|
}
|
|
133
|
-
}
|
|
143
|
+
};
|
|
144
|
+
window.addEventListener("message", handleMessage);
|
|
134
145
|
return () => {
|
|
146
|
+
window.removeEventListener("message", handleMessage);
|
|
135
147
|
parent.postMessage({ type: "close", id }, window.location.origin);
|
|
136
148
|
};
|
|
137
149
|
}, [id, setQuickEditEnabled]);
|
|
@@ -153,59 +165,53 @@ function useEditState() {
|
|
|
153
165
|
return { edit };
|
|
154
166
|
}
|
|
155
167
|
const tinaField = (object, property, index) => {
|
|
156
|
-
|
|
157
|
-
if (!
|
|
168
|
+
const contentSource = object == null ? void 0 : object._content_source;
|
|
169
|
+
if (!contentSource) {
|
|
158
170
|
return "";
|
|
159
171
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
(_a = object._content_source) == null ? void 0 : _a.queryId,
|
|
164
|
-
object._content_source.path.join(".")
|
|
165
|
-
].join("---");
|
|
166
|
-
}
|
|
167
|
-
if (typeof index === "number") {
|
|
168
|
-
return [
|
|
169
|
-
(_b = object._content_source) == null ? void 0 : _b.queryId,
|
|
170
|
-
[...object._content_source.path, property, index].join(".")
|
|
171
|
-
].join("---");
|
|
172
|
-
}
|
|
173
|
-
return [
|
|
174
|
-
(_c = object._content_source) == null ? void 0 : _c.queryId,
|
|
175
|
-
[...object._content_source.path, property].join(".")
|
|
176
|
-
].join("---");
|
|
172
|
+
const { queryId, path } = contentSource;
|
|
173
|
+
if (!property) {
|
|
174
|
+
return `${queryId}---${path.join(".")}`;
|
|
177
175
|
}
|
|
178
|
-
|
|
176
|
+
const fullPath = typeof index === "number" ? [...path, property, index] : [...path, property];
|
|
177
|
+
return `${queryId}---${fullPath.join(".")}`;
|
|
179
178
|
};
|
|
180
|
-
const addMetadata = (id,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
179
|
+
const addMetadata = (id, obj, path = []) => {
|
|
180
|
+
if (obj === null) {
|
|
181
|
+
return obj;
|
|
182
|
+
}
|
|
183
|
+
if (isScalarOrUndefined(obj)) {
|
|
184
|
+
return obj;
|
|
185
|
+
}
|
|
186
|
+
if (obj instanceof String) {
|
|
187
|
+
return obj.valueOf();
|
|
188
|
+
}
|
|
189
|
+
if (Array.isArray(obj)) {
|
|
190
|
+
return obj.map(
|
|
191
|
+
(item, index) => addMetadata(id, item, [...path, index])
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
const transformedObj = {};
|
|
195
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
196
|
+
const currentPath = [...path, key];
|
|
197
|
+
if ([
|
|
198
|
+
"__typename",
|
|
199
|
+
"_sys",
|
|
200
|
+
"_internalSys",
|
|
201
|
+
"_values",
|
|
202
|
+
"_internalValues",
|
|
203
|
+
"_content_source",
|
|
204
|
+
"_tina_metadata"
|
|
205
|
+
].includes(key)) {
|
|
206
|
+
transformedObj[key] = value;
|
|
193
207
|
} else {
|
|
194
|
-
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const itemObject = value;
|
|
198
|
-
addMetadata(id, itemObject, [...path, key]);
|
|
208
|
+
transformedObj[key] = addMetadata(id, value, currentPath);
|
|
199
209
|
}
|
|
200
|
-
});
|
|
201
|
-
if ((object == null ? void 0 : object.type) === "root") {
|
|
202
|
-
return;
|
|
203
210
|
}
|
|
204
|
-
object.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
};
|
|
208
|
-
return object;
|
|
211
|
+
if (transformedObj && typeof transformedObj === "object" && "type" in transformedObj && transformedObj.type === "root") {
|
|
212
|
+
return transformedObj;
|
|
213
|
+
}
|
|
214
|
+
return { ...transformedObj, _content_source: { queryId: id, path } };
|
|
209
215
|
};
|
|
210
216
|
function isScalarOrUndefined(value) {
|
|
211
217
|
const type = typeof value;
|
|
@@ -244,4 +250,3 @@ export {
|
|
|
244
250
|
useEditState,
|
|
245
251
|
useTina
|
|
246
252
|
};
|
|
247
|
-
//# sourceMappingURL=react.mjs.map
|
package/dist/rich-text/index.js
CHANGED
package/dist/rich-text/index.mjs
CHANGED
package/dist/rich-text/prism.js
CHANGED
package/dist/rich-text/prism.mjs
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): React.JSX.Element;
|
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<'a'> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: 'default' | 'destructive';
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -4,6 +4,6 @@ export interface PasswordFieldProps extends a {
|
|
|
4
4
|
error?: boolean;
|
|
5
5
|
ref?: any;
|
|
6
6
|
}
|
|
7
|
-
export declare const passwordFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded
|
|
7
|
+
export declare const passwordFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded";
|
|
8
8
|
export declare const BasePasswordField: React.ForwardRefExoticComponent<Omit<PasswordFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
4
|
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { Field } from '../../forms';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
type Option = {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
@@ -18,6 +18,6 @@ export interface SelectProps {
|
|
|
18
18
|
options?: (Option | string)[];
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
|
-
export declare const selectFieldClasses = "shadow appearance-none bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded
|
|
21
|
+
export declare const selectFieldClasses = "shadow appearance-none bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded";
|
|
22
22
|
export declare const Select: React.FC<SelectProps>;
|
|
23
23
|
export {};
|
|
@@ -4,6 +4,6 @@ export interface TextFieldProps extends a {
|
|
|
4
4
|
error?: boolean;
|
|
5
5
|
ref?: any;
|
|
6
6
|
}
|
|
7
|
-
export declare const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded
|
|
7
|
+
export declare const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded";
|
|
8
8
|
export declare const BaseTextField: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type InputFieldType } from '../wrap-field-with-meta';
|
|
3
|
-
import type { MdxTemplate } from './plate/types';
|
|
4
3
|
import type { InputProps } from '../../../fields/components';
|
|
5
|
-
import type {
|
|
4
|
+
import type { ToolbarOverrideType, ToolbarOverrides } from './plate/toolbar/toolbar-overrides';
|
|
5
|
+
import type { MdxTemplate } from './plate/types';
|
|
6
6
|
export type RichTextType = React.PropsWithChildren<InputFieldType<InputProps, {
|
|
7
7
|
templates: MdxTemplate[];
|
|
8
8
|
toolbarOverride?: ToolbarOverrideType[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { Form } from '../forms';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { type FC } from 'react';
|
|
3
|
-
import type { Form } from '../forms';
|
|
4
4
|
export interface FormBuilderProps {
|
|
5
5
|
form: {
|
|
6
6
|
tinaForm: Form;
|
|
@@ -12,13 +12,16 @@ export interface FormBuilderProps {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const FormBuilder: FC<FormBuilderProps>;
|
|
14
14
|
export declare const FormStatus: ({ pristine }: {
|
|
15
|
-
pristine:
|
|
15
|
+
pristine: boolean;
|
|
16
16
|
}) => React.JSX.Element;
|
|
17
|
-
export declare const FormWrapper: ({
|
|
18
|
-
header?: React.ReactNode;
|
|
19
|
-
children: React.ReactNode;
|
|
17
|
+
export declare const FormWrapper: ({ id, children, }: {
|
|
20
18
|
id: string;
|
|
19
|
+
children: React.ReactNode;
|
|
21
20
|
}) => React.JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated
|
|
23
|
+
* Original misspelt version of CreateBranchModal
|
|
24
|
+
*/
|
|
22
25
|
export declare const CreateBranchModel: ({ close, safeSubmit, relativePath, values, crudType, }: {
|
|
23
26
|
safeSubmit: () => Promise<void>;
|
|
24
27
|
close: () => void;
|
|
@@ -26,6 +29,13 @@ export declare const CreateBranchModel: ({ close, safeSubmit, relativePath, valu
|
|
|
26
29
|
values: Record<string, unknown>;
|
|
27
30
|
crudType: string;
|
|
28
31
|
}) => React.JSX.Element;
|
|
32
|
+
export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crudType, }: {
|
|
33
|
+
safeSubmit: () => Promise<void>;
|
|
34
|
+
close: () => void;
|
|
35
|
+
path: string;
|
|
36
|
+
values: Record<string, unknown>;
|
|
37
|
+
crudType: string;
|
|
38
|
+
}) => React.JSX.Element;
|
|
29
39
|
export declare const PrefixedTextField: ({ prefix, ...props }: {
|
|
30
40
|
[x: string]: any;
|
|
31
41
|
prefix?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Parser } from '@tinacms/schema-tools';
|
|
1
2
|
export type AnyField = Field & {
|
|
2
3
|
[key: string]: any;
|
|
3
4
|
};
|
|
@@ -7,10 +8,12 @@ export interface Field<F extends Field = AnyField> {
|
|
|
7
8
|
description?: string;
|
|
8
9
|
component: React.FC<any> | string | null;
|
|
9
10
|
inlineComponent?: React.FC<any>;
|
|
11
|
+
parser?: Parser;
|
|
10
12
|
parse?: (value: any, name: string, field: F) => any;
|
|
11
13
|
format?: (value: any, name: string, field: F) => any;
|
|
12
14
|
validate?(value: any, allValues: any, meta: any, field: Field): string | object | undefined;
|
|
13
15
|
defaultValue?: any;
|
|
16
|
+
namespace?: string[];
|
|
14
17
|
fields?: F[];
|
|
15
18
|
/**
|
|
16
19
|
* Focus events can come from outside of the component, this is not
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FormApi, Config, FormState } from 'final-form';
|
|
2
|
-
import type { FormSubscription } from 'final-form';
|
|
3
1
|
import type { Plugin } from '../core';
|
|
4
|
-
import {
|
|
2
|
+
import { Config, FormApi, FormState } from 'final-form';
|
|
3
|
+
import type { FormSubscription } from 'final-form';
|
|
4
|
+
import { AnyField, Field } from './field';
|
|
5
5
|
export type { FormApi };
|
|
6
6
|
type GlobalOptions = {
|
|
7
7
|
global: true;
|
|
@@ -25,7 +25,16 @@ export interface FormOptions<S, F extends Field = AnyField> extends Config<S> {
|
|
|
25
25
|
extraSubscribeValues?: FormSubscription;
|
|
26
26
|
queries?: string[];
|
|
27
27
|
crudType?: 'create' | 'update';
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
* Misleading name as per https://github.com/tinacms/tinacms/issues/5686#issuecomment-2899840518
|
|
31
|
+
* Use path property instead.
|
|
32
|
+
*/
|
|
28
33
|
relativePath?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Where to save the form within the content directory on next submission.
|
|
36
|
+
*/
|
|
37
|
+
path?: string;
|
|
29
38
|
}
|
|
30
39
|
export declare class Form<S = any, F extends Field = AnyField> implements Plugin {
|
|
31
40
|
private _reset;
|
|
@@ -42,7 +51,16 @@ export declare class Form<S = any, F extends Field = AnyField> implements Plugin
|
|
|
42
51
|
queries: string[];
|
|
43
52
|
global: GlobalOptions | null;
|
|
44
53
|
loading: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated
|
|
56
|
+
* Misleading name as per https://github.com/tinacms/tinacms/issues/5686#issuecomment-2899840518
|
|
57
|
+
* Use path property instead.
|
|
58
|
+
*/
|
|
45
59
|
relativePath: string;
|
|
60
|
+
/**
|
|
61
|
+
* Where to save the form within the content directory on next submission.
|
|
62
|
+
*/
|
|
63
|
+
path: string;
|
|
46
64
|
crudType?: 'create' | 'update';
|
|
47
65
|
beforeSubmit?: (values: S) => Promise<void | S>;
|
|
48
66
|
constructor({ id, label, fields, actions, buttons, global, reset, loadInitialValues, onChange, queries, ...options }: FormOptions<S, F>);
|
|
@@ -134,6 +152,7 @@ export declare class Form<S = any, F extends Field = AnyField> implements Plugin
|
|
|
134
152
|
label?: string;
|
|
135
153
|
name?: string;
|
|
136
154
|
fields: Field[];
|
|
155
|
+
namespace?: string[];
|
|
137
156
|
};
|
|
138
157
|
private getFieldGroup;
|
|
139
158
|
}
|