tinacms 3.11.0 → 3.12.1
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/AnnouncementsBanner.d.ts +13 -0
- package/dist/admin/components/GetDocument.d.ts +1 -1
- package/dist/admin/components/UnableToLoadModal.d.ts +4 -0
- package/dist/auth/AuthModal.d.ts +3 -1
- package/dist/auth/authenticate.d.ts +7 -9
- package/dist/auth/pkce.d.ts +3 -0
- package/dist/auth/useTinaAuthRedirect.d.ts +6 -4
- package/dist/client.js +25 -3
- package/dist/index.js +4208 -3611
- package/dist/internalClient/authProvider.d.ts +8 -6
- package/dist/internalClient/index.d.ts +9 -2
- package/dist/react.js +5 -10
- package/dist/rich-text/index.js +1 -1
- package/dist/rich-text/static.js +1 -1
- package/dist/toolkit/components/media/media-item.d.ts +1 -0
- package/dist/toolkit/components/media/modal.d.ts +6 -0
- package/dist/toolkit/components/media/utils.d.ts +22 -0
- package/dist/toolkit/components/resize-overlay.d.ts +10 -0
- package/dist/toolkit/components/tina-ui.d.ts +1 -1
- package/dist/toolkit/components/transition.d.ts +23 -0
- package/dist/toolkit/core/media-store.default.d.ts +23 -0
- package/dist/toolkit/core/media.d.ts +31 -4
- package/dist/toolkit/fields/plugins/blocks-field-plugin/block-selector-big.d.ts +2 -1
- package/dist/toolkit/fields/plugins/blocks-field-plugin/block-selector.d.ts +2 -1
- package/dist/toolkit/fields/plugins/blocks-field-plugin/index.d.ts +1 -1
- package/dist/toolkit/fields/plugins/field-props.d.ts +12 -1
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/{monaco/error-message.d.ts → error-message.d.ts} +0 -15
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +5 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +1 -17
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +2 -519
- package/dist/toolkit/form-builder/branch-deleted-modal.d.ts +1 -1
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +6 -2
- package/dist/toolkit/plugin-branch-switcher/plugin.d.ts +2 -2
- package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +2 -2
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +1 -0
- package/dist/unifiedClient/asyncLock.d.ts +35 -0
- package/dist/unifiedClient/index.d.ts +2 -1
- package/dist/utils/branch-name.d.ts +3 -0
- package/package.json +11 -18
- package/dist/auth/useGenerator.d.ts +0 -8
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/index.d.ts +0 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/use-debounce.d.ts +0 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/autocomplete.d.ts +0 -14
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/dropdown.d.ts +0 -9
- package/dist/toolkit/plugin-branch-switcher/format-branch-name.d.ts +0 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AuthProvider, LoginStrategy } from '@tinacms/schema-tools';
|
|
2
|
-
import { TokenObject } from '../auth/authenticate';
|
|
1
|
+
import { AuthProvider, LoginStrategy, TokenObject } from '@tinacms/schema-tools';
|
|
3
2
|
type Input = Parameters<AuthProvider['fetchWithToken']>[0];
|
|
4
3
|
type Init = Parameters<AuthProvider['fetchWithToken']>[1];
|
|
5
4
|
type FetchReturn = ReturnType<AuthProvider['fetchWithToken']>;
|
|
@@ -14,6 +13,7 @@ export declare abstract class AbstractAuthProvider implements AuthProvider {
|
|
|
14
13
|
* @param init fetch function init
|
|
15
14
|
*/
|
|
16
15
|
fetchWithToken(input: Input, init: Init): FetchReturn;
|
|
16
|
+
getAccessToken(): Promise<string | null>;
|
|
17
17
|
authorize(context?: any): Promise<any>;
|
|
18
18
|
isAuthorized(context?: any): Promise<boolean>;
|
|
19
19
|
isAuthenticated(): Promise<boolean>;
|
|
@@ -33,8 +33,9 @@ export declare class TinaCloudAuthProvider extends AbstractAuthProvider {
|
|
|
33
33
|
clientId: string;
|
|
34
34
|
identityApiUrl: string;
|
|
35
35
|
frontendUrl: string;
|
|
36
|
-
token:
|
|
37
|
-
|
|
36
|
+
token: TokenObject;
|
|
37
|
+
hasWarnedNoSession: boolean;
|
|
38
|
+
setToken: (_token: TokenObject | null) => void;
|
|
38
39
|
getToken: () => Promise<TokenObject>;
|
|
39
40
|
constructor({ clientId, identityApiUrl, tokenStorage, frontendUrl, ...options }: {
|
|
40
41
|
clientId: string;
|
|
@@ -46,7 +47,7 @@ export declare class TinaCloudAuthProvider extends AbstractAuthProvider {
|
|
|
46
47
|
authenticate(): Promise<TokenObject>;
|
|
47
48
|
getUser(): Promise<any>;
|
|
48
49
|
logout(): Promise<void>;
|
|
49
|
-
getRefreshedToken(tokens:
|
|
50
|
+
getRefreshedToken(tokens: TokenObject): Promise<TokenObject>;
|
|
50
51
|
parseJwt(token: any): any;
|
|
51
52
|
}
|
|
52
53
|
export declare class LocalAuthProvider extends AbstractAuthProvider {
|
|
@@ -58,7 +59,8 @@ export declare class LocalAuthProvider extends AbstractAuthProvider {
|
|
|
58
59
|
}>;
|
|
59
60
|
getUser(): Promise<boolean>;
|
|
60
61
|
getToken(): Promise<{
|
|
61
|
-
|
|
62
|
+
access_token: string;
|
|
63
|
+
refresh_token: string;
|
|
62
64
|
}>;
|
|
63
65
|
logout(): Promise<void>;
|
|
64
66
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BranchData, EventBus } from '@tinacms/toolkit';
|
|
2
2
|
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
3
|
-
import { TokenObject } from '
|
|
4
|
-
import { AuthProvider, Schema, TinaSchema } from '@tinacms/schema-tools';
|
|
3
|
+
import { AuthProvider, Schema, TinaSchema, TokenObject } from '@tinacms/schema-tools';
|
|
5
4
|
import { FuzzySearchOptions, IndexableDocument, SearchClient, SearchOptions, SearchQueryResponse } from '@tinacms/search/index-client';
|
|
6
5
|
import gql from 'graphql-tag';
|
|
7
6
|
import { EditorialWorkflowResult } from '../toolkit/form-builder/editorial-workflow-constants';
|
|
@@ -12,6 +11,13 @@ interface TinaSearchConfig {
|
|
|
12
11
|
fuzzyEnabled?: boolean;
|
|
13
12
|
fuzzyOptions?: FuzzySearchOptions;
|
|
14
13
|
}
|
|
14
|
+
export interface Announcement {
|
|
15
|
+
id: string;
|
|
16
|
+
headline: string;
|
|
17
|
+
body: string;
|
|
18
|
+
severity: 'info' | 'warning' | 'critical';
|
|
19
|
+
versionRange?: string;
|
|
20
|
+
}
|
|
15
21
|
type EditorialWorkflowStatusUpdate = {
|
|
16
22
|
status: string;
|
|
17
23
|
message?: string;
|
|
@@ -122,6 +128,7 @@ export declare class Client {
|
|
|
122
128
|
delinquencyDate: number;
|
|
123
129
|
billingState: "current" | "late" | "delinquent";
|
|
124
130
|
}>;
|
|
131
|
+
getAnnouncements(version: string): Promise<Announcement[] | null>;
|
|
125
132
|
waitForIndexStatus({ ref }: {
|
|
126
133
|
ref: string;
|
|
127
134
|
}): (Promise<any> | (() => void))[];
|
package/dist/react.js
CHANGED
|
@@ -16,10 +16,8 @@ function useTrustedAdminOrigins() {
|
|
|
16
16
|
}, [configured]);
|
|
17
17
|
}
|
|
18
18
|
function isFromAdmin(event, trustedOrigins) {
|
|
19
|
-
if (typeof window === "undefined")
|
|
20
|
-
|
|
21
|
-
if (!trustedOrigins.includes(event.origin))
|
|
22
|
-
return false;
|
|
19
|
+
if (typeof window === "undefined") return false;
|
|
20
|
+
if (!trustedOrigins.includes(event.origin)) return false;
|
|
23
21
|
return event.source === window.parent;
|
|
24
22
|
}
|
|
25
23
|
function useTina(props) {
|
|
@@ -109,8 +107,7 @@ function useTina(props) {
|
|
|
109
107
|
const { experimental___selectFormByFormId, ...rest } = props;
|
|
110
108
|
parent.postMessage({ type: "open", ...rest, id }, window.location.origin);
|
|
111
109
|
const handleMessage = (event) => {
|
|
112
|
-
if (!isFromAdmin(event, trustedAdminOrigins))
|
|
113
|
-
return;
|
|
110
|
+
if (!isFromAdmin(event, trustedAdminOrigins)) return;
|
|
114
111
|
if (event.data.type === "quickEditEnabled") {
|
|
115
112
|
setQuickEditEnabled(event.data.value);
|
|
116
113
|
}
|
|
@@ -149,13 +146,11 @@ function useEditState() {
|
|
|
149
146
|
const [edit, setEdit] = React.useState(false);
|
|
150
147
|
const trustedAdminOrigins = useTrustedAdminOrigins();
|
|
151
148
|
React.useEffect(() => {
|
|
152
|
-
if (typeof window === "undefined")
|
|
153
|
-
return;
|
|
149
|
+
if (typeof window === "undefined") return;
|
|
154
150
|
parent.postMessage({ type: "isEditMode" }, window.location.origin);
|
|
155
151
|
const handleMessage = (event) => {
|
|
156
152
|
var _a;
|
|
157
|
-
if (!isFromAdmin(event, trustedAdminOrigins))
|
|
158
|
-
return;
|
|
153
|
+
if (!isFromAdmin(event, trustedAdminOrigins)) return;
|
|
159
154
|
if (((_a = event.data) == null ? void 0 : _a.type) === "tina:editMode") {
|
|
160
155
|
setEdit(true);
|
|
161
156
|
}
|
package/dist/rich-text/index.js
CHANGED
package/dist/rich-text/static.js
CHANGED
|
@@ -18,5 +18,6 @@ export declare const smallCheckerboardStyle: {
|
|
|
18
18
|
backgroundPosition: string;
|
|
19
19
|
};
|
|
20
20
|
export declare function ListMediaItem({ item, onClick, active }: MediaItemProps): React.JSX.Element;
|
|
21
|
+
export declare function GridFolderItem({ item, onClick, }: Omit<MediaItemProps, 'active'>): React.JSX.Element;
|
|
21
22
|
export declare function GridMediaItem({ item, active, onClick }: MediaItemProps): React.JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -8,6 +8,12 @@ interface NewFolderModalProps {
|
|
|
8
8
|
onSubmit(filename: string): void;
|
|
9
9
|
close(): void;
|
|
10
10
|
}
|
|
11
|
+
interface RenameModalProps {
|
|
12
|
+
close(): void;
|
|
13
|
+
renameFunc(newFilename: string): Promise<void>;
|
|
14
|
+
filename: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const RenameModal: ({ close, renameFunc, filename, }: RenameModalProps) => React.JSX.Element;
|
|
11
17
|
export declare const DeleteModal: ({ close, deleteFunc, filename, }: DeleteModalProps) => React.JSX.Element;
|
|
12
18
|
export declare const NewFolderModal: ({ onSubmit, close }: NewFolderModalProps) => React.JSX.Element;
|
|
13
19
|
export {};
|
|
@@ -3,6 +3,14 @@ export declare const dropzoneAcceptFromString: (str: string) => any;
|
|
|
3
3
|
export declare const isImage: (filename: string) => boolean;
|
|
4
4
|
export declare const isVideo: (filename: string) => boolean;
|
|
5
5
|
export declare const absoluteImgURL: (str: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Splits a filename into its base and extension using the same final-dot rule
|
|
8
|
+
* as {@link sanitizeFilename}, so both agree on what the extension is.
|
|
9
|
+
*/
|
|
10
|
+
export declare const splitFilename: (filename: string) => {
|
|
11
|
+
base: string;
|
|
12
|
+
ext: string;
|
|
13
|
+
};
|
|
6
14
|
/**
|
|
7
15
|
* Normalizes filenames to NFC and replaces characters that are unsafe for
|
|
8
16
|
* URLs or common filesystems with a hyphen, while preserving the extension.
|
|
@@ -11,3 +19,17 @@ export declare const absoluteImgURL: (str: string) => string;
|
|
|
11
19
|
* so URLs use `%C3%A4` instead of the decomposed `%CC%88` sequence.
|
|
12
20
|
*/
|
|
13
21
|
export declare const sanitizeFilename: (filename: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Validation and preview for the rename modal, given what the editor has typed
|
|
24
|
+
* and the file's current name.
|
|
25
|
+
*
|
|
26
|
+
* The base is sanitized on its own and the extension re-attached afterwards, so
|
|
27
|
+
* a base containing slashes or dots can never rewrite or drop the extension.
|
|
28
|
+
*/
|
|
29
|
+
export declare const previewRename: (input: string, currentFilename: string) => {
|
|
30
|
+
sanitized: string;
|
|
31
|
+
extension: string;
|
|
32
|
+
valid: boolean;
|
|
33
|
+
preview: string;
|
|
34
|
+
hint: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ResizeOverlayProps {
|
|
3
|
+
isResizing: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Pointer capture on the handle is what keeps the drag alive over the iframe.
|
|
7
|
+
* This only wins hit-testing, so the resize cursor holds across the whole window.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ResizeOverlay: React.FC<ResizeOverlayProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TransitionClasses {
|
|
3
|
+
enter?: string;
|
|
4
|
+
enterFrom?: string;
|
|
5
|
+
enterTo?: string;
|
|
6
|
+
/** Held once the enter transition has landed, for as long as the element is shown. */
|
|
7
|
+
entered?: string;
|
|
8
|
+
leave?: string;
|
|
9
|
+
leaveFrom?: string;
|
|
10
|
+
leaveTo?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TransitionProps extends TransitionClasses, React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
show: boolean;
|
|
14
|
+
appear?: boolean;
|
|
15
|
+
/** Kept for API compatibility; every call site uses the default 'div'. */
|
|
16
|
+
as?: 'div';
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare const Transition: ({ show, appear, as: _as, enter, enterFrom, enterTo, entered, leave, leaveFrom, leaveTo, className, children, ...rest }: TransitionProps) => React.JSX.Element;
|
|
20
|
+
export interface TransitionChildProps extends TransitionClasses, React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare const TransitionChild: ({ enter, enterFrom, enterTo, entered, leave, leaveFrom, leaveTo, className, children, ...rest }: TransitionChildProps) => React.JSX.Element;
|
|
@@ -28,10 +28,20 @@ export declare class TinaMediaStore implements MediaStore {
|
|
|
28
28
|
private cms;
|
|
29
29
|
private isLocal;
|
|
30
30
|
private url;
|
|
31
|
+
private listUrl;
|
|
31
32
|
private staticMedia;
|
|
32
33
|
isStatic?: boolean;
|
|
33
34
|
private workflowBranchOverride;
|
|
34
35
|
private mediaWorkflowInProgress;
|
|
36
|
+
/**
|
|
37
|
+
* Renaming is only implemented against the local dev server. This is an
|
|
38
|
+
* instance property rather than a prototype method on purpose: the media
|
|
39
|
+
* manager decides whether to offer the action by checking whether the store
|
|
40
|
+
* defines `rename`, so a cloud-backed instance must not carry one — a
|
|
41
|
+
* prototype method would advertise support everywhere and surface an action
|
|
42
|
+
* that always fails.
|
|
43
|
+
*/
|
|
44
|
+
rename?: (from: string, to: string) => Promise<Media>;
|
|
35
45
|
constructor(cms: TinaCMS, staticMedia?: StaticMedia);
|
|
36
46
|
/**
|
|
37
47
|
* Repo-backed media (`media.tina`) is served by TinaCloud's assets API. A
|
|
@@ -44,6 +54,7 @@ export declare class TinaMediaStore implements MediaStore {
|
|
|
44
54
|
setup(): void;
|
|
45
55
|
isAuthenticated(): Promise<boolean>;
|
|
46
56
|
accept: string;
|
|
57
|
+
searchable: boolean;
|
|
47
58
|
maxSize: number;
|
|
48
59
|
/**
|
|
49
60
|
* Returns the workflow branch override or current branch as a single-encoded
|
|
@@ -99,7 +110,19 @@ export declare class TinaMediaStore implements MediaStore {
|
|
|
99
110
|
* throwing — the upload itself already succeeded.
|
|
100
111
|
*/
|
|
101
112
|
private fetchUploadedEntries;
|
|
113
|
+
/** Media root as a `/uploads/`-style prefix for local `src` values. */
|
|
114
|
+
private localMediaFolder;
|
|
115
|
+
/** Stripped directory does not have leading or trailing slashes */
|
|
116
|
+
private stripDirectorySlashes;
|
|
117
|
+
/** Shared by local upload and local rename so both describe a file identically. */
|
|
118
|
+
private buildLocalMedia;
|
|
102
119
|
private persist_local;
|
|
120
|
+
/**
|
|
121
|
+
* `from`/`to` are media-root-relative `directory/filename` paths, matching
|
|
122
|
+
* what the delete route receives.
|
|
123
|
+
*/
|
|
124
|
+
private rename_local;
|
|
125
|
+
private toRenameError;
|
|
103
126
|
persist(media: MediaUploadOptions[]): Promise<Media[]>;
|
|
104
127
|
private genThumbnail;
|
|
105
128
|
list(options?: MediaListOptions): Promise<MediaList>;
|
|
@@ -66,11 +66,14 @@ export interface MediaStore {
|
|
|
66
66
|
*/
|
|
67
67
|
list(options?: MediaListOptions): Promise<MediaList>;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Renames a media object in the store. `from` and `to` are media-root-relative
|
|
70
|
+
* `directory/filename` paths, matching what `delete` receives.
|
|
70
71
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* the
|
|
72
|
+
* Optional by design: the media manager only offers a Rename action when the
|
|
73
|
+
* store instance actually defines it, so stores opt in individually. Defining
|
|
74
|
+
* it on the prototype but leaving it unsupported at runtime would surface an
|
|
75
|
+
* action that always fails — see `TinaMediaStore`, which assigns it per
|
|
76
|
+
* instance.
|
|
74
77
|
*/
|
|
75
78
|
rename?(from: string, to: string): Promise<Media>;
|
|
76
79
|
/**
|
|
@@ -79,6 +82,14 @@ export interface MediaStore {
|
|
|
79
82
|
* @default false
|
|
80
83
|
*/
|
|
81
84
|
isStatic?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Indicates that `list` honours the `search` option, so the media manager
|
|
87
|
+
* may show a search box. Stores that ignore `search` should leave this
|
|
88
|
+
* unset to avoid a search box that returns unfiltered results.
|
|
89
|
+
*
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
searchable?: boolean;
|
|
82
93
|
/**
|
|
83
94
|
* Converts a Media object to the value stored in a form field.
|
|
84
95
|
*
|
|
@@ -100,6 +111,7 @@ export interface MediaListOptions {
|
|
|
100
111
|
h: number;
|
|
101
112
|
}[];
|
|
102
113
|
filesOnly?: boolean;
|
|
114
|
+
search?: string;
|
|
103
115
|
}
|
|
104
116
|
/**
|
|
105
117
|
* The response returned from listing media.
|
|
@@ -135,6 +147,12 @@ export declare class MediaManager implements MediaStore {
|
|
|
135
147
|
get maxSize(): number;
|
|
136
148
|
persist(files: MediaUploadOptions[]): Promise<Media[]>;
|
|
137
149
|
delete(media: Media): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* `from` and `to` are media-root-relative `directory/filename` paths — the
|
|
152
|
+
* same shape `delete` sends. They must not carry an origin, a CDN host, the
|
|
153
|
+
* public folder, or the media root prefix.
|
|
154
|
+
*/
|
|
155
|
+
rename(from: string, to: string): Promise<Media>;
|
|
138
156
|
list(options: MediaListOptions): Promise<MediaList>;
|
|
139
157
|
}
|
|
140
158
|
export interface SelectMediaOptions {
|
|
@@ -156,5 +174,14 @@ export declare class MediaListError extends Error {
|
|
|
156
174
|
export declare const E_UNAUTHORIZED: MediaListError;
|
|
157
175
|
export declare const E_BAD_ROUTE: MediaListError;
|
|
158
176
|
export declare const E_DEFAULT: MediaListError;
|
|
177
|
+
export type MediaRenameErrorCode = 'NOT_FOUND' | 'NAME_COLLISION' | 'INVALID_FILENAME' | 'INVALID_PATH' | 'UNAUTHORIZED' | 'UNSUPPORTED' | 'BACKEND_FAILURE';
|
|
178
|
+
export declare class MediaRenameError extends Error {
|
|
179
|
+
ERR_TYPE: string;
|
|
180
|
+
code: MediaRenameErrorCode;
|
|
181
|
+
constructor(config: {
|
|
182
|
+
code: MediaRenameErrorCode;
|
|
183
|
+
message: string;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
159
186
|
export declare const E_SELF_HOSTED_MEDIA: MediaListError;
|
|
160
187
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { BlockTemplate } from '.';
|
|
3
|
-
export declare const BlockSelectorBig: ({ templates, addItem, label, }: {
|
|
3
|
+
export declare const BlockSelectorBig: ({ templates, addItem, label, fieldName, }: {
|
|
4
4
|
templates: {
|
|
5
5
|
[key: string]: BlockTemplate;
|
|
6
6
|
};
|
|
7
7
|
addItem: any;
|
|
8
8
|
label: string | boolean;
|
|
9
|
+
fieldName?: string;
|
|
9
10
|
}) => React.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { BlockTemplate } from '.';
|
|
3
|
-
export declare const BlockSelector: ({ templates, addItem, }: {
|
|
3
|
+
export declare const BlockSelector: ({ templates, addItem, fieldName, }: {
|
|
4
4
|
templates: {
|
|
5
5
|
[key: string]: BlockTemplate;
|
|
6
6
|
};
|
|
7
7
|
addItem: any;
|
|
8
|
+
fieldName?: string;
|
|
8
9
|
}) => React.JSX.Element;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { Field, FormApi } from '../../forms';
|
|
1
|
+
import { Field, Form, FormApi } from '../../forms';
|
|
2
2
|
import { FieldRenderProps } from '../../form-builder';
|
|
3
|
+
/**
|
|
4
|
+
* Props every field plugin receives.
|
|
5
|
+
*
|
|
6
|
+
* `react-final-form` v6 declared `[otherProp: string]: any` on `FieldRenderProps`,
|
|
7
|
+
* so the extras `FieldsBuilder` passes down type-checked implicitly. v7 dropped
|
|
8
|
+
* that index signature, so they are declared here instead.
|
|
9
|
+
*/
|
|
3
10
|
export interface FieldProps<InputProps> extends FieldRenderProps<any, HTMLElement> {
|
|
4
11
|
field: Field & InputProps;
|
|
5
12
|
form: FormApi;
|
|
13
|
+
tinaForm: Form;
|
|
14
|
+
index?: number;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
experimental_focusIntent?: boolean;
|
|
6
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { Field, Form } from '../../forms';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
interface GroupFieldDefinititon extends Field {
|
|
4
4
|
component: 'group';
|
|
5
5
|
fields: Field[];
|
|
@@ -48,9 +48,10 @@ export declare const ItemHeader: ({ isDragging, children, provider, ...props }:
|
|
|
48
48
|
children: any | any[];
|
|
49
49
|
provider: any;
|
|
50
50
|
} & any) => React.JSX.Element;
|
|
51
|
-
export declare const ItemDeleteButton: ({ onClick, disabled }: {
|
|
51
|
+
export declare const ItemDeleteButton: ({ onClick, disabled, fieldName, }: {
|
|
52
52
|
onClick: any;
|
|
53
53
|
disabled?: boolean;
|
|
54
|
+
fieldName?: string;
|
|
54
55
|
}) => React.JSX.Element;
|
|
55
56
|
export declare const DragHandle: ({ isDragging, dragHandleProps, }: {
|
|
56
57
|
isDragging: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export type EmptyTextElement = {
|
|
3
2
|
type: 'text';
|
|
4
3
|
text: '';
|
|
@@ -21,18 +20,4 @@ export type InvalidMarkdownElement = {
|
|
|
21
20
|
position?: Position;
|
|
22
21
|
children: [EmptyTextElement];
|
|
23
22
|
};
|
|
24
|
-
type ErrorType = {
|
|
25
|
-
message: string;
|
|
26
|
-
position?: {
|
|
27
|
-
startColumn: number;
|
|
28
|
-
endColumn: number;
|
|
29
|
-
startLineNumber: number;
|
|
30
|
-
endLineNumber: number;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export declare const buildError: (element: InvalidMarkdownElement) => ErrorType;
|
|
34
23
|
export declare const buildErrorMessage: (element: InvalidMarkdownElement) => string;
|
|
35
|
-
export declare function ErrorMessage({ error }: {
|
|
36
|
-
error: InvalidMarkdownElement;
|
|
37
|
-
}): React.JSX.Element;
|
|
38
|
-
export {};
|
|
@@ -19,7 +19,11 @@ export declare const MdxFieldPlugin: {
|
|
|
19
19
|
export declare const MdxFieldPluginExtendible: {
|
|
20
20
|
name: string;
|
|
21
21
|
validate(value: any): string;
|
|
22
|
-
Component: (props: InputFieldType<InputProps
|
|
22
|
+
Component: (props: InputFieldType<InputProps & {
|
|
23
|
+
rawMode?: boolean;
|
|
24
|
+
setRawMode?: (rawMode: boolean) => void;
|
|
25
|
+
rawEditor?: React.ReactNode;
|
|
26
|
+
}, {
|
|
23
27
|
templates: MdxTemplate[];
|
|
24
28
|
toolbarOverride?: ToolbarOverrideType[];
|
|
25
29
|
overrides?: ToolbarOverrides;
|
|
@@ -1,18 +1,2 @@
|
|
|
1
1
|
export declare const HANDLES_MDX: ("h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p")[];
|
|
2
|
-
export declare const plugins:
|
|
3
|
-
type: string;
|
|
4
|
-
} & {
|
|
5
|
-
level?: number;
|
|
6
|
-
type?: string;
|
|
7
|
-
} & import("@udecode/plate").QueryNodeOptions, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"autoformat", {
|
|
8
|
-
enableUndoOnDelete?: boolean;
|
|
9
|
-
rules?: import("@udecode/plate-autoformat").AutoformatRule[];
|
|
10
|
-
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"exitBreak", {
|
|
11
|
-
rules?: import("node_modules/@udecode/plate-break/dist/BaseSoftBreakPlugin-CeLtcSTo").E[];
|
|
12
|
-
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"resetNode", {
|
|
13
|
-
disableEditorReset?: boolean;
|
|
14
|
-
disableFirstBlockReset?: boolean;
|
|
15
|
-
rules?: import("@udecode/plate-reset-node").ResetNodePluginRule[];
|
|
16
|
-
}, {}, {}, {}>> | import("@udecode/plate/react").PlatePlugin<import("@udecode/plate").PluginConfig<"softBreak", {
|
|
17
|
-
rules?: import("node_modules/@udecode/plate-break/dist/BaseSoftBreakPlugin-CeLtcSTo").b[];
|
|
18
|
-
}, {}, {}, {}>>)[];
|
|
2
|
+
export declare const plugins: any[];
|