tinacms 3.6.0 → 3.6.2
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.
- package/dist/auth/authenticate.d.ts +3 -0
- package/dist/index.js +139 -43
- package/dist/lib/posthog/posthog.d.ts +18 -4
- package/package.json +3 -4
|
@@ -7,4 +7,7 @@ export type TokenObject = {
|
|
|
7
7
|
access_token?: string;
|
|
8
8
|
refresh_token?: string;
|
|
9
9
|
};
|
|
10
|
+
export declare class AuthenticationCancelledError extends Error {
|
|
11
|
+
constructor(message?: string);
|
|
12
|
+
}
|
|
10
13
|
export declare const authenticate: (clientId: string, frontendUrl: string) => Promise<TokenObject>;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
var _a;
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import * as React from "react";
|
|
10
|
-
import React__default, { useState, useCallback, useContext, createContext, forwardRef, useRef, useReducer, useMemo, useEffect, useLayoutEffect, Component, memo, useDebugValue, useId, startTransition, useImperativeHandle } from "react";
|
|
10
|
+
import React__default, { useState, useCallback, useContext, createContext, forwardRef, useRef, useReducer, useMemo, useEffect, useLayoutEffect, Component, memo, useDebugValue, useId, startTransition, useImperativeHandle, Fragment } from "react";
|
|
11
11
|
import ReactDOM, { createPortal } from "react-dom";
|
|
12
12
|
import clsx$1, { clsx } from "clsx";
|
|
13
13
|
import { twMerge } from "tailwind-merge";
|
|
@@ -45,6 +45,7 @@ import { sortableKeyboardCoordinates, useSortable, SortableContext, verticalList
|
|
|
45
45
|
import { CSS } from "@dnd-kit/utilities";
|
|
46
46
|
import { buildSchema, print, getIntrospectionQuery, buildClientSchema, parse as parse$4 } from "graphql";
|
|
47
47
|
import { diff as diff$1 } from "@graphql-inspector/core";
|
|
48
|
+
import posthog from "posthog-js";
|
|
48
49
|
import { get as get$6, to as to$1 } from "color-string";
|
|
49
50
|
import { HexColorPicker } from "react-colorful";
|
|
50
51
|
import * as dropzone from "react-dropzone";
|
|
@@ -63,7 +64,6 @@ import { DayPicker } from "react-day-picker";
|
|
|
63
64
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
64
65
|
import { formatDistanceToNow } from "date-fns";
|
|
65
66
|
import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from "@tanstack/react-table";
|
|
66
|
-
import posthog from "posthog-js";
|
|
67
67
|
import { TinaSchema, addNamespaceToSchema, parseURL, resolveForm, normalizePath, canonicalPath, validateSchema } from "@tinacms/schema-tools";
|
|
68
68
|
import { NAMER, resolveField } from "@tinacms/schema-tools";
|
|
69
69
|
import gql from "graphql-tag";
|
|
@@ -811,7 +811,7 @@ const ModalHeader = ({ children, close: close2 }) => {
|
|
|
811
811
|
));
|
|
812
812
|
};
|
|
813
813
|
const ModalTitle = ({ children }) => {
|
|
814
|
-
return /* @__PURE__ */ React.createElement("h2", { className: "font-medium flex items-center" }, children);
|
|
814
|
+
return /* @__PURE__ */ React.createElement("h2", { className: "text-black font-sans font-medium text-base m-0 block truncate flex items-center" }, children);
|
|
815
815
|
};
|
|
816
816
|
const FullscreenModal = ({ className = "", style = {}, ...props }) => /* @__PURE__ */ React__default.createElement(
|
|
817
817
|
"div",
|
|
@@ -44039,10 +44039,18 @@ const BranchSwitcherOpenedEvent = "branch-switcher-opened";
|
|
|
44039
44039
|
const BranchSwitcherSearchEvent = "branch-switcher-search";
|
|
44040
44040
|
const BranchSwitcherDropDownEvent = "branch-switcher-dropdown";
|
|
44041
44041
|
const BranchSwitcherPRClickedEvent = "branch-switcher-pr-clicked";
|
|
44042
|
+
const SavedContentEvent = "saved-content";
|
|
44043
|
+
const SaveContentErrorEvent = "save-content-error";
|
|
44044
|
+
const FormResetEvent = "form-reset";
|
|
44045
|
+
const MediaManagerContentUploadedEvent = "media-manager-content-uploaded";
|
|
44046
|
+
const MediaManagerContentDeletedEvent = "media-manager-content-deleted";
|
|
44047
|
+
const RichTextEditorSwitchedEvent = "rich-text-editor-switched";
|
|
44048
|
+
const EventLogPageViewedEvent = "event-log-page-viewed";
|
|
44042
44049
|
const TinaCMSStartedEvent = "tina-cms-started";
|
|
44043
44050
|
const CollectionListPageItemClickedEvent = "collection-list-page-item-clicked";
|
|
44044
44051
|
const CollectionListPageSortEvent = "collection-list-page-sort";
|
|
44045
44052
|
const CollectionListPageSearchEvent = "collection-list-page-search";
|
|
44053
|
+
const CloudConfigNavComponentClickedEvent = "cloud-config-nav-component-clicked";
|
|
44046
44054
|
const IndexStatus$1 = ({ indexingStatus }) => {
|
|
44047
44055
|
const styles = {
|
|
44048
44056
|
complete: {
|
|
@@ -45864,17 +45872,22 @@ function dirname(path3) {
|
|
|
45864
45872
|
const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React__default.createElement(
|
|
45865
45873
|
"button",
|
|
45866
45874
|
{
|
|
45867
|
-
className:
|
|
45875
|
+
className: cn(
|
|
45876
|
+
"capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500",
|
|
45877
|
+
className
|
|
45878
|
+
),
|
|
45868
45879
|
...props
|
|
45869
45880
|
}
|
|
45870
45881
|
);
|
|
45882
|
+
const BreadcrumbItem$1 = ({ className = "", ...props }) => /* @__PURE__ */ React__default.createElement("span", { className: cn("capitalize", className), ...props });
|
|
45871
45883
|
function Breadcrumb$2({ directory = "", setDirectory }) {
|
|
45872
|
-
|
|
45873
|
-
|
|
45884
|
+
const normalizedDir = directory && !directory.startsWith("/") ? "/" + directory : directory;
|
|
45885
|
+
const directoryParts = normalizedDir.split("/");
|
|
45886
|
+
let prevDir = dirname(normalizedDir) || "";
|
|
45874
45887
|
if (prevDir === ".") {
|
|
45875
45888
|
prevDir = "";
|
|
45876
45889
|
}
|
|
45877
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" },
|
|
45890
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directoryParts.length > 1 && /* @__PURE__ */ React__default.createElement(
|
|
45878
45891
|
IconButton,
|
|
45879
45892
|
{
|
|
45880
45893
|
variant: "ghost",
|
|
@@ -45887,26 +45900,22 @@ function Breadcrumb$2({ directory = "", setDirectory }) {
|
|
|
45887
45900
|
className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
|
|
45888
45901
|
}
|
|
45889
45902
|
)
|
|
45890
|
-
),
|
|
45891
|
-
|
|
45892
|
-
|
|
45893
|
-
|
|
45894
|
-
|
|
45895
|
-
|
|
45896
|
-
|
|
45897
|
-
|
|
45898
|
-
|
|
45899
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
45903
|
+
), directoryParts.map((part, index) => {
|
|
45904
|
+
return directoryParts.length === index + 1 ? /* @__PURE__ */ React__default.createElement(
|
|
45905
|
+
BreadcrumbItem$1,
|
|
45906
|
+
{
|
|
45907
|
+
key: index,
|
|
45908
|
+
className: "pl-1.5 font-bold text-gray-500"
|
|
45909
|
+
},
|
|
45910
|
+
part === "" ? "Media" : part
|
|
45911
|
+
) : /* @__PURE__ */ React__default.createElement(Fragment, { key: index }, /* @__PURE__ */ React__default.createElement(
|
|
45900
45912
|
BreadcrumbButton,
|
|
45901
45913
|
{
|
|
45902
|
-
|
|
45903
|
-
|
|
45904
|
-
onClick: () => {
|
|
45905
|
-
setDirectory(currentDir);
|
|
45906
|
-
}
|
|
45914
|
+
onClick: () => setDirectory(directoryParts.slice(0, index + 1).join("/")),
|
|
45915
|
+
className: "pl-1.5 text-gray-300"
|
|
45907
45916
|
},
|
|
45908
|
-
part
|
|
45909
|
-
);
|
|
45917
|
+
part === "" ? "Media" : part
|
|
45918
|
+
), /* @__PURE__ */ React__default.createElement("span", { className: "pl-1.5 text-gray-300" }, "/"));
|
|
45910
45919
|
}));
|
|
45911
45920
|
}
|
|
45912
45921
|
const CopyField = ({ label, description, value }) => {
|
|
@@ -46244,7 +46253,10 @@ function MediaPicker({
|
|
|
46244
46253
|
let deleteMediaItem;
|
|
46245
46254
|
if (allowDelete) {
|
|
46246
46255
|
deleteMediaItem = async (item) => {
|
|
46256
|
+
var _a3;
|
|
46247
46257
|
await cms.media.delete(item);
|
|
46258
|
+
const ext = ((_a3 = item.filename.split(".").pop()) == null ? void 0 : _a3.toLowerCase()) || "unknown";
|
|
46259
|
+
captureEvent(MediaManagerContentDeletedEvent, { fileType: ext });
|
|
46248
46260
|
};
|
|
46249
46261
|
}
|
|
46250
46262
|
let selectMediaItem;
|
|
@@ -46302,6 +46314,19 @@ function MediaPicker({
|
|
|
46302
46314
|
});
|
|
46303
46315
|
}
|
|
46304
46316
|
if (mediaItems.length !== 0) {
|
|
46317
|
+
const extensions = [
|
|
46318
|
+
...new Set(
|
|
46319
|
+
mediaItems.map((item) => {
|
|
46320
|
+
var _a3;
|
|
46321
|
+
const ext = (_a3 = item.filename.split(".").pop()) == null ? void 0 : _a3.toLowerCase();
|
|
46322
|
+
return ext || "unknown";
|
|
46323
|
+
})
|
|
46324
|
+
)
|
|
46325
|
+
];
|
|
46326
|
+
captureEvent(MediaManagerContentUploadedEvent, {
|
|
46327
|
+
fileType: extensions.join(","),
|
|
46328
|
+
fileCount: mediaItems.length
|
|
46329
|
+
});
|
|
46305
46330
|
setActiveItem(mediaItems[0]);
|
|
46306
46331
|
setList((mediaList) => {
|
|
46307
46332
|
return {
|
|
@@ -46974,13 +46999,12 @@ const NavProvider = ({
|
|
|
46974
46999
|
const name = "tinacms";
|
|
46975
47000
|
const type = "module";
|
|
46976
47001
|
const typings = "dist/index.d.ts";
|
|
46977
|
-
const version$1 = "3.6.
|
|
47002
|
+
const version$1 = "3.6.2";
|
|
46978
47003
|
const main = "dist/index.js";
|
|
46979
47004
|
const module = "./dist/index.js";
|
|
46980
47005
|
const exports = {
|
|
46981
47006
|
".": "./dist/index.js",
|
|
46982
47007
|
"./dist/client": "./dist/client.js",
|
|
46983
|
-
"./dist/edit-state": "./dist/edit-state.js",
|
|
46984
47008
|
"./react": "./dist/react.js",
|
|
46985
47009
|
"./dist/react": "./dist/react.js",
|
|
46986
47010
|
"./dist/rich-text": "./dist/rich-text/index.js",
|
|
@@ -47330,7 +47354,19 @@ const SyncStatusButton = ({
|
|
|
47330
47354
|
if ((_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isCustomContentApi) {
|
|
47331
47355
|
return null;
|
|
47332
47356
|
}
|
|
47333
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
47357
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
47358
|
+
"button",
|
|
47359
|
+
{
|
|
47360
|
+
onClick: () => {
|
|
47361
|
+
setEventsOpen(true);
|
|
47362
|
+
captureEvent(EventLogPageViewedEvent, {});
|
|
47363
|
+
},
|
|
47364
|
+
...buttonProps
|
|
47365
|
+
},
|
|
47366
|
+
syncStatus.state !== "error" ? /* @__PURE__ */ React.createElement(TbLogs, { className: "w-6 h-auto mr-2" }) : /* @__PURE__ */ React.createElement(MdSyncProblem, { className: "w-6 h-auto mr-2 text-red-400" }),
|
|
47367
|
+
" ",
|
|
47368
|
+
"Event Log"
|
|
47369
|
+
));
|
|
47334
47370
|
};
|
|
47335
47371
|
const Nav = ({
|
|
47336
47372
|
isLocalMode,
|
|
@@ -47529,12 +47565,25 @@ const NavCloudLink = ({ config }) => {
|
|
|
47529
47565
|
{
|
|
47530
47566
|
target: "_blank",
|
|
47531
47567
|
className: "ml-1 text-blue-600 hover:opacity-60",
|
|
47568
|
+
onClick: () => captureEvent(CloudConfigNavComponentClickedEvent, {
|
|
47569
|
+
itemType: config.link.text
|
|
47570
|
+
}),
|
|
47532
47571
|
href: config.link.href
|
|
47533
47572
|
},
|
|
47534
47573
|
config.link.text
|
|
47535
47574
|
));
|
|
47536
47575
|
}
|
|
47537
|
-
return /* @__PURE__ */ React__default.createElement("span", { className: "text-base tracking-wide text-gray-500 hover:text-blue-600 flex items-center opacity-90 hover:opacity-100" }, /* @__PURE__ */ React__default.createElement(config.Icon, { className: "mr-2 h-6 opacity-80 w-auto" }), /* @__PURE__ */ React__default.createElement(
|
|
47576
|
+
return /* @__PURE__ */ React__default.createElement("span", { className: "text-base tracking-wide text-gray-500 hover:text-blue-600 flex items-center opacity-90 hover:opacity-100" }, /* @__PURE__ */ React__default.createElement(config.Icon, { className: "mr-2 h-6 opacity-80 w-auto" }), /* @__PURE__ */ React__default.createElement(
|
|
47577
|
+
"a",
|
|
47578
|
+
{
|
|
47579
|
+
target: "_blank",
|
|
47580
|
+
href: config.link.href,
|
|
47581
|
+
onClick: () => captureEvent(CloudConfigNavComponentClickedEvent, {
|
|
47582
|
+
itemType: config.link.text
|
|
47583
|
+
})
|
|
47584
|
+
},
|
|
47585
|
+
config.link.text
|
|
47586
|
+
));
|
|
47538
47587
|
};
|
|
47539
47588
|
const ResizeHandle = () => {
|
|
47540
47589
|
const {
|
|
@@ -49159,7 +49208,7 @@ function Alerts2({ alerts }) {
|
|
|
49159
49208
|
/* @__PURE__ */ React__default.createElement(MdError, { className: "mr-1 w-6 h-auto fill-current inline-block text-red-600" }),
|
|
49160
49209
|
" ",
|
|
49161
49210
|
"Error"
|
|
49162
|
-
), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement("div", { className: "tina-prose" }, /* @__PURE__ */ React__default.createElement(AlertMessage, null))), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement("div", { className: "flex-1" }), /* @__PURE__ */ React__default.createElement(
|
|
49211
|
+
), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement("div", { className: "tina-prose whitespace-pre-wrap" }, /* @__PURE__ */ React__default.createElement(AlertMessage, null))), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement("div", { className: "flex-1" }), /* @__PURE__ */ React__default.createElement(
|
|
49163
49212
|
Button$2,
|
|
49164
49213
|
{
|
|
49165
49214
|
style: { flexGrow: 1 },
|
|
@@ -65404,7 +65453,18 @@ const FormBuilder = ({
|
|
|
65404
65453
|
const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
|
|
65405
65454
|
const safeSubmit = async () => {
|
|
65406
65455
|
if (canSubmit) {
|
|
65407
|
-
await handleSubmit();
|
|
65456
|
+
const result = await handleSubmit();
|
|
65457
|
+
if (result && result[FORM_ERROR]) {
|
|
65458
|
+
const error2 = result[FORM_ERROR];
|
|
65459
|
+
captureEvent(SaveContentErrorEvent, {
|
|
65460
|
+
documentPath: tinaForm.path,
|
|
65461
|
+
error: error2 instanceof Error ? error2.message : String(error2)
|
|
65462
|
+
});
|
|
65463
|
+
} else {
|
|
65464
|
+
captureEvent(SavedContentEvent, {
|
|
65465
|
+
documentPath: tinaForm.path
|
|
65466
|
+
});
|
|
65467
|
+
}
|
|
65408
65468
|
}
|
|
65409
65469
|
};
|
|
65410
65470
|
const safeHandleSubmit = async () => {
|
|
@@ -65437,6 +65497,7 @@ const FormBuilder = ({
|
|
|
65437
65497
|
reset: async () => {
|
|
65438
65498
|
finalForm.reset();
|
|
65439
65499
|
await tinaForm.reset();
|
|
65500
|
+
captureEvent(FormResetEvent);
|
|
65440
65501
|
}
|
|
65441
65502
|
},
|
|
65442
65503
|
tinaForm.buttons.reset
|
|
@@ -67207,6 +67268,7 @@ const useRawMarkdownToolbarButton = () => {
|
|
|
67207
67268
|
const { setRawMode } = useEditorContext();
|
|
67208
67269
|
const onMouseDown = (e3) => {
|
|
67209
67270
|
setRawMode(true);
|
|
67271
|
+
captureEvent(RichTextEditorSwitchedEvent, { to: "markdown" });
|
|
67210
67272
|
};
|
|
67211
67273
|
return {
|
|
67212
67274
|
props: {
|
|
@@ -119785,8 +119847,10 @@ const RichEditor = ({ input, tinaForm, field }) => {
|
|
|
119785
119847
|
return [{ type: "p", children: [{ type: "text", text: "" }] }];
|
|
119786
119848
|
}
|
|
119787
119849
|
}, []);
|
|
119850
|
+
const showFloatingToolbar = ((_a2 = field == null ? void 0 : field.overrides) == null ? void 0 : _a2.showFloatingToolbar) !== false;
|
|
119851
|
+
const plugins2 = showFloatingToolbar ? editorPlugins : editorPlugins.filter((plugin) => plugin.key !== "floating-toolbar");
|
|
119788
119852
|
const editor = useCreateEditor({
|
|
119789
|
-
plugins: [...
|
|
119853
|
+
plugins: [...plugins2],
|
|
119790
119854
|
value: initialValue,
|
|
119791
119855
|
components: Components()
|
|
119792
119856
|
});
|
|
@@ -119826,8 +119890,7 @@ const RichEditor = ({ input, tinaForm, field }) => {
|
|
|
119826
119890
|
templates: field.templates,
|
|
119827
119891
|
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
119828
119892
|
},
|
|
119829
|
-
/* @__PURE__ */ React__default.createElement(FixedToolbar, null, /* @__PURE__ */ React__default.createElement(FixedToolbarButtons, null))
|
|
119830
|
-
((_a2 = field == null ? void 0 : field.overrides) == null ? void 0 : _a2.showFloatingToolbar) !== false ? /* @__PURE__ */ React__default.createElement(FloatingToolbar, null, /* @__PURE__ */ React__default.createElement(FloatingToolbarButtons, null)) : null
|
|
119893
|
+
/* @__PURE__ */ React__default.createElement(FixedToolbar, null, /* @__PURE__ */ React__default.createElement(FixedToolbarButtons, null))
|
|
119831
119894
|
), /* @__PURE__ */ React__default.createElement(Editor$1, null)))
|
|
119832
119895
|
));
|
|
119833
119896
|
};
|
|
@@ -119965,8 +120028,14 @@ function popupWindow(url, title, window2, w2, h) {
|
|
|
119965
120028
|
}
|
|
119966
120029
|
const TINA_LOGIN_EVENT = "tinaCloudLogin";
|
|
119967
120030
|
const AUTH_TOKEN_KEY = "tinacms-auth";
|
|
120031
|
+
class AuthenticationCancelledError extends Error {
|
|
120032
|
+
constructor(message = "Authentication cancelled") {
|
|
120033
|
+
super(message);
|
|
120034
|
+
this.name = "AuthenticationCancelledError";
|
|
120035
|
+
}
|
|
120036
|
+
}
|
|
119968
120037
|
const authenticate = (clientId, frontendUrl) => {
|
|
119969
|
-
return new Promise((resolve) => {
|
|
120038
|
+
return new Promise((resolve, reject) => {
|
|
119970
120039
|
const origin = `${window.location.protocol}//${window.location.host}`;
|
|
119971
120040
|
const authTab = popupWindow(
|
|
119972
120041
|
`${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`,
|
|
@@ -119975,8 +120044,18 @@ const authenticate = (clientId, frontendUrl) => {
|
|
|
119975
120044
|
1e3,
|
|
119976
120045
|
700
|
|
119977
120046
|
);
|
|
119978
|
-
|
|
120047
|
+
if (!authTab) {
|
|
120048
|
+
reject(
|
|
120049
|
+
new Error(
|
|
120050
|
+
"Popup was blocked by browser. Please allow popups for this site."
|
|
120051
|
+
)
|
|
120052
|
+
);
|
|
120053
|
+
return;
|
|
120054
|
+
}
|
|
120055
|
+
const messageHandler = (e3) => {
|
|
119979
120056
|
if (e3.data.source === TINA_LOGIN_EVENT) {
|
|
120057
|
+
clearInterval(pollInterval);
|
|
120058
|
+
window.removeEventListener("message", messageHandler);
|
|
119980
120059
|
if (authTab) {
|
|
119981
120060
|
authTab.close();
|
|
119982
120061
|
}
|
|
@@ -119986,7 +120065,15 @@ const authenticate = (clientId, frontendUrl) => {
|
|
|
119986
120065
|
refresh_token: e3.data.refresh_token
|
|
119987
120066
|
});
|
|
119988
120067
|
}
|
|
119989
|
-
}
|
|
120068
|
+
};
|
|
120069
|
+
const pollInterval = setInterval(() => {
|
|
120070
|
+
if (authTab.closed) {
|
|
120071
|
+
clearInterval(pollInterval);
|
|
120072
|
+
window.removeEventListener("message", messageHandler);
|
|
120073
|
+
reject(new AuthenticationCancelledError("Popup was closed"));
|
|
120074
|
+
}
|
|
120075
|
+
}, 500);
|
|
120076
|
+
window.addEventListener("message", messageHandler);
|
|
119990
120077
|
});
|
|
119991
120078
|
};
|
|
119992
120079
|
const DefaultSessionProvider = ({
|
|
@@ -121010,6 +121097,9 @@ const AuthWallInner = ({
|
|
|
121010
121097
|
}
|
|
121011
121098
|
return onAuthenticated();
|
|
121012
121099
|
} catch (e3) {
|
|
121100
|
+
if (e3 instanceof AuthenticationCancelledError || (e3 == null ? void 0 : e3.name) === "AuthenticationCancelledError") {
|
|
121101
|
+
return;
|
|
121102
|
+
}
|
|
121013
121103
|
console.error(e3);
|
|
121014
121104
|
setActiveModal("error");
|
|
121015
121105
|
setErrorMessage({
|
|
@@ -123973,18 +124063,24 @@ const CheckSchema = ({
|
|
|
123973
124063
|
if (schemaJson && cms) {
|
|
123974
124064
|
api.checkGraphqlSchema({
|
|
123975
124065
|
localSchema: schemaJson
|
|
123976
|
-
}).then((
|
|
123977
|
-
if (
|
|
124066
|
+
}).then((isSchemaMatchedToCloud) => {
|
|
124067
|
+
if (isSchemaMatchedToCloud === false) {
|
|
123978
124068
|
cms.alerts.error(
|
|
123979
|
-
|
|
124069
|
+
`GraphQL Schema Mismatch - Editing may not work.
|
|
124070
|
+
|
|
124071
|
+
If you just switched branches, try going back to the previous branch.
|
|
124072
|
+
|
|
124073
|
+
If you just pushed changes to the branch, try pulling the latest changes.
|
|
124074
|
+
|
|
124075
|
+
For more information, please see https://tina.io/docs/tinacloud/troubleshooting`
|
|
123980
124076
|
);
|
|
123981
124077
|
}
|
|
123982
|
-
}).catch((
|
|
123983
|
-
if (
|
|
124078
|
+
}).catch((error2) => {
|
|
124079
|
+
if (error2.message.includes("has not been indexed by TinaCloud")) {
|
|
123984
124080
|
setSchemaMissingError(true);
|
|
123985
124081
|
} else {
|
|
123986
|
-
cms.alerts.error(`Unexpected error checking schema: ${
|
|
123987
|
-
throw
|
|
124082
|
+
cms.alerts.error(`Unexpected error checking schema: ${error2}`);
|
|
124083
|
+
throw error2;
|
|
123988
124084
|
}
|
|
123989
124085
|
});
|
|
123990
124086
|
}
|
|
@@ -16,17 +16,28 @@ export type BranchSwitcherPRClickedPayload = {
|
|
|
16
16
|
};
|
|
17
17
|
export declare const SavedContentEvent: string;
|
|
18
18
|
export type SavedContentPayload = {
|
|
19
|
-
collection?: string;
|
|
20
19
|
documentPath?: string;
|
|
21
20
|
};
|
|
21
|
+
export declare const SaveContentErrorEvent: string;
|
|
22
|
+
export type SaveContentErrorPayload = {
|
|
23
|
+
documentPath?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const FormResetEvent: string;
|
|
22
27
|
export declare const MediaManagerContentUploadedEvent: string;
|
|
23
|
-
export type MediaManagerContentUploadedPayload =
|
|
28
|
+
export type MediaManagerContentUploadedPayload = {
|
|
29
|
+
fileType: string;
|
|
30
|
+
fileCount: number;
|
|
31
|
+
};
|
|
24
32
|
export declare const MediaManagerContentDeletedEvent: string;
|
|
25
|
-
export type MediaManagerContentDeletedPayload =
|
|
33
|
+
export type MediaManagerContentDeletedPayload = {
|
|
34
|
+
fileType: string;
|
|
35
|
+
};
|
|
26
36
|
export declare const RichTextEditorSwitchedEvent: string;
|
|
27
37
|
export type RichTextEditorSwitchedPayload = {
|
|
28
38
|
to: 'markdown' | 'richtext';
|
|
29
39
|
};
|
|
40
|
+
export declare const EventLogPageViewedEvent: string;
|
|
30
41
|
export declare const ProjectConfigNavigatedToFromWebsiteEvent: string;
|
|
31
42
|
export type ProjectConfigNavigatedToFromWebsitePayload = Record<string, never>;
|
|
32
43
|
export declare const UserManagementNavigatedToFromWebsiteEvent: string;
|
|
@@ -51,4 +62,7 @@ export declare const CollectionListPageSearchEvent: string;
|
|
|
51
62
|
export type CollectionListPageSearchPayload = {
|
|
52
63
|
searchQuery: string;
|
|
53
64
|
};
|
|
54
|
-
export declare const
|
|
65
|
+
export declare const CloudConfigNavComponentClickedEvent: string;
|
|
66
|
+
export type CloudConfigNavComponentClickedPayload = {
|
|
67
|
+
itemType: 'Project Config' | 'User Management' | 'Support';
|
|
68
|
+
};
|
package/package.json
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
"name": "tinacms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"typings": "dist/index.d.ts",
|
|
5
|
-
"version": "3.6.
|
|
5
|
+
"version": "3.6.2",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./dist/index.js",
|
|
10
10
|
"./dist/client": "./dist/client.js",
|
|
11
|
-
"./dist/edit-state": "./dist/edit-state.js",
|
|
12
11
|
"./react": "./dist/react.js",
|
|
13
12
|
"./dist/react": "./dist/react.js",
|
|
14
13
|
"./dist/rich-text": "./dist/rich-text/index.js",
|
|
@@ -112,9 +111,9 @@
|
|
|
112
111
|
"webfontloader": "1.6.28",
|
|
113
112
|
"yup": "^1.6.1",
|
|
114
113
|
"zod": "^3.24.2",
|
|
114
|
+
"@tinacms/schema-tools": "2.7.0",
|
|
115
115
|
"@tinacms/mdx": "2.0.7",
|
|
116
|
-
"@tinacms/search": "1.2.
|
|
117
|
-
"@tinacms/schema-tools": "2.7.0"
|
|
116
|
+
"@tinacms/search": "1.2.6"
|
|
118
117
|
},
|
|
119
118
|
"devDependencies": {
|
|
120
119
|
"@graphql-tools/utils": "^10.8.1",
|