tinacms 0.0.0-9bb408f-20241030010559 → 0.0.0-9d35253-20251202065744

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 (194) hide show
  1. package/README.md +1 -1
  2. package/dist/__vite-browser-external-d06ac358.js +4 -0
  3. package/dist/admin/api.d.ts +5 -1
  4. package/dist/admin/components/{Sidebar.d.ts → AdminNav.d.ts} +0 -3
  5. package/dist/admin/components/GetCollection.d.ts +2 -2
  6. package/dist/admin/components/Page.d.ts +3 -9
  7. package/dist/admin/components/ui/tooltip.d.ts +7 -0
  8. package/dist/admin/pages/CollectionCreatePage.d.ts +1 -1
  9. package/dist/admin/pages/CollectionListPage.d.ts +2 -2
  10. package/dist/admin/pages/DashboardPage.d.ts +0 -3
  11. package/dist/admin/pages/ScreenPage.d.ts +0 -3
  12. package/dist/admin/types.d.ts +3 -0
  13. package/dist/auth/AuthModal.d.ts +1 -4
  14. package/dist/auth/TinaCloudProvider.d.ts +1 -2
  15. package/dist/client.js +135 -153
  16. package/dist/hooks/create-page-plugin.d.ts +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +121822 -32492
  19. package/dist/internalClient/index.d.ts +28 -3
  20. package/dist/node-cache-c9558e1e.js +63 -0
  21. package/dist/react.d.ts +14 -6
  22. package/dist/react.js +209 -192
  23. package/dist/rich-text/index.d.ts +6 -0
  24. package/dist/rich-text/index.js +234 -224
  25. package/dist/rich-text/prism.js +16 -18
  26. package/dist/rich-text/static.d.ts +154 -0
  27. package/dist/rich-text/{index.mjs → static.js} +99 -99
  28. package/dist/tina-cms.d.ts +1 -1
  29. package/dist/toolkit/components/ProgressBar.d.ts +11 -0
  30. package/dist/toolkit/components/media/media-item.d.ts +11 -1
  31. package/dist/toolkit/components/media/media-manager.d.ts +1 -1
  32. package/dist/toolkit/components/ui/breadcrumb.d.ts +11 -0
  33. package/dist/toolkit/components/ui/button.d.ts +11 -0
  34. package/dist/toolkit/components/ui/calendar.d.ts +8 -0
  35. package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
  36. package/dist/toolkit/components/ui/dropdown-menu.d.ts +25 -0
  37. package/dist/toolkit/components/ui/input.d.ts +3 -0
  38. package/dist/toolkit/components/ui/popover.d.ts +7 -0
  39. package/dist/toolkit/components/ui/select.d.ts +13 -0
  40. package/dist/toolkit/fields/components/password-field.d.ts +1 -1
  41. package/dist/toolkit/fields/components/reference/components/button.d.ts +2 -2
  42. package/dist/toolkit/fields/components/reference/components/command.d.ts +21 -33
  43. package/dist/toolkit/fields/components/reference/components/popover.d.ts +1 -1
  44. package/dist/toolkit/fields/components/reference/model/reference-link-props.d.ts +2 -0
  45. package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
  46. package/dist/toolkit/fields/components/select.d.ts +2 -2
  47. package/dist/toolkit/fields/components/text-field.d.ts +1 -1
  48. package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
  49. package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
  50. package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
  51. package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
  52. package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +1 -1
  53. package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -1
  54. package/dist/toolkit/fields/plugins/list-field-meta.d.ts +1 -1
  55. package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -0
  56. package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +5 -2
  57. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +20 -18
  58. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +14 -10
  59. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +5 -5
  60. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +17 -0
  61. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/error-message.d.ts +6 -0
  62. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-combobox.d.ts +6 -0
  63. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-toolbar-button.d.ts +6 -6
  64. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-leaf.d.ts +2 -11
  65. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +14 -10
  66. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-syntax-leaf.d.ts +2 -11
  67. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +112 -0
  68. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dialog.d.ts +12 -0
  69. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dropdown-menu.d.ts +10 -10
  70. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/floating-toolbar.d.ts +2 -2
  71. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-element.d.ts +3 -0
  72. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-toolbar-button.d.ts +18 -0
  73. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -1
  74. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/image-toolbar-button.d.ts +6 -6
  75. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +6 -7
  76. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/inline-combobox.d.ts +1 -1
  77. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/input.d.ts +3 -3
  78. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-element.d.ts +4 -11
  79. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-floating-toolbar.d.ts +4 -5
  80. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-toolbar-button.d.ts +4 -4
  81. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +28 -11
  82. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
  83. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +3 -10
  84. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +6 -8
  85. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +15 -0
  86. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/popover.d.ts +7 -2
  87. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/quote-toolbar-button.d.ts +6 -6
  88. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/raw-markdown-toolbar-button.d.ts +6 -6
  89. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +24 -21
  90. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/separator.d.ts +2 -2
  91. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +15 -11
  92. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/block-selection.d.ts +6 -0
  93. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +33 -0
  94. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/{table-dropdown-menu.d.ts → table/table-dropdown-menu.d.ts} +1 -0
  95. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +20 -0
  96. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +15 -0
  97. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/toolbar.d.ts +7 -7
  98. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +10 -0
  99. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-state.d.ts +22 -0
  100. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/hooks/use-create-editor.d.ts +6 -0
  101. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +1 -1
  102. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-block.d.ts +1 -1
  103. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-lists.d.ts +1 -1
  104. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-marks.d.ts +1 -1
  105. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-utils.d.ts +3 -5
  106. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +11 -6
  107. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +18 -2
  108. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/index.d.ts +0 -1
  109. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-html-block/index.d.ts +6 -0
  110. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/index.d.ts +2 -2
  111. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-invalid-markdown-plugin/index.d.ts +5 -5
  112. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +7 -4
  113. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/index.d.ts +3 -5
  114. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +520 -0
  115. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +262 -212
  116. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/floating-toolbar-plugin.d.ts +1 -0
  117. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +5 -1
  118. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +2 -2
  119. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/is-url.d.ts +1 -2
  120. package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
  121. package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
  122. package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
  123. package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
  124. package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
  125. package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +17 -0
  126. package/dist/toolkit/form-builder/fields-builder.d.ts +1 -1
  127. package/dist/toolkit/form-builder/form-builder.d.ts +8 -9
  128. package/dist/toolkit/form-builder/index.d.ts +1 -0
  129. package/dist/toolkit/forms/field.d.ts +3 -0
  130. package/dist/toolkit/forms/form.d.ts +22 -3
  131. package/dist/toolkit/git-client/git-client.d.ts +25 -2
  132. package/dist/toolkit/git-client/git-file.d.ts +18 -0
  133. package/dist/toolkit/git-client/git-media-store.d.ts +13 -0
  134. package/dist/toolkit/git-client/use-git-file.d.ts +4 -0
  135. package/dist/toolkit/icons/Tina.d.ts +0 -5
  136. package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
  137. package/dist/toolkit/icons/index.d.ts +1 -0
  138. package/dist/toolkit/index.d.ts +1 -1
  139. package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +4 -1
  140. package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
  141. package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
  142. package/dist/toolkit/plugin-branch-switcher/index.d.ts +0 -1
  143. package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
  144. package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
  145. package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
  146. package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
  147. package/dist/toolkit/react-sidebar/components/VersionInfo.d.ts +2 -0
  148. package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
  149. package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
  150. package/dist/toolkit/react-sidebar/components/form-list.d.ts +1 -1
  151. package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
  152. package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
  153. package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
  154. package/dist/toolkit/react-sidebar/components/nav.d.ts +6 -3
  155. package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +0 -5
  156. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +7 -10
  157. package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
  158. package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
  159. package/dist/toolkit/react-sidebar/components/sidebar.d.ts +0 -7
  160. package/dist/toolkit/react-sidebar/components/sync-status.d.ts +5 -8
  161. package/dist/toolkit/react-sidebar/index.d.ts +4 -1
  162. package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
  163. package/dist/toolkit/styles/button.d.ts +2 -2
  164. package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
  165. package/dist/toolkit/styles/index.d.ts +1 -0
  166. package/dist/toolkit/tina-cms.d.ts +3 -3
  167. package/dist/toolkit/tina-state.d.ts +15 -0
  168. package/dist/unifiedClient/index.d.ts +8 -1
  169. package/dist/utils/cn.d.ts +2 -0
  170. package/dist/utils/index.d.ts +1 -0
  171. package/package.json +85 -100
  172. package/dist/admin/pages/IndexingPage.d.ts +0 -2
  173. package/dist/client.mjs +0 -109
  174. package/dist/index.mjs +0 -33831
  175. package/dist/node-cache-4c336858.mjs +0 -50
  176. package/dist/react.mjs +0 -234
  177. package/dist/rich-text/prism.mjs +0 -16
  178. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-element.d.ts +0 -11
  179. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +0 -27
  180. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +0 -14
  181. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +0 -13
  182. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/with-correct-void-behavior.d.ts +0 -8
  183. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-code-block/index.d.ts +0 -3
  184. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts +0 -15
  185. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +0 -2
  186. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/create-soft-break-plugin.d.ts +0 -7
  187. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/index.d.ts +0 -6
  188. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/on-key-down-soft-break.d.ts +0 -5
  189. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/types.d.ts +0 -11
  190. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +0 -11
  191. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/insert-empty-block.d.ts +0 -2
  192. package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +0 -2
  193. package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
  194. package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const SidebarLoadingPlaceholder: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const SidebarNoFormsPlaceholder: () => 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,7 @@ 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';
6
+ export { NavCloudLink } from './components/nav-components';
7
+ export { NavProvider, useNav } from './components/nav-context';
8
+ export { NavMenuTrigger } from './components/NavMenuTrigger';
@@ -1,5 +1,5 @@
1
- import { EventBus, Callback } from '../core';
2
1
  import * as React from 'react';
2
+ import { Callback, EventBus } from '../core';
3
3
  export interface SidebarStateOptions {
4
4
  position?: SidebarPosition;
5
5
  buttons?: SidebarButtons;
@@ -22,7 +22,7 @@ export declare type DefaultSidebarState = 'open' | 'closed';
22
22
  export declare class SidebarState {
23
23
  private events;
24
24
  private _isOpen;
25
- placeholder: React.FC;
25
+ loadingPlaceholder: React.FC;
26
26
  defaultState: DefaultSidebarState;
27
27
  position: SidebarPosition;
28
28
  renderNav: boolean;
@@ -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' | 'accent' | '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;
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ import { ButtonProps } from './button';
3
+ export interface DropdownButtonItem {
4
+ label: string;
5
+ onClick: () => void;
6
+ variant?: 'default' | 'destructive';
7
+ icon?: React.ReactNode;
8
+ disabled?: boolean;
9
+ }
10
+ export interface DropdownButtonProps extends Omit<ButtonProps, 'onClick'> {
11
+ /**
12
+ * The main action to perform when the button is clicked
13
+ */
14
+ onMainAction?: () => void;
15
+ /**
16
+ * Array of dropdown menu items
17
+ */
18
+ items: DropdownButtonItem[];
19
+ /**
20
+ * Whether to show the dropdown arrow in a split button style
21
+ * @default true
22
+ */
23
+ showSplitButton?: boolean;
24
+ /**
25
+ * Alignment of the dropdown menu
26
+ * @default 'end'
27
+ */
28
+ align?: 'start' | 'center' | 'end';
29
+ }
30
+ /**
31
+ * A button component that combines a primary action with a dropdown menu of additional options.
32
+ *
33
+ * This component follows the split-button pattern found in TinaCMS, where the main button
34
+ * performs a primary action and a small arrow button opens a dropdown menu with additional options.
35
+ *
36
+ * @example
37
+ * // Basic usage with split button
38
+ * <DropdownButton
39
+ * variant="primary"
40
+ * onMainAction={() => console.log('Save to new branch')}
41
+ * items={[
42
+ * { label: 'Save to protected branch', onClick: () => console.log('Protected') },
43
+ * { label: 'Save and publish', onClick: () => console.log('Publish') },
44
+ * ]}
45
+ * >
46
+ * Save to new branch
47
+ * </DropdownButton>
48
+ *
49
+ * @example
50
+ * // Dropdown-only button (no main action)
51
+ * <DropdownButton
52
+ * variant="secondary"
53
+ * showSplitButton={false}
54
+ * items={[
55
+ * { label: 'Save to new branch', onClick: () => console.log('New branch') },
56
+ * { label: 'Save to protected branch', onClick: () => console.log('Protected') },
57
+ * ]}
58
+ * >
59
+ * Save options
60
+ * </DropdownButton>
61
+ *
62
+ * @example
63
+ * // With icons and destructive action
64
+ * <DropdownButton
65
+ * variant="primary"
66
+ * onMainAction={() => console.log('Save')}
67
+ * items={[
68
+ * { label: 'Duplicate', onClick: () => console.log('Duplicate'), icon: <CopyIcon /> },
69
+ * { label: 'Delete', onClick: () => console.log('Delete'), variant: 'destructive', icon: <TrashIcon /> },
70
+ * ]}
71
+ * >
72
+ * Save
73
+ * </DropdownButton>
74
+ */
75
+ export declare const DropdownButton: React.ForwardRefExoticComponent<DropdownButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -2,3 +2,4 @@ export * from './button';
2
2
  export * from './font-loader';
3
3
  export * from './overflow-menu';
4
4
  export * from './message';
5
+ export * from './dropdown-button';
@@ -1,11 +1,11 @@
1
+ import { Alerts, type EventsToAlerts } from './alerts';
1
2
  import { CMS, type CMSConfig, type PluginType } from './core';
2
3
  import type { FieldPlugin } from './form-builder';
3
- import type { ScreenPlugin } from './react-screens';
4
4
  import type { Form } from './forms';
5
- import { Alerts, type EventsToAlerts } from './alerts';
5
+ import type { ScreenPlugin } from './react-screens';
6
6
  import { SidebarState, type SidebarStateOptions } from './react-sidebar';
7
- import type { TinaAction, TinaState } from './tina-state';
8
7
  import type { Client } from '../internalClient';
8
+ import type { TinaAction, TinaState } from './tina-state';
9
9
  export interface TinaCMSConfig extends CMSConfig {
10
10
  sidebar?: SidebarStateOptions | boolean;
11
11
  alerts?: EventsToAlerts;
@@ -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;
@@ -58,8 +64,12 @@ export type TinaAction = {
58
64
  } | {
59
65
  type: 'sidebar:set-display-state';
60
66
  value: TinaState['sidebarDisplayState'] | 'openOrFull';
67
+ } | {
68
+ type: 'sidebar:set-loading-state';
69
+ value: boolean;
61
70
  };
62
71
  export interface TinaState {
72
+ breadcrumbs: Breadcrumb[];
63
73
  activeFormId: string | null;
64
74
  /**
65
75
  * Forms are wrapped here because we need `activeFieldName` to be reactive, so adding it as a propery
@@ -76,9 +86,14 @@ export interface TinaState {
76
86
  }[];
77
87
  formLists: FormList[];
78
88
  editingMode: 'visual' | 'basic';
89
+ isLoadingContent: boolean;
79
90
  quickEditSupported: boolean;
80
91
  sidebarDisplayState: 'closed' | 'open' | 'fullscreen';
81
92
  }
82
93
  export declare const initialState: (cms: TinaCMS) => TinaState;
83
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[];
84
99
  export {};
@@ -1,4 +1,6 @@
1
1
  import type { Config } from '@tinacms/schema-tools';
2
+ import AsyncLock from 'async-lock';
3
+ import type { GraphQLError } from 'graphql';
2
4
  import type { Cache } from '../cache/index';
3
5
  export declare const TINA_HOST = "content.tinajs.io";
4
6
  export interface TinaClientArgs<GenQueries = Record<string, unknown>> {
@@ -25,12 +27,17 @@ export declare class TinaClient<GenQueries> {
25
27
  queries: GenQueries;
26
28
  errorPolicy: Config['client']['errorPolicy'];
27
29
  initialized: boolean;
30
+ cacheLock: AsyncLock | undefined;
28
31
  cacheDir: string;
29
32
  cache: Cache;
30
33
  constructor({ token, url, queries, errorPolicy, cacheDir, }: TinaClientArgs<GenQueries>);
31
34
  init(): Promise<void>;
32
35
  request<DataType extends Record<string, any> = any>({ errorPolicy, ...args }: TinaClientRequestArgs, options: {
33
36
  fetchOptions?: Parameters<typeof fetch>[1];
34
- }): Promise<any>;
37
+ }): Promise<{
38
+ data: DataType;
39
+ errors: GraphQLError[] | null;
40
+ query: string;
41
+ }>;
35
42
  }
36
43
  export declare function createClient<GenQueries>(args: TinaClientArgs<GenQueries>): TinaClient<GenQueries>;
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -20,3 +20,4 @@ export interface CreateClientProps {
20
20
  export declare const createClient: ({ clientId, isLocalClient, branch, tinaioConfig, schema, apiUrl, tinaGraphQLVersion, }: CreateClientProps) => Client;
21
21
  export declare function assertShape<T>(value: unknown, yupSchema: (args: typeof yup) => yup.AnySchema, errorMessage?: string): asserts value is T;
22
22
  export declare function safeAssertShape<T>(value: unknown, yupSchema: (args: typeof yup) => yup.AnySchema): boolean;
23
+ export declare const get: (obj: any, path: any, defaultValue?: any) => any;
package/package.json CHANGED
@@ -1,39 +1,19 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "0.0.0-9bb408f-20241030010559",
3
+ "type": "module",
4
+ "typings": "dist/index.d.ts",
5
+ "version": "0.0.0-9d35253-20251202065744",
4
6
  "main": "dist/index.js",
5
- "module": "./dist/index.mjs",
7
+ "module": "./dist/index.js",
6
8
  "exports": {
7
- ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.mjs",
10
- "require": "./dist/index.js"
11
- },
12
- "./dist/client": {
13
- "types": "./dist/client.d.ts",
14
- "import": "./dist/client.mjs",
15
- "require": "./dist/client.js"
16
- },
17
- "./dist/edit-state": {
18
- "types": "./dist/edit-state.d.ts",
19
- "import": "./dist/edit-state.mjs",
20
- "require": "./dist/edit-state.js"
21
- },
22
- "./dist/react": {
23
- "types": "./dist/react.d.ts",
24
- "import": "./dist/react.mjs",
25
- "require": "./dist/react.js"
26
- },
27
- "./dist/rich-text": {
28
- "types": "./dist/rich-text/index.d.ts",
29
- "import": "./dist/rich-text/index.mjs",
30
- "require": "./dist/rich-text/index.js"
31
- },
32
- "./dist/rich-text/prism": {
33
- "types": "./dist/rich-text/prism.d.ts",
34
- "import": "./dist/rich-text/prism.mjs",
35
- "require": "./dist/rich-text/prism.js"
36
- }
9
+ ".": "./dist/index.js",
10
+ "./dist/client": "./dist/client.js",
11
+ "./dist/edit-state": "./dist/edit-state.js",
12
+ "./react": "./dist/react.js",
13
+ "./dist/react": "./dist/react.js",
14
+ "./dist/rich-text": "./dist/rich-text/index.js",
15
+ "./dist/rich-text/static": "./dist/rich-text/static.js",
16
+ "./dist/rich-text/prism": "./dist/rich-text/prism.js"
37
17
  },
38
18
  "files": [
39
19
  "dist"
@@ -42,6 +22,7 @@
42
22
  "entryPoints": [
43
23
  "src/index.ts",
44
24
  "src/rich-text/index.tsx",
25
+ "src/rich-text/static.tsx",
45
26
  "src/rich-text/prism.tsx",
46
27
  "src/react.tsx",
47
28
  "src/client.ts"
@@ -57,114 +38,118 @@
57
38
  }
58
39
  }
59
40
  },
60
- "typings": "dist/index.d.ts",
61
41
  "license": "Apache-2.0",
62
42
  "dependencies": {
63
- "@ariakit/react": "^0.4.11",
64
- "@floating-ui/dom": "^1.6.11",
43
+ "@ariakit/react": "^0.4.15",
44
+ "@dnd-kit/core": "^6.1.0",
45
+ "@dnd-kit/sortable": "^8.0.0",
46
+ "@dnd-kit/utilities": "^3.2.2",
47
+ "@floating-ui/dom": "^1.6.13",
65
48
  "@floating-ui/react-dom": "^2.1.2",
66
- "@graphql-inspector/core": "^6.1.0",
49
+ "@graphql-inspector/core": "^6.2.1",
67
50
  "@headlessui/react": "2.1.8",
68
51
  "@heroicons/react": "^1.0.6",
69
- "@monaco-editor/react": "4.4.5",
70
- "@radix-ui/react-checkbox": "^1.1.1",
71
- "@radix-ui/react-dialog": "^1.1.1",
72
- "@radix-ui/react-dropdown-menu": "^2.1.1",
73
- "@radix-ui/react-popover": "^1.1.1",
74
- "@radix-ui/react-separator": "^1.1.0",
75
- "@radix-ui/react-slot": "^1.1.0",
76
- "@radix-ui/react-toolbar": "^1.1.0",
77
- "@radix-ui/react-tooltip": "^1.1.2",
52
+ "@monaco-editor/react": "4.7.0-rc.0",
53
+ "@radix-ui/react-checkbox": "^1.1.4",
54
+ "@radix-ui/react-dialog": "^1.1.6",
55
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
56
+ "@radix-ui/react-popover": "^1.1.15",
57
+ "@radix-ui/react-select": "^2.2.6",
58
+ "@radix-ui/react-separator": "^1.1.2",
59
+ "@radix-ui/react-slot": "^1.1.2",
60
+ "@radix-ui/react-toolbar": "^1.1.2",
61
+ "@radix-ui/react-tooltip": "^1.2.8",
78
62
  "@react-hook/window-size": "^3.1.1",
79
- "@udecode/cn": "^33.0.0",
80
- "@udecode/plate": "^36.5.9",
81
- "@udecode/plate-autoformat": "^36.5.6",
82
- "@udecode/plate-block-quote": "^36.0.0",
83
- "@udecode/plate-code-block": "^36.5.6",
84
- "@udecode/plate-combobox": "^36.0.0",
85
- "@udecode/plate-common": "^36.5.9",
86
- "@udecode/plate-floating": "^36.3.8",
87
- "@udecode/plate-heading": "^36.0.12",
88
- "@udecode/plate-indent-list": "^36.5.2",
89
- "@udecode/plate-link": "^36.5.9",
90
- "@udecode/plate-list": "^36.5.2",
91
- "@udecode/plate-paragraph": "^36.0.0",
92
- "@udecode/plate-resizable": "36.0.0",
93
- "@udecode/plate-slash-command": "^36.0.0",
94
- "@udecode/plate-table": "36.5.8",
95
- "class-variance-authority": "^0.7.0",
63
+ "@udecode/cmdk": "^0.2.1",
64
+ "@udecode/cn": "^48.0.3",
65
+ "@udecode/plate": "^48.0.3",
66
+ "@udecode/plate-autoformat": "^48.0.0",
67
+ "@udecode/plate-basic-marks": "^48.0.0",
68
+ "@udecode/plate-block-quote": "^48",
69
+ "@udecode/plate-break": "^48",
70
+ "@udecode/plate-code-block": "^48.0.0",
71
+ "@udecode/plate-combobox": "^48",
72
+ "@udecode/plate-dnd": "^48.0.0",
73
+ "@udecode/plate-floating": "^48.0.0",
74
+ "@udecode/plate-heading": "^48",
75
+ "@udecode/plate-horizontal-rule": "^48",
76
+ "@udecode/plate-indent-list": "^48.0.0",
77
+ "@udecode/plate-link": "^48.0.0",
78
+ "@udecode/plate-list": "^48.0.0",
79
+ "@udecode/plate-node-id": "^48.0.0",
80
+ "@udecode/plate-reset-node": "^48",
81
+ "@udecode/plate-resizable": "^48",
82
+ "@udecode/plate-selection": "^48.0.0",
83
+ "@udecode/plate-slash-command": "^48.0.0",
84
+ "@udecode/plate-table": "^48.0.0",
85
+ "@udecode/plate-trailing-block": "^48.0.0",
86
+ "add": "^2.0.6",
87
+ "async-lock": "^1.4.1",
88
+ "class-variance-authority": "^0.7.1",
96
89
  "clsx": "^2.1.1",
97
- "cmdk": "^1.0.0",
90
+ "cmdk": "^1.0.4",
98
91
  "color-string": "^1.9.1",
99
92
  "crypto-js": "^4.2.0",
100
93
  "date-fns": "2.30.0",
101
- "fetch-ponyfill": "^7.1.0",
94
+ "es-toolkit": "^1.42.0",
102
95
  "final-form": "4.20.10",
103
96
  "final-form-arrays": "^3.1.0",
104
97
  "final-form-set-field-data": "^1.0.2",
105
98
  "graphql": "15.8.0",
106
99
  "graphql-tag": "^2.12.6",
107
100
  "is-hotkey": "^0.2.0",
108
- "lodash.get": "^4.4.2",
109
- "lodash.set": "^4.3.2",
110
101
  "lucide-react": "^0.424.0",
111
102
  "mermaid": "9.3.0",
112
103
  "moment": "2.29.4",
104
+ "moment-timezone": "^0.6.0",
113
105
  "monaco-editor": "0.31.0",
114
- "prism-react-renderer": "^2.4.0",
106
+ "prism-react-renderer": "^2.4.1",
115
107
  "prop-types": "15.7.2",
116
- "react-beautiful-dnd": "^13.1.1",
117
108
  "react-color": "^2.19.3",
118
- "react-datetime": "^3.2.0",
109
+ "react-datetime": "^3.3.1",
110
+ "react-day-picker": "^9.11.1",
119
111
  "react-dropzone": "14.2.3",
120
112
  "react-final-form": "^6.5.9",
121
- "react-icons": "^5.3.0",
122
- "react-onclickoutside": "^6.13.1",
113
+ "react-icons": "^5.4.0",
123
114
  "react-router-dom": "6.3.0",
124
- "slate": "^0.103.0",
125
- "slate-history": "^0.100.0",
126
- "slate-hyperscript": "^0.100.0",
127
- "slate-react": "^0.107.1",
128
- "tailwind-merge": "^2.5.2",
115
+ "react-use": "^17.6.0",
116
+ "tailwind-merge": "^2.6.0",
129
117
  "webfontloader": "1.6.28",
130
- "yup": "^1.4.0",
131
- "zod": "^3.23.8",
132
- "@tinacms/search": "0.0.0-9bb408f-20241030010559",
133
- "@tinacms/schema-tools": "0.0.0-9bb408f-20241030010559",
134
- "@tinacms/mdx": "0.0.0-9bb408f-20241030010559"
118
+ "yup": "^1.6.1",
119
+ "zod": "^3.24.2",
120
+ "@tinacms/mdx": "2.0.0",
121
+ "@tinacms/schema-tools": "2.0.0",
122
+ "@tinacms/search": "1.1.4"
135
123
  },
136
124
  "devDependencies": {
137
- "@graphql-tools/utils": "^10.5.4",
125
+ "@graphql-tools/utils": "^10.8.1",
138
126
  "@testing-library/dom": "^10.4.0",
139
- "@testing-library/jest-dom": "^6.5.0",
140
- "@testing-library/react": "^16.0.1",
141
- "@testing-library/user-event": "^14.5.2",
127
+ "@testing-library/jest-dom": "^6.7.0",
128
+ "@testing-library/react": "^16.2.0",
129
+ "@testing-library/user-event": "^14.6.1",
142
130
  "@types/atob": "^2.1.4",
143
131
  "@types/codemirror": "^5.60.15",
144
132
  "@types/color-string": "^1.5.5",
145
- "@types/lodash.debounce": "^4.0.9",
146
- "@types/lodash.get": "^4.4.9",
147
- "@types/node": "^22.7.4",
148
- "@types/prop-types": "^15.7.13",
149
- "@types/react": "^18.3.10",
150
- "@types/react-beautiful-dnd": "^13.1.8",
151
- "@types/react-color": "^3.0.12",
152
- "@types/react-dom": "^18.3.0",
153
- "@types/yup": "^0.32.0",
154
- "happy-dom": "^14.12.3",
133
+ "@types/node": "^22.13.1",
134
+ "@types/prop-types": "^15.7.14",
135
+ "@types/react": "^18.3.18",
136
+ "@types/react-color": "^3.0.13",
137
+ "@types/react-dom": "^18.3.5",
138
+ "happy-dom": "15.10.2",
155
139
  "identity-obj-proxy": "^3.0.0",
156
140
  "isomorphic-fetch": "^3.0.0",
157
141
  "jest-file-snapshot": "^0.7.0",
142
+ "lowlight": "^3.3.0",
158
143
  "next": "14.2.10",
159
144
  "react": "^18.3.1",
160
145
  "react-dom": "^18.3.1",
161
146
  "react-is": "^18.3.1",
162
147
  "tsc-alias": "^1.8.10",
163
- "tslib": "^2.7.0",
164
- "typescript": "^5.6.2",
165
- "vite": "^5.4.8",
166
- "vitest": "^2.1.1",
167
- "@tinacms/scripts": "1.3.0"
148
+ "tslib": "^2.8.1",
149
+ "typescript": "^5.7.3",
150
+ "vite": "^5.4.14",
151
+ "vitest": "^2.1.9",
152
+ "@tinacms/scripts": "1.4.1"
168
153
  },
169
154
  "peerDependencies": {
170
155
  "react": ">=16.14.0",
@@ -1,2 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const IndexingPage: FC;
package/dist/client.mjs DELETED
@@ -1,109 +0,0 @@
1
- import fetchPonyfill from "fetch-ponyfill";
2
- const { fetch: fetchPonyfillFN, Headers: HeadersPonyfill } = fetchPonyfill();
3
- const fetchDefined = typeof fetch === "undefined" ? fetchPonyfillFN : fetch;
4
- const HeadersDefined = typeof Headers === "undefined" ? HeadersPonyfill : Headers;
5
- const TINA_HOST = "content.tinajs.io";
6
- class TinaClient {
7
- constructor({
8
- token,
9
- url,
10
- queries,
11
- errorPolicy,
12
- cacheDir
13
- }) {
14
- this.initialized = false;
15
- this.apiUrl = url;
16
- this.readonlyToken = token == null ? void 0 : token.trim();
17
- this.queries = queries(this);
18
- this.errorPolicy = errorPolicy || "throw";
19
- this.cacheDir = cacheDir || "";
20
- }
21
- async init() {
22
- if (this.initialized) {
23
- return;
24
- }
25
- try {
26
- if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
27
- const { NodeCache } = await import("./node-cache-4c336858.mjs");
28
- this.cache = await NodeCache(this.cacheDir);
29
- }
30
- } catch (e) {
31
- console.error(e);
32
- }
33
- this.initialized = true;
34
- }
35
- async request({ errorPolicy, ...args }, options) {
36
- var _a;
37
- await this.init();
38
- const errorPolicyDefined = errorPolicy || this.errorPolicy;
39
- const headers = new HeadersDefined();
40
- if (this.readonlyToken) {
41
- headers.append("X-API-KEY", this.readonlyToken);
42
- }
43
- headers.append("Content-Type", "application/json");
44
- if (options == null ? void 0 : options.fetchOptions) {
45
- if ((_a = options == null ? void 0 : options.fetchOptions) == null ? void 0 : _a.headers) {
46
- Object.entries(options.fetchOptions.headers).forEach(([key2, value]) => {
47
- headers.append(key2, value);
48
- });
49
- }
50
- }
51
- const { headers: _, ...providedFetchOptions } = (options == null ? void 0 : options.fetchOptions) || {};
52
- const bodyString = JSON.stringify({
53
- query: args.query,
54
- variables: (args == null ? void 0 : args.variables) || {}
55
- });
56
- const url = (args == null ? void 0 : args.url) || this.apiUrl;
57
- const optionsObject = {
58
- method: "POST",
59
- headers,
60
- body: bodyString,
61
- redirect: "follow",
62
- ...providedFetchOptions
63
- };
64
- let key = "";
65
- if (this.cache) {
66
- key = this.cache.makeKey(bodyString);
67
- const value = await this.cache.get(key);
68
- if (value) {
69
- return value;
70
- }
71
- }
72
- const res = await fetchDefined(url, optionsObject);
73
- if (!res.ok) {
74
- let additionalInfo = "";
75
- if (res.status === 401) {
76
- additionalInfo = "Please check that your client ID, URL and read only token are configured properly.";
77
- }
78
- throw new Error(
79
- `Server responded with status code ${res.status}, ${res.statusText}. ${additionalInfo ? additionalInfo : ""} Please see our FAQ for more information: https://tina.io/docs/errors/faq/`
80
- );
81
- }
82
- const json = await res.json();
83
- if (json.errors && errorPolicyDefined === "throw") {
84
- throw new Error(
85
- `Unable to fetch, please see our FAQ for more information: https://tina.io/docs/errors/faq/
86
- Errors:
87
- ${json.errors.map((error) => error.message).join("\n")}`
88
- );
89
- }
90
- const result = {
91
- data: json == null ? void 0 : json.data,
92
- errors: (json == null ? void 0 : json.errors) || null,
93
- query: args.query
94
- };
95
- if (this.cache) {
96
- await this.cache.set(key, result);
97
- }
98
- return result;
99
- }
100
- }
101
- function createClient(args) {
102
- const client = new TinaClient(args);
103
- return client;
104
- }
105
- export {
106
- TINA_HOST,
107
- TinaClient,
108
- createClient
109
- };