tinacms 0.68.9 → 0.68.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # tinacms
2
2
 
3
+ ## 0.68.10
4
+
5
+ ### Patch Changes
6
+
7
+ - d95b73974: Fix collection list page delete modal
8
+ - 7b77fe1b5: Add a default TinaMediaStore for repo-based media
9
+ - Updated dependencies [2ef5a1f33]
10
+ - Updated dependencies [fb73fb355]
11
+ - Updated dependencies [7b77fe1b5]
12
+ - Updated dependencies [99a13024d]
13
+ - @tinacms/toolkit@0.56.33
14
+ - @tinacms/schema-tools@0.0.6
15
+ - @tinacms/sharedctx@0.1.1
16
+
17
+ All notable changes to `tinacms/packages/tinacms` will be documented in this file.
18
+
19
+ Note: For root tinacms changes, please refer to the [CHANGELOG.md](https://github.com/tinacms/tinacms/CHANGELOG.md) specific to root `tinacms`.
20
+
3
21
  ## 0.68.9
4
22
 
5
23
  ### Patch Changes
package/dist/index.es.js CHANGED
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { useCMS, Form, GlobalFormPlugin, EventBus, Modal, ModalPopup, ModalHeader, ModalBody, ModalActions, Button as Button$1, LoadingDots, useLocalStorage, TinaCMS, BranchSwitcherPlugin, BranchDataProvider, TinaProvider, Nav, LocalWarning, OverflowMenu, FormStatus, FormBuilder } from "@tinacms/toolkit";
32
+ import { useCMS, Form, GlobalFormPlugin, EventBus, Modal, ModalPopup, ModalHeader, ModalBody, ModalActions, Button as Button$1, LoadingDots, useLocalStorage, TinaCMS, BranchSwitcherPlugin, BranchDataProvider, TinaProvider, TinaMediaStore, DummyMediaStore, Nav, LocalWarning, OverflowMenu, PopupModal, FormStatus, FormBuilder } from "@tinacms/toolkit";
33
33
  export * from "@tinacms/toolkit";
34
34
  import * as G from "graphql";
35
35
  import { TypeInfo, visit, visitWithTypeInfo, getNamedType, GraphQLObjectType, isLeafType, GraphQLUnionType, isScalarType as isScalarType$1, getIntrospectionQuery, buildClientSchema, print, parse } from "graphql";
@@ -2206,11 +2206,12 @@ mutation addPendingDocumentMutation(
2206
2206
  return this.contentApiUrl.includes("localhost");
2207
2207
  }
2208
2208
  setBranch(branchName) {
2209
- var _a, _b, _c;
2209
+ var _a, _b, _c, _d;
2210
2210
  const encodedBranch = encodeURIComponent(branchName);
2211
- this.frontendUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.frontendUrlOverride) || "https://app.tina.io";
2212
- this.identityApiUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.identityApiUrlOverride) || "https://identity.tinajs.io";
2213
- this.contentApiBase = ((_c = this.options.tinaioConfig) == null ? void 0 : _c.contentApiUrlOverride) || `https://content.tinajs.io`;
2211
+ this.assetsApiUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.assetsApiUrlOverride) || "https://assets.tinajs.io";
2212
+ this.frontendUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.frontendUrlOverride) || "https://app.tina.io";
2213
+ this.identityApiUrl = ((_c = this.options.tinaioConfig) == null ? void 0 : _c.identityApiUrlOverride) || "https://identity.tinajs.io";
2214
+ this.contentApiBase = ((_d = this.options.tinaioConfig) == null ? void 0 : _d.contentApiUrlOverride) || `https://content.tinajs.io`;
2214
2215
  this.contentApiUrl = this.options.customContentApiUrl || `${this.contentApiBase}/content/${this.options.clientId}/github/${encodedBranch}`;
2215
2216
  }
2216
2217
  async requestWithForm(query, {
@@ -2662,7 +2663,7 @@ const TinaCloudProvider = (props) => {
2662
2663
  cms.registerApi("admin", new TinaAdminApi(cms));
2663
2664
  }
2664
2665
  const setupMedia = async () => {
2665
- var _a;
2666
+ var _a, _b, _c;
2666
2667
  if (props.mediaStore) {
2667
2668
  if ((_a = props.mediaStore.prototype) == null ? void 0 : _a.persist) {
2668
2669
  cms.media.store = new props.mediaStore(cms.api.tina);
@@ -2670,6 +2671,12 @@ const TinaCloudProvider = (props) => {
2670
2671
  const MediaClass = await props.mediaStore();
2671
2672
  cms.media.store = new MediaClass(cms.api.tina);
2672
2673
  }
2674
+ } else {
2675
+ if ((_c = (_b = props.schema.config) == null ? void 0 : _b.media) == null ? void 0 : _c.tina) {
2676
+ cms.media.store = new TinaMediaStore(cms);
2677
+ } else {
2678
+ cms.media.store = new DummyMediaStore();
2679
+ }
2673
2680
  }
2674
2681
  };
2675
2682
  const handleListBranches = async () => {
@@ -5012,7 +5019,7 @@ const CollectionListPage = () => {
5012
5019
  });
5013
5020
  };
5014
5021
  const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
5015
- return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, {
5022
+ return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, {
5016
5023
  close: close2
5017
5024
  }, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, {
5018
5025
  padded: true
@@ -5026,7 +5033,7 @@ const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
5026
5033
  await deleteFunc();
5027
5034
  close2();
5028
5035
  }
5029
- }, "Delete")));
5036
+ }, "Delete"))));
5030
5037
  };
5031
5038
  function HiChevronRight(props) {
5032
5039
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", "clipRule": "evenodd" } }] })(props);
package/dist/index.js CHANGED
@@ -2224,11 +2224,12 @@ mutation addPendingDocumentMutation(
2224
2224
  return this.contentApiUrl.includes("localhost");
2225
2225
  }
2226
2226
  setBranch(branchName) {
2227
- var _a, _b, _c;
2227
+ var _a, _b, _c, _d;
2228
2228
  const encodedBranch = encodeURIComponent(branchName);
2229
- this.frontendUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.frontendUrlOverride) || "https://app.tina.io";
2230
- this.identityApiUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.identityApiUrlOverride) || "https://identity.tinajs.io";
2231
- this.contentApiBase = ((_c = this.options.tinaioConfig) == null ? void 0 : _c.contentApiUrlOverride) || `https://content.tinajs.io`;
2229
+ this.assetsApiUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.assetsApiUrlOverride) || "https://assets.tinajs.io";
2230
+ this.frontendUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.frontendUrlOverride) || "https://app.tina.io";
2231
+ this.identityApiUrl = ((_c = this.options.tinaioConfig) == null ? void 0 : _c.identityApiUrlOverride) || "https://identity.tinajs.io";
2232
+ this.contentApiBase = ((_d = this.options.tinaioConfig) == null ? void 0 : _d.contentApiUrlOverride) || `https://content.tinajs.io`;
2232
2233
  this.contentApiUrl = this.options.customContentApiUrl || `${this.contentApiBase}/content/${this.options.clientId}/github/${encodedBranch}`;
2233
2234
  }
2234
2235
  async requestWithForm(query, {
@@ -2680,7 +2681,7 @@ mutation addPendingDocumentMutation(
2680
2681
  cms.registerApi("admin", new TinaAdminApi(cms));
2681
2682
  }
2682
2683
  const setupMedia = async () => {
2683
- var _a;
2684
+ var _a, _b, _c;
2684
2685
  if (props.mediaStore) {
2685
2686
  if ((_a = props.mediaStore.prototype) == null ? void 0 : _a.persist) {
2686
2687
  cms.media.store = new props.mediaStore(cms.api.tina);
@@ -2688,6 +2689,12 @@ mutation addPendingDocumentMutation(
2688
2689
  const MediaClass = await props.mediaStore();
2689
2690
  cms.media.store = new MediaClass(cms.api.tina);
2690
2691
  }
2692
+ } else {
2693
+ if ((_c = (_b = props.schema.config) == null ? void 0 : _b.media) == null ? void 0 : _c.tina) {
2694
+ cms.media.store = new toolkit.TinaMediaStore(cms);
2695
+ } else {
2696
+ cms.media.store = new toolkit.DummyMediaStore();
2697
+ }
2691
2698
  }
2692
2699
  };
2693
2700
  const handleListBranches = async () => {
@@ -5030,7 +5037,7 @@ This will work when developing locally but NOT when deployed to production.
5030
5037
  });
5031
5038
  };
5032
5039
  const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
5033
- return /* @__PURE__ */ React__default["default"].createElement(toolkit.Modal, null, /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalHeader, {
5040
+ return /* @__PURE__ */ React__default["default"].createElement(toolkit.Modal, null, /* @__PURE__ */ React__default["default"].createElement(toolkit.PopupModal, null, /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalHeader, {
5034
5041
  close: close2
5035
5042
  }, "Delete ", filename), /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalBody, {
5036
5043
  padded: true
@@ -5044,7 +5051,7 @@ This will work when developing locally but NOT when deployed to production.
5044
5051
  await deleteFunc();
5045
5052
  close2();
5046
5053
  }
5047
- }, "Delete")));
5054
+ }, "Delete"))));
5048
5055
  };
5049
5056
  function HiChevronRight(props) {
5050
5057
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", "clipRule": "evenodd" } }] })(props);
@@ -16,6 +16,7 @@ import { DocumentNode, GraphQLSchema } from 'graphql';
16
16
  import gql from 'graphql-tag';
17
17
  import { TinaSchema, TinaCloudSchema } from '@tinacms/schema-tools';
18
18
  export declare type TinaIOConfig = {
19
+ assetsApiUrlOverride?: string;
19
20
  frontendUrlOverride?: string;
20
21
  identityApiUrlOverride?: string;
21
22
  contentApiUrlOverride?: string;
@@ -33,6 +34,7 @@ export declare class Client {
33
34
  frontendUrl: string;
34
35
  contentApiUrl: string;
35
36
  identityApiUrl: string;
37
+ assetsApiUrl: string;
36
38
  gqlSchema: GraphQLSchema;
37
39
  schema?: TinaSchema;
38
40
  clientId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "0.68.9",
3
+ "version": "0.68.10",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"
@@ -26,9 +26,9 @@
26
26
  "@headlessui/react": "^1.5.0",
27
27
  "@heroicons/react": "^1.0.4",
28
28
  "@react-hook/window-size": "^3.0.7",
29
- "@tinacms/schema-tools": "0.0.5",
29
+ "@tinacms/schema-tools": "0.0.6",
30
30
  "@tinacms/sharedctx": "0.1.1",
31
- "@tinacms/toolkit": "0.56.32",
31
+ "@tinacms/toolkit": "0.56.33",
32
32
  "crypto-js": "^4.0.0",
33
33
  "fetch-ponyfill": "^7.1.0",
34
34
  "final-form": "4.20.1",
@@ -46,7 +46,7 @@
46
46
  "@testing-library/react": "^12.0.0",
47
47
  "@testing-library/react-hooks": "^7.0.2",
48
48
  "@testing-library/user-event": "^12.7.0",
49
- "@tinacms/scripts": "0.50.8",
49
+ "@tinacms/scripts": "0.50.9",
50
50
  "@types/jest": "^27.0.1",
51
51
  "@types/lodash": "^4.14.169",
52
52
  "@types/node": "^14.0.13",