tinacms 3.11.0 → 3.12.0

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 (39) hide show
  1. package/dist/admin/components/AnnouncementsBanner.d.ts +13 -0
  2. package/dist/auth/AuthModal.d.ts +3 -1
  3. package/dist/auth/authenticate.d.ts +7 -9
  4. package/dist/auth/pkce.d.ts +3 -0
  5. package/dist/auth/useTinaAuthRedirect.d.ts +6 -4
  6. package/dist/client.js +25 -3
  7. package/dist/index.js +3697 -3260
  8. package/dist/internalClient/authProvider.d.ts +6 -6
  9. package/dist/internalClient/index.d.ts +9 -2
  10. package/dist/react.js +5 -10
  11. package/dist/rich-text/index.js +1 -1
  12. package/dist/rich-text/static.js +1 -1
  13. package/dist/toolkit/components/media/media-item.d.ts +1 -0
  14. package/dist/toolkit/components/media/modal.d.ts +6 -0
  15. package/dist/toolkit/components/media/utils.d.ts +22 -0
  16. package/dist/toolkit/components/resize-overlay.d.ts +10 -0
  17. package/dist/toolkit/components/tina-ui.d.ts +1 -1
  18. package/dist/toolkit/components/transition.d.ts +23 -0
  19. package/dist/toolkit/core/media-store.default.d.ts +23 -0
  20. package/dist/toolkit/core/media.d.ts +31 -4
  21. package/dist/toolkit/fields/plugins/blocks-field-plugin/index.d.ts +1 -1
  22. package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +1 -1
  23. package/dist/toolkit/fields/plugins/mdx-field-plugin/{monaco/error-message.d.ts → error-message.d.ts} +0 -15
  24. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +1 -17
  25. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +1 -1
  26. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/editor-plugins.d.ts +2 -519
  27. package/dist/toolkit/form-builder/branch-deleted-modal.d.ts +1 -1
  28. package/dist/toolkit/form-builder/create-branch-modal.d.ts +1 -1
  29. package/dist/toolkit/plugin-branch-switcher/plugin.d.ts +2 -2
  30. package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +2 -2
  31. package/dist/toolkit/react-sidebar/components/sidebar.d.ts +1 -0
  32. package/dist/unifiedClient/asyncLock.d.ts +35 -0
  33. package/dist/unifiedClient/index.d.ts +2 -1
  34. package/package.json +6 -12
  35. package/dist/auth/useGenerator.d.ts +0 -8
  36. package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/index.d.ts +0 -4
  37. package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/use-debounce.d.ts +0 -1
  38. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/autocomplete.d.ts +0 -14
  39. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/dropdown.d.ts +0 -9
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { Announcement } from '../../internalClient';
3
+ export declare const DISMISSED_KEY = "tinacms-announcements-dismissed";
4
+ export declare function resetDismissedStore(): void;
5
+ export declare function useAnnouncements(): {
6
+ announcements: Announcement[];
7
+ dismissed: string[];
8
+ dismiss: (id: string) => void;
9
+ };
10
+ export declare const AnnouncementsProvider: ({ children, }: {
11
+ children: React.ReactNode;
12
+ }) => React.JSX.Element;
13
+ export declare const AnnouncementsBanner: () => React.JSX.Element;
@@ -6,6 +6,7 @@ interface ModalBuilderProps {
6
6
  actions: ButtonProps[];
7
7
  close(): void;
8
8
  children?: React.ReactNode;
9
+ busy?: boolean;
9
10
  }
10
11
  export declare function ModalBuilder(modalProps: ModalBuilderProps): React.JSX.Element;
11
12
  export declare const ErrorLabel: ({ style, ...props }: {
@@ -16,6 +17,7 @@ interface ButtonProps {
16
17
  name: string;
17
18
  action(): Promise<void>;
18
19
  primary: boolean;
20
+ busy?: boolean;
19
21
  }
20
- export declare const AsyncButton: ({ name, primary, action }: ButtonProps) => React.JSX.Element;
22
+ export declare const AsyncButton: ({ name, primary, action, busy }: ButtonProps) => React.JSX.Element;
21
23
  export {};
@@ -1,13 +1,11 @@
1
- /**
2
-
3
- */
1
+ import { TokenObject } from '@tinacms/schema-tools';
4
2
  export declare const AUTH_TOKEN_KEY = "tinacms-auth";
5
- export type TokenObject = {
6
- id_token: string;
7
- access_token?: string;
8
- refresh_token?: string;
9
- };
3
+ export declare const PKCE_STORAGE_KEY = "tinacms-pkce";
10
4
  export declare class AuthenticationCancelledError extends Error {
11
5
  constructor(message?: string);
12
6
  }
13
- export declare const authenticate: (clientId: string, frontendUrl: string) => Promise<TokenObject>;
7
+ export declare function getWorkosEnabled(identityApiUrl: string): Promise<boolean>;
8
+ export declare function resetWorkosEnabledCache(): void;
9
+ export declare function authenticatePopup(clientId: string, frontendUrl: string): Promise<TokenObject>;
10
+ export declare function authenticatePKCE(clientId: string, identityApiUrl: string): Promise<void>;
11
+ export declare function authenticate(clientId: string, identityApiUrl: string, frontendUrl: string): Promise<TokenObject | void>;
@@ -0,0 +1,3 @@
1
+ export declare function randomString(length?: number): string;
2
+ export declare function base64UrlEncode(arrayBuffer: ArrayBuffer): string;
3
+ export declare function generateCodeChallenge(verifier: string): Promise<string>;
@@ -1,4 +1,6 @@
1
- /**
2
-
3
- */
4
- export declare const useTinaAuthRedirect: () => void;
1
+ export interface AuthRedirectParams {
2
+ code: string | null;
3
+ state: string | null;
4
+ error: string | null;
5
+ }
6
+ export declare const useTinaAuthRedirect: (params: AuthRedirectParams, enabled?: boolean) => void;
package/dist/client.js CHANGED
@@ -1,7 +1,12 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
3
+ var __esm = (fn, res, err) => function __init() {
4
+ if (err) throw err[0];
5
+ try {
6
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ } catch (e) {
8
+ throw err = [e], e;
9
+ }
5
10
  };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
@@ -115,8 +120,24 @@ var init_node_cache = __esm({
115
120
  }
116
121
  });
117
122
 
123
+ // src/unifiedClient/asyncLock.ts
124
+ var AsyncLock = class {
125
+ queues = /* @__PURE__ */ new Map();
126
+ acquire(key, fn) {
127
+ const prev = this.queues.get(key) ?? Promise.resolve();
128
+ const next = prev.then(fn);
129
+ this.queues.set(
130
+ key,
131
+ next.then(
132
+ () => void 0,
133
+ () => void 0
134
+ )
135
+ );
136
+ return next;
137
+ }
138
+ };
139
+
118
140
  // src/unifiedClient/index.ts
119
- import AsyncLock from "async-lock";
120
141
  var TINA_HOST = "content.tinajs.io";
121
142
  function replaceGithubPathSplit(url, replacement) {
122
143
  const parts = url.split("github/");
@@ -264,6 +285,7 @@ function createClient(args) {
264
285
  return client;
265
286
  }
266
287
  export {
288
+ AsyncLock,
267
289
  TINA_HOST,
268
290
  TinaClient,
269
291
  createClient