tinacms 1.5.23 → 1.5.24
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/auth/AuthModal.d.ts +3 -2
- package/dist/auth/TinaCloudProvider.d.ts +0 -3
- package/dist/auth/defaultSessionProvider.d.ts +3 -0
- package/dist/index.js +839 -388
- package/dist/index.mjs +835 -383
- package/dist/internalClient/asyncPoll.d.ts +84 -0
- package/dist/internalClient/authProvider.d.ts +61 -0
- package/dist/internalClient/index.d.ts +4 -115
- package/dist/toolkit/components/account/update-password.d.ts +2 -0
- package/dist/toolkit/fields/components/index.d.ts +1 -0
- package/dist/toolkit/fields/components/password-field.d.ts +9 -0
- package/dist/toolkit/fields/components/toggle.d.ts +3 -3
- package/dist/toolkit/fields/plugins/index.d.ts +1 -0
- package/dist/toolkit/fields/plugins/password-field-plugin.d.ts +15 -0
- package/dist/toolkit/fields/plugins/text-field-plugin.d.ts +1 -1
- package/dist/toolkit/plugin-screens/password-screen.d.ts +1 -0
- package/dist/toolkit/react-screens/screen-plugin.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/nav.d.ts +13 -5
- package/package.json +5 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The function you pass to `asyncPoll` should return a promise
|
|
3
|
+
* that resolves with object that satisfies this interface.
|
|
4
|
+
*
|
|
5
|
+
* The `done` property indicates to the async poller whether to
|
|
6
|
+
* continue polling or not.
|
|
7
|
+
*
|
|
8
|
+
* When done is `true` that means you've got what you need
|
|
9
|
+
* and the poller will resolve with `data`.
|
|
10
|
+
*
|
|
11
|
+
* When done is `false` taht means you don't have what you need
|
|
12
|
+
* and the poller will continue polling.
|
|
13
|
+
*/
|
|
14
|
+
export interface AsyncData<T> {
|
|
15
|
+
done: boolean;
|
|
16
|
+
data?: T;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Your custom function you provide to the async poller should
|
|
20
|
+
* satisfy this interface. Your function returns a promise that
|
|
21
|
+
* resolves with `AsyncData` to indicate to the poller whether
|
|
22
|
+
* you have what you need or we should continue polling.
|
|
23
|
+
*/
|
|
24
|
+
export interface AsyncFunction<T> extends Function {
|
|
25
|
+
(): PromiseLike<AsyncData<T>>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* How to repeatedly call an async function until get a desired result.
|
|
29
|
+
*
|
|
30
|
+
* Inspired by the following gist:
|
|
31
|
+
* https://gist.github.com/twmbx/2321921670c7e95f6fad164fbdf3170e#gistcomment-3053587
|
|
32
|
+
* https://davidwalsh.name/javascript-polling
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
asyncPoll(
|
|
36
|
+
async (): Promise<AsyncData<any>> => {
|
|
37
|
+
try {
|
|
38
|
+
const result = await getYourAsyncResult();
|
|
39
|
+
if (result.isWhatYouWant) {
|
|
40
|
+
return Promise.resolve({
|
|
41
|
+
done: true,
|
|
42
|
+
data: result,
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
return Promise.resolve({
|
|
46
|
+
done: false
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
} catch (err) {
|
|
50
|
+
return Promise.reject(err);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
500, // interval
|
|
54
|
+
15000, // timeout
|
|
55
|
+
);
|
|
56
|
+
*/
|
|
57
|
+
export declare function asyncPoll<T>(
|
|
58
|
+
/**
|
|
59
|
+
* Function to call periodically until it resolves or rejects.
|
|
60
|
+
*
|
|
61
|
+
* It should resolve as soon as possible indicating if it found
|
|
62
|
+
* what it was looking for or not. If not then it will be reinvoked
|
|
63
|
+
* after the `pollInterval` if we haven't timed out.
|
|
64
|
+
*
|
|
65
|
+
* Rejections will stop the polling and be propagated.
|
|
66
|
+
*/
|
|
67
|
+
fn: AsyncFunction<T>,
|
|
68
|
+
/**
|
|
69
|
+
* Milliseconds to wait before attempting to resolve the promise again.
|
|
70
|
+
* The promise won't be called concurrently. This is the wait period
|
|
71
|
+
* after the promise has resolved/rejected before trying again for a
|
|
72
|
+
* successful resolve so long as we haven't timed out.
|
|
73
|
+
*
|
|
74
|
+
* Default 5 seconds.
|
|
75
|
+
*/
|
|
76
|
+
pollInterval?: number,
|
|
77
|
+
/**
|
|
78
|
+
* Max time to keep polling to receive a successful resolved response.
|
|
79
|
+
* If the promise never resolves before the timeout then this method
|
|
80
|
+
* rejects with a timeout error.
|
|
81
|
+
*
|
|
82
|
+
* Default 30 seconds.
|
|
83
|
+
*/
|
|
84
|
+
pollTimeout?: number): (Promise<T> | (() => void))[];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AuthProvider, LoginStrategy } from '@tinacms/schema-tools';
|
|
3
|
+
import { TokenObject } from '../auth/authenticate';
|
|
4
|
+
declare type Input = Parameters<AuthProvider['fetchWithToken']>[0];
|
|
5
|
+
declare type Init = Parameters<AuthProvider['fetchWithToken']>[1];
|
|
6
|
+
declare type FetchReturn = ReturnType<AuthProvider['fetchWithToken']>;
|
|
7
|
+
export declare abstract class AbstractAuthProvider implements AuthProvider {
|
|
8
|
+
/**
|
|
9
|
+
* Wraps the normal fetch function with same API but adds the authorization header token.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const test = await tinaCloudClient.fetchWithToken(`/mycustomAPI/thing/one`) // the token will be passed in the authorization header
|
|
13
|
+
*
|
|
14
|
+
* @param input fetch function input
|
|
15
|
+
* @param init fetch function init
|
|
16
|
+
*/
|
|
17
|
+
fetchWithToken(input: Input, init: Init): FetchReturn;
|
|
18
|
+
authorize(context?: any): Promise<any>;
|
|
19
|
+
isAuthorized(context?: any): Promise<boolean>;
|
|
20
|
+
isAuthenticated(): Promise<boolean>;
|
|
21
|
+
getLoginStrategy(): LoginStrategy;
|
|
22
|
+
getSessionProvider(): import("react").FC<{}>;
|
|
23
|
+
abstract getToken(): any;
|
|
24
|
+
abstract getUser(): any;
|
|
25
|
+
abstract logout(): any;
|
|
26
|
+
abstract authenticate(props?: Record<string, string>): any;
|
|
27
|
+
}
|
|
28
|
+
export declare class TinaCloudAuthProvider extends AbstractAuthProvider {
|
|
29
|
+
clientId: string;
|
|
30
|
+
identityApiUrl: string;
|
|
31
|
+
frontendUrl: string;
|
|
32
|
+
token: string;
|
|
33
|
+
setToken: (_token: TokenObject) => void;
|
|
34
|
+
getToken: () => Promise<TokenObject>;
|
|
35
|
+
constructor({ clientId, identityApiUrl, tokenStorage, frontendUrl, ...options }: {
|
|
36
|
+
clientId: string;
|
|
37
|
+
identityApiUrl: string;
|
|
38
|
+
tokenStorage?: 'MEMORY' | 'LOCAL_STORAGE' | 'CUSTOM';
|
|
39
|
+
getTokenFn?: () => Promise<TokenObject>;
|
|
40
|
+
frontendUrl: string;
|
|
41
|
+
});
|
|
42
|
+
authenticate(): Promise<TokenObject>;
|
|
43
|
+
getUser(): Promise<any>;
|
|
44
|
+
logout(): Promise<void>;
|
|
45
|
+
getRefreshedToken(tokens: string): Promise<TokenObject>;
|
|
46
|
+
parseJwt(token: any): any;
|
|
47
|
+
}
|
|
48
|
+
export declare class LocalAuthProvider extends AbstractAuthProvider {
|
|
49
|
+
constructor();
|
|
50
|
+
authenticate(): Promise<{
|
|
51
|
+
access_token: string;
|
|
52
|
+
id_token: string;
|
|
53
|
+
refresh_token: string;
|
|
54
|
+
}>;
|
|
55
|
+
getUser(): Promise<boolean>;
|
|
56
|
+
getToken(): Promise<{
|
|
57
|
+
id_token: string;
|
|
58
|
+
}>;
|
|
59
|
+
logout(): Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -2,11 +2,12 @@ import { TokenObject } from '../auth/authenticate';
|
|
|
2
2
|
import { BranchData, EventBus } from '@tinacms/toolkit';
|
|
3
3
|
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
4
4
|
import gql from 'graphql-tag';
|
|
5
|
-
import { TinaSchema, Schema } from '@tinacms/schema-tools';
|
|
5
|
+
import { TinaSchema, Schema, AuthProvider } from '@tinacms/schema-tools';
|
|
6
6
|
import { TinaCloudProject } from './types';
|
|
7
7
|
import { SearchClient } from '@tinacms/search/dist/index-client';
|
|
8
|
+
export * from './authProvider';
|
|
8
9
|
export declare type OnLoginFunc = (args: {
|
|
9
|
-
token
|
|
10
|
+
token?: TokenObject;
|
|
10
11
|
}) => Promise<void>;
|
|
11
12
|
export declare type TinaIOConfig = {
|
|
12
13
|
assetsApiUrlOverride?: string;
|
|
@@ -24,91 +25,8 @@ interface ServerOptions {
|
|
|
24
25
|
tinaioConfig?: TinaIOConfig;
|
|
25
26
|
tokenStorage?: 'MEMORY' | 'LOCAL_STORAGE' | 'CUSTOM';
|
|
26
27
|
}
|
|
27
|
-
/**
|
|
28
|
-
* The function you pass to `asyncPoll` should return a promise
|
|
29
|
-
* that resolves with object that satisfies this interface.
|
|
30
|
-
*
|
|
31
|
-
* The `done` property indicates to the async poller whether to
|
|
32
|
-
* continue polling or not.
|
|
33
|
-
*
|
|
34
|
-
* When done is `true` that means you've got what you need
|
|
35
|
-
* and the poller will resolve with `data`.
|
|
36
|
-
*
|
|
37
|
-
* When done is `false` taht means you don't have what you need
|
|
38
|
-
* and the poller will continue polling.
|
|
39
|
-
*/
|
|
40
|
-
export interface AsyncData<T> {
|
|
41
|
-
done: boolean;
|
|
42
|
-
data?: T;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Your custom function you provide to the async poller should
|
|
46
|
-
* satisfy this interface. Your function returns a promise that
|
|
47
|
-
* resolves with `AsyncData` to indicate to the poller whether
|
|
48
|
-
* you have what you need or we should continue polling.
|
|
49
|
-
*/
|
|
50
|
-
export interface AsyncFunction<T> extends Function {
|
|
51
|
-
(): PromiseLike<AsyncData<T>>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* How to repeatedly call an async function until get a desired result.
|
|
55
|
-
*
|
|
56
|
-
* Inspired by the following gist:
|
|
57
|
-
* https://gist.github.com/twmbx/2321921670c7e95f6fad164fbdf3170e#gistcomment-3053587
|
|
58
|
-
* https://davidwalsh.name/javascript-polling
|
|
59
|
-
*
|
|
60
|
-
* Usage:
|
|
61
|
-
asyncPoll(
|
|
62
|
-
async (): Promise<AsyncData<any>> => {
|
|
63
|
-
try {
|
|
64
|
-
const result = await getYourAsyncResult();
|
|
65
|
-
if (result.isWhatYouWant) {
|
|
66
|
-
return Promise.resolve({
|
|
67
|
-
done: true,
|
|
68
|
-
data: result,
|
|
69
|
-
});
|
|
70
|
-
} else {
|
|
71
|
-
return Promise.resolve({
|
|
72
|
-
done: false
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
} catch (err) {
|
|
76
|
-
return Promise.reject(err);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
500, // interval
|
|
80
|
-
15000, // timeout
|
|
81
|
-
);
|
|
82
|
-
*/
|
|
83
|
-
export declare function asyncPoll<T>(
|
|
84
|
-
/**
|
|
85
|
-
* Function to call periodically until it resolves or rejects.
|
|
86
|
-
*
|
|
87
|
-
* It should resolve as soon as possible indicating if it found
|
|
88
|
-
* what it was looking for or not. If not then it will be reinvoked
|
|
89
|
-
* after the `pollInterval` if we haven't timed out.
|
|
90
|
-
*
|
|
91
|
-
* Rejections will stop the polling and be propagated.
|
|
92
|
-
*/
|
|
93
|
-
fn: AsyncFunction<T>,
|
|
94
|
-
/**
|
|
95
|
-
* Milliseconds to wait before attempting to resolve the promise again.
|
|
96
|
-
* The promise won't be called concurrently. This is the wait period
|
|
97
|
-
* after the promise has resolved/rejected before trying again for a
|
|
98
|
-
* successful resolve so long as we haven't timed out.
|
|
99
|
-
*
|
|
100
|
-
* Default 5 seconds.
|
|
101
|
-
*/
|
|
102
|
-
pollInterval?: number,
|
|
103
|
-
/**
|
|
104
|
-
* Max time to keep polling to receive a successful resolved response.
|
|
105
|
-
* If the promise never resolves before the timeout then this method
|
|
106
|
-
* rejects with a timeout error.
|
|
107
|
-
*
|
|
108
|
-
* Default 30 seconds.
|
|
109
|
-
*/
|
|
110
|
-
pollTimeout?: number): (Promise<T> | (() => void))[];
|
|
111
28
|
export declare class Client {
|
|
29
|
+
authProvider: AuthProvider;
|
|
112
30
|
onLogin?: OnLoginFunc;
|
|
113
31
|
onLogout?: () => Promise<void>;
|
|
114
32
|
frontendUrl: string;
|
|
@@ -120,9 +38,6 @@ export declare class Client {
|
|
|
120
38
|
clientId: string;
|
|
121
39
|
contentApiBase: string;
|
|
122
40
|
tinaGraphQLVersion: string;
|
|
123
|
-
setToken: (_token: TokenObject) => void;
|
|
124
|
-
private getToken;
|
|
125
|
-
token: string;
|
|
126
41
|
branch: string;
|
|
127
42
|
private options;
|
|
128
43
|
events: EventBus;
|
|
@@ -187,24 +102,6 @@ export declare class Client {
|
|
|
187
102
|
}[];
|
|
188
103
|
cursor?: string;
|
|
189
104
|
}>;
|
|
190
|
-
parseJwt(token: any): any;
|
|
191
|
-
getRefreshedToken(tokens: string): Promise<TokenObject>;
|
|
192
|
-
isAuthorized(context?: any): Promise<boolean>;
|
|
193
|
-
isAuthenticated(): Promise<boolean>;
|
|
194
|
-
logout(): Promise<void>;
|
|
195
|
-
authenticate(): Promise<TokenObject>;
|
|
196
|
-
authorize(context?: any): Promise<any>;
|
|
197
|
-
/**
|
|
198
|
-
* Wraps the normal fetch function with same API but adds the authorization header token.
|
|
199
|
-
*
|
|
200
|
-
* @example
|
|
201
|
-
* const test = await tinaCloudClient.fetchWithToken(`/mycustomAPI/thing/one`) // the token will be passed in the authorization header
|
|
202
|
-
*
|
|
203
|
-
* @param input fetch function input
|
|
204
|
-
* @param init fetch function init
|
|
205
|
-
*/
|
|
206
|
-
fetchWithToken(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
207
|
-
getUser(): Promise<any>;
|
|
208
105
|
getBillingState(): Promise<{
|
|
209
106
|
clientId: string;
|
|
210
107
|
delinquencyDate: number;
|
|
@@ -248,13 +145,6 @@ export declare class LocalClient extends Client {
|
|
|
248
145
|
schema?: Schema;
|
|
249
146
|
} & Omit<ServerOptions, 'clientId' | 'branch' | 'tinaGraphQLVersion'>);
|
|
250
147
|
get isLocalMode(): boolean;
|
|
251
|
-
logout(): Promise<void>;
|
|
252
|
-
authenticate(): Promise<{
|
|
253
|
-
access_token: string;
|
|
254
|
-
id_token: string;
|
|
255
|
-
refresh_token: string;
|
|
256
|
-
}>;
|
|
257
|
-
getUser(): Promise<boolean>;
|
|
258
148
|
}
|
|
259
149
|
export declare class TinaCMSSearchClient implements SearchClient {
|
|
260
150
|
private client;
|
|
@@ -291,4 +181,3 @@ export declare class LocalSearchClient implements SearchClient {
|
|
|
291
181
|
put(docs: any[]): Promise<any>;
|
|
292
182
|
supportsClientSideIndexing(): boolean;
|
|
293
183
|
}
|
|
294
|
-
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type a = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
3
|
+
export interface PasswordFieldProps extends a {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
ref?: any;
|
|
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-md";
|
|
8
|
+
export declare const BasePasswordField: React.ForwardRefExoticComponent<Pick<PasswordFieldProps, "error" | "type" | "form" | "slot" | "style" | "title" | "pattern" | "children" | "dir" | "key" | "value" | "src" | "hidden" | "list" | "className" | "name" | "id" | "onChange" | "onSubmit" | "alt" | "disabled" | "accept" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "placeholder" | "readOnly" | "required" | "size" | "step" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export {};
|
|
@@ -6,9 +6,9 @@ export interface ToggleProps {
|
|
|
6
6
|
input: any;
|
|
7
7
|
field: ToggleFieldDefinition;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
onBlur
|
|
10
|
-
onChange
|
|
11
|
-
onFocus
|
|
9
|
+
onBlur?: <T>(_event?: React.FocusEvent<T>) => void;
|
|
10
|
+
onChange?: <T>(_event: React.ChangeEvent<T> | any) => void;
|
|
11
|
+
onFocus?: <T>(_event?: React.FocusEvent<T>) => void;
|
|
12
12
|
}
|
|
13
13
|
interface ToggleFieldDefinition extends Field {
|
|
14
14
|
component: 'toggle';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputProps } from '../components';
|
|
3
|
+
interface ExtraProps {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
confirmPlaceholder: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const PasswordFieldComponent: (props: import("./field-props").FieldProps<InputProps & ExtraProps>) => JSX.Element;
|
|
9
|
+
export declare const PasswordFieldPlugin: {
|
|
10
|
+
name: string;
|
|
11
|
+
Component: (props: import("./field-props").FieldProps<InputProps & ExtraProps>) => JSX.Element;
|
|
12
|
+
validate(value: any, values: any, meta: any, field: any): string;
|
|
13
|
+
parse: (value?: string) => string;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -8,7 +8,7 @@ export declare const TextField: (props: import("./field-props").FieldProps<Input
|
|
|
8
8
|
export declare const TextFieldPlugin: {
|
|
9
9
|
name: string;
|
|
10
10
|
Component: (props: import("./field-props").FieldProps<InputProps & ExtraProps>) => JSX.Element;
|
|
11
|
-
validate(value: any,
|
|
11
|
+
validate(value: any, allValues: any, meta: any, field: any): "Required" | "Item with this unique id already exists";
|
|
12
12
|
parse: (value?: string) => string;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PasswordScreenPlugin: import("../react-screens").ScreenPlugin<{}>;
|
|
@@ -17,6 +17,7 @@ export interface ScreenPlugin<ExtraProps = {}> extends Plugin {
|
|
|
17
17
|
Component(props: ScreenComponentProps & ExtraProps): React.ReactElement;
|
|
18
18
|
Icon: any;
|
|
19
19
|
layout: 'fullscreen' | 'popup';
|
|
20
|
+
navCategory?: 'Account' | 'Site';
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* The set of props passed to all Screen Components.
|
|
@@ -33,6 +34,7 @@ export interface ScreenOptions<ExtraProps = {}> {
|
|
|
33
34
|
Icon: any;
|
|
34
35
|
layout?: ScreenPlugin['layout'];
|
|
35
36
|
props?: ExtraProps;
|
|
37
|
+
navCategory?: 'Account' | 'Site';
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* Creates screen plugins.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ScreenPlugin } from '../../react-screens';
|
|
3
3
|
import { CloudConfigPlugin } from '../../react-cloud-config';
|
|
4
|
+
interface NavCollection {
|
|
5
|
+
label?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
isAuthCollection?: boolean;
|
|
8
|
+
}
|
|
4
9
|
interface NavProps {
|
|
5
10
|
isLocalMode: boolean;
|
|
6
11
|
children?: any;
|
|
@@ -8,10 +13,7 @@ interface NavProps {
|
|
|
8
13
|
userName?: string;
|
|
9
14
|
showCollections: boolean;
|
|
10
15
|
collectionsInfo: {
|
|
11
|
-
collections:
|
|
12
|
-
label?: string;
|
|
13
|
-
name: string;
|
|
14
|
-
}[];
|
|
16
|
+
collections: NavCollection[];
|
|
15
17
|
};
|
|
16
18
|
contentCreators?: any;
|
|
17
19
|
screens?: ScreenPlugin[];
|
|
@@ -29,6 +31,12 @@ interface NavProps {
|
|
|
29
31
|
name: string;
|
|
30
32
|
};
|
|
31
33
|
}>;
|
|
34
|
+
AuthRenderNavCollection: React.ComponentType<{
|
|
35
|
+
collection: {
|
|
36
|
+
label: string;
|
|
37
|
+
name: string;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
32
40
|
}
|
|
33
|
-
export declare const Nav: ({ isLocalMode, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, ...props }: NavProps) => JSX.Element;
|
|
41
|
+
export declare const Nav: ({ isLocalMode, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => JSX.Element;
|
|
34
42
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.24",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"@react-types/combobox": "^3.2.0",
|
|
70
70
|
"@react-types/shared": "^3.10.0",
|
|
71
71
|
"@sambego/storybook-styles": "^1.0.0",
|
|
72
|
-
"@tinacms/schema-tools": "1.4.
|
|
73
|
-
"@tinacms/search": "1.0.
|
|
74
|
-
"@tinacms/mdx": "1.3.
|
|
72
|
+
"@tinacms/schema-tools": "1.4.14",
|
|
73
|
+
"@tinacms/search": "1.0.14",
|
|
74
|
+
"@tinacms/mdx": "1.3.22",
|
|
75
75
|
"@tinacms/sharedctx": "1.0.2",
|
|
76
76
|
"@udecode/plate-headless": "^21.4.0",
|
|
77
77
|
"atob": "2.1.2",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@testing-library/react": "^12.0.0",
|
|
119
119
|
"@testing-library/react-hooks": "^7.0.2",
|
|
120
120
|
"@testing-library/user-event": "^12.7.0",
|
|
121
|
-
"@tinacms/scripts": "1.1.
|
|
121
|
+
"@tinacms/scripts": "1.1.3",
|
|
122
122
|
"@types/atob": "^2.1.2",
|
|
123
123
|
"@types/codemirror": "^0.0.71",
|
|
124
124
|
"@types/color-string": "^1.5.0",
|