tinacms 0.0.0-cef656e-20250119001929 → 0.0.0-cf37070-20251203063307

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 (189) 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/auth/AuthModal.d.ts +1 -4
  13. package/dist/auth/TinaCloudProvider.d.ts +1 -2
  14. package/dist/client.js +135 -150
  15. package/dist/hooks/create-page-plugin.d.ts +1 -1
  16. package/dist/index.js +121767 -32362
  17. package/dist/internalClient/index.d.ts +28 -3
  18. package/dist/node-cache-c9558e1e.js +63 -0
  19. package/dist/react.d.ts +14 -6
  20. package/dist/react.js +209 -192
  21. package/dist/rich-text/index.d.ts +6 -0
  22. package/dist/rich-text/index.js +234 -224
  23. package/dist/rich-text/prism.js +16 -18
  24. package/dist/rich-text/static.d.ts +154 -0
  25. package/dist/rich-text/{index.mjs → static.js} +99 -99
  26. package/dist/tina-cms.d.ts +1 -1
  27. package/dist/toolkit/components/ProgressBar.d.ts +11 -0
  28. package/dist/toolkit/components/media/media-item.d.ts +11 -1
  29. package/dist/toolkit/components/media/media-manager.d.ts +1 -1
  30. package/dist/toolkit/components/ui/breadcrumb.d.ts +11 -0
  31. package/dist/toolkit/components/ui/button.d.ts +11 -0
  32. package/dist/toolkit/components/ui/calendar.d.ts +8 -0
  33. package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
  34. package/dist/toolkit/components/ui/dropdown-menu.d.ts +25 -0
  35. package/dist/toolkit/components/ui/input.d.ts +3 -0
  36. package/dist/toolkit/components/ui/popover.d.ts +7 -0
  37. package/dist/toolkit/components/ui/select.d.ts +13 -0
  38. package/dist/toolkit/fields/components/password-field.d.ts +1 -1
  39. package/dist/toolkit/fields/components/reference/components/button.d.ts +2 -2
  40. package/dist/toolkit/fields/components/reference/components/command.d.ts +21 -33
  41. package/dist/toolkit/fields/components/reference/components/popover.d.ts +1 -1
  42. package/dist/toolkit/fields/components/reference/model/reference-link-props.d.ts +2 -0
  43. package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
  44. package/dist/toolkit/fields/components/select.d.ts +2 -2
  45. package/dist/toolkit/fields/components/text-field.d.ts +1 -1
  46. package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
  47. package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
  48. package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
  49. package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
  50. package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +1 -1
  51. package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -1
  52. package/dist/toolkit/fields/plugins/list-field-meta.d.ts +1 -1
  53. package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -0
  54. package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +2 -2
  55. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +20 -18
  56. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +14 -10
  57. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +5 -5
  58. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +17 -0
  59. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/error-message.d.ts +6 -0
  60. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-combobox.d.ts +6 -0
  61. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-toolbar-button.d.ts +6 -6
  62. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-leaf.d.ts +2 -11
  63. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +14 -10
  64. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-syntax-leaf.d.ts +2 -11
  65. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +112 -0
  66. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dialog.d.ts +12 -0
  67. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/dropdown-menu.d.ts +10 -10
  68. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/floating-toolbar.d.ts +2 -2
  69. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-element.d.ts +3 -0
  70. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/hr-toolbar-button.d.ts +18 -0
  71. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -1
  72. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/image-toolbar-button.d.ts +6 -6
  73. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +6 -7
  74. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/inline-combobox.d.ts +1 -1
  75. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/input.d.ts +3 -3
  76. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-element.d.ts +4 -11
  77. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-floating-toolbar.d.ts +4 -5
  78. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/link-toolbar-button.d.ts +4 -4
  79. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +28 -11
  80. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
  81. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +3 -10
  82. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +6 -8
  83. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +15 -0
  84. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/popover.d.ts +7 -2
  85. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/quote-toolbar-button.d.ts +6 -6
  86. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/raw-markdown-toolbar-button.d.ts +6 -6
  87. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +24 -21
  88. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/separator.d.ts +2 -2
  89. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +15 -11
  90. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/block-selection.d.ts +6 -0
  91. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +33 -0
  92. 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
  93. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +20 -0
  94. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +15 -0
  95. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/toolbar.d.ts +7 -7
  96. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +10 -0
  97. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-state.d.ts +22 -0
  98. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/hooks/use-create-editor.d.ts +6 -0
  99. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-block.d.ts +1 -1
  100. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-lists.d.ts +1 -1
  101. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-marks.d.ts +1 -1
  102. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-utils.d.ts +3 -5
  103. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +11 -6
  104. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +18 -2
  105. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/index.d.ts +0 -1
  106. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-html-block/index.d.ts +6 -0
  107. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/index.d.ts +2 -2
  108. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-invalid-markdown-plugin/index.d.ts +5 -5
  109. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +7 -4
  110. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/index.d.ts +3 -5
  111. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +520 -0
  112. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +262 -212
  113. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/floating-toolbar-plugin.d.ts +1 -0
  114. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +1 -1
  115. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/is-url.d.ts +1 -2
  116. package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
  117. package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
  118. package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
  119. package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
  120. package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +17 -0
  121. package/dist/toolkit/form-builder/fields-builder.d.ts +1 -1
  122. package/dist/toolkit/form-builder/form-builder.d.ts +8 -9
  123. package/dist/toolkit/form-builder/index.d.ts +1 -0
  124. package/dist/toolkit/forms/field.d.ts +3 -0
  125. package/dist/toolkit/forms/form.d.ts +22 -3
  126. package/dist/toolkit/git-client/git-client.d.ts +25 -2
  127. package/dist/toolkit/git-client/git-file.d.ts +18 -0
  128. package/dist/toolkit/git-client/git-media-store.d.ts +13 -0
  129. package/dist/toolkit/git-client/use-git-file.d.ts +4 -0
  130. package/dist/toolkit/icons/Tina.d.ts +0 -5
  131. package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
  132. package/dist/toolkit/icons/index.d.ts +1 -0
  133. package/dist/toolkit/index.d.ts +1 -1
  134. package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +4 -1
  135. package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
  136. package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
  137. package/dist/toolkit/plugin-branch-switcher/index.d.ts +0 -1
  138. package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
  139. package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
  140. package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
  141. package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
  142. package/dist/toolkit/react-sidebar/components/VersionInfo.d.ts +2 -0
  143. package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
  144. package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
  145. package/dist/toolkit/react-sidebar/components/form-list.d.ts +1 -1
  146. package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
  147. package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
  148. package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
  149. package/dist/toolkit/react-sidebar/components/nav.d.ts +6 -3
  150. package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +0 -5
  151. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +7 -10
  152. package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
  153. package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
  154. package/dist/toolkit/react-sidebar/components/sidebar.d.ts +0 -7
  155. package/dist/toolkit/react-sidebar/components/sync-status.d.ts +5 -8
  156. package/dist/toolkit/react-sidebar/index.d.ts +4 -1
  157. package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
  158. package/dist/toolkit/styles/button.d.ts +2 -2
  159. package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
  160. package/dist/toolkit/styles/index.d.ts +1 -0
  161. package/dist/toolkit/tina-cms.d.ts +3 -3
  162. package/dist/toolkit/tina-state.d.ts +15 -0
  163. package/dist/unifiedClient/index.d.ts +8 -1
  164. package/dist/utils/cn.d.ts +2 -0
  165. package/dist/utils/index.d.ts +1 -0
  166. package/package.json +81 -95
  167. package/dist/admin/pages/IndexingPage.d.ts +0 -2
  168. package/dist/client.mjs +0 -105
  169. package/dist/index.mjs +0 -33756
  170. package/dist/node-cache-4c336858.mjs +0 -50
  171. package/dist/react.mjs +0 -234
  172. package/dist/rich-text/prism.mjs +0 -16
  173. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block-element.d.ts +0 -11
  174. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +0 -27
  175. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +0 -14
  176. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +0 -13
  177. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/with-correct-void-behavior.d.ts +0 -8
  178. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-code-block/index.d.ts +0 -3
  179. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts +0 -15
  180. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +0 -2
  181. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/create-soft-break-plugin.d.ts +0 -7
  182. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/index.d.ts +0 -6
  183. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/on-key-down-soft-break.d.ts +0 -5
  184. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/types.d.ts +0 -11
  185. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +0 -11
  186. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/insert-empty-block.d.ts +0 -2
  187. package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +0 -2
  188. package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
  189. package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
package/README.md CHANGED
@@ -24,7 +24,7 @@ Test a TinaCMS starter site locally
24
24
  npx create-tina-app@latest
25
25
  ```
26
26
 
27
- Or try a [demo site](https://app.tina.io/quickstart) on Tina Cloud.
27
+ Or try a [demo site](https://app.tina.io/quickstart) on TinaCloud.
28
28
 
29
29
  ## Documentation
30
30
 
@@ -0,0 +1,4 @@
1
+ const __viteBrowserExternal = {};
2
+ export {
3
+ __viteBrowserExternal as default
4
+ };
@@ -2,11 +2,15 @@ import type { TinaCMS } from '@tinacms/toolkit';
2
2
  import type { Collection, TinaSchema } from '@tinacms/schema-tools';
3
3
  import type { Client } from '../internalClient';
4
4
  import type { CollectionResponse, DocumentForm } from './types';
5
- import { SearchClient } from '@tinacms/search/dist/index-client';
5
+ import { SearchClient } from '@tinacms/search/index-client';
6
+ export declare const CREATE_DOCUMENT_GQL = "#graphql\nmutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {\n createDocument(\n collection: $collection,\n relativePath: $relativePath,\n params: $params\n ){__typename}\n}";
7
+ export declare const UPDATE_DOCUMENT_GQL = "#graphql\nmutation($collection: String!, $relativePath: String!, $params: DocumentUpdateMutation!) {\n updateDocument(\n collection: $collection,\n relativePath: $relativePath,\n params: $params\n ){__typename}\n}";
8
+ export declare const DELETE_DOCUMENT_GQL = "#graphql\nmutation DeleteDocument($collection: String!, $relativePath: String!){\n deleteDocument(collection: $collection, relativePath: $relativePath){\n __typename\n }\n}";
6
9
  export interface FilterArgs {
7
10
  filterField: string;
8
11
  collection?: string;
9
12
  relativePath?: string;
13
+ relativePathWithoutExtension?: string;
10
14
  newRelativePath?: string;
11
15
  startsWith?: string;
12
16
  endsWith?: string;
@@ -1,6 +1,3 @@
1
- /**
2
-
3
- */
4
1
  import React from 'react';
5
2
  import type { TinaCMS } from '@tinacms/toolkit';
6
3
  export declare const slugify: (text: any) => any;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
 
3
3
  */
4
- import React from 'react';
5
- import type { TinaCMS } from '@tinacms/toolkit';
6
4
  import type { Collection } from '@tinacms/schema-tools';
5
+ import type { TinaCMS } from '@tinacms/toolkit';
6
+ import React from 'react';
7
7
  import { FilterArgs } from '../api';
8
8
  import type { CollectionResponse } from '../types';
9
9
  export declare const useGetCollection: (cms: TinaCMS, collectionName: string, includeDocuments: boolean, folder: {
@@ -1,17 +1,11 @@
1
- /**
2
-
3
- */
4
1
  import React from 'react';
5
- export declare const PageWrapper: ({ children }: {
2
+ export declare const PageWrapper: ({ headerClassName, children, }: {
3
+ headerClassName?: string;
6
4
  children: React.ReactNode;
7
5
  }) => React.JSX.Element;
8
- export declare const PageHeader: ({ isLocalMode, children, }: {
9
- isLocalMode?: boolean;
6
+ export declare const PageHeader: ({ children, }: {
10
7
  children: React.ReactNode;
11
8
  }) => React.JSX.Element;
12
9
  export declare const PageBody: ({ children }: {
13
10
  children: React.ReactNode;
14
11
  }) => React.JSX.Element;
15
- export declare const PageBodyNarrow: ({ children }: {
16
- children: React.ReactNode;
17
- }) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
+ import * as React from 'react';
3
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
4
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { Collection } from '@tinacms/schema-tools';
2
+ import React from 'react';
3
3
  import type { TinaCMS } from '@tinacms/toolkit';
4
4
  declare const CollectionCreatePage: () => React.JSX.Element;
5
5
  export declare const RenderForm: ({ cms, collection, folder, templateName, mutationInfo, customDefaults, }: {
@@ -1,8 +1,8 @@
1
+ import type { Collection } from '@tinacms/schema-tools';
2
+ import { type TinaCMS } from '@tinacms/toolkit';
1
3
  import React from 'react';
2
4
  import { type NavigateFunction } from 'react-router-dom';
3
- import { type TinaCMS } from '@tinacms/toolkit';
4
5
  import type { CollectionResponse, DocumentSys } from '../types';
5
- import type { Collection } from '@tinacms/schema-tools';
6
6
  export declare const handleNavigate: (navigate: NavigateFunction, cms: TinaCMS, collection: CollectionResponse, collectionDefinition: Collection<true>, document: DocumentSys) => Promise<any>;
7
7
  declare const CollectionListPage: () => React.JSX.Element;
8
8
  export default CollectionListPage;
@@ -1,6 +1,3 @@
1
- /**
2
-
3
- */
4
1
  import React from 'react';
5
2
  declare const DashboardPage: () => React.JSX.Element;
6
3
  export default DashboardPage;
@@ -1,6 +1,3 @@
1
- /**
2
-
3
- */
4
1
  import React from 'react';
5
2
  declare const ScreenPage: () => React.JSX.Element;
6
3
  export default ScreenPage;
@@ -1,10 +1,7 @@
1
- /**
2
-
3
- */
4
1
  import React from 'react';
5
2
  interface ModalBuilderProps {
6
3
  title: string;
7
- message?: string;
4
+ message?: React.ReactNode;
8
5
  error?: string;
9
6
  actions: ButtonProps[];
10
7
  close(): void;
@@ -1,5 +1,5 @@
1
+ import { MediaStore, StaticMedia, TinaCMS } from '@tinacms/toolkit';
1
2
  import React from 'react';
2
- import { TinaCMS, MediaStore, StaticMedia } from '@tinacms/toolkit';
3
3
  import { Client, TinaIOConfig } from '../internalClient';
4
4
  import { CreateClientProps } from '../utils';
5
5
  export interface TinaCloudMediaStoreClass {
@@ -18,7 +18,6 @@ export interface TinaCloudAuthWallProps {
18
18
  }[];
19
19
  mediaStore?: TinaCloudMediaStoreClass | (() => Promise<TinaCloudMediaStoreClass>);
20
20
  }
21
- export declare const AuthWallInner: ({ children, cms, getModalActions, }: TinaCloudAuthWallProps) => React.JSX.Element;
22
21
  /**
23
22
  * Provides the ability to setup your CMS and media while also providing an authentication wall so Tina is not enabled without a valid user session.
24
23
  *
package/dist/client.js CHANGED
@@ -1,160 +1,145 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}));
3
- })(this, function(exports2) {
4
- "use strict";
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 || "";
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import AsyncLock from "async-lock";
8
+ const TINA_HOST = "content.tinajs.io";
9
+ function replaceGithubPathSplit(url, replacement) {
10
+ const parts = url.split("github/");
11
+ if (parts.length > 1 && replacement) {
12
+ return parts[0] + "github/" + replacement;
13
+ } else {
14
+ return url;
15
+ }
16
+ }
17
+ class TinaClient {
18
+ constructor({
19
+ token,
20
+ url,
21
+ queries,
22
+ errorPolicy,
23
+ cacheDir
24
+ }) {
25
+ __publicField(this, "apiUrl");
26
+ __publicField(this, "readonlyToken");
27
+ __publicField(this, "queries");
28
+ __publicField(this, "errorPolicy");
29
+ __publicField(this, "initialized", false);
30
+ __publicField(this, "cacheLock");
31
+ __publicField(this, "cacheDir");
32
+ __publicField(this, "cache");
33
+ this.apiUrl = url;
34
+ this.readonlyToken = token == null ? void 0 : token.trim();
35
+ this.queries = queries(this);
36
+ this.errorPolicy = errorPolicy || "throw";
37
+ this.cacheDir = cacheDir || "";
38
+ }
39
+ async init() {
40
+ if (this.initialized) {
41
+ return;
20
42
  }
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: NodeCache2 } = await Promise.resolve().then(() => nodeCache);
28
- this.cache = await NodeCache2(this.cacheDir);
29
- }
30
- } catch (e) {
31
- console.error(e);
43
+ try {
44
+ if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
45
+ const { NodeCache } = await import("./node-cache-c9558e1e.js");
46
+ this.cache = await NodeCache(this.cacheDir);
47
+ this.cacheLock = new AsyncLock();
32
48
  }
33
- this.initialized = true;
49
+ } catch (e) {
50
+ console.error(e);
51
+ }
52
+ this.initialized = true;
53
+ }
54
+ async request({ errorPolicy, ...args }, options) {
55
+ var _a;
56
+ await this.init();
57
+ const errorPolicyDefined = errorPolicy || this.errorPolicy;
58
+ const headers = new Headers();
59
+ if (this.readonlyToken) {
60
+ headers.append("X-API-KEY", this.readonlyToken);
34
61
  }
35
- async request({ errorPolicy, ...args }, options) {
36
- var _a;
37
- await this.init();
38
- const errorPolicyDefined = errorPolicy || this.errorPolicy;
39
- const headers = new Headers();
40
- if (this.readonlyToken) {
41
- headers.append("X-API-KEY", this.readonlyToken);
62
+ headers.append("Content-Type", "application/json");
63
+ if (options == null ? void 0 : options.fetchOptions) {
64
+ if ((_a = options == null ? void 0 : options.fetchOptions) == null ? void 0 : _a.headers) {
65
+ Object.entries(options.fetchOptions.headers).forEach(([key2, value]) => {
66
+ headers.append(key2, value);
67
+ });
42
68
  }
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
- });
69
+ }
70
+ const { headers: _, ...providedFetchOptions } = (options == null ? void 0 : options.fetchOptions) || {};
71
+ const bodyString = JSON.stringify({
72
+ query: args.query,
73
+ variables: (args == null ? void 0 : args.variables) || {}
74
+ });
75
+ const optionsObject = {
76
+ method: "POST",
77
+ headers,
78
+ body: bodyString,
79
+ redirect: "follow",
80
+ ...providedFetchOptions
81
+ };
82
+ const draftBranch = headers.get("x-branch");
83
+ const url = replaceGithubPathSplit((args == null ? void 0 : args.url) || this.apiUrl, draftBranch);
84
+ let key = "";
85
+ let result;
86
+ if (this.cache) {
87
+ key = this.cache.makeKey(bodyString);
88
+ await this.cacheLock.acquire(key, async () => {
89
+ result = await this.cache.get(key);
90
+ if (!result) {
91
+ result = await requestFromServer(
92
+ url,
93
+ args.query,
94
+ optionsObject,
95
+ errorPolicyDefined
96
+ );
97
+ await this.cache.set(key, result);
49
98
  }
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
99
  });
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 fetch(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;
100
+ } else {
101
+ result = await requestFromServer(
102
+ url,
103
+ args.query,
104
+ optionsObject,
105
+ errorPolicyDefined
106
+ );
99
107
  }
108
+ return result;
100
109
  }
101
- function createClient(args) {
102
- const client = new TinaClient(args);
103
- return client;
104
- }
105
- const makeCacheDir = async (dir, fs, path, os) => {
106
- const pathParts = dir.split(path.sep).filter(Boolean);
107
- const cacheHash = pathParts[pathParts.length - 1];
108
- const rootUser = pathParts[0];
109
- let cacheDir = dir;
110
- if (!fs.existsSync(path.join(path.sep, rootUser))) {
111
- cacheDir = path.join(os.tmpdir(), cacheHash);
110
+ }
111
+ async function requestFromServer(url, query, optionsObject, errorPolicyDefined) {
112
+ const res = await fetch(url, optionsObject);
113
+ if (!res.ok) {
114
+ let additionalInfo = "";
115
+ if (res.status === 401) {
116
+ additionalInfo = "Please check that your client ID, URL and read only token are configured properly.";
112
117
  }
113
- try {
114
- fs.mkdirSync(cacheDir, { recursive: true });
115
- } catch (error) {
116
- throw new Error(`Failed to create cache directory: ${error.message}`);
117
- }
118
- return cacheDir;
119
- };
120
- const NodeCache = async (dir) => {
121
- const fs = require("node:fs");
122
- const path = require("node:path");
123
- const os = require("node:os");
124
- const { createHash } = require("node:crypto");
125
- const cacheDir = await makeCacheDir(dir, fs, path, os);
126
- return {
127
- makeKey: (key) => {
128
- const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
129
- return createHash("sha256").update(input).digest("hex");
130
- },
131
- get: async (key) => {
132
- try {
133
- const data = await fs.promises.readFile(`${cacheDir}/${key}`, "utf-8");
134
- return JSON.parse(data);
135
- } catch (e) {
136
- if (e.code === "ENOENT") {
137
- return void 0;
138
- }
139
- throw e;
140
- }
141
- },
142
- set: async (key, value) => {
143
- await fs.promises.writeFile(
144
- `${cacheDir}/${key}`,
145
- JSON.stringify(value),
146
- "utf-8"
147
- );
148
- }
149
- };
118
+ throw new Error(
119
+ `Server responded with status code ${res.status}, ${res.statusText}. ${additionalInfo ? additionalInfo : ""} Please see our FAQ for more information: https://tina.io/docs/r/FAQ/`
120
+ );
121
+ }
122
+ const json = await res.json();
123
+ if (json.errors && errorPolicyDefined === "throw") {
124
+ throw new Error(
125
+ `Unable to fetch, please see our FAQ for more information: https://tina.io/docs/r/FAQ/
126
+ Errors:
127
+ ${json.errors.map((error) => error.message).join("\n")}`
128
+ );
129
+ }
130
+ const result = {
131
+ data: json == null ? void 0 : json.data,
132
+ errors: (json == null ? void 0 : json.errors) || null,
133
+ query
150
134
  };
151
- const nodeCache = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152
- __proto__: null,
153
- NodeCache,
154
- makeCacheDir
155
- }, Symbol.toStringTag, { value: "Module" }));
156
- exports2.TINA_HOST = TINA_HOST;
157
- exports2.TinaClient = TinaClient;
158
- exports2.createClient = createClient;
159
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
160
- });
135
+ return result;
136
+ }
137
+ function createClient(args) {
138
+ const client = new TinaClient(args);
139
+ return client;
140
+ }
141
+ export {
142
+ TINA_HOST,
143
+ TinaClient,
144
+ createClient
145
+ };
@@ -29,7 +29,7 @@ export type OnNewDocument = (args: {
29
29
  path: string;
30
30
  }) => void;
31
31
  export declare class ContentCreatorPlugin implements AddContentPlugin<FormShape> {
32
- __type: 'content-creator';
32
+ __type: "content-creator";
33
33
  fields: AddContentPlugin<FormShape>['fields'];
34
34
  onNewDocument?: OnNewDocument;
35
35
  onChange: (values: any) => void;