tinacms 0.69.17 → 0.69.19

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.
@@ -10,6 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
- export declare const TinaAdmin: ({ preview }: {
14
- preview?: JSX.Element;
13
+ export declare const TinaAdmin: ({ preview, config, }: {
14
+ preview?: (props: object) => JSX.Element;
15
+ config: object;
15
16
  }) => JSX.Element;
package/dist/index.d.ts CHANGED
@@ -27,6 +27,8 @@ export default TinaCMSProvider2;
27
27
  import { TinaCMS } from '@tinacms/toolkit';
28
28
  import { formifyCallback } from './hooks/use-graphql-forms';
29
29
  import type { TinaCloudSchema as TinaCloudSchemaBase, TinaCloudCollection as TinaCloudCollectionBase, TinaCloudTemplateBase, TinaTemplate, TinaFieldBase, TinaCMSConfig } from '@tinacms/schema-tools';
30
+ export { NAMER, resolveForm } from '@tinacms/schema-tools';
31
+ export type { TinaFieldEnriched, TinaSchema, Template, Templateable, } from '@tinacms/schema-tools';
30
32
  export declare type TinaCloudSchema = TinaCloudSchemaBase<false>;
31
33
  export declare type TinaCloudCollection = TinaCloudCollectionBase<false>;
32
34
  export declare type TinaCollection = TinaCloudCollectionBase<false>;
package/dist/index.es.js CHANGED
@@ -6,6 +6,7 @@ import set from "lodash.set";
6
6
  import React, { useState, useCallback, useEffect, Fragment, useMemo } from "react";
7
7
  import { getIn, setIn } from "final-form";
8
8
  import { resolveForm, TinaSchema, addNamespaceToSchema, validateSchema } from "@tinacms/schema-tools";
9
+ export { NAMER, resolveForm } from "@tinacms/schema-tools";
9
10
  import gql$1 from "graphql-tag";
10
11
  import * as yup from "yup";
11
12
  import { setEditing, TinaDataContext, EditContext, useEditState } from "@tinacms/sharedctx";
@@ -3262,6 +3263,9 @@ var styles = `.tina-tailwind {
3262
3263
  .tina-tailwind .w-56 {
3263
3264
  width: 224px;
3264
3265
  }
3266
+ .tina-tailwind .w-\\[15\\%\\] {
3267
+ width: 15%;
3268
+ }
3265
3269
  .tina-tailwind .w-0 {
3266
3270
  width: 0px;
3267
3271
  }
@@ -3280,6 +3284,9 @@ var styles = `.tina-tailwind {
3280
3284
  .tina-tailwind .max-w-full {
3281
3285
  max-width: 100%;
3282
3286
  }
3287
+ .tina-tailwind .max-w-0 {
3288
+ max-width: 0rem;
3289
+ }
3283
3290
  .tina-tailwind .flex-1 {
3284
3291
  flex: 1 1 0%;
3285
3292
  }
@@ -3386,9 +3393,6 @@ var styles = `.tina-tailwind {
3386
3393
  .tina-tailwind .whitespace-normal {
3387
3394
  white-space: normal;
3388
3395
  }
3389
- .tina-tailwind .whitespace-nowrap {
3390
- white-space: nowrap;
3391
- }
3392
3396
  .tina-tailwind .rounded-lg {
3393
3397
  border-radius: 8px;
3394
3398
  }
@@ -3497,6 +3501,10 @@ var styles = `.tina-tailwind {
3497
3501
  padding-top: 4px;
3498
3502
  padding-bottom: 4px;
3499
3503
  }
3504
+ .tina-tailwind .px-3 {
3505
+ padding-left: 12px;
3506
+ padding-right: 12px;
3507
+ }
3500
3508
  .tina-tailwind .py-5 {
3501
3509
  padding-top: 20px;
3502
3510
  padding-bottom: 20px;
@@ -3519,6 +3527,9 @@ var styles = `.tina-tailwind {
3519
3527
  .tina-tailwind .pl-3 {
3520
3528
  padding-left: 12px;
3521
3529
  }
3530
+ .tina-tailwind .pl-5 {
3531
+ padding-left: 20px;
3532
+ }
3522
3533
  .tina-tailwind .pt-3 {
3523
3534
  padding-top: 12px;
3524
3535
  }
@@ -4948,12 +4959,15 @@ const handleNavigate = (navigate, cms, collection, collectionDefinition, documen
4948
4959
  const plugins = cms.plugins.all("tina-admin");
4949
4960
  const routeMapping = plugins.find(({ name }) => name === "route-mapping");
4950
4961
  const tinaPreview = cms.flags.get("tina-preview") || false;
4951
- const routeOverride = ((_a = collectionDefinition.ui) == null ? void 0 : _a.router) ? (_b = collectionDefinition.ui) == null ? void 0 : _b.router({
4962
+ let routeOverride = ((_a = collectionDefinition.ui) == null ? void 0 : _a.router) ? (_b = collectionDefinition.ui) == null ? void 0 : _b.router({
4952
4963
  document,
4953
4964
  collection: collectionDefinition
4954
4965
  }) : routeMapping ? routeMapping.mapper(collection, document) : void 0;
4955
4966
  if (routeOverride) {
4956
- tinaPreview ? navigate(`/preview?iframe-url=${encodeURIComponent(routeOverride)}`) : window.location.href = routeOverride;
4967
+ if (routeOverride.startsWith("/")) {
4968
+ routeOverride = routeOverride.slice(1);
4969
+ }
4970
+ tinaPreview ? navigate(`/preview/${routeOverride}`) : window.location.href = routeOverride;
4957
4971
  return null;
4958
4972
  } else {
4959
4973
  navigate(document._sys.breadcrumbs.join("/"));
@@ -5084,34 +5098,36 @@ const CollectionListPage = () => {
5084
5098
  key: `document-${document.node._sys.relativePath}`,
5085
5099
  className: ""
5086
5100
  }, /* @__PURE__ */ React.createElement("td", {
5087
- className: "px-6 py-2 whitespace-nowrap"
5101
+ className: "pl-5 pr-3 py-2 truncate max-w-0"
5088
5102
  }, /* @__PURE__ */ React.createElement("a", {
5089
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer",
5103
+ className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
5090
5104
  onClick: () => {
5091
5105
  handleNavigate(navigate, cms, collection, collectionDefinition, document.node);
5092
5106
  }
5093
5107
  }, /* @__PURE__ */ React.createElement(BiEdit, {
5094
- className: "inline-block h-6 w-auto opacity-70"
5095
- }), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("span", {
5108
+ className: "inline-block h-6 w-auto flex-shrink-0 opacity-70"
5109
+ }), /* @__PURE__ */ React.createElement("span", {
5110
+ className: "truncate block"
5111
+ }, /* @__PURE__ */ React.createElement("span", {
5096
5112
  className: "block text-xs text-gray-400 mb-1 uppercase"
5097
5113
  }, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React.createElement("span", {
5098
- className: "h-5 leading-5 block whitespace-nowrap"
5114
+ className: "h-5 leading-5 block truncate"
5099
5115
  }, subfolders && /* @__PURE__ */ React.createElement("span", {
5100
5116
  className: "text-xs text-gray-400"
5101
5117
  }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, hasTitle ? (_a2 = document.node._sys) == null ? void 0 : _a2.title : document.node._sys.filename))))), hasTitle && /* @__PURE__ */ React.createElement("td", {
5102
- className: "px-6 py-4 whitespace-nowrap"
5118
+ className: "px-3 py-4 truncate max-w-0 "
5103
5119
  }, /* @__PURE__ */ React.createElement("span", {
5104
5120
  className: "block text-xs text-gray-400 mb-1 uppercase"
5105
5121
  }, "Filename"), /* @__PURE__ */ React.createElement("span", {
5106
- className: "h-5 leading-5 block text-sm font-medium text-gray-900"
5122
+ className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate"
5107
5123
  }, document.node._sys.filename)), /* @__PURE__ */ React.createElement("td", {
5108
- className: "px-6 py-4 whitespace-nowrap"
5124
+ className: "px-3 py-4 truncate w-[15%]"
5109
5125
  }, /* @__PURE__ */ React.createElement("span", {
5110
5126
  className: "block text-xs text-gray-400 mb-1 uppercase"
5111
5127
  }, "Extension"), /* @__PURE__ */ React.createElement("span", {
5112
5128
  className: "h-5 leading-5 block text-sm font-medium text-gray-900"
5113
5129
  }, document.node._sys.extension)), /* @__PURE__ */ React.createElement("td", {
5114
- className: "px-6 py-4 whitespace-nowrap"
5130
+ className: "px-3 py-4 truncate w-[15%]"
5115
5131
  }, /* @__PURE__ */ React.createElement("span", {
5116
5132
  className: "block text-xs text-gray-400 mb-1 uppercase"
5117
5133
  }, "Template"), /* @__PURE__ */ React.createElement("span", {
@@ -5550,7 +5566,47 @@ const SetPreviewFlag = ({
5550
5566
  }, [preview]);
5551
5567
  return null;
5552
5568
  };
5553
- const TinaAdmin = ({ preview }) => {
5569
+ const PreviewInner = ({ preview, config }) => {
5570
+ const params = useParams();
5571
+ const navigate = useNavigate();
5572
+ const [url, setURL] = React.useState(`/${params["*"]}`);
5573
+ const [reportedURL, setReportedURL] = useState(null);
5574
+ const ref = React.useRef(null);
5575
+ const paramURL = `/${params["*"]}`;
5576
+ React.useEffect(() => {
5577
+ if (reportedURL !== paramURL && paramURL) {
5578
+ setURL(paramURL);
5579
+ }
5580
+ }, [paramURL]);
5581
+ React.useEffect(() => {
5582
+ if ((reportedURL !== url || reportedURL !== paramURL) && reportedURL) {
5583
+ navigate(`/preview${reportedURL}`);
5584
+ }
5585
+ }, [reportedURL]);
5586
+ React.useEffect(() => {
5587
+ setInterval(() => {
5588
+ var _a;
5589
+ if (ref.current) {
5590
+ const url2 = new URL(((_a = ref.current.contentWindow) == null ? void 0 : _a.location.href) || "");
5591
+ if (url2.origin === "null") {
5592
+ return;
5593
+ }
5594
+ const href = url2.href.replace(url2.origin, "");
5595
+ setReportedURL(href);
5596
+ }
5597
+ }, 100);
5598
+ }, [ref.current]);
5599
+ const Preview = preview;
5600
+ return /* @__PURE__ */ React.createElement(Preview, {
5601
+ url,
5602
+ iframeRef: ref,
5603
+ ...config
5604
+ });
5605
+ };
5606
+ const TinaAdmin = ({
5607
+ preview,
5608
+ config
5609
+ }) => {
5554
5610
  const isSSR2 = typeof window === "undefined";
5555
5611
  const { edit } = useEditState();
5556
5612
  if (isSSR2) {
@@ -5566,8 +5622,11 @@ const TinaAdmin = ({ preview }) => {
5566
5622
  preview,
5567
5623
  cms
5568
5624
  }), /* @__PURE__ */ React.createElement(Routes, null, preview && /* @__PURE__ */ React.createElement(Route, {
5569
- path: "preview",
5570
- element: preview
5625
+ path: "/preview/*",
5626
+ element: /* @__PURE__ */ React.createElement(PreviewInner, {
5627
+ config,
5628
+ preview
5629
+ })
5571
5630
  }), /* @__PURE__ */ React.createElement(Route, {
5572
5631
  path: "collections/:collectionName/new",
5573
5632
  element: /* @__PURE__ */ React.createElement(DefaultWrapper, {
@@ -5630,13 +5689,15 @@ class RouteMappingPlugin {
5630
5689
  }
5631
5690
  }
5632
5691
  const defineSchema = (config) => {
5633
- validateSchema({ config });
5692
+ validateSchema({ schema: config });
5634
5693
  return config;
5635
5694
  };
5636
5695
  const defineConfig = (config) => {
5696
+ validateSchema({ schema: config.schema });
5637
5697
  return config;
5638
5698
  };
5639
5699
  const defineStaticConfig = (config) => {
5700
+ validateSchema({ schema: config.schema });
5640
5701
  return config;
5641
5702
  };
5642
5703
  export { AuthWallInner, Client, DEFAULT_LOCAL_TINA_GQL_SERVER_URL, LocalClient, RouteMappingPlugin, TinaAdmin, TinaAdminApi, TinaCMSProvider2, TinaCloudAuthWall, TinaCloudProvider, TinaDataProvider, assertShape, createClient, TinaCMSProvider2 as default, defineConfig, defineSchema, defineStaticConfig, getStaticPropsForTina, gql, safeAssertShape, staticRequest, useDocumentCreatorPlugin, useGraphqlForms, useTinaAuthRedirect };
package/dist/index.js CHANGED
@@ -3280,6 +3280,9 @@ mutation addPendingDocumentMutation(
3280
3280
  .tina-tailwind .w-56 {
3281
3281
  width: 224px;
3282
3282
  }
3283
+ .tina-tailwind .w-\\[15\\%\\] {
3284
+ width: 15%;
3285
+ }
3283
3286
  .tina-tailwind .w-0 {
3284
3287
  width: 0px;
3285
3288
  }
@@ -3298,6 +3301,9 @@ mutation addPendingDocumentMutation(
3298
3301
  .tina-tailwind .max-w-full {
3299
3302
  max-width: 100%;
3300
3303
  }
3304
+ .tina-tailwind .max-w-0 {
3305
+ max-width: 0rem;
3306
+ }
3301
3307
  .tina-tailwind .flex-1 {
3302
3308
  flex: 1 1 0%;
3303
3309
  }
@@ -3404,9 +3410,6 @@ mutation addPendingDocumentMutation(
3404
3410
  .tina-tailwind .whitespace-normal {
3405
3411
  white-space: normal;
3406
3412
  }
3407
- .tina-tailwind .whitespace-nowrap {
3408
- white-space: nowrap;
3409
- }
3410
3413
  .tina-tailwind .rounded-lg {
3411
3414
  border-radius: 8px;
3412
3415
  }
@@ -3515,6 +3518,10 @@ mutation addPendingDocumentMutation(
3515
3518
  padding-top: 4px;
3516
3519
  padding-bottom: 4px;
3517
3520
  }
3521
+ .tina-tailwind .px-3 {
3522
+ padding-left: 12px;
3523
+ padding-right: 12px;
3524
+ }
3518
3525
  .tina-tailwind .py-5 {
3519
3526
  padding-top: 20px;
3520
3527
  padding-bottom: 20px;
@@ -3537,6 +3544,9 @@ mutation addPendingDocumentMutation(
3537
3544
  .tina-tailwind .pl-3 {
3538
3545
  padding-left: 12px;
3539
3546
  }
3547
+ .tina-tailwind .pl-5 {
3548
+ padding-left: 20px;
3549
+ }
3540
3550
  .tina-tailwind .pt-3 {
3541
3551
  padding-top: 12px;
3542
3552
  }
@@ -4966,12 +4976,15 @@ This will work when developing locally but NOT when deployed to production.
4966
4976
  const plugins = cms.plugins.all("tina-admin");
4967
4977
  const routeMapping = plugins.find(({ name }) => name === "route-mapping");
4968
4978
  const tinaPreview = cms.flags.get("tina-preview") || false;
4969
- const routeOverride = ((_a = collectionDefinition.ui) == null ? void 0 : _a.router) ? (_b = collectionDefinition.ui) == null ? void 0 : _b.router({
4979
+ let routeOverride = ((_a = collectionDefinition.ui) == null ? void 0 : _a.router) ? (_b = collectionDefinition.ui) == null ? void 0 : _b.router({
4970
4980
  document,
4971
4981
  collection: collectionDefinition
4972
4982
  }) : routeMapping ? routeMapping.mapper(collection, document) : void 0;
4973
4983
  if (routeOverride) {
4974
- tinaPreview ? navigate(`/preview?iframe-url=${encodeURIComponent(routeOverride)}`) : window.location.href = routeOverride;
4984
+ if (routeOverride.startsWith("/")) {
4985
+ routeOverride = routeOverride.slice(1);
4986
+ }
4987
+ tinaPreview ? navigate(`/preview/${routeOverride}`) : window.location.href = routeOverride;
4975
4988
  return null;
4976
4989
  } else {
4977
4990
  navigate(document._sys.breadcrumbs.join("/"));
@@ -5102,34 +5115,36 @@ This will work when developing locally but NOT when deployed to production.
5102
5115
  key: `document-${document.node._sys.relativePath}`,
5103
5116
  className: ""
5104
5117
  }, /* @__PURE__ */ React__default["default"].createElement("td", {
5105
- className: "px-6 py-2 whitespace-nowrap"
5118
+ className: "pl-5 pr-3 py-2 truncate max-w-0"
5106
5119
  }, /* @__PURE__ */ React__default["default"].createElement("a", {
5107
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer",
5120
+ className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
5108
5121
  onClick: () => {
5109
5122
  handleNavigate(navigate, cms, collection, collectionDefinition, document.node);
5110
5123
  }
5111
5124
  }, /* @__PURE__ */ React__default["default"].createElement(BiEdit, {
5112
- className: "inline-block h-6 w-auto opacity-70"
5113
- }), /* @__PURE__ */ React__default["default"].createElement("span", null, /* @__PURE__ */ React__default["default"].createElement("span", {
5125
+ className: "inline-block h-6 w-auto flex-shrink-0 opacity-70"
5126
+ }), /* @__PURE__ */ React__default["default"].createElement("span", {
5127
+ className: "truncate block"
5128
+ }, /* @__PURE__ */ React__default["default"].createElement("span", {
5114
5129
  className: "block text-xs text-gray-400 mb-1 uppercase"
5115
5130
  }, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React__default["default"].createElement("span", {
5116
- className: "h-5 leading-5 block whitespace-nowrap"
5131
+ className: "h-5 leading-5 block truncate"
5117
5132
  }, subfolders && /* @__PURE__ */ React__default["default"].createElement("span", {
5118
5133
  className: "text-xs text-gray-400"
5119
5134
  }, `${subfolders}/`), /* @__PURE__ */ React__default["default"].createElement("span", null, hasTitle ? (_a2 = document.node._sys) == null ? void 0 : _a2.title : document.node._sys.filename))))), hasTitle && /* @__PURE__ */ React__default["default"].createElement("td", {
5120
- className: "px-6 py-4 whitespace-nowrap"
5135
+ className: "px-3 py-4 truncate max-w-0 "
5121
5136
  }, /* @__PURE__ */ React__default["default"].createElement("span", {
5122
5137
  className: "block text-xs text-gray-400 mb-1 uppercase"
5123
5138
  }, "Filename"), /* @__PURE__ */ React__default["default"].createElement("span", {
5124
- className: "h-5 leading-5 block text-sm font-medium text-gray-900"
5139
+ className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate"
5125
5140
  }, document.node._sys.filename)), /* @__PURE__ */ React__default["default"].createElement("td", {
5126
- className: "px-6 py-4 whitespace-nowrap"
5141
+ className: "px-3 py-4 truncate w-[15%]"
5127
5142
  }, /* @__PURE__ */ React__default["default"].createElement("span", {
5128
5143
  className: "block text-xs text-gray-400 mb-1 uppercase"
5129
5144
  }, "Extension"), /* @__PURE__ */ React__default["default"].createElement("span", {
5130
5145
  className: "h-5 leading-5 block text-sm font-medium text-gray-900"
5131
5146
  }, document.node._sys.extension)), /* @__PURE__ */ React__default["default"].createElement("td", {
5132
- className: "px-6 py-4 whitespace-nowrap"
5147
+ className: "px-3 py-4 truncate w-[15%]"
5133
5148
  }, /* @__PURE__ */ React__default["default"].createElement("span", {
5134
5149
  className: "block text-xs text-gray-400 mb-1 uppercase"
5135
5150
  }, "Template"), /* @__PURE__ */ React__default["default"].createElement("span", {
@@ -5568,7 +5583,47 @@ This will work when developing locally but NOT when deployed to production.
5568
5583
  }, [preview]);
5569
5584
  return null;
5570
5585
  };
5571
- const TinaAdmin = ({ preview }) => {
5586
+ const PreviewInner = ({ preview, config }) => {
5587
+ const params = reactRouterDom.useParams();
5588
+ const navigate = reactRouterDom.useNavigate();
5589
+ const [url, setURL] = React__default["default"].useState(`/${params["*"]}`);
5590
+ const [reportedURL, setReportedURL] = React.useState(null);
5591
+ const ref = React__default["default"].useRef(null);
5592
+ const paramURL = `/${params["*"]}`;
5593
+ React__default["default"].useEffect(() => {
5594
+ if (reportedURL !== paramURL && paramURL) {
5595
+ setURL(paramURL);
5596
+ }
5597
+ }, [paramURL]);
5598
+ React__default["default"].useEffect(() => {
5599
+ if ((reportedURL !== url || reportedURL !== paramURL) && reportedURL) {
5600
+ navigate(`/preview${reportedURL}`);
5601
+ }
5602
+ }, [reportedURL]);
5603
+ React__default["default"].useEffect(() => {
5604
+ setInterval(() => {
5605
+ var _a;
5606
+ if (ref.current) {
5607
+ const url2 = new URL(((_a = ref.current.contentWindow) == null ? void 0 : _a.location.href) || "");
5608
+ if (url2.origin === "null") {
5609
+ return;
5610
+ }
5611
+ const href = url2.href.replace(url2.origin, "");
5612
+ setReportedURL(href);
5613
+ }
5614
+ }, 100);
5615
+ }, [ref.current]);
5616
+ const Preview = preview;
5617
+ return /* @__PURE__ */ React__default["default"].createElement(Preview, {
5618
+ url,
5619
+ iframeRef: ref,
5620
+ ...config
5621
+ });
5622
+ };
5623
+ const TinaAdmin = ({
5624
+ preview,
5625
+ config
5626
+ }) => {
5572
5627
  const isSSR2 = typeof window === "undefined";
5573
5628
  const { edit } = sharedctx.useEditState();
5574
5629
  if (isSSR2) {
@@ -5584,8 +5639,11 @@ This will work when developing locally but NOT when deployed to production.
5584
5639
  preview,
5585
5640
  cms
5586
5641
  }), /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Routes, null, preview && /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
5587
- path: "preview",
5588
- element: preview
5642
+ path: "/preview/*",
5643
+ element: /* @__PURE__ */ React__default["default"].createElement(PreviewInner, {
5644
+ config,
5645
+ preview
5646
+ })
5589
5647
  }), /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
5590
5648
  path: "collections/:collectionName/new",
5591
5649
  element: /* @__PURE__ */ React__default["default"].createElement(DefaultWrapper, {
@@ -5648,15 +5706,29 @@ This will work when developing locally but NOT when deployed to production.
5648
5706
  }
5649
5707
  }
5650
5708
  const defineSchema = (config) => {
5651
- schemaTools.validateSchema({ config });
5709
+ schemaTools.validateSchema({ schema: config });
5652
5710
  return config;
5653
5711
  };
5654
5712
  const defineConfig = (config) => {
5713
+ schemaTools.validateSchema({ schema: config.schema });
5655
5714
  return config;
5656
5715
  };
5657
5716
  const defineStaticConfig = (config) => {
5717
+ schemaTools.validateSchema({ schema: config.schema });
5658
5718
  return config;
5659
5719
  };
5720
+ Object.defineProperty(exports2, "NAMER", {
5721
+ enumerable: true,
5722
+ get: function() {
5723
+ return schemaTools.NAMER;
5724
+ }
5725
+ });
5726
+ Object.defineProperty(exports2, "resolveForm", {
5727
+ enumerable: true,
5728
+ get: function() {
5729
+ return schemaTools.resolveForm;
5730
+ }
5731
+ });
5660
5732
  exports2.AuthWallInner = AuthWallInner;
5661
5733
  exports2.Client = Client;
5662
5734
  exports2.DEFAULT_LOCAL_TINA_GQL_SERVER_URL = DEFAULT_LOCAL_TINA_GQL_SERVER_URL;
package/dist/react.es.js CHANGED
@@ -1,17 +1,19 @@
1
1
  import React from "react";
2
2
  function useTina(props) {
3
3
  const [data, setData] = React.useState(props.data);
4
+ const id = JSON.stringify({ query: props.query, variables: props.variables });
5
+ React.useEffect(() => {
6
+ setData(props.data);
7
+ }, [id]);
4
8
  React.useEffect(() => {
5
- const id = btoa(JSON.stringify({ query: props.query }));
6
9
  parent.postMessage({ type: "open", ...props, id }, window.location.origin);
7
10
  window.addEventListener("message", (event) => {
8
- if (event.data.id === id) {
9
- console.log("child: event received");
11
+ if (event.data.id === id && event.data.type === "updateData") {
10
12
  setData(event.data.data);
11
13
  }
12
14
  });
13
15
  return () => parent.postMessage({ type: "close", id }, window.location.origin);
14
- }, []);
16
+ }, [id]);
15
17
  return { data };
16
18
  }
17
19
  export { useTina };
package/dist/react.js CHANGED
@@ -8,17 +8,19 @@
8
8
  var React__default = /* @__PURE__ */ _interopDefaultLegacy(React);
9
9
  function useTina(props) {
10
10
  const [data, setData] = React__default["default"].useState(props.data);
11
+ const id = JSON.stringify({ query: props.query, variables: props.variables });
12
+ React__default["default"].useEffect(() => {
13
+ setData(props.data);
14
+ }, [id]);
11
15
  React__default["default"].useEffect(() => {
12
- const id = btoa(JSON.stringify({ query: props.query }));
13
16
  parent.postMessage({ type: "open", ...props, id }, window.location.origin);
14
17
  window.addEventListener("message", (event) => {
15
- if (event.data.id === id) {
16
- console.log("child: event received");
18
+ if (event.data.id === id && event.data.type === "updateData") {
17
19
  setData(event.data.data);
18
20
  }
19
21
  });
20
22
  return () => parent.postMessage({ type: "close", id }, window.location.origin);
21
- }, []);
23
+ }, [id]);
22
24
  return { data };
23
25
  }
24
26
  exports2.useTina = useTina;
package/dist/style.css CHANGED
@@ -462,6 +462,9 @@
462
462
  .tina-tailwind .w-56 {
463
463
  width: 224px;
464
464
  }
465
+ .tina-tailwind .w-\[15\%\] {
466
+ width: 15%;
467
+ }
465
468
  .tina-tailwind .w-0 {
466
469
  width: 0px;
467
470
  }
@@ -480,6 +483,9 @@
480
483
  .tina-tailwind .max-w-full {
481
484
  max-width: 100%;
482
485
  }
486
+ .tina-tailwind .max-w-0 {
487
+ max-width: 0rem;
488
+ }
483
489
  .tina-tailwind .flex-1 {
484
490
  flex: 1 1 0%;
485
491
  }
@@ -586,9 +592,6 @@
586
592
  .tina-tailwind .whitespace-normal {
587
593
  white-space: normal;
588
594
  }
589
- .tina-tailwind .whitespace-nowrap {
590
- white-space: nowrap;
591
- }
592
595
  .tina-tailwind .rounded-lg {
593
596
  border-radius: 8px;
594
597
  }
@@ -697,6 +700,10 @@
697
700
  padding-top: 4px;
698
701
  padding-bottom: 4px;
699
702
  }
703
+ .tina-tailwind .px-3 {
704
+ padding-left: 12px;
705
+ padding-right: 12px;
706
+ }
700
707
  .tina-tailwind .py-5 {
701
708
  padding-top: 20px;
702
709
  padding-bottom: 20px;
@@ -719,6 +726,9 @@
719
726
  .tina-tailwind .pl-3 {
720
727
  padding-left: 12px;
721
728
  }
729
+ .tina-tailwind .pl-5 {
730
+ padding-left: 20px;
731
+ }
722
732
  .tina-tailwind .pt-3 {
723
733
  padding-top: 12px;
724
734
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "0.69.17",
3
+ "version": "0.69.19",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "exports": {
@@ -54,13 +54,13 @@
54
54
  "@headlessui/react": "^1.5.0",
55
55
  "@heroicons/react": "^1.0.4",
56
56
  "@react-hook/window-size": "^3.0.7",
57
- "@tinacms/schema-tools": "0.1.8",
57
+ "@tinacms/schema-tools": "0.1.9",
58
58
  "@tinacms/sharedctx": "0.1.3",
59
- "@tinacms/toolkit": "0.58.0",
59
+ "@tinacms/toolkit": "0.58.1",
60
60
  "crypto-js": "^4.0.0",
61
61
  "fetch-ponyfill": "^7.1.0",
62
62
  "final-form": "4.20.1",
63
- "graphql": "^15.1.0",
63
+ "graphql": "15.8.0",
64
64
  "graphql-tag": "^2.11.0",
65
65
  "lodash.set": "^4.3.2",
66
66
  "prism-react-renderer": "^1.3.5",
@@ -75,7 +75,7 @@
75
75
  "@testing-library/react": "^12.0.0",
76
76
  "@testing-library/react-hooks": "^7.0.2",
77
77
  "@testing-library/user-event": "^12.7.0",
78
- "@tinacms/scripts": "0.51.2",
78
+ "@tinacms/scripts": "0.51.3",
79
79
  "@types/jest": "^27.0.1",
80
80
  "@types/lodash": "^4.14.169",
81
81
  "@types/node": "^14.0.13",