tinacms 3.13.0 → 3.14.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/README.md +2 -2
- package/dist/admin/preview-url.d.ts +14 -0
- package/dist/client.browser.d.ts +1 -0
- package/dist/client.browser.js +175 -0
- package/dist/client.d.ts +6 -3
- package/dist/client.js +110 -127
- package/dist/index.js +246 -77
- package/dist/internalClient/bearerToken.d.ts +2 -0
- package/dist/rich-text/index.d.ts +1 -1
- package/dist/rich-text/static.d.ts +1 -1
- package/dist/toolkit/components/loading-messages.d.ts +9 -0
- package/dist/toolkit/fields/components/toggle.d.ts +2 -2
- package/dist/toolkit/fields/plugins/field-props.d.ts +4 -3
- package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +3 -2
- package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +3 -0
- package/dist/toolkit/form-builder/editorial-workflow-error-box.d.ts +5 -0
- package/dist/toolkit/form-builder/editorial-workflow-utils.d.ts +17 -0
- package/dist/toolkit/form-builder/use-editorial-workflow.d.ts +3 -2
- package/dist/unifiedClient/index.d.ts +1 -0
- package/package.json +13 -8
|
@@ -146,7 +146,7 @@ export type TinaMarkdownContent = {
|
|
|
146
146
|
export declare const TinaMarkdown: <CustomComponents extends {
|
|
147
147
|
[key: string]: object;
|
|
148
148
|
} = any>({ content, components, }: {
|
|
149
|
-
content: TinaMarkdownContent | TinaMarkdownContent[];
|
|
149
|
+
content: TinaMarkdownContent | TinaMarkdownContent[] | null | undefined;
|
|
150
150
|
components?: Components<{}> | Components<{ [BK in keyof CustomComponents]: (props: CustomComponents[BK]) => JSX.Element; }>;
|
|
151
151
|
}) => React.JSX.Element;
|
|
152
152
|
export {};
|
|
@@ -148,7 +148,7 @@ export type TinaMarkdownContent = {
|
|
|
148
148
|
export declare const StaticTinaMarkdown: <CustomComponents extends {
|
|
149
149
|
[key: string]: object;
|
|
150
150
|
} = any>({ content, components, }: {
|
|
151
|
-
content: TinaMarkdownContent | TinaMarkdownContent[];
|
|
151
|
+
content: TinaMarkdownContent | TinaMarkdownContent[] | null | undefined;
|
|
152
152
|
components?: Components<{}> | Components<{ [BK in keyof CustomComponents]: (props: CustomComponents[BK]) => JSX.Element; }>;
|
|
153
153
|
}) => React.JSX.Element;
|
|
154
154
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const LOADING_MESSAGES: string[];
|
|
3
|
+
interface LoadingMessageProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
messages?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const LoadingMessage: ({ className, style, messages, }: LoadingMessageProps) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Field } from '../../forms';
|
|
4
4
|
export interface ToggleProps {
|
|
5
|
-
name
|
|
5
|
+
name?: string;
|
|
6
6
|
input: any;
|
|
7
7
|
field: ToggleFieldDefinition;
|
|
8
8
|
disabled?: boolean;
|
|
@@ -10,7 +10,7 @@ export interface ToggleProps {
|
|
|
10
10
|
onChange?: <T>(_event: React.ChangeEvent<T> | any) => void;
|
|
11
11
|
onFocus?: <T>(_event?: React.FocusEvent<T>) => void;
|
|
12
12
|
}
|
|
13
|
-
interface ToggleFieldDefinition extends Field {
|
|
13
|
+
export interface ToggleFieldDefinition extends Field {
|
|
14
14
|
component: 'toggle';
|
|
15
15
|
toggleLabels?: boolean | FieldLabels;
|
|
16
16
|
}
|
|
@@ -3,9 +3,10 @@ import { FieldRenderProps } from '../../form-builder';
|
|
|
3
3
|
/**
|
|
4
4
|
* Props every field plugin receives.
|
|
5
5
|
*
|
|
6
|
-
* `react-final-form` v6
|
|
7
|
-
* so the extras `FieldsBuilder` passes down type-
|
|
8
|
-
* that index signature,
|
|
6
|
+
* `react-final-form` v6 declares `[otherProp: string]: any` on `FieldRenderProps`,
|
|
7
|
+
* so the extras `FieldsBuilder` passes down would type-check implicitly. They are
|
|
8
|
+
* declared explicitly anyway: v7 drops that index signature, and the next bump
|
|
9
|
+
* should not have to rediscover them.
|
|
9
10
|
*/
|
|
10
11
|
export interface FieldProps<InputProps> extends FieldRenderProps<any, HTMLElement> {
|
|
11
12
|
field: Field & InputProps;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const ToggleField: (props: import("./wrap-field-with-meta").InputFieldType<import("..").ToggleProps,
|
|
1
|
+
export declare const ToggleField: (props: import("./wrap-field-with-meta").InputFieldType<import("..").ToggleProps, import("..").ToggleFieldDefinition>) => import("react").JSX.Element;
|
|
2
2
|
export declare const ToggleFieldPlugin: {
|
|
3
3
|
name: string;
|
|
4
4
|
type: string;
|
|
5
|
-
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("..").ToggleProps,
|
|
5
|
+
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("..").ToggleProps, import("..").ToggleFieldDefinition>) => import("react").JSX.Element;
|
|
6
6
|
validate(value: any, values: any, meta: any, field: any): string;
|
|
7
7
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Form } from '../forms';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { type EditorialWorkflowErrorCopy } from './editorial-workflow-utils';
|
|
3
4
|
import { type SaveChoice } from './save-options';
|
|
4
5
|
export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crudType, tinaForm, onBaseBranchDeleted, }: {
|
|
5
6
|
safeSubmit: (editorialWorkflowChoice?: SaveChoice) => Promise<void>;
|
|
@@ -10,11 +11,11 @@ export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crud
|
|
|
10
11
|
tinaForm?: Form;
|
|
11
12
|
onBaseBranchDeleted?: () => void;
|
|
12
13
|
}) => React.JSX.Element;
|
|
13
|
-
export declare const CreateBranchPromptModal: ({ branchName, close, disabled,
|
|
14
|
+
export declare const CreateBranchPromptModal: ({ branchName, close, disabled, error, onBranchNameChange, onCreateBranch, onSaveToProtectedBranch, showSaveOptions, disablePublish, allowSaveToProtectedBranch, }: {
|
|
14
15
|
branchName: string;
|
|
15
16
|
close: () => void;
|
|
16
17
|
disabled?: boolean;
|
|
17
|
-
|
|
18
|
+
error?: EditorialWorkflowErrorCopy;
|
|
18
19
|
onBranchNameChange: (value: string) => void;
|
|
19
20
|
onCreateBranch: (isDraft: boolean) => void;
|
|
20
21
|
onSaveToProtectedBranch: () => void;
|
|
@@ -23,6 +23,7 @@ export declare const EDITORIAL_WORKFLOW_ERROR: {
|
|
|
23
23
|
readonly BRANCH_EXISTS: "BRANCH_EXISTS";
|
|
24
24
|
readonly BRANCH_HIERARCHY_CONFLICT: "BRANCH_HIERARCHY_CONFLICT";
|
|
25
25
|
readonly VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
26
|
+
readonly INDEXING_FAILED: "INDEXING_FAILED";
|
|
26
27
|
};
|
|
27
28
|
export type EditorialWorkflowError = (typeof EDITORIAL_WORKFLOW_ERROR)[keyof typeof EDITORIAL_WORKFLOW_ERROR];
|
|
28
29
|
/**
|
|
@@ -31,7 +32,9 @@ export type EditorialWorkflowError = (typeof EDITORIAL_WORKFLOW_ERROR)[keyof typ
|
|
|
31
32
|
export type EditorialWorkflowErrorDetails = Error & {
|
|
32
33
|
errorCode?: string;
|
|
33
34
|
conflictingBranch?: string;
|
|
35
|
+
file?: string;
|
|
34
36
|
};
|
|
37
|
+
export declare const EDITORIAL_WORKFLOW_EVENT_LOG_DOCS_URL = "https://tina.io/docs/tinacloud/dashboard/event-log#common-causes";
|
|
35
38
|
/**
|
|
36
39
|
* Result from a completed editorial workflow operation
|
|
37
40
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TinaSchema } from '@tinacms/schema-tools';
|
|
1
2
|
export interface MediaWorkflowConfirmBranchEvent {
|
|
2
3
|
type: 'media:workflow:confirm-branch';
|
|
3
4
|
branchName: string;
|
|
@@ -24,3 +25,19 @@ export declare const checkBranchGuard: (tinaApi: {
|
|
|
24
25
|
signal?: AbortSignal;
|
|
25
26
|
}) => Promise<Record<string, boolean>>;
|
|
26
27
|
}, baseBranch: string, targetBranch: string, debugLabel: string, signal?: AbortSignal) => Promise<BranchGuardResult>;
|
|
28
|
+
export interface EditorialWorkflowErrorLink {
|
|
29
|
+
url: string;
|
|
30
|
+
label: string;
|
|
31
|
+
}
|
|
32
|
+
export interface EditorialWorkflowMessagePart {
|
|
33
|
+
text: string;
|
|
34
|
+
emphasis?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface EditorialWorkflowErrorCopy {
|
|
37
|
+
messageParts: EditorialWorkflowMessagePart[];
|
|
38
|
+
link?: EditorialWorkflowErrorLink;
|
|
39
|
+
}
|
|
40
|
+
export declare const plainMessage: (text: string) => EditorialWorkflowMessagePart[];
|
|
41
|
+
export declare const messageText: (parts: EditorialWorkflowMessagePart[]) => string;
|
|
42
|
+
export declare const collectionLabelResolver: (schema?: Pick<TinaSchema, "getCollectionByFullPath">) => (file: string) => string | undefined;
|
|
43
|
+
export declare const getEditorialWorkflowError: (e: unknown, resolveCollectionLabel?: (file: string) => string | undefined) => EditorialWorkflowErrorCopy;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Form } from '../forms';
|
|
2
|
+
import { type EditorialWorkflowErrorCopy } from './editorial-workflow-utils';
|
|
3
|
+
export { collectionLabelResolver, getEditorialWorkflowError, plainMessage, } from './editorial-workflow-utils';
|
|
2
4
|
export declare const WORKFLOW_STEPS: {
|
|
3
5
|
id: number;
|
|
4
6
|
name: string;
|
|
@@ -18,7 +20,7 @@ export interface ExecuteWorkflowOptions {
|
|
|
18
20
|
}
|
|
19
21
|
export interface UseEditorialWorkflowResult {
|
|
20
22
|
isExecuting: boolean;
|
|
21
|
-
|
|
23
|
+
error?: EditorialWorkflowErrorCopy;
|
|
22
24
|
currentStep: number;
|
|
23
25
|
elapsedTime: number;
|
|
24
26
|
/** Resolves with the outcome; on failure `error` holds the message. */
|
|
@@ -29,5 +31,4 @@ export interface UseEditorialWorkflowResult {
|
|
|
29
31
|
/** Reset error/executing state so the form can be retried */
|
|
30
32
|
reset: () => void;
|
|
31
33
|
}
|
|
32
|
-
export declare const getEditorialWorkflowErrorMessage: (e: unknown) => string;
|
|
33
34
|
export declare function useEditorialWorkflow(): UseEditorialWorkflowResult;
|
|
@@ -41,6 +41,7 @@ export declare class TinaClient<GenQueries> {
|
|
|
41
41
|
cacheEnabled: boolean;
|
|
42
42
|
constructor({ token, url, queries, errorPolicy, cacheDir, cache, }: TinaClientArgs<GenQueries>);
|
|
43
43
|
init(): Promise<void>;
|
|
44
|
+
protected createCache(_dir: string): Promise<Cache | null>;
|
|
44
45
|
request<DataType extends Record<string, any> = any>({ errorPolicy, ...args }: TinaClientRequestArgs, options: {
|
|
45
46
|
fetchOptions?: Parameters<typeof fetch>[1];
|
|
46
47
|
}): Promise<{
|
package/package.json
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
"name": "tinacms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"typings": "dist/index.d.ts",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.14.1",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./dist/index.js",
|
|
10
|
-
"./dist/client":
|
|
10
|
+
"./dist/client": {
|
|
11
|
+
"types": "./dist/client.d.ts",
|
|
12
|
+
"browser": "./dist/client.browser.js",
|
|
13
|
+
"default": "./dist/client.js"
|
|
14
|
+
},
|
|
11
15
|
"./react": "./dist/react.js",
|
|
12
16
|
"./dist/react": "./dist/react.js",
|
|
13
17
|
"./tina-field": "./dist/tina-field.js",
|
|
@@ -30,7 +34,8 @@
|
|
|
30
34
|
{
|
|
31
35
|
"name": "src/client.ts",
|
|
32
36
|
"target": "node"
|
|
33
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"src/client.browser.ts"
|
|
34
39
|
]
|
|
35
40
|
},
|
|
36
41
|
"license": "Apache-2.0",
|
|
@@ -82,8 +87,8 @@
|
|
|
82
87
|
"color-string": "^1.9.1",
|
|
83
88
|
"date-fns": "4.1.0",
|
|
84
89
|
"es-toolkit": "^1.42.0",
|
|
85
|
-
"final-form": "
|
|
86
|
-
"final-form-arrays": "^
|
|
90
|
+
"final-form": "4.20.10",
|
|
91
|
+
"final-form-arrays": "^3.1.0",
|
|
87
92
|
"final-form-set-field-data": "^1.0.2",
|
|
88
93
|
"graphql": "15.8.0",
|
|
89
94
|
"graphql-tag": "^2.12.6",
|
|
@@ -98,7 +103,7 @@
|
|
|
98
103
|
"react-dnd": "^16.0.1",
|
|
99
104
|
"react-dnd-html5-backend": "^16.0.1",
|
|
100
105
|
"react-dropzone": "14.2.3",
|
|
101
|
-
"react-final-form": "^
|
|
106
|
+
"react-final-form": "^6.5.9",
|
|
102
107
|
"react-router-dom": "^6.30.3",
|
|
103
108
|
"react-use": "^17.6.0",
|
|
104
109
|
"tailwind-merge": "^2.6.0",
|
|
@@ -106,9 +111,9 @@
|
|
|
106
111
|
"yup": "^1.6.1",
|
|
107
112
|
"zod": "^3.24.2",
|
|
108
113
|
"@tinacms/bridge": "^0.3.1",
|
|
109
|
-
"@tinacms/mdx": "^2.2.
|
|
114
|
+
"@tinacms/mdx": "^2.2.3",
|
|
110
115
|
"@tinacms/schema-tools": "^2.10.0",
|
|
111
|
-
"@tinacms/search": "^1.2.
|
|
116
|
+
"@tinacms/search": "^1.2.25"
|
|
112
117
|
},
|
|
113
118
|
"devDependencies": {
|
|
114
119
|
"@graphql-tools/utils": "^10.8.1",
|