@tinacms/app 0.0.0-20221005184812 → 0.0.0-20221006133416
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/assets/out.es.js +21 -148
- package/package.json +3 -3
package/dist/assets/out.es.js
CHANGED
|
@@ -81101,6 +81101,9 @@ class TinaMediaStore {
|
|
|
81101
81101
|
const newFiles = [];
|
|
81102
81102
|
if (await this.isAuthenticated()) {
|
|
81103
81103
|
for (const item of media) {
|
|
81104
|
+
console.log({
|
|
81105
|
+
item
|
|
81106
|
+
});
|
|
81104
81107
|
const path2 = `${item.directory && item.directory !== "/" ? `${item.directory}/${item.file.name}` : item.file.name}`;
|
|
81105
81108
|
const res = await this.api.fetchWithToken(`${this.url}/upload_url/${path2}`, {
|
|
81106
81109
|
method: "GET"
|
|
@@ -81111,6 +81114,8 @@ class TinaMediaStore {
|
|
|
81111
81114
|
if (!signedUrl) {
|
|
81112
81115
|
throw new Error("Unexpected error generating upload url");
|
|
81113
81116
|
}
|
|
81117
|
+
console.log(item.file);
|
|
81118
|
+
console.log(mimeTypes.contentType(item.file.name));
|
|
81114
81119
|
const uploadRes = await this.fetchFunction(signedUrl, {
|
|
81115
81120
|
method: "PUT",
|
|
81116
81121
|
body: item.file,
|
|
@@ -82062,13 +82067,13 @@ const ModalLayout = ({
|
|
|
82062
82067
|
});
|
|
82063
82068
|
};
|
|
82064
82069
|
const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded-md";
|
|
82065
|
-
const disabledClasses = "
|
|
82070
|
+
const disabledClasses = "bg-gray-100 pointer-events-none opacity-30 cursor-not-allowed";
|
|
82066
82071
|
const BaseTextField = ({
|
|
82067
82072
|
...props
|
|
82068
82073
|
}) => {
|
|
82069
82074
|
return /* @__PURE__ */ jsx$1("input", {
|
|
82070
82075
|
type: "text",
|
|
82071
|
-
className: `${textFieldClasses}
|
|
82076
|
+
className: `${textFieldClasses}${(props == null ? void 0 : props.disabled) ? disabledClasses : ""}`,
|
|
82072
82077
|
...props
|
|
82073
82078
|
});
|
|
82074
82079
|
};
|
|
@@ -112324,9 +112329,6 @@ var styles = `.tina-tailwind {
|
|
|
112324
112329
|
--tw-backdrop-saturate: ;
|
|
112325
112330
|
--tw-backdrop-sepia: ;
|
|
112326
112331
|
}
|
|
112327
|
-
.tina-tailwind .pointer-events-none {
|
|
112328
|
-
pointer-events: none;
|
|
112329
|
-
}
|
|
112330
112332
|
.tina-tailwind .pointer-events-auto {
|
|
112331
112333
|
pointer-events: auto;
|
|
112332
112334
|
}
|
|
@@ -112366,12 +112368,6 @@ var styles = `.tina-tailwind {
|
|
|
112366
112368
|
.tina-tailwind .top-4 {
|
|
112367
112369
|
top: 16px;
|
|
112368
112370
|
}
|
|
112369
|
-
.tina-tailwind .top-1\\/2 {
|
|
112370
|
-
top: 50%;
|
|
112371
|
-
}
|
|
112372
|
-
.tina-tailwind .left-2 {
|
|
112373
|
-
left: 8px;
|
|
112374
|
-
}
|
|
112375
112371
|
.tina-tailwind .z-overlay {
|
|
112376
112372
|
z-index: 10600;
|
|
112377
112373
|
}
|
|
@@ -112448,12 +112444,12 @@ var styles = `.tina-tailwind {
|
|
|
112448
112444
|
.tina-tailwind .h-7 {
|
|
112449
112445
|
height: 28px;
|
|
112450
112446
|
}
|
|
112451
|
-
.tina-tailwind .h-5 {
|
|
112452
|
-
height: 20px;
|
|
112453
|
-
}
|
|
112454
112447
|
.tina-tailwind .h-10 {
|
|
112455
112448
|
height: 40px;
|
|
112456
112449
|
}
|
|
112450
|
+
.tina-tailwind .h-5 {
|
|
112451
|
+
height: 20px;
|
|
112452
|
+
}
|
|
112457
112453
|
.tina-tailwind .h-12 {
|
|
112458
112454
|
height: 48px;
|
|
112459
112455
|
}
|
|
@@ -112517,10 +112513,6 @@ var styles = `.tina-tailwind {
|
|
|
112517
112513
|
--tw-translate-x: 100%;
|
|
112518
112514
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
112519
112515
|
}
|
|
112520
|
-
.tina-tailwind .-translate-y-1\\/2 {
|
|
112521
|
-
--tw-translate-y: -50%;
|
|
112522
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
112523
|
-
}
|
|
112524
112516
|
.tina-tailwind .scale-95 {
|
|
112525
112517
|
--tw-scale-x: .95;
|
|
112526
112518
|
--tw-scale-y: .95;
|
|
@@ -112588,11 +112580,6 @@ var styles = `.tina-tailwind {
|
|
|
112588
112580
|
.tina-tailwind .overflow-y-auto {
|
|
112589
112581
|
overflow-y: auto;
|
|
112590
112582
|
}
|
|
112591
|
-
.tina-tailwind .truncate {
|
|
112592
|
-
overflow: hidden;
|
|
112593
|
-
text-overflow: ellipsis;
|
|
112594
|
-
white-space: nowrap;
|
|
112595
|
-
}
|
|
112596
112583
|
.tina-tailwind .whitespace-normal {
|
|
112597
112584
|
white-space: normal;
|
|
112598
112585
|
}
|
|
@@ -112605,12 +112592,12 @@ var styles = `.tina-tailwind {
|
|
|
112605
112592
|
.tina-tailwind .rounded {
|
|
112606
112593
|
border-radius: 4px;
|
|
112607
112594
|
}
|
|
112608
|
-
.tina-tailwind .rounded-md {
|
|
112609
|
-
border-radius: 6px;
|
|
112610
|
-
}
|
|
112611
112595
|
.tina-tailwind .rounded-full {
|
|
112612
112596
|
border-radius: 9999px;
|
|
112613
112597
|
}
|
|
112598
|
+
.tina-tailwind .rounded-md {
|
|
112599
|
+
border-radius: 6px;
|
|
112600
|
+
}
|
|
112614
112601
|
.tina-tailwind .rounded-r-md {
|
|
112615
112602
|
border-top-right-radius: 6px;
|
|
112616
112603
|
border-bottom-right-radius: 6px;
|
|
@@ -112691,10 +112678,6 @@ var styles = `.tina-tailwind {
|
|
|
112691
112678
|
padding-top: 40px;
|
|
112692
112679
|
padding-bottom: 40px;
|
|
112693
112680
|
}
|
|
112694
|
-
.tina-tailwind .py-2 {
|
|
112695
|
-
padding-top: 8px;
|
|
112696
|
-
padding-bottom: 8px;
|
|
112697
|
-
}
|
|
112698
112681
|
.tina-tailwind .px-20 {
|
|
112699
112682
|
padding-left: 80px;
|
|
112700
112683
|
padding-right: 80px;
|
|
@@ -112707,6 +112690,10 @@ var styles = `.tina-tailwind {
|
|
|
112707
112690
|
padding-top: 4px;
|
|
112708
112691
|
padding-bottom: 4px;
|
|
112709
112692
|
}
|
|
112693
|
+
.tina-tailwind .py-2 {
|
|
112694
|
+
padding-top: 8px;
|
|
112695
|
+
padding-bottom: 8px;
|
|
112696
|
+
}
|
|
112710
112697
|
.tina-tailwind .py-5 {
|
|
112711
112698
|
padding-top: 20px;
|
|
112712
112699
|
padding-bottom: 20px;
|
|
@@ -112720,15 +112707,6 @@ var styles = `.tina-tailwind {
|
|
|
112720
112707
|
.tina-tailwind .pt-16 {
|
|
112721
112708
|
padding-top: 64px;
|
|
112722
112709
|
}
|
|
112723
|
-
.tina-tailwind .pr-3 {
|
|
112724
|
-
padding-right: 12px;
|
|
112725
|
-
}
|
|
112726
|
-
.tina-tailwind .pl-8 {
|
|
112727
|
-
padding-left: 32px;
|
|
112728
|
-
}
|
|
112729
|
-
.tina-tailwind .pl-3 {
|
|
112730
|
-
padding-left: 12px;
|
|
112731
|
-
}
|
|
112732
112710
|
.tina-tailwind .pt-3 {
|
|
112733
112711
|
padding-top: 12px;
|
|
112734
112712
|
}
|
|
@@ -112808,18 +112786,10 @@ var styles = `.tina-tailwind {
|
|
|
112808
112786
|
--tw-text-opacity: 1;
|
|
112809
112787
|
color: rgb(113 108 127 / var(--tw-text-opacity));
|
|
112810
112788
|
}
|
|
112811
|
-
.tina-tailwind .text-gray-300 {
|
|
112812
|
-
--tw-text-opacity: 1;
|
|
112813
|
-
color: rgb(178 173 190 / var(--tw-text-opacity));
|
|
112814
|
-
}
|
|
112815
112789
|
.tina-tailwind .text-gray-400 {
|
|
112816
112790
|
--tw-text-opacity: 1;
|
|
112817
112791
|
color: rgb(145 140 158 / var(--tw-text-opacity));
|
|
112818
112792
|
}
|
|
112819
|
-
.tina-tailwind .text-blue-500 {
|
|
112820
|
-
--tw-text-opacity: 1;
|
|
112821
|
-
color: rgb(0 132 255 / var(--tw-text-opacity));
|
|
112822
|
-
}
|
|
112823
112793
|
.tina-tailwind .text-current {
|
|
112824
112794
|
color: currentColor;
|
|
112825
112795
|
}
|
|
@@ -112854,9 +112824,6 @@ var styles = `.tina-tailwind {
|
|
|
112854
112824
|
.tina-tailwind .opacity-90 {
|
|
112855
112825
|
opacity: .9;
|
|
112856
112826
|
}
|
|
112857
|
-
.tina-tailwind .opacity-20 {
|
|
112858
|
-
opacity: .2;
|
|
112859
|
-
}
|
|
112860
112827
|
.tina-tailwind .opacity-50 {
|
|
112861
112828
|
opacity: .5;
|
|
112862
112829
|
}
|
|
@@ -112873,11 +112840,6 @@ var styles = `.tina-tailwind {
|
|
|
112873
112840
|
--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
|
|
112874
112841
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
112875
112842
|
}
|
|
112876
|
-
.tina-tailwind .shadow-inner {
|
|
112877
|
-
--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
|
|
112878
|
-
--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);
|
|
112879
|
-
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
112880
|
-
}
|
|
112881
112843
|
.tina-tailwind .shadow {
|
|
112882
112844
|
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
112883
112845
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
@@ -112967,14 +112929,6 @@ var styles = `.tina-tailwind {
|
|
|
112967
112929
|
.tina-tailwind .hover\\:opacity-60:hover {
|
|
112968
112930
|
opacity: .6;
|
|
112969
112931
|
}
|
|
112970
|
-
.tina-tailwind .focus\\:border-blue-500:focus {
|
|
112971
|
-
--tw-border-opacity: 1;
|
|
112972
|
-
border-color: rgb(0 132 255 / var(--tw-border-opacity));
|
|
112973
|
-
}
|
|
112974
|
-
.tina-tailwind .focus\\:text-gray-900:focus {
|
|
112975
|
-
--tw-text-opacity: 1;
|
|
112976
|
-
color: rgb(37 35 54 / var(--tw-text-opacity));
|
|
112977
|
-
}
|
|
112978
112932
|
.tina-tailwind .focus\\:text-blue-400:focus {
|
|
112979
112933
|
--tw-text-opacity: 1;
|
|
112980
112934
|
color: rgb(34 150 254 / var(--tw-text-opacity));
|
|
@@ -113000,30 +112954,6 @@ var styles = `.tina-tailwind {
|
|
|
113000
112954
|
--tw-ring-opacity: 1;
|
|
113001
112955
|
--tw-ring-color: rgb(0 132 255 / var(--tw-ring-opacity));
|
|
113002
112956
|
}
|
|
113003
|
-
.tina-tailwind .group:hover .group-hover\\:border-gray-200 {
|
|
113004
|
-
--tw-border-opacity: 1;
|
|
113005
|
-
border-color: rgb(225 221 236 / var(--tw-border-opacity));
|
|
113006
|
-
}
|
|
113007
|
-
.tina-tailwind .group:hover .group-hover\\:bg-white {
|
|
113008
|
-
--tw-bg-opacity: 1;
|
|
113009
|
-
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
113010
|
-
}
|
|
113011
|
-
.tina-tailwind .group:hover .group-hover\\:text-gray-600 {
|
|
113012
|
-
--tw-text-opacity: 1;
|
|
113013
|
-
color: rgb(86 81 101 / var(--tw-text-opacity));
|
|
113014
|
-
}
|
|
113015
|
-
.tina-tailwind .group:hover .group-hover\\:opacity-0 {
|
|
113016
|
-
opacity: 0;
|
|
113017
|
-
}
|
|
113018
|
-
.tina-tailwind .group:hover .group-hover\\:opacity-80 {
|
|
113019
|
-
opacity: .8;
|
|
113020
|
-
}
|
|
113021
|
-
.tina-tailwind .group:active .group-active\\:opacity-0 {
|
|
113022
|
-
opacity: 0;
|
|
113023
|
-
}
|
|
113024
|
-
.tina-tailwind .group:active .group-active\\:opacity-80 {
|
|
113025
|
-
opacity: .8;
|
|
113026
|
-
}
|
|
113027
112957
|
`;
|
|
113028
112958
|
class ContentCreatorPlugin {
|
|
113029
112959
|
constructor(options) {
|
|
@@ -114804,34 +114734,6 @@ function HiChevronRight(props) {
|
|
|
114804
114734
|
}]
|
|
114805
114735
|
})(props);
|
|
114806
114736
|
}
|
|
114807
|
-
function FaLock(props) {
|
|
114808
|
-
return GenIcon({
|
|
114809
|
-
"tag": "svg",
|
|
114810
|
-
"attr": {
|
|
114811
|
-
"viewBox": "0 0 448 512"
|
|
114812
|
-
},
|
|
114813
|
-
"child": [{
|
|
114814
|
-
"tag": "path",
|
|
114815
|
-
"attr": {
|
|
114816
|
-
"d": "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"
|
|
114817
|
-
}
|
|
114818
|
-
}]
|
|
114819
|
-
})(props);
|
|
114820
|
-
}
|
|
114821
|
-
function FaUnlock(props) {
|
|
114822
|
-
return GenIcon({
|
|
114823
|
-
"tag": "svg",
|
|
114824
|
-
"attr": {
|
|
114825
|
-
"viewBox": "0 0 448 512"
|
|
114826
|
-
},
|
|
114827
|
-
"child": [{
|
|
114828
|
-
"tag": "path",
|
|
114829
|
-
"attr": {
|
|
114830
|
-
"d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"
|
|
114831
|
-
}
|
|
114832
|
-
}]
|
|
114833
|
-
})(props);
|
|
114834
|
-
}
|
|
114835
114737
|
const createDocument = async (cms, collection, template, mutationInfo, values2) => {
|
|
114836
114738
|
const api = new TinaAdminApi(cms);
|
|
114837
114739
|
const {
|
|
@@ -114887,25 +114789,6 @@ const CollectionCreatePage = () => {
|
|
|
114887
114789
|
})
|
|
114888
114790
|
});
|
|
114889
114791
|
};
|
|
114890
|
-
const FilenameInput = (props) => {
|
|
114891
|
-
const [filenameTouched, setFilenameTouched] = React.useState(false);
|
|
114892
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
114893
|
-
className: "group relative block cursor-pointer",
|
|
114894
|
-
onClick: () => {
|
|
114895
|
-
setFilenameTouched(true);
|
|
114896
|
-
},
|
|
114897
|
-
children: [/* @__PURE__ */ jsx$1("input", {
|
|
114898
|
-
type: "text",
|
|
114899
|
-
className: `shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base pr-3 truncate py-2 w-full border transition-all ease-out duration-150 focus:text-gray-900 rounded-md ${props.readonly || !filenameTouched ? "bg-gray-50 text-gray-300 border-gray-150 pointer-events-none pl-8 group-hover:bg-white group-hover:text-gray-600 group-hover:border-gray-200" : "bg-white text-gray-600 border-gray-200 pl-3"}`,
|
|
114900
|
-
...props,
|
|
114901
|
-
disabled: props.readonly || !filenameTouched
|
|
114902
|
-
}), /* @__PURE__ */ jsx$1(FaLock, {
|
|
114903
|
-
className: `text-gray-400 absolute top-1/2 left-2 -translate-y-1/2 pointer-events-none h-5 w-auto transition-opacity duration-150 ease-out ${!filenameTouched && !props.readonly ? "opacity-20 group-hover:opacity-0 group-active:opacity-0" : "opacity-0"}`
|
|
114904
|
-
}), /* @__PURE__ */ jsx$1(FaUnlock, {
|
|
114905
|
-
className: `text-blue-500 absolute top-1/2 left-2 -translate-y-1/2 pointer-events-none h-5 w-auto transition-opacity duration-150 ease-out ${!filenameTouched && !props.readonly ? "opacity-0 group-hover:opacity-80 group-active:opacity-80" : "opacity-0"}`
|
|
114906
|
-
})]
|
|
114907
|
-
});
|
|
114908
|
-
};
|
|
114909
114792
|
const RenderForm$1 = ({
|
|
114910
114793
|
cms,
|
|
114911
114794
|
collection,
|
|
@@ -114957,21 +114840,11 @@ const RenderForm$1 = ({
|
|
|
114957
114840
|
},
|
|
114958
114841
|
id: "create-form",
|
|
114959
114842
|
label: "form",
|
|
114960
|
-
fields: [
|
|
114843
|
+
fields: [{
|
|
114961
114844
|
name: "filename",
|
|
114962
114845
|
label: "Filename",
|
|
114963
|
-
component:
|
|
114964
|
-
|
|
114965
|
-
input,
|
|
114966
|
-
meta
|
|
114967
|
-
}) => {
|
|
114968
|
-
var _a3, _b3;
|
|
114969
|
-
return /* @__PURE__ */ jsx$1(FilenameInput, {
|
|
114970
|
-
readonly: (_b3 = (_a3 = template == null ? void 0 : template.ui) == null ? void 0 : _a3.filename) == null ? void 0 : _b3.readonly,
|
|
114971
|
-
...input
|
|
114972
|
-
});
|
|
114973
|
-
}) : "text",
|
|
114974
|
-
disabled: (_b2 = (_a22 = template == null ? void 0 : template.ui) == null ? void 0 : _a22.filename) == null ? void 0 : _b2.readonly,
|
|
114846
|
+
component: "text",
|
|
114847
|
+
disabled: (_b2 = (_a22 = template == null ? void 0 : template.ui) == null ? void 0 : _a22.filename) == null ? void 0 : _b2.disabled,
|
|
114975
114848
|
description: /* @__PURE__ */ jsxs("span", {
|
|
114976
114849
|
children: ["A unique filename for the content.", /* @__PURE__ */ jsx$1("br", {}), "Examples: ", /* @__PURE__ */ jsx$1("code", {
|
|
114977
114850
|
children: "My_Document"
|
|
@@ -114994,7 +114867,7 @@ const RenderForm$1 = ({
|
|
|
114994
114867
|
return "Must begin with a-z, A-Z, 0-9, or _ and contain only a-z, A-Z, 0-9, -, _, ., or /.";
|
|
114995
114868
|
}
|
|
114996
114869
|
}
|
|
114997
|
-
}],
|
|
114870
|
+
}, ...formInfo.fields],
|
|
114998
114871
|
onSubmit: async (values2) => {
|
|
114999
114872
|
try {
|
|
115000
114873
|
await createDocument(cms, collection, template, mutationInfo, values2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/app",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20221006133416",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@tailwindcss/aspect-ratio": "^0.4.0",
|
|
38
38
|
"@tailwindcss/line-clamp": "^0.3.1",
|
|
39
39
|
"@tailwindcss/typography": "^0.5.4",
|
|
40
|
-
"@tinacms/schema-tools": "0.
|
|
40
|
+
"@tinacms/schema-tools": "0.1.6",
|
|
41
41
|
"@tinacms/scripts": "0.51.1",
|
|
42
42
|
"@vitejs/plugin-react": "^1.3.2",
|
|
43
43
|
"@xstate/react": "^3.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react-router-dom": "6",
|
|
56
56
|
"styled-components": "5.3.5",
|
|
57
57
|
"tailwindcss": "^3.1.6",
|
|
58
|
-
"tinacms": "0.0.0-
|
|
58
|
+
"tinacms": "0.0.0-20221006133416",
|
|
59
59
|
"typescript": "^4.6.4",
|
|
60
60
|
"vite": "2.9.15",
|
|
61
61
|
"vite-node": "^0.23.4",
|