tinacms 2.7.8 → 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.
Files changed (47) hide show
  1. package/dist/admin/components/Page.d.ts +3 -9
  2. package/dist/admin/components/Sidebar.d.ts +0 -3
  3. package/dist/admin/pages/CollectionCreatePage.d.ts +1 -1
  4. package/dist/admin/pages/DashboardPage.d.ts +0 -3
  5. package/dist/admin/pages/ScreenPage.d.ts +0 -3
  6. package/dist/index.js +4287 -4364
  7. package/dist/index.mjs +10998 -11076
  8. package/dist/react.d.ts +13 -6
  9. package/dist/react.js +58 -52
  10. package/dist/react.mjs +58 -52
  11. package/dist/toolkit/components/media/media-item.d.ts +1 -1
  12. package/dist/toolkit/components/ui/breadcrumb.d.ts +11 -0
  13. package/dist/toolkit/components/ui/dropdown-menu.d.ts +25 -0
  14. package/dist/toolkit/fields/components/password-field.d.ts +1 -1
  15. package/dist/toolkit/fields/components/reference/components/button.d.ts +1 -1
  16. package/dist/toolkit/fields/components/reference/components/popover.d.ts +1 -1
  17. package/dist/toolkit/fields/components/reference/model/reference-link-props.d.ts +2 -0
  18. package/dist/toolkit/fields/components/select.d.ts +2 -2
  19. package/dist/toolkit/fields/components/text-field.d.ts +1 -1
  20. package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +1 -1
  21. package/dist/toolkit/fields/plugins/list-field-meta.d.ts +1 -1
  22. package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +2 -2
  23. package/dist/toolkit/form-builder/fields-builder.d.ts +1 -1
  24. package/dist/toolkit/form-builder/form-builder.d.ts +4 -5
  25. package/dist/toolkit/forms/field.d.ts +3 -0
  26. package/dist/toolkit/forms/form.d.ts +22 -3
  27. package/dist/toolkit/git-client/git-client.d.ts +25 -2
  28. package/dist/toolkit/git-client/git-file.d.ts +18 -0
  29. package/dist/toolkit/git-client/git-media-store.d.ts +13 -0
  30. package/dist/toolkit/git-client/use-git-file.d.ts +4 -0
  31. package/dist/toolkit/icons/Tina.d.ts +0 -5
  32. package/dist/toolkit/index.d.ts +1 -1
  33. package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +1 -0
  34. package/dist/toolkit/plugin-branch-switcher/index.d.ts +0 -1
  35. package/dist/toolkit/react-sidebar/components/alert.d.ts +5 -0
  36. package/dist/toolkit/react-sidebar/components/form-list.d.ts +1 -1
  37. package/dist/toolkit/react-sidebar/components/nav.d.ts +5 -3
  38. package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +0 -5
  39. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +3 -7
  40. package/dist/toolkit/react-sidebar/components/sidebar.d.ts +0 -7
  41. package/dist/toolkit/react-sidebar/components/sync-status.d.ts +5 -8
  42. package/dist/toolkit/react-sidebar/index.d.ts +1 -1
  43. package/dist/toolkit/styles/button.d.ts +2 -2
  44. package/dist/toolkit/tina-state.d.ts +11 -0
  45. package/dist/utils/cn.d.ts +2 -0
  46. package/package.json +4 -4
  47. package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +0 -2
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @deprecated as the API is clunky and hard to use. Mutations should now be
3
+ * done via Graphql. This will be removed by July 2025.
4
+ */
1
5
  export declare class GitClient {
2
6
  private baseUrl;
3
7
  constructor(baseUrl: string);
@@ -29,6 +33,9 @@ export declare class GitClient {
29
33
  * @deprecated
30
34
  */
31
35
  isAuthenticated(): boolean;
36
+ /**
37
+ * @deprecated
38
+ */
32
39
  commit(data: {
33
40
  files: string[];
34
41
  message?: string;
@@ -36,15 +43,17 @@ export declare class GitClient {
36
43
  email?: string;
37
44
  }): Promise<Response>;
38
45
  /**
39
- *
40
46
  * TODO: Add return type.
41
47
  * TODO: Remove `catch`
48
+ *
49
+ * @deprecated
42
50
  */
43
51
  push(): Promise<any>;
44
52
  /**
45
- *
46
53
  * TODO: Add return type.
47
54
  * TODO: Remove `catch`
55
+ *
56
+ * @deprecated
48
57
  */
49
58
  writeToDisk(data: {
50
59
  fileRelativePath: string;
@@ -53,6 +62,8 @@ export declare class GitClient {
53
62
  /**
54
63
  * Uploads a File to disk
55
64
  * TODO: Remove `catch`
65
+ *
66
+ * @deprecated
56
67
  */
57
68
  writeMediaToDisk(data: {
58
69
  directory: string;
@@ -62,31 +73,43 @@ export declare class GitClient {
62
73
  * TODO: rename `data.relPath` to `data.fileRelativePath`
63
74
  * TODO: Add return type.
64
75
  * TODO: Remove `catch`
76
+ *
77
+ * @deprecated
65
78
  */
66
79
  deleteFromDisk(data: {
67
80
  relPath: string;
68
81
  }): Promise<any>;
69
82
  /**
70
83
  * Resets the given files.
84
+ *
85
+ * @deprecated
71
86
  */
72
87
  reset(data: {
73
88
  files: string[];
74
89
  }): Promise<Response>;
75
90
  /**
76
91
  * Get the contents of a file or directory on disk.
92
+ *
93
+ * @deprecated
77
94
  */
78
95
  getFile(fileRelativePath: string): Promise<any>;
79
96
  /**
80
97
  * Get the contents of a file for the most recent commit.
98
+ *
99
+ * @deprecated
81
100
  */
82
101
  show(fileRelativePath: string): Promise<any>;
83
102
  /**
84
103
  * Get information about a local branch by name, or the current branch if no
85
104
  * name is specified.
105
+ *
106
+ * @deprecated
86
107
  */
87
108
  branch(name?: string): Promise<any>;
88
109
  /**
89
110
  * Get a list of the names of all local branches.
111
+ *
112
+ * @deprecated
90
113
  */
91
114
  branches(): Promise<any>;
92
115
  }
@@ -1,4 +1,8 @@
1
1
  import { CMS } from '../core';
2
+ /**
3
+ * @deprecated as the API is clunky and hard to use. Mutations should now be
4
+ * done via Graphql. This will be removed by July 2025.
5
+ */
2
6
  export declare class GitFile {
3
7
  private cms;
4
8
  relativePath: string;
@@ -7,10 +11,24 @@ export declare class GitFile {
7
11
  constructor(cms: CMS, relativePath: string, format: (file: any) => string, parse: (content: string) => any);
8
12
  /**
9
13
  * Load the contents of this file at HEAD
14
+ *
15
+ * @deprecated
10
16
  */
11
17
  show: () => Promise<any>;
18
+ /**
19
+ * @deprecated
20
+ */
12
21
  commit: () => Promise<void>;
22
+ /**
23
+ * @deprecated
24
+ */
13
25
  reset: () => void;
26
+ /**
27
+ * @deprecated
28
+ */
14
29
  write: (values: any) => void;
30
+ /**
31
+ * @deprecated
32
+ */
15
33
  private get git();
16
34
  }
@@ -1,11 +1,24 @@
1
1
  import { MediaStore, MediaUploadOptions, Media, MediaListOptions, MediaList } from '../core';
2
2
  import { GitClient } from './git-client';
3
+ /**
4
+ * @deprecated as the API is clunky and hard to use. Mutations should now be
5
+ * done via Graphql. This will be removed by July 2025.
6
+ */
3
7
  export declare class GitMediaStore implements MediaStore {
4
8
  private client;
5
9
  accept: string;
6
10
  constructor(client: GitClient);
11
+ /**
12
+ * @deprecated
13
+ */
7
14
  persist(files: MediaUploadOptions[]): Promise<Media[]>;
15
+ /**
16
+ * @deprecated
17
+ */
8
18
  list(options?: MediaListOptions): Promise<MediaList>;
19
+ /**
20
+ * @deprecated
21
+ */
9
22
  delete(media: Media): Promise<void>;
10
23
  }
11
24
  export declare const nextOffset: (offset: number, limit: number, count: number) => number;
@@ -1,2 +1,6 @@
1
1
  import { GitFile } from './git-file';
2
+ /**
3
+ * @deprecated as the API is clunky and hard to use. Mutations should now be
4
+ * done via Graphql. This will be removed by July 2025.
5
+ */
2
6
  export declare function useGitFile(relativePath: string, format: (file: any) => string, parse: (content: string) => any): GitFile;
@@ -1,8 +1,3 @@
1
- /**
2
-
3
-
4
-
5
- */
6
1
  import * as React from 'react';
7
2
  export declare const TinaIcon: ({ ...props }: {
8
3
  [x: string]: any;
@@ -19,7 +19,7 @@ export type { TinaState } from './tina-state';
19
19
  export * from './forms';
20
20
  export * from './icons';
21
21
  export * from './react-dismissible';
22
- export { Nav, LocalWarning, BillingWarning, SyncStatus, } from './react-sidebar';
22
+ export { Nav, LocalWarning, BillingWarning, SyncStatusButton, } from './react-sidebar';
23
23
  export { useCMS } from './react-core';
24
24
  /**
25
25
  * Custom `tinacms` things
@@ -1,2 +1,3 @@
1
1
  import * as React from 'react';
2
2
  export declare const BranchButton: () => React.JSX.Element;
3
+ export declare const BranchPreviewButton: (props: React.ButtonHTMLAttributes<HTMLButtonElement>) => React.JSX.Element;
@@ -2,5 +2,4 @@ export * from './plugin';
2
2
  export * from './types';
3
3
  export * from './branch-switcher';
4
4
  export * from './branch-data';
5
- export * from './branch-banner';
6
5
  export * from './branch-button';
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare const Alert: ({ children, alertStyle, className, ...props }: {
3
+ children?: React.ReactNode;
4
+ alertStyle?: "warning";
5
+ } & React.HTMLProps<HTMLDivElement>) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import type { TinaState } from '../../tina-state';
2
+ import * as React from 'react';
3
3
  type FormListItem = TinaState['formLists'][number]['items'][number];
4
4
  export interface FormsListProps {
5
5
  formList: FormListItem[];
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
2
- import type { ScreenPlugin } from '../../react-screens';
3
1
  import type { CloudConfigPlugin } from '../../react-cloud-config';
2
+ import type { ScreenPlugin } from '../../react-screens';
3
+ import * as React from 'react';
4
4
  interface NavCollection {
5
5
  label?: string;
6
6
  name: string;
@@ -8,6 +8,8 @@ interface NavCollection {
8
8
  }
9
9
  interface NavProps {
10
10
  isLocalMode: boolean;
11
+ showHamburger?: boolean;
12
+ toggleMenu: () => void;
11
13
  children?: any;
12
14
  className?: string;
13
15
  userName?: string;
@@ -38,5 +40,5 @@ interface NavProps {
38
40
  };
39
41
  }>;
40
42
  }
41
- export declare const Nav: ({ isLocalMode, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
43
+ export declare const Nav: ({ isLocalMode, showHamburger, toggleMenu, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
42
44
  export {};
@@ -1,7 +1,2 @@
1
- /**
2
-
3
-
4
-
5
- */
6
1
  import * as React from 'react';
7
2
  export declare const ResizeHandle: () => React.JSX.Element;
@@ -4,13 +4,6 @@ export interface FormsViewProps {
4
4
  loadingPlaceholder?: React.FC;
5
5
  }
6
6
  export declare const FormsView: ({ loadingPlaceholder }?: FormsViewProps) => React.JSX.Element;
7
- export interface MultiformFormHeaderProps {
8
- activeForm: {
9
- activeFieldName?: string;
10
- tinaForm: Form;
11
- };
12
- }
13
- export declare const MultiformFormHeader: ({ activeForm, }: MultiformFormHeaderProps) => React.JSX.Element;
14
7
  export interface FormHeaderProps {
15
8
  activeForm: {
16
9
  activeFieldName?: string;
@@ -18,3 +11,6 @@ export interface FormHeaderProps {
18
11
  };
19
12
  }
20
13
  export declare const FormHeader: ({ activeForm }: FormHeaderProps) => React.JSX.Element;
14
+ export declare const FormBreadcrumbs: ({ rootBreadcrumbName, ...props }: {
15
+ rootBreadcrumbName?: string;
16
+ } & React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
@@ -3,7 +3,6 @@ import type { SidebarState, SidebarStateOptions } from '../sidebar';
3
3
  export declare const SidebarContext: React.Context<any>;
4
4
  export declare const minPreviewWidth = 440;
5
5
  export declare const minSidebarWidth = 360;
6
- export declare const navBreakpoint = 1279;
7
6
  export interface SidebarProviderProps {
8
7
  sidebar: SidebarState;
9
8
  resizingSidebar: boolean;
@@ -13,9 +12,3 @@ export interface SidebarProviderProps {
13
12
  defaultState?: SidebarStateOptions['defaultState'];
14
13
  }
15
14
  export declare function SidebarProvider({ position, resizingSidebar, setResizingSidebar, defaultWidth, sidebar, }: SidebarProviderProps): React.JSX.Element;
16
- export declare const updateBodyDisplacement: ({ position, displayState, sidebarWidth, resizingSidebar, }: {
17
- position?: string;
18
- displayState: any;
19
- sidebarWidth: any;
20
- resizingSidebar: any;
21
- }) => void;
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
1
  import { TinaCMS } from '../../tina-cms';
2
+ import * as React from 'react';
3
3
  export declare const useGetEvents: (cms: TinaCMS, cursor?: string, existingEvents?: {
4
4
  message: string;
5
5
  id: string;
@@ -18,14 +18,11 @@ export declare const useGetEvents: (cms: TinaCMS, cursor?: string, existingEvent
18
18
  loading: boolean;
19
19
  error: Error;
20
20
  };
21
- export declare const SyncErrorWidget: ({ cms }: {
22
- cms: any;
23
- }) => React.JSX.Element;
24
21
  export declare const SyncStatusModal: ({ closeEventsModal, cms }: {
25
22
  closeEventsModal: any;
26
23
  cms: any;
27
24
  }) => React.JSX.Element;
28
- export declare const SyncStatus: ({ cms, setEventsOpen }: {
29
- cms: any;
30
- setEventsOpen: any;
31
- }) => React.JSX.Element;
25
+ export declare const SyncStatusButton: ({ cms, setEventsOpen, ...buttonProps }: {
26
+ cms: TinaCMS;
27
+ setEventsOpen: (open: boolean) => void;
28
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>) => React.JSX.Element;
@@ -2,4 +2,4 @@ export * from './sidebar';
2
2
  export { SidebarProvider } from './components/sidebar';
3
3
  export { Nav } from './components/nav';
4
4
  export { LocalWarning, BillingWarning } from './components/local-warning';
5
- export { SyncStatus } from './components/sync-status';
5
+ export { SyncStatusButton } from './components/sync-status';
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
- variant?: 'primary' | 'secondary' | 'white' | 'ghost' | 'danger';
3
+ variant?: 'primary' | 'secondary' | 'white' | 'ghost' | 'danger' | 'custom';
4
4
  as?: React.ElementType;
5
5
  href?: string;
6
6
  target?: string;
7
7
  size?: 'small' | 'medium' | 'custom';
8
8
  busy?: boolean;
9
- rounded?: 'full' | 'left' | 'right' | 'custom';
9
+ rounded?: 'full' | 'left' | 'right' | 'custom' | 'none';
10
10
  disabled?: boolean;
11
11
  className?: string;
12
12
  children?: React.ReactNode;
@@ -15,6 +15,12 @@ type FormList = {
15
15
  items: FormListItem[];
16
16
  formIds: string[];
17
17
  };
18
+ type Breadcrumb = {
19
+ label: string;
20
+ formId: string;
21
+ formName: string;
22
+ namespace: string[];
23
+ };
18
24
  export type TinaAction = {
19
25
  type: 'forms:add';
20
26
  value: Form;
@@ -63,6 +69,7 @@ export type TinaAction = {
63
69
  value: boolean;
64
70
  };
65
71
  export interface TinaState {
72
+ breadcrumbs: Breadcrumb[];
66
73
  activeFormId: string | null;
67
74
  /**
68
75
  * Forms are wrapped here because we need `activeFieldName` to be reactive, so adding it as a propery
@@ -85,4 +92,8 @@ export interface TinaState {
85
92
  }
86
93
  export declare const initialState: (cms: TinaCMS) => TinaState;
87
94
  export declare function tinaReducer(state: TinaState, action: TinaAction): TinaState;
95
+ export declare function calculateBreadcrumbs(forms: {
96
+ activeFieldName?: string | null;
97
+ tinaForm: Form;
98
+ }[], activeFormId: string, activeFieldName?: string): Breadcrumb[];
88
99
  export {};
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "2.7.8",
3
+ "version": "2.7.9",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -129,9 +129,9 @@
129
129
  "webfontloader": "1.6.28",
130
130
  "yup": "^1.6.1",
131
131
  "zod": "^3.24.2",
132
- "@tinacms/mdx": "1.6.3",
133
- "@tinacms/search": "1.0.45",
134
- "@tinacms/schema-tools": "1.7.4"
132
+ "@tinacms/mdx": "1.7.0",
133
+ "@tinacms/schema-tools": "1.8.0",
134
+ "@tinacms/search": "1.0.46"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@graphql-tools/utils": "^10.8.1",
@@ -1,2 +0,0 @@
1
- import * as React from 'react';
2
- export declare const BranchBanner: () => React.JSX.Element;