tinacms 0.0.0-bc986dd-20250128224550 → 0.0.0-bdc07c1-20250506013835

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 (35) hide show
  1. package/README.md +1 -1
  2. package/dist/admin/api.d.ts +1 -0
  3. package/dist/admin/components/GetCollection.d.ts +2 -2
  4. package/dist/auth/TinaCloudProvider.d.ts +1 -1
  5. package/dist/client.d.ts +1 -4
  6. package/dist/client.js +10 -1
  7. package/dist/client.mjs +10 -1
  8. package/dist/hooks/create-page-plugin.d.ts +1 -1
  9. package/dist/index.d.ts +1 -61
  10. package/dist/index.js +4325 -3007
  11. package/dist/index.mjs +4334 -3016
  12. package/dist/internalClient/index.d.ts +3 -3
  13. package/dist/react.d.ts +1 -33
  14. package/dist/react.js +13 -1
  15. package/dist/react.mjs +13 -1
  16. package/dist/rich-text/index.d.ts +1 -142
  17. package/dist/rich-text/prism.d.ts +1 -10
  18. package/dist/toolkit/components/media/media-manager.d.ts +1 -1
  19. package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
  20. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +17 -5
  21. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
  22. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +6 -11
  23. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +1 -1
  24. package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
  25. package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
  26. package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
  27. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +5 -4
  28. package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
  29. package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
  30. package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
  31. package/dist/toolkit/tina-cms.d.ts +3 -3
  32. package/dist/toolkit/tina-state.d.ts +4 -0
  33. package/dist/unifiedClient/index.d.ts +1 -1
  34. package/package.json +34 -34
  35. 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
 
@@ -7,6 +7,7 @@ export interface FilterArgs {
7
7
  filterField: string;
8
8
  collection?: string;
9
9
  relativePath?: string;
10
+ relativePathWithoutExtension?: string;
10
11
  newRelativePath?: string;
11
12
  startsWith?: string;
12
13
  endsWith?: string;
@@ -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,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 {
package/dist/client.d.ts CHANGED
@@ -1,4 +1 @@
1
- /**
2
-
3
- */
4
- export * from './unifiedClient';
1
+ export * from "../src/client"
package/dist/client.js CHANGED
@@ -3,6 +3,14 @@
3
3
  })(this, function(exports2, AsyncLock) {
4
4
  "use strict";
5
5
  const TINA_HOST = "content.tinajs.io";
6
+ function replaceGithubPathSplit(url, replacement) {
7
+ const parts = url.split("github/");
8
+ if (parts.length > 1 && replacement) {
9
+ return parts[0] + "github/" + replacement;
10
+ } else {
11
+ return url;
12
+ }
13
+ }
6
14
  class TinaClient {
7
15
  constructor({
8
16
  token,
@@ -54,7 +62,6 @@
54
62
  query: args.query,
55
63
  variables: (args == null ? void 0 : args.variables) || {}
56
64
  });
57
- const url = (args == null ? void 0 : args.url) || this.apiUrl;
58
65
  const optionsObject = {
59
66
  method: "POST",
60
67
  headers,
@@ -62,6 +69,8 @@
62
69
  redirect: "follow",
63
70
  ...providedFetchOptions
64
71
  };
72
+ const draftBranch = headers.get("x-branch");
73
+ const url = replaceGithubPathSplit((args == null ? void 0 : args.url) || this.apiUrl, draftBranch);
65
74
  let key = "";
66
75
  let result;
67
76
  if (this.cache) {
package/dist/client.mjs CHANGED
@@ -1,5 +1,13 @@
1
1
  import AsyncLock from "async-lock";
2
2
  const TINA_HOST = "content.tinajs.io";
3
+ function replaceGithubPathSplit(url, replacement) {
4
+ const parts = url.split("github/");
5
+ if (parts.length > 1 && replacement) {
6
+ return parts[0] + "github/" + replacement;
7
+ } else {
8
+ return url;
9
+ }
10
+ }
3
11
  class TinaClient {
4
12
  constructor({
5
13
  token,
@@ -51,7 +59,6 @@ class TinaClient {
51
59
  query: args.query,
52
60
  variables: (args == null ? void 0 : args.variables) || {}
53
61
  });
54
- const url = (args == null ? void 0 : args.url) || this.apiUrl;
55
62
  const optionsObject = {
56
63
  method: "POST",
57
64
  headers,
@@ -59,6 +66,8 @@ class TinaClient {
59
66
  redirect: "follow",
60
67
  ...providedFetchOptions
61
68
  };
69
+ const draftBranch = headers.get("x-branch");
70
+ const url = replaceGithubPathSplit((args == null ? void 0 : args.url) || this.apiUrl, draftBranch);
62
71
  let key = "";
63
72
  let result;
64
73
  if (this.cache) {
@@ -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;
package/dist/index.d.ts CHANGED
@@ -1,61 +1 @@
1
- /**
2
-
3
- */
4
- export * from './internalClient';
5
- export * from './auth';
6
- export * from './utils';
7
- export * from './tina-cms';
8
- export { useDocumentCreatorPlugin } from './hooks/use-content-creator';
9
- export { TinaAdmin } from './admin';
10
- export { RouteMappingPlugin } from './admin/plugins/route-mapping';
11
- export { TinaAdminApi } from './admin/api';
12
- export { ErrorDialog } from './admin/components/ErrorDialog';
13
- export * from './toolkit';
14
- export { Form } from './toolkit/forms/form';
15
- export { MdxFieldPluginExtendible } from '@tinacms/toolkit';
16
- import { TinaCMSProvider2, DocumentCreatorCallback } from './tina-cms';
17
- import type { TinaCMSProviderDefaultProps } from './types/cms';
18
- export type { TinaCMSProviderDefaultProps };
19
- export default TinaCMSProvider2;
20
- import { MediaStore, TinaCMS } from '@tinacms/toolkit';
21
- import { formifyCallback } from './hooks/use-graphql-forms';
22
- export { NAMER, resolveField } from '@tinacms/schema-tools';
23
- export type { LoginScreenProps, LoginStrategy } from '@tinacms/schema-tools';
24
- import { TinaSchema, TinaField, Config, Schema, Collection, Template } from '@tinacms/schema-tools';
25
- export type { Config, Schema, Collection, Template, TinaField, TinaSchema };
26
- /**
27
- * @deprecated use `TinaField` instead
28
- */
29
- export type TinaFieldEnriched = TinaField;
30
- /**
31
- * @deprecated use `TinaField` instead
32
- */
33
- export type SchemaField = TinaField;
34
- /**
35
- * @deprecated use `Template` instead
36
- */
37
- export type TinaTemplate = Template;
38
- /**
39
- * @deprecated use `Template` instead
40
- */
41
- export type TinaCloudTemplatebase = Template;
42
- /**
43
- * @deprecated use `Collection` instead
44
- */
45
- export type TinaCloudCollectionCollection = Collection;
46
- /**
47
- * @deprecated use `Collection` instead
48
- */
49
- export type TinaCollection = Collection;
50
- /**
51
- * @deprecated use `Schema` instead
52
- */
53
- export type TinaCloudSchema = Schema;
54
- export declare const defineSchema: (config: Schema) => Schema<false>;
55
- export declare const defineLegacyConfig: (config: Omit<TinaCMSProviderDefaultProps, "children">) => Omit<TinaCMSProviderDefaultProps, "children">;
56
- export interface MediaStoreClass {
57
- new (...args: any[]): MediaStore;
58
- }
59
- export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, DocumentCreatorCallback, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;
60
- export declare const defineConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, DocumentCreatorCallback, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;
61
- export { tinaTableTemplate } from './table';
1
+ export * from "../src/index"