tinacms 3.7.1 → 3.7.3

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.
@@ -9,6 +9,7 @@ interface TinaSearchConfig {
9
9
  fuzzyOptions?: FuzzySearchOptions;
10
10
  }
11
11
  import gql from 'graphql-tag';
12
+ import { EditorialWorkflowResult } from '../toolkit/form-builder/editorial-workflow-constants';
12
13
  import { TinaCloudProject } from './types';
13
14
  export * from './authProvider';
14
15
  export type OnLoginFunc = (args: {
@@ -86,6 +87,7 @@ export declare class Client {
86
87
  variables: object;
87
88
  }): Promise<ReturnType>;
88
89
  get appDashboardLink(): string;
90
+ get gitSettingsLink(): string;
89
91
  checkSyncStatus({ assetsSyncing, }: {
90
92
  assetsSyncing: string[];
91
93
  }): Promise<{
@@ -145,6 +147,7 @@ export declare class Client {
145
147
  githubPullRequestUrl?: string;
146
148
  }[]>;
147
149
  usingProtectedBranch(): boolean;
150
+ branchExists(branchName: string): Promise<boolean>;
148
151
  createBranch({ baseBranch, branchName }: BranchData): Promise<string>;
149
152
  getLatestVersion(): Promise<LatestVersionResponse>;
150
153
  /**
@@ -165,7 +168,7 @@ export declare class Client {
165
168
  status: string;
166
169
  message?: string;
167
170
  }) => void;
168
- }): Promise<any>;
171
+ }): Promise<EditorialWorkflowResult>;
169
172
  }
170
173
  export declare const DEFAULT_LOCAL_TINA_GQL_SERVER_URL = "http://localhost:4001/graphql";
171
174
  export declare class LocalClient extends Client {
@@ -72,3 +72,23 @@ export declare const SlashCommandUsedEvent: string;
72
72
  export type SlashCommandUsedPayload = {
73
73
  command: string;
74
74
  };
75
+ export declare const MediaUsageDashboardOpenedEvent: string;
76
+ export type MediaUsageDashboardOpenedPayload = Record<string, never>;
77
+ export declare const MediaUsageDashboardRefreshedEvent: string;
78
+ export type MediaUsageDashboardRefreshedPayload = {
79
+ errorOccured?: boolean;
80
+ };
81
+ export declare const MediaUsageDashboardTypeFilterEvent: string;
82
+ export type MediaUsageDashboardTypeFilterPayload = {
83
+ type: 'all' | 'image' | 'video' | 'other';
84
+ };
85
+ export declare const MediaUsageDashboardUsageFilterChangedEvent: string;
86
+ export type MediaUsageDashboardUsageFilterChangedPayload = {
87
+ usage: 'all' | 'used' | 'unused';
88
+ };
89
+ export declare const MediaUsageDashboardRowExpandedEvent: string;
90
+ export type MediaUsageDashboardRowExpandedEvent = Record<string, never>;
91
+ export declare const MediaUsageDashboardPreviewOpenedEvent: string;
92
+ export type MediaUsageDashboardPreviewOpenedPayload = Record<string, never>;
93
+ export declare const MediaUsageDashboardDocumentLinkClickedEvent: string;
94
+ export type MediaUsageDashboardDocumentLinkClickedEvent = Record<string, never>;
@@ -71,6 +71,13 @@ export interface MediaStore {
71
71
  * @default false
72
72
  */
73
73
  isStatic?: boolean;
74
+ /**
75
+ * Converts a Media object to the value stored in a form field.
76
+ *
77
+ * Typically returns `media.src`. If not implemented, the image field
78
+ * plugin falls back to `media.src`.
79
+ */
80
+ parse?(media: Media): string;
74
81
  }
75
82
  export declare type MediaListOffset = string | number;
76
83
  /**
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export declare const DisplayOnlyFieldPlugin: {
3
+ name: string;
4
+ Component: (props: any) => React.JSX.Element;
5
+ };
6
+ export declare const InfoBox: ({ message, links, }: {
7
+ message: string;
8
+ links?: {
9
+ text: string;
10
+ url: string;
11
+ }[];
12
+ }) => React.FC<any>;
@@ -18,3 +18,4 @@ export * from './reference-field-plugin';
18
18
  export * from './button-toggle-field-plugin';
19
19
  export * from './hidden-field-plugin';
20
20
  export * from './password-field-plugin';
21
+ export * from './display-only-field-plugin';
@@ -1,4 +1,5 @@
1
- export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'strikethrough' | 'highlight' | 'mermaid' | 'raw' | 'embed' | 'table' | 'hr';
1
+ import type { ToolbarOverrideType } from '@tinacms/schema-tools';
2
+ export type { ToolbarOverrideType };
2
3
  export declare const STANDARD_ICON_WIDTH = 32;
3
4
  export declare const HEADING_ICON_WITH_TEXT = 127;
4
5
  export declare const HEADING_ICON_ONLY = 58;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { Form } from '../forms';
3
+ export declare const BranchDeletedModal: ({ branchName, close, path, values, crudType, tinaForm, }: {
4
+ branchName: string;
5
+ close: () => void;
6
+ path: string;
7
+ values: Record<string, unknown>;
8
+ crudType: string;
9
+ tinaForm?: Form;
10
+ }) => React.JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { Form } from '../forms';
3
- export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crudType, tinaForm, }: {
3
+ export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crudType, tinaForm, onBaseBranchDeleted, }: {
4
4
  safeSubmit: () => Promise<void>;
5
5
  close: () => void;
6
6
  path: string;
7
7
  values: Record<string, unknown>;
8
8
  crudType: string;
9
9
  tinaForm?: Form;
10
+ onBaseBranchDeleted?: () => void;
10
11
  }) => React.JSX.Element;
11
12
  export declare const PrefixedTextField: ({ label, prefix, ...props }: {
12
13
  [x: string]: any;
@@ -32,3 +32,11 @@ export type EditorialWorkflowErrorDetails = Error & {
32
32
  errorCode?: string;
33
33
  conflictingBranch?: string;
34
34
  };
35
+ /**
36
+ * Result from a completed editorial workflow operation
37
+ */
38
+ export interface EditorialWorkflowResult {
39
+ branchName: string;
40
+ pullRequestUrl: string;
41
+ warning?: string;
42
+ }
@@ -0,0 +1,26 @@
1
+ import { Form } from '../forms';
2
+ export declare const WORKFLOW_STEPS: {
3
+ id: number;
4
+ name: string;
5
+ description: string;
6
+ }[];
7
+ export declare const formatTime: (seconds: number) => string;
8
+ export interface ExecuteWorkflowOptions {
9
+ branchName: string;
10
+ baseBranch: string;
11
+ path: string;
12
+ values: Record<string, unknown>;
13
+ crudType: string;
14
+ tinaForm?: Form;
15
+ }
16
+ export interface UseEditorialWorkflowResult {
17
+ isExecuting: boolean;
18
+ errorMessage: string;
19
+ currentStep: number;
20
+ elapsedTime: number;
21
+ /** Returns true on success, false on failure (error captured in errorMessage) */
22
+ executeWorkflow: (opts: ExecuteWorkflowOptions) => Promise<boolean>;
23
+ /** Reset error/executing state so the form can be retried */
24
+ reset: () => void;
25
+ }
26
+ export declare function useEditorialWorkflow(): UseEditorialWorkflowResult;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ interface WorkflowProgressIndicatorProps {
3
+ currentStep: number;
4
+ isExecuting: boolean;
5
+ elapsedTime: number;
6
+ }
7
+ export declare const WorkflowProgressIndicator: ({ currentStep, isExecuting, elapsedTime, }: WorkflowProgressIndicatorProps) => React.JSX.Element;
8
+ export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tinacms",
3
3
  "type": "module",
4
4
  "typings": "dist/index.d.ts",
5
- "version": "3.7.1",
5
+ "version": "3.7.3",
6
6
  "main": "dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "exports": {
@@ -114,9 +114,9 @@
114
114
  "webfontloader": "1.6.28",
115
115
  "yup": "^1.6.1",
116
116
  "zod": "^3.24.2",
117
- "@tinacms/mdx": "2.1.0",
118
- "@tinacms/schema-tools": "2.7.0",
119
- "@tinacms/search": "1.2.8"
117
+ "@tinacms/schema-tools": "2.7.2",
118
+ "@tinacms/search": "1.2.10",
119
+ "@tinacms/mdx": "2.1.2"
120
120
  },
121
121
  "devDependencies": {
122
122
  "@graphql-tools/utils": "^10.8.1",