tinacms 1.4.6 → 1.5.1

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/react.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare function useTina<T extends object>(props: {
8
8
  data: T;
9
9
  }): {
10
10
  data: T;
11
+ isClient: boolean;
11
12
  };
12
13
  export declare function useEditState(): {
13
14
  edit: boolean;
@@ -18,7 +19,7 @@ export declare function useEditState(): {
18
19
  * is working with.
19
20
  */
20
21
  export declare const tinaField: <T extends object & {
21
- __meta__?: {
22
+ _tina_metadata?: {
22
23
  id: string;
23
24
  name?: string;
24
25
  fields: Record<string, string>;
package/dist/react.es.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import React from "react";
2
2
  function useTina(props) {
3
3
  const [data, setData] = React.useState(props.data);
4
+ const [isClient, setIsClient] = React.useState(false);
4
5
  const id = JSON.stringify({ query: props.query, variables: props.variables });
5
6
  React.useEffect(() => {
7
+ setIsClient(true);
6
8
  setData(props.data);
7
9
  }, [id]);
8
10
  React.useEffect(() => {
@@ -12,9 +14,11 @@ function useTina(props) {
12
14
  setData(event.data.data);
13
15
  }
14
16
  });
15
- return () => parent.postMessage({ type: "close", id }, window.location.origin);
17
+ return () => {
18
+ parent.postMessage({ type: "close", id }, window.location.origin);
19
+ };
16
20
  }, [id]);
17
- return { data };
21
+ return { data, isClient };
18
22
  }
19
23
  function useEditState() {
20
24
  const [edit, setEdit] = React.useState(false);
@@ -34,11 +38,11 @@ function useEditState() {
34
38
  const tinaField = (obj, field) => {
35
39
  var _a, _b, _c;
36
40
  if (!field) {
37
- return `${(_a = obj.__meta__) == null ? void 0 : _a.id}#${(_b = obj.__meta__) == null ? void 0 : _b.name}`;
41
+ return `${(_a = obj._tina_metadata) == null ? void 0 : _a.id}#${(_b = obj._tina_metadata) == null ? void 0 : _b.name}`;
38
42
  }
39
- if (obj == null ? void 0 : obj.__meta__) {
43
+ if (obj == null ? void 0 : obj._tina_metadata) {
40
44
  if (typeof field === "string") {
41
- return `${(_c = obj.__meta__) == null ? void 0 : _c.id}#${obj.__meta__.fields[field]}`;
45
+ return `${(_c = obj._tina_metadata) == null ? void 0 : _c.id}#${obj._tina_metadata.fields[field]}`;
42
46
  }
43
47
  }
44
48
  return "";
package/dist/react.js CHANGED
@@ -8,8 +8,10 @@
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 [isClient, setIsClient] = React__default["default"].useState(false);
11
12
  const id = JSON.stringify({ query: props.query, variables: props.variables });
12
13
  React__default["default"].useEffect(() => {
14
+ setIsClient(true);
13
15
  setData(props.data);
14
16
  }, [id]);
15
17
  React__default["default"].useEffect(() => {
@@ -19,9 +21,11 @@
19
21
  setData(event.data.data);
20
22
  }
21
23
  });
22
- return () => parent.postMessage({ type: "close", id }, window.location.origin);
24
+ return () => {
25
+ parent.postMessage({ type: "close", id }, window.location.origin);
26
+ };
23
27
  }, [id]);
24
- return { data };
28
+ return { data, isClient };
25
29
  }
26
30
  function useEditState() {
27
31
  const [edit, setEdit] = React__default["default"].useState(false);
@@ -41,11 +45,11 @@
41
45
  const tinaField = (obj, field) => {
42
46
  var _a, _b, _c;
43
47
  if (!field) {
44
- return `${(_a = obj.__meta__) == null ? void 0 : _a.id}#${(_b = obj.__meta__) == null ? void 0 : _b.name}`;
48
+ return `${(_a = obj._tina_metadata) == null ? void 0 : _a.id}#${(_b = obj._tina_metadata) == null ? void 0 : _b.name}`;
45
49
  }
46
- if (obj == null ? void 0 : obj.__meta__) {
50
+ if (obj == null ? void 0 : obj._tina_metadata) {
47
51
  if (typeof field === "string") {
48
- return `${(_c = obj.__meta__) == null ? void 0 : _c.id}#${obj.__meta__.fields[field]}`;
52
+ return `${(_c = obj._tina_metadata) == null ? void 0 : _c.id}#${obj._tina_metadata.fields[field]}`;
49
53
  }
50
54
  }
51
55
  return "";
package/dist/style.css CHANGED
@@ -510,6 +510,9 @@
510
510
  .tina-tailwind .flex-shrink-0 {
511
511
  flex-shrink: 0;
512
512
  }
513
+ .tina-tailwind .shrink-0 {
514
+ flex-shrink: 0;
515
+ }
513
516
  .tina-tailwind .flex-grow-0 {
514
517
  flex-grow: 0;
515
518
  }
@@ -572,6 +575,9 @@
572
575
  .tina-tailwind .items-stretch {
573
576
  align-items: stretch;
574
577
  }
578
+ .tina-tailwind .justify-start {
579
+ justify-content: flex-start;
580
+ }
575
581
  .tina-tailwind .justify-end {
576
582
  justify-content: flex-end;
577
583
  }
@@ -587,6 +593,9 @@
587
593
  .tina-tailwind .gap-0\.5 {
588
594
  gap: 2px;
589
595
  }
596
+ .tina-tailwind .gap-1 {
597
+ gap: 4px;
598
+ }
590
599
  .tina-tailwind .gap-2 {
591
600
  gap: 8px;
592
601
  }
@@ -647,9 +656,15 @@
647
656
  .tina-tailwind .border {
648
657
  border-width: 1px;
649
658
  }
659
+ .tina-tailwind .border-0 {
660
+ border-width: 0;
661
+ }
650
662
  .tina-tailwind .border-b {
651
663
  border-bottom-width: 1px;
652
664
  }
665
+ .tina-tailwind .border-r {
666
+ border-right-width: 1px;
667
+ }
653
668
  .tina-tailwind .border-gray-100 {
654
669
  --tw-border-opacity: 1;
655
670
  border-color: rgb(237 236 243 / var(--tw-border-opacity));
@@ -674,6 +689,12 @@
674
689
  --tw-bg-opacity: 1;
675
690
  background-color: rgb(246 246 249 / var(--tw-bg-opacity));
676
691
  }
692
+ .tina-tailwind .bg-gray-50\/30 {
693
+ background-color: rgb(246 246 249 / .3);
694
+ }
695
+ .tina-tailwind .bg-transparent {
696
+ background-color: transparent;
697
+ }
677
698
  .tina-tailwind .bg-white {
678
699
  --tw-bg-opacity: 1;
679
700
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -715,6 +736,9 @@
715
736
  .tina-tailwind .fill-current {
716
737
  fill: currentColor;
717
738
  }
739
+ .tina-tailwind .p-0 {
740
+ padding: 0px;
741
+ }
718
742
  .tina-tailwind .px-12 {
719
743
  padding-left: 48px;
720
744
  padding-right: 48px;
@@ -783,6 +807,12 @@
783
807
  .tina-tailwind .pl-8 {
784
808
  padding-left: 32px;
785
809
  }
810
+ .tina-tailwind .pr-0 {
811
+ padding-right: 0px;
812
+ }
813
+ .tina-tailwind .pr-0\.5 {
814
+ padding-right: 2px;
815
+ }
786
816
  .tina-tailwind .pr-3 {
787
817
  padding-right: 12px;
788
818
  }
@@ -853,6 +883,10 @@
853
883
  .tina-tailwind .tracking-wide {
854
884
  letter-spacing: 0.025em;
855
885
  }
886
+ .tina-tailwind .text-blue-400 {
887
+ --tw-text-opacity: 1;
888
+ color: rgb(34 150 254 / var(--tw-text-opacity));
889
+ }
856
890
  .tina-tailwind .text-blue-500 {
857
891
  --tw-text-opacity: 1;
858
892
  color: rgb(0 132 255 / var(--tw-text-opacity));
@@ -864,6 +898,10 @@
864
898
  .tina-tailwind .text-current {
865
899
  color: currentColor;
866
900
  }
901
+ .tina-tailwind .text-gray-200 {
902
+ --tw-text-opacity: 1;
903
+ color: rgb(225 221 236 / var(--tw-text-opacity));
904
+ }
867
905
  .tina-tailwind .text-gray-300 {
868
906
  --tw-text-opacity: 1;
869
907
  color: rgb(178 173 190 / var(--tw-text-opacity));
@@ -903,6 +941,15 @@
903
941
  .tina-tailwind .underline {
904
942
  text-decoration-line: underline;
905
943
  }
944
+ .tina-tailwind .decoration-blue-200 {
945
+ text-decoration-color: #85C5FE;
946
+ }
947
+ .tina-tailwind .decoration-1 {
948
+ text-decoration-thickness: 1px;
949
+ }
950
+ .tina-tailwind .underline-offset-2 {
951
+ text-underline-offset: 2px;
952
+ }
906
953
  .tina-tailwind .opacity-0 {
907
954
  opacity: 0;
908
955
  }
@@ -1014,14 +1061,24 @@
1014
1061
  --tw-bg-opacity: 1;
1015
1062
  background-color: rgb(5 116 228 / var(--tw-bg-opacity));
1016
1063
  }
1064
+ .tina-tailwind .hover\:bg-gray-50\/50:hover {
1065
+ background-color: rgb(246 246 249 / .5);
1066
+ }
1017
1067
  .tina-tailwind .hover\:text-blue-400:hover {
1018
1068
  --tw-text-opacity: 1;
1019
1069
  color: rgb(34 150 254 / var(--tw-text-opacity));
1020
1070
  }
1071
+ .tina-tailwind .hover\:text-blue-500:hover {
1072
+ --tw-text-opacity: 1;
1073
+ color: rgb(0 132 255 / var(--tw-text-opacity));
1074
+ }
1021
1075
  .tina-tailwind .hover\:text-blue-600:hover {
1022
1076
  --tw-text-opacity: 1;
1023
1077
  color: rgb(5 116 228 / var(--tw-text-opacity));
1024
1078
  }
1079
+ .tina-tailwind .hover\:decoration-blue-400:hover {
1080
+ text-decoration-color: #2296fe;
1081
+ }
1025
1082
  .tina-tailwind .hover\:opacity-100:hover {
1026
1083
  opacity: 1;
1027
1084
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "1.4.6",
3
+ "version": "1.5.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "exports": {
@@ -56,9 +56,9 @@
56
56
  "@headlessui/react": "^1.5.0",
57
57
  "@heroicons/react": "^1.0.4",
58
58
  "@react-hook/window-size": "^3.0.7",
59
- "@tinacms/schema-tools": "1.4.2",
59
+ "@tinacms/schema-tools": "1.4.3",
60
60
  "@tinacms/sharedctx": "1.0.1",
61
- "@tinacms/toolkit": "1.6.4",
61
+ "@tinacms/toolkit": "1.7.1",
62
62
  "crypto-js": "^4.0.0",
63
63
  "encoding": "0.1.13",
64
64
  "fetch-ponyfill": "^7.1.0",