tinacms 0.67.3 → 0.67.4

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,15 @@
1
1
  # tinacms
2
2
 
3
+ ## 0.67.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 168f6cc6e: Update delete modal header
8
+ - 2a6060138: Fix url parsing issue when a branch name contained a `/`
9
+ - 3af3d6787: Fix issues with finding the template for multitemplate collections
10
+ - Updated dependencies [bf5fe0074]
11
+ - @tinacms/toolkit@0.56.22
12
+
3
13
  ## 0.67.3
4
14
 
5
15
  ### Patch Changes
package/dist/index.es.js CHANGED
@@ -3133,6 +3133,30 @@ function useTina({
3133
3133
  isLoading
3134
3134
  };
3135
3135
  }
3136
+ const TINA_HOST = "content.tinajs.io";
3137
+ const parseURL = (url) => {
3138
+ if (url.includes("localhost")) {
3139
+ return { branch: null, isLocalClient: true, clientId: null };
3140
+ }
3141
+ const params = new URL(url);
3142
+ const pattern = new UrlPattern("/content/:clientId/github/*", {
3143
+ escapeChar: " "
3144
+ });
3145
+ const result = pattern.match(params.pathname);
3146
+ const branch = result == null ? void 0 : result._;
3147
+ const clientId = result == null ? void 0 : result.clientId;
3148
+ if (!branch || !clientId) {
3149
+ throw new Error(`Invalid URL format provided. Expected: https://content.tinajs.io/content/<ClientID>/github/<Branch> but but received ${url}`);
3150
+ }
3151
+ if (params.host !== TINA_HOST) {
3152
+ throw new Error(`The only supported hosts are ${TINA_HOST} or localhost, but received ${params.host}.`);
3153
+ }
3154
+ return {
3155
+ branch,
3156
+ clientId,
3157
+ isLocalClient: false
3158
+ };
3159
+ };
3136
3160
  const errorButtonStyles = {
3137
3161
  background: "#eb6337",
3138
3162
  padding: "12px 18px",
@@ -3212,21 +3236,6 @@ class ErrorBoundary extends React.Component {
3212
3236
  return this.props.children;
3213
3237
  }
3214
3238
  }
3215
- const parseURL = (url) => {
3216
- if (url.includes("localhost")) {
3217
- return { branch: null, isLocalClient: true, clientId: null };
3218
- }
3219
- const tinaHost = "content.tinajs.io";
3220
- const params = new URL(url);
3221
- const pattern = new UrlPattern("/content/:clientId/github/:branch");
3222
- const result = pattern.match(params.pathname);
3223
- if (params.host !== tinaHost) {
3224
- throw new Error(`The only supported hosts are ${tinaHost} or localhost, but received ${params.host}.`);
3225
- }
3226
- return __spreadProps(__spreadValues({}, result), {
3227
- isLocalClient: false
3228
- });
3229
- };
3230
3239
  const TinaCMSProvider2 = (_c) => {
3231
3240
  var _d = _c, {
3232
3241
  query,
@@ -4111,7 +4120,7 @@ const CollectionListPage = () => {
4111
4120
  const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
4112
4121
  return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, {
4113
4122
  close: close2
4114
- }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, {
4123
+ }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, {
4115
4124
  padded: true
4116
4125
  }, /* @__PURE__ */ React.createElement("p", null, `Are you sure you want to delete ${filename}?`)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, {
4117
4126
  style: { flexGrow: 2 },
@@ -4236,15 +4245,11 @@ const RenderForm$1 = ({ cms, collection, template, fields, mutationInfo }) => {
4236
4245
  let schemaFields = fields;
4237
4246
  if (schema) {
4238
4247
  const schemaCollection = schema.getCollection(collection.name);
4239
- const template2 = schema.getTemplateForData({
4240
- collection: schemaCollection,
4241
- data: {}
4242
- });
4243
4248
  const formInfo = resolveForm({
4244
4249
  collection: schemaCollection,
4245
4250
  basename: schemaCollection.name,
4246
4251
  schema,
4247
- template: template2
4252
+ template
4248
4253
  });
4249
4254
  schemaFields = formInfo.fields;
4250
4255
  }
@@ -4402,7 +4407,7 @@ const RenderForm = ({
4402
4407
  const schemaCollection = schema.getCollection(collection.name);
4403
4408
  const template = schema.getTemplateForData({
4404
4409
  collection: schemaCollection,
4405
- data: document.value
4410
+ data: document.values
4406
4411
  });
4407
4412
  const formInfo = resolveForm({
4408
4413
  collection: schemaCollection,
package/dist/index.js CHANGED
@@ -3152,6 +3152,30 @@ mutation addPendingDocumentMutation(
3152
3152
  isLoading
3153
3153
  };
3154
3154
  }
3155
+ const TINA_HOST = "content.tinajs.io";
3156
+ const parseURL = (url) => {
3157
+ if (url.includes("localhost")) {
3158
+ return { branch: null, isLocalClient: true, clientId: null };
3159
+ }
3160
+ const params = new URL(url);
3161
+ const pattern = new UrlPattern__default["default"]("/content/:clientId/github/*", {
3162
+ escapeChar: " "
3163
+ });
3164
+ const result = pattern.match(params.pathname);
3165
+ const branch = result == null ? void 0 : result._;
3166
+ const clientId = result == null ? void 0 : result.clientId;
3167
+ if (!branch || !clientId) {
3168
+ throw new Error(`Invalid URL format provided. Expected: https://content.tinajs.io/content/<ClientID>/github/<Branch> but but received ${url}`);
3169
+ }
3170
+ if (params.host !== TINA_HOST) {
3171
+ throw new Error(`The only supported hosts are ${TINA_HOST} or localhost, but received ${params.host}.`);
3172
+ }
3173
+ return {
3174
+ branch,
3175
+ clientId,
3176
+ isLocalClient: false
3177
+ };
3178
+ };
3155
3179
  const errorButtonStyles = {
3156
3180
  background: "#eb6337",
3157
3181
  padding: "12px 18px",
@@ -3231,21 +3255,6 @@ mutation addPendingDocumentMutation(
3231
3255
  return this.props.children;
3232
3256
  }
3233
3257
  }
3234
- const parseURL = (url) => {
3235
- if (url.includes("localhost")) {
3236
- return { branch: null, isLocalClient: true, clientId: null };
3237
- }
3238
- const tinaHost = "content.tinajs.io";
3239
- const params = new URL(url);
3240
- const pattern = new UrlPattern__default["default"]("/content/:clientId/github/:branch");
3241
- const result = pattern.match(params.pathname);
3242
- if (params.host !== tinaHost) {
3243
- throw new Error(`The only supported hosts are ${tinaHost} or localhost, but received ${params.host}.`);
3244
- }
3245
- return __spreadProps(__spreadValues({}, result), {
3246
- isLocalClient: false
3247
- });
3248
- };
3249
3258
  const TinaCMSProvider2 = (_c) => {
3250
3259
  var _d = _c, {
3251
3260
  query,
@@ -4130,7 +4139,7 @@ This will work when developing locally but NOT when deployed to production.
4130
4139
  const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
4131
4140
  return /* @__PURE__ */ React__default["default"].createElement(toolkit.Modal, null, /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalPopup, null, /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalHeader, {
4132
4141
  close: close2
4133
- }, "Reset"), /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalBody, {
4142
+ }, "Delete ", filename), /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalBody, {
4134
4143
  padded: true
4135
4144
  }, /* @__PURE__ */ React__default["default"].createElement("p", null, `Are you sure you want to delete ${filename}?`)), /* @__PURE__ */ React__default["default"].createElement(toolkit.ModalActions, null, /* @__PURE__ */ React__default["default"].createElement(toolkit.Button, {
4136
4145
  style: { flexGrow: 2 },
@@ -4255,15 +4264,11 @@ This will work when developing locally but NOT when deployed to production.
4255
4264
  let schemaFields = fields;
4256
4265
  if (schema) {
4257
4266
  const schemaCollection = schema.getCollection(collection.name);
4258
- const template2 = schema.getTemplateForData({
4259
- collection: schemaCollection,
4260
- data: {}
4261
- });
4262
4267
  const formInfo = schemaTools.resolveForm({
4263
4268
  collection: schemaCollection,
4264
4269
  basename: schemaCollection.name,
4265
4270
  schema,
4266
- template: template2
4271
+ template
4267
4272
  });
4268
4273
  schemaFields = formInfo.fields;
4269
4274
  }
@@ -4421,7 +4426,7 @@ This will work when developing locally but NOT when deployed to production.
4421
4426
  const schemaCollection = schema.getCollection(collection.name);
4422
4427
  const template = schema.getTemplateForData({
4423
4428
  collection: schemaCollection,
4424
- data: document.value
4429
+ data: document.values
4425
4430
  });
4426
4431
  const formInfo = schemaTools.resolveForm({
4427
4432
  collection: schemaCollection,
@@ -0,0 +1,18 @@
1
+ /**
2
+ Copyright 2021 Forestry.io Holdings, Inc.
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0
7
+ Unless required by applicable law or agreed to in writing, software
8
+ distributed under the License is distributed on an "AS IS" BASIS,
9
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ See the License for the specific language governing permissions and
11
+ limitations under the License.
12
+ */
13
+ export declare const TINA_HOST = "content.tinajs.io";
14
+ export declare const parseURL: (url: string) => {
15
+ branch: any;
16
+ isLocalClient: any;
17
+ clientId: any;
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "0.67.3",
3
+ "version": "0.67.4",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"
@@ -26,7 +26,7 @@
26
26
  "@heroicons/react": "^1.0.4",
27
27
  "@tinacms/schema-tools": "0.0.3",
28
28
  "@tinacms/sharedctx": "0.1.1",
29
- "@tinacms/toolkit": "0.56.21",
29
+ "@tinacms/toolkit": "0.56.22",
30
30
  "crypto-js": "^4.0.0",
31
31
  "final-form": "4.20.1",
32
32
  "graphql": "^15.1.0",