tinacms 0.66.4 → 0.66.7

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/index.js CHANGED
@@ -30,8 +30,8 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  (function(global, factory) {
33
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@tinacms/toolkit"), require("graphql"), require("lodash.set"), require("graphql-tag"), require("react"), require("styled-components"), require("yup"), require("@tinacms/sharedctx"), require("final-form"), require("url-pattern"), require("react-router-dom"), require("@headlessui/react")) : typeof define === "function" && define.amd ? define(["exports", "@tinacms/toolkit", "graphql", "lodash.set", "graphql-tag", "react", "styled-components", "yup", "@tinacms/sharedctx", "final-form", "url-pattern", "react-router-dom", "@headlessui/react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
34
- })(this, function(exports2, toolkit, graphql, set, gql$1, React, styled, yup, sharedctx, finalForm, UrlPattern, reactRouterDom, react) {
33
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@tinacms/toolkit"), require("graphql"), require("lodash.set"), require("react"), require("graphql-tag"), require("styled-components"), require("yup"), require("@tinacms/sharedctx"), require("final-form"), require("url-pattern"), require("react-router-dom"), require("@headlessui/react")) : typeof define === "function" && define.amd ? define(["exports", "@tinacms/toolkit", "graphql", "lodash.set", "react", "graphql-tag", "styled-components", "yup", "@tinacms/sharedctx", "final-form", "url-pattern", "react-router-dom", "@headlessui/react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
34
+ })(this, function(exports2, toolkit, G, set, React, gql$1, styled, yup, sharedctx, finalForm, UrlPattern, reactRouterDom, react) {
35
35
  "use strict";
36
36
  function _interopDefaultLegacy(e) {
37
37
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
@@ -56,9 +56,10 @@ var __objRest = (source, exclude) => {
56
56
  n["default"] = e;
57
57
  return Object.freeze(n);
58
58
  }
59
+ var G__namespace = /* @__PURE__ */ _interopNamespace(G);
59
60
  var set__default = /* @__PURE__ */ _interopDefaultLegacy(set);
60
- var gql__default = /* @__PURE__ */ _interopDefaultLegacy(gql$1);
61
61
  var React__default = /* @__PURE__ */ _interopDefaultLegacy(React);
62
+ var gql__default = /* @__PURE__ */ _interopDefaultLegacy(gql$1);
62
63
  var styled__default = /* @__PURE__ */ _interopDefaultLegacy(styled);
63
64
  var yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
64
65
  var UrlPattern__default = /* @__PURE__ */ _interopDefaultLegacy(UrlPattern);
@@ -88,35 +89,35 @@ var __objRest = (source, exclude) => {
88
89
  authTab = popupWindow(`${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`, "_blank", window, 1e3, 700);
89
90
  });
90
91
  };
91
- const formify = (query, schema) => {
92
- const typeInfo = new graphql.TypeInfo(schema);
92
+ const formify$1 = (query, schema) => {
93
+ const typeInfo = new G.TypeInfo(schema);
93
94
  const pathsToPopulate = [];
94
95
  const visitor = {
95
- leave(node, key, parent, path, ancestors) {
96
+ leave(node2, key, parent, path, ancestors) {
96
97
  const type = typeInfo.getType();
97
98
  if (type) {
98
- const namedType = graphql.getNamedType(type);
99
- if (namedType instanceof graphql.GraphQLObjectType) {
99
+ const namedType = G.getNamedType(type);
100
+ if (namedType instanceof G.GraphQLObjectType) {
100
101
  const hasNodeInterface = !!namedType.getInterfaces().find((i) => i.name === "Node");
101
102
  if (hasNodeInterface) {
102
103
  if (typeof path[path.length - 1] === "number") {
103
104
  assertIsObjectType(namedType);
104
105
  const valuesNode = namedType.getFields().values;
105
- const namedValuesNode = graphql.getNamedType(valuesNode.type);
106
+ const namedValuesNode = G.getNamedType(valuesNode.type);
106
107
  const pathForValues = [...path];
107
108
  pathForValues.push("selectionSet");
108
109
  pathForValues.push("selections");
109
110
  const valuesAst = buildValuesForType(namedValuesNode);
110
111
  pathForValues.push(100);
111
112
  const formNode = namedType.getFields().form;
112
- const namedFormNode = graphql.getNamedType(formNode.type);
113
+ const namedFormNode = G.getNamedType(formNode.type);
113
114
  const pathForForm = [...path];
114
115
  pathForForm.push("selectionSet");
115
116
  pathForForm.push("selections");
116
117
  const formAst = buildFormForType(namedFormNode);
117
118
  pathForForm.push(101);
118
119
  const sysNode = namedType.getFields().sys;
119
- const namedSysNode = graphql.getNamedType(sysNode.type);
120
+ const namedSysNode = G.getNamedType(sysNode.type);
120
121
  const pathForSys = [...path];
121
122
  pathForSys.push("selectionSet");
122
123
  pathForSys.push("selections");
@@ -145,7 +146,7 @@ var __objRest = (source, exclude) => {
145
146
  }
146
147
  }
147
148
  };
148
- graphql.visit(query, graphql.visitWithTypeInfo(typeInfo, visitor));
149
+ G.visit(query, G.visitWithTypeInfo(typeInfo, visitor));
149
150
  const topLevelPaths = pathsToPopulate.filter((p, i) => {
150
151
  const otherPaths = pathsToPopulate.filter((_, index) => index !== i);
151
152
  const isChildOfOtherPaths = otherPaths.some((op) => {
@@ -254,8 +255,8 @@ var __objRest = (source, exclude) => {
254
255
  kind: "SelectionSet",
255
256
  selections: [
256
257
  ...Object.values(type.getFields()).map((field) => {
257
- const namedType = graphql.getNamedType(field.type);
258
- if (graphql.isLeafType(namedType)) {
258
+ const namedType = G.getNamedType(field.type);
259
+ if (G.isLeafType(namedType)) {
259
260
  return {
260
261
  kind: "Field",
261
262
  name: {
@@ -263,7 +264,7 @@ var __objRest = (source, exclude) => {
263
264
  value: field.name
264
265
  }
265
266
  };
266
- } else if (namedType instanceof graphql.GraphQLUnionType) {
267
+ } else if (namedType instanceof G.GraphQLUnionType) {
267
268
  return {
268
269
  kind: "Field",
269
270
  name: {
@@ -277,7 +278,7 @@ var __objRest = (source, exclude) => {
277
278
  ]
278
279
  }
279
280
  };
280
- } else if (namedType instanceof graphql.GraphQLObjectType) {
281
+ } else if (namedType instanceof G.GraphQLObjectType) {
281
282
  return {
282
283
  kind: "Field",
283
284
  name: {
@@ -306,7 +307,7 @@ var __objRest = (source, exclude) => {
306
307
  const result = callback(fields);
307
308
  if (!result.continue) {
308
309
  if (fields.every((field) => {
309
- return !graphql.isScalarType(graphql.getNamedType(field.type));
310
+ return !G.isScalarType(G.getNamedType(field.type));
310
311
  })) {
311
312
  return [
312
313
  {
@@ -319,7 +320,7 @@ var __objRest = (source, exclude) => {
319
320
  ];
320
321
  }
321
322
  return buildSelectionsFields(result.filteredFields.filter((field) => {
322
- if (graphql.isScalarType(graphql.getNamedType(field.type))) {
323
+ if (G.isScalarType(G.getNamedType(field.type))) {
323
324
  return true;
324
325
  }
325
326
  return false;
@@ -329,8 +330,8 @@ var __objRest = (source, exclude) => {
329
330
  }
330
331
  }
331
332
  return filteredFields.map((field) => {
332
- const namedType = graphql.getNamedType(field.type);
333
- if (graphql.isLeafType(namedType)) {
333
+ const namedType = G.getNamedType(field.type);
334
+ if (G.isLeafType(namedType)) {
334
335
  return {
335
336
  kind: "Field",
336
337
  name: {
@@ -338,7 +339,7 @@ var __objRest = (source, exclude) => {
338
339
  value: field.name
339
340
  }
340
341
  };
341
- } else if (namedType instanceof graphql.GraphQLUnionType) {
342
+ } else if (namedType instanceof G.GraphQLUnionType) {
342
343
  return {
343
344
  kind: "Field",
344
345
  name: {
@@ -352,7 +353,7 @@ var __objRest = (source, exclude) => {
352
353
  ]
353
354
  }
354
355
  };
355
- } else if (namedType instanceof graphql.GraphQLObjectType) {
356
+ } else if (namedType instanceof G.GraphQLObjectType) {
356
357
  return {
357
358
  kind: "Field",
358
359
  name: {
@@ -382,19 +383,448 @@ var __objRest = (source, exclude) => {
382
383
  });
383
384
  };
384
385
  function assertIsObjectType(type) {
385
- if (type instanceof graphql.GraphQLObjectType)
386
+ if (type instanceof G.GraphQLObjectType)
386
387
  ;
387
388
  else {
388
389
  throw new Error(`Expected an instance of GraphQLObjectType for type ${type.name}`);
389
390
  }
390
391
  }
391
392
  function assertIsUnionType(type) {
392
- if (type instanceof graphql.GraphQLUnionType)
393
+ if (type instanceof G.GraphQLUnionType)
393
394
  ;
394
395
  else {
395
396
  throw new Error(`Expected an instance of GraphQLUnionType for type ${type.name}`);
396
397
  }
397
398
  }
399
+ const isNodeField = (type) => {
400
+ if (G__namespace.isUnionType(type)) {
401
+ return type.getTypes().every((type2) => {
402
+ return type2.getInterfaces().find((intfc) => intfc.name === "Node");
403
+ });
404
+ } else if (G__namespace.isObjectType(type)) {
405
+ return !!type.getInterfaces().find((intfc) => intfc.name === "Node");
406
+ } else if (G__namespace.isInterfaceType(type)) {
407
+ if (type.name === "Node") {
408
+ return true;
409
+ }
410
+ } else {
411
+ throw new Error(`Expected GraphQLObjectType or GraphQLUnionType for isNodeField check`);
412
+ }
413
+ };
414
+ const isConnectionField = (type) => {
415
+ if (G__namespace.isObjectType(type)) {
416
+ return !!type.getInterfaces().find((intfc) => intfc.name === "Connection");
417
+ } else {
418
+ throw new Error(`Expected GraphQLObjectType for isCollectionField check`);
419
+ }
420
+ };
421
+ const getObjectField = (object, selectionNode) => {
422
+ return object.getFields()[selectionNode.name.value];
423
+ };
424
+ const getSelectedUnionType = (unionType, selectionNode) => {
425
+ return unionType.getTypes().find((type) => type.name === selectionNode.typeCondition.name.value);
426
+ };
427
+ function ensureNodeField(field) {
428
+ if (!isNodeField(field)) {
429
+ throw new Error(`Expected field to implement Node interface`);
430
+ }
431
+ }
432
+ function ensureUnionType(type) {
433
+ if (!G__namespace.isUnionType(type)) {
434
+ throw new Error(`Expected type to be GraphQLUnionType`);
435
+ }
436
+ }
437
+ function ensureObjectType(type) {
438
+ if (!G__namespace.isObjectType(type)) {
439
+ console.log(type);
440
+ throw new Error(`Expected type to be GraphQLObjectType`);
441
+ }
442
+ }
443
+ function ensureOperationDefinition(type) {
444
+ if (type.kind !== "OperationDefinition") {
445
+ throw new Error(`Expected top-level definition to be an OperationDefinition node, ensure your query has been optimized before calling formify`);
446
+ }
447
+ }
448
+ function getNameAndAlias(fieldNode, list) {
449
+ return {
450
+ name: fieldNode.name.value,
451
+ alias: fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value,
452
+ list: !!list
453
+ };
454
+ }
455
+ const node = G__namespace.parse(`
456
+ query Sample {
457
+ _internalSys: sys {
458
+ path
459
+ collection {
460
+ name
461
+ }
462
+ }
463
+ form
464
+ values
465
+ }`);
466
+ const metaFields = node.definitions[0].selectionSet.selections;
467
+ const NOOP = "This is either an error or is not yet supported";
468
+ const UNEXPECTED = "Formify encountered an unexpected error, please contact support";
469
+ const DATA_NODE_NAME = "data";
470
+ const EDGES_NODE_NAME = "edges";
471
+ const NODE_NAME = "node";
472
+ const COLLECTION_FIELD_NAME = "getCollection";
473
+ const COLLECTIONS_FIELD_NAME = "getCollections";
474
+ const COLLECTIONS_DOCUMENTS_NAME = "documents";
475
+ class FormifyError extends Error {
476
+ constructor(code, details) {
477
+ let message;
478
+ switch (code) {
479
+ case "NOOP":
480
+ message = NOOP;
481
+ break;
482
+ case "UNEXPECTED":
483
+ message = UNEXPECTED;
484
+ break;
485
+ default:
486
+ message = "";
487
+ break;
488
+ }
489
+ super(`${message} ${details || ""}`);
490
+ this.name = "FormifyError";
491
+ }
492
+ }
493
+ const formify = async ({
494
+ schema,
495
+ query,
496
+ getOptimizedQuery
497
+ }) => {
498
+ const nodes = [];
499
+ const documentNode = G__namespace.parse(query);
500
+ const visitor2 = {
501
+ OperationDefinition: (node2) => {
502
+ if (!node2.name) {
503
+ return __spreadProps(__spreadValues({}, node2), {
504
+ name: {
505
+ kind: "Name",
506
+ value: `QueryOperation`
507
+ }
508
+ });
509
+ }
510
+ return node2;
511
+ }
512
+ };
513
+ const documentNodeWithName = G.visit(documentNode, visitor2);
514
+ const optimizedQuery = await getOptimizedQuery(documentNodeWithName);
515
+ const typeInfo = new G__namespace.TypeInfo(schema);
516
+ const formifyConnection = ({
517
+ namedFieldType,
518
+ selectionNode,
519
+ path
520
+ }) => {
521
+ ensureObjectType(namedFieldType);
522
+ return __spreadProps(__spreadValues({}, selectionNode), {
523
+ selectionSet: {
524
+ kind: "SelectionSet",
525
+ selections: selectionNode.selectionSet.selections.map((selectionNode2) => {
526
+ switch (selectionNode2.kind) {
527
+ case "Field":
528
+ if (selectionNode2.name.value === EDGES_NODE_NAME) {
529
+ const edgeField = namedFieldType.getFields()[EDGES_NODE_NAME];
530
+ const edgeType = G__namespace.getNamedType(edgeField.type);
531
+ ensureObjectType(edgeType);
532
+ return __spreadProps(__spreadValues({}, selectionNode2), {
533
+ selectionSet: {
534
+ kind: "SelectionSet",
535
+ selections: selectionNode2.selectionSet.selections.map((subSelectionNode) => {
536
+ switch (subSelectionNode.kind) {
537
+ case "Field":
538
+ if (subSelectionNode.name.value === NODE_NAME) {
539
+ const nodeField = edgeType.getFields()[NODE_NAME];
540
+ return formifyNode({
541
+ fieldOrInlineFragmentNode: subSelectionNode,
542
+ parentType: nodeField.type,
543
+ path: [
544
+ ...path,
545
+ getNameAndAlias(selectionNode2),
546
+ getNameAndAlias(subSelectionNode, true)
547
+ ]
548
+ });
549
+ } else {
550
+ return subSelectionNode;
551
+ }
552
+ default:
553
+ throw new FormifyError("NOOP");
554
+ }
555
+ })
556
+ }
557
+ });
558
+ }
559
+ return selectionNode2;
560
+ default:
561
+ throw new FormifyError("UNEXPECTED");
562
+ }
563
+ })
564
+ }
565
+ });
566
+ };
567
+ function formifyNode({
568
+ fieldOrInlineFragmentNode,
569
+ parentType,
570
+ path
571
+ }) {
572
+ let extraFields = [];
573
+ const namedParentType = G__namespace.getNamedType(parentType);
574
+ const formifiedNode = __spreadProps(__spreadValues({}, fieldOrInlineFragmentNode), {
575
+ selectionSet: {
576
+ kind: "SelectionSet",
577
+ selections: [
578
+ ...fieldOrInlineFragmentNode.selectionSet.selections.map((selectionNode) => {
579
+ switch (selectionNode.kind) {
580
+ case "InlineFragment":
581
+ if (G__namespace.isInterfaceType(namedParentType)) {
582
+ const type2 = schema.getImplementations(namedParentType).objects[selectionNode.typeCondition.name.value];
583
+ return formifyNode({
584
+ fieldOrInlineFragmentNode: selectionNode,
585
+ parentType: type2,
586
+ path
587
+ });
588
+ }
589
+ ensureUnionType(namedParentType);
590
+ const type = getSelectedUnionType(namedParentType, selectionNode);
591
+ return formifyNode({
592
+ fieldOrInlineFragmentNode: selectionNode,
593
+ parentType: type,
594
+ path
595
+ });
596
+ case "Field":
597
+ if (selectionNode.name.value === DATA_NODE_NAME) {
598
+ extraFields = metaFields;
599
+ if (G__namespace.isObjectType(namedParentType)) {
600
+ const field = getObjectField(namedParentType, selectionNode);
601
+ const namedType = G__namespace.getNamedType(field.type);
602
+ ensureObjectType(namedType);
603
+ return __spreadProps(__spreadValues({}, selectionNode), {
604
+ selectionSet: {
605
+ kind: "SelectionSet",
606
+ selections: [
607
+ ...selectionNode.selectionSet.selections.map((subSelectionNode) => {
608
+ switch (subSelectionNode.kind) {
609
+ case "Field":
610
+ const subSelectionField = getObjectField(namedType, subSelectionNode);
611
+ if (!subSelectionField) {
612
+ return subSelectionNode;
613
+ }
614
+ return formifyField({
615
+ fieldNode: subSelectionNode,
616
+ parentType: field.type,
617
+ path: [
618
+ ...path,
619
+ getNameAndAlias(subSelectionNode, G__namespace.isListType(subSelectionField.type))
620
+ ]
621
+ });
622
+ default:
623
+ throw new FormifyError("UNEXPECTED", `selection ${subSelectionNode.kind}`);
624
+ }
625
+ })
626
+ ]
627
+ }
628
+ });
629
+ }
630
+ return selectionNode;
631
+ }
632
+ return selectionNode;
633
+ default:
634
+ throw new FormifyError("UNEXPECTED");
635
+ }
636
+ }),
637
+ ...extraFields
638
+ ]
639
+ }
640
+ });
641
+ return formifiedNode;
642
+ }
643
+ const formifyField = ({
644
+ fieldNode,
645
+ parentType,
646
+ path
647
+ }) => {
648
+ const namedParentType = G__namespace.getNamedType(parentType);
649
+ ensureObjectType(namedParentType);
650
+ const field = getObjectField(namedParentType, fieldNode);
651
+ if (!field) {
652
+ if (fieldNode.name.value === "__typename") {
653
+ return fieldNode;
654
+ } else {
655
+ throw new FormifyError("UNEXPECTED", `field with no associated type ${fieldNode.name.value}`);
656
+ }
657
+ }
658
+ const namedType = G__namespace.getNamedType(field.type);
659
+ if (G__namespace.isScalarType(namedType)) {
660
+ return fieldNode;
661
+ }
662
+ return __spreadProps(__spreadValues({}, fieldNode), {
663
+ selectionSet: {
664
+ kind: "SelectionSet",
665
+ selections: [
666
+ ...fieldNode.selectionSet.selections.map((selectionNode) => {
667
+ switch (selectionNode.kind) {
668
+ case "Field":
669
+ if (selectionNode.name.value === "__typename") {
670
+ return selectionNode;
671
+ }
672
+ ensureObjectType(namedType);
673
+ const field2 = getObjectField(namedType, selectionNode);
674
+ if (!field2) {
675
+ return fieldNode;
676
+ }
677
+ if (G__namespace.isScalarType(G__namespace.getNamedType(field2.type))) {
678
+ return selectionNode;
679
+ }
680
+ return __spreadProps(__spreadValues({}, selectionNode), {
681
+ selectionSet: {
682
+ kind: "SelectionSet",
683
+ selections: selectionNode.selectionSet.selections.map((selectionNode2) => {
684
+ switch (selectionNode2.kind) {
685
+ case "Field":
686
+ if (selectionNode2.name.value === "__typename") {
687
+ return selectionNode2;
688
+ }
689
+ return formifyField({
690
+ fieldNode: selectionNode2,
691
+ parentType: field2.type,
692
+ path
693
+ });
694
+ case "InlineFragment":
695
+ const namedType2 = G__namespace.getNamedType(field2.type);
696
+ ensureNodeField(namedType2);
697
+ return formifyNode({
698
+ fieldOrInlineFragmentNode: selectionNode2,
699
+ parentType: field2.type,
700
+ path
701
+ });
702
+ default:
703
+ throw new FormifyError("UNEXPECTED", `selection ${selectionNode2.kind}`);
704
+ }
705
+ })
706
+ }
707
+ });
708
+ case "InlineFragment":
709
+ ensureUnionType(namedType);
710
+ if (isNodeField(namedType)) {
711
+ const parentType2 = getSelectedUnionType(namedType, selectionNode);
712
+ return formifyNode({
713
+ fieldOrInlineFragmentNode: selectionNode,
714
+ parentType: parentType2,
715
+ path
716
+ });
717
+ }
718
+ return __spreadProps(__spreadValues({}, selectionNode), {
719
+ selectionSet: {
720
+ kind: "SelectionSet",
721
+ selections: selectionNode.selectionSet.selections.map((subSelectionNode) => {
722
+ switch (subSelectionNode.kind) {
723
+ case "Field":
724
+ const parentType2 = getSelectedUnionType(namedType, selectionNode);
725
+ return formifyField({
726
+ fieldNode: subSelectionNode,
727
+ parentType: parentType2,
728
+ path
729
+ });
730
+ default:
731
+ throw new FormifyError("UNEXPECTED", `selection ${subSelectionNode.kind}`);
732
+ }
733
+ })
734
+ }
735
+ });
736
+ default:
737
+ throw new FormifyError("UNEXPECTED", `selection ${selectionNode.kind}`);
738
+ }
739
+ })
740
+ ]
741
+ }
742
+ });
743
+ };
744
+ const formifiedQuery = {
745
+ kind: "Document",
746
+ definitions: optimizedQuery.definitions.map((definition) => {
747
+ typeInfo.enter(definition);
748
+ ensureOperationDefinition(definition);
749
+ const type = typeInfo.getType();
750
+ const namedType = G__namespace.getNamedType(type);
751
+ ensureObjectType(namedType);
752
+ return __spreadProps(__spreadValues({}, definition), {
753
+ selectionSet: {
754
+ kind: "SelectionSet",
755
+ selections: definition.selectionSet.selections.map((selectionNode) => {
756
+ switch (selectionNode.kind) {
757
+ case "Field":
758
+ const parentType = type;
759
+ const namedParentType = G__namespace.getNamedType(parentType);
760
+ ensureObjectType(namedParentType);
761
+ const field = getObjectField(namedParentType, selectionNode);
762
+ const namedFieldType = G__namespace.getNamedType(field.type);
763
+ if (isNodeField(namedFieldType)) {
764
+ return formifyNode({
765
+ fieldOrInlineFragmentNode: selectionNode,
766
+ parentType: field.type,
767
+ path: [getNameAndAlias(selectionNode)]
768
+ });
769
+ } else if (isConnectionField(namedFieldType)) {
770
+ return formifyConnection({
771
+ namedFieldType,
772
+ selectionNode,
773
+ path: [getNameAndAlias(selectionNode)]
774
+ });
775
+ }
776
+ if (selectionNode.name.value === COLLECTION_FIELD_NAME || selectionNode.name.value === COLLECTIONS_FIELD_NAME) {
777
+ return __spreadProps(__spreadValues({}, selectionNode), {
778
+ selectionSet: {
779
+ kind: "SelectionSet",
780
+ selections: selectionNode.selectionSet.selections.map((selectionNode2) => {
781
+ switch (selectionNode2.kind) {
782
+ case "Field":
783
+ if (selectionNode2.name.value === COLLECTIONS_DOCUMENTS_NAME) {
784
+ ensureObjectType(namedFieldType);
785
+ const n = namedFieldType.getFields()[COLLECTIONS_DOCUMENTS_NAME];
786
+ const docType = G__namespace.getNamedType(n.type);
787
+ return formifyConnection({
788
+ namedFieldType: docType,
789
+ selectionNode: selectionNode2,
790
+ path: [getNameAndAlias(selectionNode2)]
791
+ });
792
+ }
793
+ return selectionNode2;
794
+ default:
795
+ throw new FormifyError("NOOP");
796
+ }
797
+ })
798
+ }
799
+ });
800
+ }
801
+ throw new FormifyError("NOOP");
802
+ default:
803
+ throw new FormifyError("UNEXPECTED");
804
+ }
805
+ })
806
+ }
807
+ });
808
+ })
809
+ };
810
+ nodes.map((node2) => {
811
+ const namePath = [];
812
+ const aliasPath = [];
813
+ node2.path.forEach((p) => {
814
+ namePath.push(p.name);
815
+ aliasPath.push(p.alias);
816
+ if (p.list) {
817
+ namePath.push("NUM");
818
+ aliasPath.push("NUM");
819
+ }
820
+ });
821
+ JSON.stringify({
822
+ namePath: namePath.join("."),
823
+ aliasPath: aliasPath.join(".")
824
+ }, null, 2);
825
+ });
826
+ return { formifiedQuery, nodes };
827
+ };
398
828
  const captureBranchName = /^refs\/heads\/(.*)/;
399
829
  const parseRefForBranchName = (ref) => {
400
830
  const matches = ref.match(captureBranchName);
@@ -435,13 +865,21 @@ mutation addPendingDocumentMutation(
435
865
  };
436
866
  this.getSchema = async () => {
437
867
  if (!this.schema) {
438
- const data = await this.request(graphql.getIntrospectionQuery(), {
868
+ const data = await this.request(G.getIntrospectionQuery(), {
439
869
  variables: {}
440
870
  });
441
- this.schema = graphql.buildClientSchema(data);
871
+ this.schema = G.buildClientSchema(data);
442
872
  }
443
873
  return this.schema;
444
874
  };
875
+ this.getOptimizedQuery = async (documentNode) => {
876
+ const data = await this.request(`query GetOptimizedQuery($queryString: String!) {
877
+ getOptimizedQuery(queryString: $queryString)
878
+ }`, {
879
+ variables: { queryString: G.print(documentNode) }
880
+ });
881
+ return G.parse(data.getOptimizedQuery);
882
+ };
445
883
  this.options = options;
446
884
  this.setBranch(options.branch);
447
885
  this.events.subscribe("branch:change", ({ branchName }) => {
@@ -501,10 +939,23 @@ mutation addPendingDocumentMutation(
501
939
  this.contentApiBase = ((_c = this.options.tinaioConfig) == null ? void 0 : _c.contentApiUrlOverride) || `https://content.tinajs.io`;
502
940
  this.contentApiUrl = this.options.customContentApiUrl || `${this.contentApiBase}/content/${this.options.clientId}/github/${encodedBranch}`;
503
941
  }
504
- async requestWithForm(query, { variables }) {
942
+ async requestWithForm(query, {
943
+ variables,
944
+ useUnstableFormify
945
+ }) {
505
946
  const schema = await this.getSchema();
506
- const formifiedQuery = formify(query(gql__default["default"]), schema);
507
- return this.request(graphql.print(formifiedQuery), { variables });
947
+ let formifiedQuery;
948
+ if (useUnstableFormify) {
949
+ const res = await formify({
950
+ schema,
951
+ query: G.print(query(gql__default["default"])),
952
+ getOptimizedQuery: this.getOptimizedQuery
953
+ });
954
+ formifiedQuery = res.formifiedQuery;
955
+ } else {
956
+ formifiedQuery = formify$1(query(gql__default["default"]), schema);
957
+ }
958
+ return this.request(G.print(formifiedQuery), { variables });
508
959
  }
509
960
  async request(query, { variables }) {
510
961
  const res = await fetch(this.contentApiUrl, {
@@ -514,7 +965,7 @@ mutation addPendingDocumentMutation(
514
965
  Authorization: "Bearer " + (await this.getToken()).id_token
515
966
  },
516
967
  body: JSON.stringify({
517
- query: typeof query === "function" ? graphql.print(query(gql__default["default"])) : query,
968
+ query: typeof query === "function" ? G.print(query(gql__default["default"])) : query,
518
969
  variables
519
970
  })
520
971
  });
@@ -539,7 +990,7 @@ mutation addPendingDocumentMutation(
539
990
  async getRefreshedToken(tokens) {
540
991
  const { access_token, id_token, refresh_token } = JSON.parse(tokens);
541
992
  const { exp, iss, client_id } = this.parseJwt(access_token);
542
- if (Date.now() / 1e3 >= exp) {
993
+ if (Date.now() / 1e3 >= exp - 120) {
543
994
  const refreshResponse = await fetch(iss, {
544
995
  method: "POST",
545
996
  headers: {
@@ -897,6 +1348,9 @@ mutation addPendingDocumentMutation(
897
1348
  if (!cms.api.tina) {
898
1349
  cms.registerApi("tina", createClient(props));
899
1350
  }
1351
+ if (!cms.api.admin) {
1352
+ cms.registerApi("admin", new TinaAdminApi(cms));
1353
+ }
900
1354
  const setupMedia = async () => {
901
1355
  var _a;
902
1356
  if (props.mediaStore) {
@@ -921,11 +1375,6 @@ mutation addPendingDocumentMutation(
921
1375
  return newBranch;
922
1376
  };
923
1377
  setupMedia();
924
- React__default["default"].useMemo(() => {
925
- if (cms.flags.get("tina-admin") === true) {
926
- cms.registerApi("admin", new TinaAdminApi(cms));
927
- }
928
- }, [cms, cms.flags.get("tina-admin")]);
929
1378
  const [branchingEnabled, setBranchingEnabled] = React__default["default"].useState(() => cms.flags.get("branch-switcher"));
930
1379
  React__default["default"].useEffect(() => {
931
1380
  cms.events.subscribe("flag:set", ({ key, value }) => {
@@ -1034,7 +1483,8 @@ mutation addPendingDocumentMutation(
1034
1483
  const formIds = [];
1035
1484
  setIsLoading(true);
1036
1485
  cms.api.tina.requestWithForm((gql2) => gql2(query), {
1037
- variables
1486
+ variables,
1487
+ useUnstableFormify: cms.flags.get("use-unstable-formify")
1038
1488
  }).then((payload) => {
1039
1489
  cms.plugins.remove(new toolkit.FormMetaPlugin({ name: "tina-admin-link" }));
1040
1490
  setData(payload);
@@ -1405,1326 +1855,7 @@ mutation addPendingDocumentMutation(
1405
1855
  };
1406
1856
  }, [plugin]);
1407
1857
  };
1408
- var styles = `/**
1409
- Use a better box model (opinionated).
1410
- */
1411
-
1412
- .tina-tailwind *,
1413
- .tina-tailwind ::before,
1414
- .tina-tailwind ::after {
1415
- box-sizing: border-box;
1416
- }
1417
-
1418
- /**
1419
- Use a more readable tab size (opinionated).
1420
- */
1421
-
1422
- .tina-tailwind html {
1423
- -moz-tab-size: 4;
1424
- tab-size: 4;
1425
- }
1426
-
1427
- /**
1428
- 1. Correct the line height in all browsers.
1429
- 2. Prevent adjustments of font size after orientation changes in iOS.
1430
- */
1431
-
1432
- .tina-tailwind html {
1433
- line-height: 1.15; /* 1 */
1434
- -webkit-text-size-adjust: 100%; /* 2 */
1435
- }
1436
-
1437
- /**
1438
- Remove the margin in all browsers.
1439
- */
1440
-
1441
- .tina-tailwind body {
1442
- margin: 0;
1443
- }
1444
-
1445
- /**
1446
- Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
1447
- */
1448
-
1449
- .tina-tailwind body {
1450
- font-family:
1451
- system-ui,
1452
- -apple-system, /* Firefox supports this but not yet \`system-ui\` */
1453
- 'Segoe UI',
1454
- Roboto,
1455
- Helvetica,
1456
- Arial,
1457
- sans-serif,
1458
- 'Apple Color Emoji',
1459
- 'Segoe UI Emoji';
1460
- }
1461
-
1462
- /**
1463
- 1. Add the correct height in Firefox.
1464
- 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
1465
- */
1466
-
1467
- .tina-tailwind hr {
1468
- height: 0; /* 1 */
1469
- color: inherit; /* 2 */
1470
- }
1471
-
1472
- /**
1473
- Add the correct text decoration in Chrome, Edge, and Safari.
1474
- */
1475
-
1476
- .tina-tailwind abbr[title] {
1477
- text-decoration: underline dotted;
1478
- }
1479
-
1480
- /**
1481
- Add the correct font weight in Edge and Safari.
1482
- */
1483
-
1484
- .tina-tailwind b,
1485
- .tina-tailwind strong {
1486
- font-weight: bolder;
1487
- }
1488
-
1489
- /**
1490
- 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
1491
- 2. Correct the odd 'em' font sizing in all browsers.
1492
- */
1493
-
1494
- .tina-tailwind code,
1495
- .tina-tailwind kbd,
1496
- .tina-tailwind samp,
1497
- .tina-tailwind pre {
1498
- font-family:
1499
- ui-monospace,
1500
- SFMono-Regular,
1501
- Consolas,
1502
- 'Liberation Mono',
1503
- Menlo,
1504
- monospace; /* 1 */
1505
- font-size: 1em; /* 2 */
1506
- }
1507
-
1508
- /**
1509
- Add the correct font size in all browsers.
1510
- */
1511
-
1512
- .tina-tailwind small {
1513
- font-size: 80%;
1514
- }
1515
-
1516
- /**
1517
- Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
1518
- */
1519
-
1520
- .tina-tailwind sub,
1521
- .tina-tailwind sup {
1522
- font-size: 75%;
1523
- line-height: 0;
1524
- position: relative;
1525
- vertical-align: baseline;
1526
- }
1527
-
1528
- /*
1529
- Text-level semantics
1530
- ====================
1531
- */
1532
-
1533
- .tina-tailwind sub {
1534
- bottom: -0.25em;
1535
- }
1536
-
1537
- /*
1538
- Grouping content
1539
- ================
1540
- */
1541
-
1542
- .tina-tailwind sup {
1543
- top: -0.5em;
1544
- }
1545
-
1546
- /**
1547
- 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
1548
- 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
1549
- */
1550
-
1551
- .tina-tailwind table {
1552
- text-indent: 0; /* 1 */
1553
- border-color: inherit; /* 2 */
1554
- }
1555
-
1556
- /**
1557
- 1. Change the font styles in all browsers.
1558
- 2. Remove the margin in Firefox and Safari.
1559
- */
1560
-
1561
- .tina-tailwind button,
1562
- .tina-tailwind input,
1563
- .tina-tailwind optgroup,
1564
- .tina-tailwind select,
1565
- .tina-tailwind textarea {
1566
- font-family: inherit; /* 1 */
1567
- font-size: 100%; /* 1 */
1568
- line-height: 1.15; /* 1 */
1569
- margin: 0; /* 2 */
1570
- }
1571
-
1572
- /**
1573
- Remove the inheritance of text transform in Edge and Firefox.
1574
- 1. Remove the inheritance of text transform in Firefox.
1575
- */
1576
-
1577
- .tina-tailwind button,
1578
- .tina-tailwind select { /* 1 */
1579
- text-transform: none;
1580
- }
1581
-
1582
- /**
1583
- Correct the inability to style clickable types in iOS and Safari.
1584
- */
1585
-
1586
- .tina-tailwind button,
1587
- .tina-tailwind [type='button'],
1588
- .tina-tailwind [type='reset'],
1589
- .tina-tailwind [type='submit'] {
1590
- -webkit-appearance: button;
1591
- }
1592
-
1593
- /**
1594
- Remove the inner border and padding in Firefox.
1595
- */
1596
-
1597
- .tina-tailwind ::-moz-focus-inner {
1598
- border-style: none;
1599
- padding: 0;
1600
- }
1601
-
1602
- /**
1603
- Restore the focus styles unset by the previous rule.
1604
- */
1605
-
1606
- .tina-tailwind :-moz-focusring {
1607
- outline: 1px dotted ButtonText;
1608
- }
1609
-
1610
- /**
1611
- Remove the additional ':invalid' styles in Firefox.
1612
- See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
1613
- */
1614
-
1615
- .tina-tailwind :-moz-ui-invalid {
1616
- box-shadow: none;
1617
- }
1618
-
1619
- /**
1620
- Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
1621
- */
1622
-
1623
- .tina-tailwind legend {
1624
- padding: 0;
1625
- }
1626
-
1627
- /**
1628
- Add the correct vertical alignment in Chrome and Firefox.
1629
- */
1630
-
1631
- .tina-tailwind progress {
1632
- vertical-align: baseline;
1633
- }
1634
-
1635
- /**
1636
- Correct the cursor style of increment and decrement buttons in Safari.
1637
- */
1638
-
1639
- .tina-tailwind ::-webkit-inner-spin-button,
1640
- .tina-tailwind ::-webkit-outer-spin-button {
1641
- height: auto;
1642
- }
1643
-
1644
- /**
1645
- 1. Correct the odd appearance in Chrome and Safari.
1646
- 2. Correct the outline style in Safari.
1647
- */
1648
-
1649
- .tina-tailwind [type='search'] {
1650
- -webkit-appearance: textfield; /* 1 */
1651
- outline-offset: -2px; /* 2 */
1652
- }
1653
-
1654
- /**
1655
- Remove the inner padding in Chrome and Safari on macOS.
1656
- */
1657
-
1658
- .tina-tailwind ::-webkit-search-decoration {
1659
- -webkit-appearance: none;
1660
- }
1661
-
1662
- /**
1663
- 1. Correct the inability to style clickable types in iOS and Safari.
1664
- 2. Change font properties to 'inherit' in Safari.
1665
- */
1666
-
1667
- .tina-tailwind ::-webkit-file-upload-button {
1668
- -webkit-appearance: button; /* 1 */
1669
- font: inherit; /* 2 */
1670
- }
1671
-
1672
- /*
1673
- Add the correct display in Chrome and Safari.
1674
- */
1675
-
1676
- .tina-tailwind summary {
1677
- display: list-item;
1678
- }
1679
-
1680
- /**
1681
- * Removes the default spacing and border for appropriate elements.
1682
- */
1683
-
1684
- .tina-tailwind blockquote,
1685
- .tina-tailwind dl,
1686
- .tina-tailwind dd,
1687
- .tina-tailwind h1,
1688
- .tina-tailwind h2,
1689
- .tina-tailwind h3,
1690
- .tina-tailwind h4,
1691
- .tina-tailwind h5,
1692
- .tina-tailwind h6,
1693
- .tina-tailwind hr,
1694
- .tina-tailwind figure,
1695
- .tina-tailwind p,
1696
- .tina-tailwind pre {
1697
- margin: 0;
1698
- }
1699
-
1700
- /**
1701
- * Manually forked from SUIT CSS Base: https://github.com/suitcss/base
1702
- * A thin layer on top of normalize.css that provides a starting point more
1703
- * suitable for web applications.
1704
- */
1705
-
1706
- .tina-tailwind button {
1707
- background-color: transparent;
1708
- background-image: none;
1709
- }
1710
-
1711
- /*
1712
- Interactive
1713
- ===========
1714
- */
1715
-
1716
- .tina-tailwind fieldset {
1717
- margin: 0;
1718
- padding: 0;
1719
- }
1720
-
1721
- /*
1722
- Forms
1723
- =====
1724
- */
1725
-
1726
- .tina-tailwind ol,
1727
- .tina-tailwind ul {
1728
- list-style: none;
1729
- margin: 0;
1730
- padding: 0;
1731
- }
1732
-
1733
- /**
1734
- * 1. Use the user's configured \`sans\` font-family (with Tailwind's default
1735
- * sans-serif font stack as a fallback) as a sane default.
1736
- * 2. Use Tailwind's default "normal" line-height so the user isn't forced
1737
- * to override it to ensure consistency even when using the default theme.
1738
- */
1739
-
1740
- .tina-tailwind html {
1741
- font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
1742
- line-height: 1.5; /* 2 */
1743
- }
1744
-
1745
- /**
1746
- * Inherit font-family and line-height from \`html\` so users can set them as
1747
- * a class directly on the \`html\` element.
1748
- */
1749
-
1750
- .tina-tailwind body {
1751
- font-family: inherit;
1752
- line-height: inherit;
1753
- }
1754
-
1755
- /**
1756
- * 1. Prevent padding and border from affecting element width.
1757
- *
1758
- * We used to set this in the html element and inherit from
1759
- * the parent element for everything else. This caused issues
1760
- * in shadow-dom-enhanced elements like <details> where the content
1761
- * is wrapped by a div with box-sizing set to \`content-box\`.
1762
- *
1763
- * https://github.com/mozdevs/cssremedy/issues/4
1764
- *
1765
- *
1766
- * 2. Allow adding a border to an element by just adding a border-width.
1767
- *
1768
- * By default, the way the browser specifies that an element should have no
1769
- * border is by setting it's border-style to \`none\` in the user-agent
1770
- * stylesheet.
1771
- *
1772
- * In order to easily add borders to elements by just setting the \`border-width\`
1773
- * property, we change the default border-style for all elements to \`solid\`, and
1774
- * use border-width to hide them instead. This way our \`border\` utilities only
1775
- * need to set the \`border-width\` property instead of the entire \`border\`
1776
- * shorthand, making our border utilities much more straightforward to compose.
1777
- *
1778
- * https://github.com/tailwindcss/tailwindcss/pull/116
1779
- */
1780
-
1781
- .tina-tailwind *,
1782
- .tina-tailwind ::before,
1783
- .tina-tailwind ::after {
1784
- box-sizing: border-box; /* 1 */
1785
- border-width: 0; /* 2 */
1786
- border-style: solid; /* 2 */
1787
- border-color: currentColor; /* 2 */
1788
- }
1789
-
1790
- /*
1791
- * Ensure horizontal rules are visible by default
1792
- */
1793
-
1794
- .tina-tailwind hr {
1795
- border-top-width: 1px;
1796
- }
1797
-
1798
- /**
1799
- * Undo the \`border-style: none\` reset that Normalize applies to images so that
1800
- * our \`border-{width}\` utilities have the expected effect.
1801
- *
1802
- * The Normalize reset is unnecessary for us since we default the border-width
1803
- * to 0 on all elements.
1804
- *
1805
- * https://github.com/tailwindcss/tailwindcss/issues/362
1806
- */
1807
-
1808
- .tina-tailwind img {
1809
- border-style: solid;
1810
- }
1811
-
1812
- /**
1813
- * Tailwind custom reset styles
1814
- */
1815
-
1816
- .tina-tailwind textarea {
1817
- resize: vertical;
1818
- }
1819
-
1820
- /*
1821
- Tabular data
1822
- ============
1823
- */
1824
-
1825
- .tina-tailwind input::placeholder,
1826
- .tina-tailwind textarea::placeholder {
1827
- opacity: 1;
1828
- color: #918c9e;
1829
- }
1830
-
1831
- /*
1832
- Sections
1833
- ========
1834
- */
1835
-
1836
- .tina-tailwind button,
1837
- .tina-tailwind [role="button"] {
1838
- cursor: pointer;
1839
- }
1840
-
1841
- /**
1842
- * Override legacy focus reset from Normalize with modern Firefox focus styles.
1843
- *
1844
- * This is actually an improvement over the new defaults in Firefox in our testing,
1845
- * as it triggers the better focus styles even for links, which still use a dotted
1846
- * outline in Firefox by default.
1847
- */
1848
-
1849
- .tina-tailwind :-moz-focusring {
1850
- outline: auto;
1851
- }
1852
-
1853
- /*
1854
- Document
1855
- ========
1856
- */
1857
-
1858
- .tina-tailwind table {
1859
- border-collapse: collapse;
1860
- }
1861
-
1862
- /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
1863
-
1864
- .tina-tailwind h1,
1865
- .tina-tailwind h2,
1866
- .tina-tailwind h3,
1867
- .tina-tailwind h4,
1868
- .tina-tailwind h5,
1869
- .tina-tailwind h6 {
1870
- font-size: inherit;
1871
- font-weight: inherit;
1872
- }
1873
-
1874
- /**
1875
- * Reset links to optimize for opt-in styling instead of
1876
- * opt-out.
1877
- */
1878
-
1879
- .tina-tailwind a {
1880
- color: inherit;
1881
- text-decoration: inherit;
1882
- }
1883
-
1884
- /**
1885
- * Reset form element properties that are easy to forget to
1886
- * style explicitly so you don't inadvertently introduce
1887
- * styles that deviate from your design system. These styles
1888
- * supplement a partial reset that is already applied by
1889
- * normalize.css.
1890
- */
1891
-
1892
- .tina-tailwind button,
1893
- .tina-tailwind input,
1894
- .tina-tailwind optgroup,
1895
- .tina-tailwind select,
1896
- .tina-tailwind textarea {
1897
- padding: 0;
1898
- line-height: inherit;
1899
- color: inherit;
1900
- }
1901
-
1902
- /**
1903
- * Use the configured 'mono' font family for elements that
1904
- * are expected to be rendered with a monospace font, falling
1905
- * back to the system monospace stack if there is no configured
1906
- * 'mono' font family.
1907
- */
1908
-
1909
- .tina-tailwind pre,
1910
- .tina-tailwind code,
1911
- .tina-tailwind kbd,
1912
- .tina-tailwind samp {
1913
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1914
- }
1915
-
1916
- /**
1917
- * 1. Make replaced elements \`display: block\` by default as that's
1918
- * the behavior you want almost all of the time. Inspired by
1919
- * CSS Remedy, with \`svg\` added as well.
1920
- *
1921
- * https://github.com/mozdevs/cssremedy/issues/14
1922
- *
1923
- * 2. Add \`vertical-align: middle\` to align replaced elements more
1924
- * sensibly by default when overriding \`display\` by adding a
1925
- * utility like \`inline\`.
1926
- *
1927
- * This can trigger a poorly considered linting error in some
1928
- * tools but is included by design.
1929
- *
1930
- * https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210
1931
- */
1932
-
1933
- .tina-tailwind img,
1934
- .tina-tailwind svg,
1935
- .tina-tailwind video,
1936
- .tina-tailwind canvas,
1937
- .tina-tailwind audio,
1938
- .tina-tailwind iframe,
1939
- .tina-tailwind embed,
1940
- .tina-tailwind object {
1941
- display: block; /* 1 */
1942
- vertical-align: middle; /* 2 */
1943
- }
1944
-
1945
- /**
1946
- * Constrain images and videos to the parent width and preserve
1947
- * their intrinsic aspect ratio.
1948
- *
1949
- * https://github.com/mozdevs/cssremedy/issues/14
1950
- */
1951
-
1952
- .tina-tailwind img,
1953
- .tina-tailwind video {
1954
- max-width: 100%;
1955
- height: auto;
1956
- }
1957
-
1958
- /**
1959
- * Ensure the default browser behavior of the \`hidden\` attribute.
1960
- */
1961
-
1962
- .tina-tailwind [hidden] {
1963
- display: none;
1964
- }
1965
-
1966
- /*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com
1967
- */
1968
-
1969
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1970
- --tw-translate-x: 0;
1971
- --tw-translate-y: 0;
1972
- --tw-rotate: 0;
1973
- --tw-skew-x: 0;
1974
- --tw-skew-y: 0;
1975
- --tw-scale-x: 1;
1976
- --tw-scale-y: 1;
1977
- --tw-transform: translateX(var(--tw-translate-x)) translateY(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));
1978
- }
1979
-
1980
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1981
- --tw-border-opacity: 1;
1982
- border-color: rgba(225, 221, 236, var(--tw-border-opacity));
1983
- }
1984
-
1985
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1986
- --tw-ring-offset-shadow: 0 0 #0000;
1987
- --tw-ring-shadow: 0 0 #0000;
1988
- --tw-shadow: 0 0 #0000;
1989
- }
1990
-
1991
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1992
- --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
1993
- --tw-ring-offset-width: 0px;
1994
- --tw-ring-offset-color: #fff;
1995
- --tw-ring-color: rgba(0, 132, 255, 0.5);
1996
- --tw-ring-offset-shadow: 0 0 #0000;
1997
- --tw-ring-shadow: 0 0 #0000;
1998
- --tw-shadow: 0 0 #0000;
1999
- }
2000
-
2001
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
2002
- --tw-blur: var(--tw-empty,/*!*/ /*!*/);
2003
- --tw-brightness: var(--tw-empty,/*!*/ /*!*/);
2004
- --tw-contrast: var(--tw-empty,/*!*/ /*!*/);
2005
- --tw-grayscale: var(--tw-empty,/*!*/ /*!*/);
2006
- --tw-hue-rotate: var(--tw-empty,/*!*/ /*!*/);
2007
- --tw-invert: var(--tw-empty,/*!*/ /*!*/);
2008
- --tw-saturate: var(--tw-empty,/*!*/ /*!*/);
2009
- --tw-sepia: var(--tw-empty,/*!*/ /*!*/);
2010
- --tw-drop-shadow: var(--tw-empty,/*!*/ /*!*/);
2011
- --tw-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
2012
- }
2013
-
2014
- .tina-tailwind .static {
2015
- position: static !important;
2016
- }
2017
-
2018
- .tina-tailwind .fixed {
2019
- position: fixed !important;
2020
- }
2021
-
2022
- .tina-tailwind .absolute {
2023
- position: absolute !important;
2024
- }
2025
-
2026
- .tina-tailwind .relative {
2027
- position: relative !important;
2028
- }
2029
-
2030
- .tina-tailwind .left-0 {
2031
- left: 0px !important;
2032
- }
2033
-
2034
- .tina-tailwind .right-0 {
2035
- right: 0px !important;
2036
- }
2037
-
2038
- .tina-tailwind .bottom-2 {
2039
- bottom: 8px !important;
2040
- }
2041
-
2042
- .tina-tailwind .right-5 {
2043
- right: 20px !important;
2044
- }
2045
-
2046
- .tina-tailwind .z-50 {
2047
- z-index: 50 !important;
2048
- }
2049
-
2050
- .tina-tailwind .mx-auto {
2051
- margin-left: auto !important;
2052
- margin-right: auto !important;
2053
- }
2054
-
2055
- .tina-tailwind .mr-2 {
2056
- margin-right: 8px !important;
2057
- }
2058
-
2059
- .tina-tailwind .mb-2 {
2060
- margin-bottom: 8px !important;
2061
- }
2062
-
2063
- .tina-tailwind .mb-1 {
2064
- margin-bottom: 4px !important;
2065
- }
2066
-
2067
- .tina-tailwind .-mt-0\\.5 {
2068
- margin-top: -2px !important;
2069
- }
2070
-
2071
- .tina-tailwind .-mt-0 {
2072
- margin-top: 0px !important;
2073
- }
2074
-
2075
- .tina-tailwind .ml-1 {
2076
- margin-left: 4px !important;
2077
- }
2078
-
2079
- .tina-tailwind .mt-2 {
2080
- margin-top: 8px !important;
2081
- }
2082
-
2083
- .tina-tailwind .mr-1\\.5 {
2084
- margin-right: 6px !important;
2085
- }
2086
-
2087
- .tina-tailwind .mr-1 {
2088
- margin-right: 4px !important;
2089
- }
2090
-
2091
- .tina-tailwind .block {
2092
- display: block !important;
2093
- }
2094
-
2095
- .tina-tailwind .inline-block {
2096
- display: inline-block !important;
2097
- }
2098
-
2099
- .tina-tailwind .flex {
2100
- display: flex !important;
2101
- }
2102
-
2103
- .tina-tailwind .inline-flex {
2104
- display: inline-flex !important;
2105
- }
2106
-
2107
- .tina-tailwind .table {
2108
- display: table !important;
2109
- }
2110
-
2111
- .tina-tailwind .h-screen {
2112
- height: 100vh !important;
2113
- }
2114
-
2115
- .tina-tailwind .h-auto {
2116
- height: auto !important;
2117
- }
2118
-
2119
- .tina-tailwind .h-full {
2120
- height: 100% !important;
2121
- }
2122
-
2123
- .tina-tailwind .h-6 {
2124
- height: 24px !important;
2125
- }
2126
-
2127
- .tina-tailwind .h-10 {
2128
- height: 40px !important;
2129
- }
2130
-
2131
- .tina-tailwind .h-5 {
2132
- height: 20px !important;
2133
- }
2134
-
2135
- .tina-tailwind .w-full {
2136
- width: 100% !important;
2137
- }
2138
-
2139
- .tina-tailwind .w-10 {
2140
- width: 40px !important;
2141
- }
2142
-
2143
- .tina-tailwind .w-auto {
2144
- width: auto !important;
2145
- }
2146
-
2147
- .tina-tailwind .w-5 {
2148
- width: 20px !important;
2149
- }
2150
-
2151
- .tina-tailwind .w-56 {
2152
- width: 224px !important;
2153
- }
2154
-
2155
- .tina-tailwind .w-6 {
2156
- width: 24px !important;
2157
- }
2158
-
2159
- .tina-tailwind .max-w-lg {
2160
- max-width: 32rem !important;
2161
- }
2162
-
2163
- .tina-tailwind .max-w-screen-xl {
2164
- max-width: 1280px !important;
2165
- }
2166
-
2167
- .tina-tailwind .max-w-form {
2168
- max-width: 900px !important;
2169
- }
2170
-
2171
- .tina-tailwind .max-w-full {
2172
- max-width: 100% !important;
2173
- }
2174
-
2175
- .tina-tailwind .flex-1 {
2176
- flex: 1 1 0% !important;
2177
- }
2178
-
2179
- .tina-tailwind .table-auto {
2180
- table-layout: auto !important;
2181
- }
2182
-
2183
- .tina-tailwind .origin-top-right {
2184
- transform-origin: top right !important;
2185
- }
2186
-
2187
- .tina-tailwind .translate-y-full {
2188
- --tw-translate-y: 100% !important;
2189
- transform: var(--tw-transform) !important;
2190
- }
2191
-
2192
- .tina-tailwind .-translate-y-2 {
2193
- --tw-translate-y: -8px !important;
2194
- transform: var(--tw-transform) !important;
2195
- }
2196
-
2197
- .tina-tailwind .translate-y-0 {
2198
- --tw-translate-y: 0px !important;
2199
- transform: var(--tw-transform) !important;
2200
- }
2201
-
2202
- .tina-tailwind .scale-95 {
2203
- --tw-scale-x: .95 !important;
2204
- --tw-scale-y: .95 !important;
2205
- transform: var(--tw-transform) !important;
2206
- }
2207
-
2208
- .tina-tailwind .scale-100 {
2209
- --tw-scale-x: 1 !important;
2210
- --tw-scale-y: 1 !important;
2211
- transform: var(--tw-transform) !important;
2212
- }
2213
-
2214
- .tina-tailwind .transform {
2215
- transform: var(--tw-transform) !important;
2216
- }
2217
-
2218
- .tina-tailwind .flex-col {
2219
- flex-direction: column !important;
2220
- }
2221
-
2222
- .tina-tailwind .items-end {
2223
- align-items: flex-end !important;
2224
- }
2225
-
2226
- .tina-tailwind .items-center {
2227
- align-items: center !important;
2228
- }
2229
-
2230
- .tina-tailwind .items-stretch {
2231
- align-items: stretch !important;
2232
- }
2233
-
2234
- .tina-tailwind .justify-center {
2235
- justify-content: center !important;
2236
- }
2237
-
2238
- .tina-tailwind .justify-between {
2239
- justify-content: space-between !important;
2240
- }
2241
-
2242
- .tina-tailwind .gap-0\\.5 {
2243
- gap: 2px !important;
2244
- }
2245
-
2246
- .tina-tailwind .gap-0 {
2247
- gap: 0px !important;
2248
- }
2249
-
2250
- .tina-tailwind .gap-4 {
2251
- gap: 16px !important;
2252
- }
2253
-
2254
- .tina-tailwind .gap-3 {
2255
- gap: 12px !important;
2256
- }
2257
-
2258
- .tina-tailwind .divide-y > :not([hidden]) ~ :not([hidden]) {
2259
- --tw-divide-y-reverse: 0 !important;
2260
- border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse))) !important;
2261
- border-bottom-width: calc(1px * var(--tw-divide-y-reverse)) !important;
2262
- }
2263
-
2264
- .tina-tailwind .overflow-hidden {
2265
- overflow: hidden !important;
2266
- }
2267
-
2268
- .tina-tailwind .overflow-y-auto {
2269
- overflow-y: auto !important;
2270
- }
2271
-
2272
- .tina-tailwind .whitespace-nowrap {
2273
- white-space: nowrap !important;
2274
- }
2275
-
2276
- .tina-tailwind .rounded-lg {
2277
- border-radius: 8px !important;
2278
- }
2279
-
2280
- .tina-tailwind .rounded-full {
2281
- border-radius: 9999px !important;
2282
- }
2283
-
2284
- .tina-tailwind .rounded-md {
2285
- border-radius: 6px !important;
2286
- }
2287
-
2288
- .tina-tailwind .border {
2289
- border-width: 1px !important;
2290
- }
2291
-
2292
- .tina-tailwind .border-b {
2293
- border-bottom-width: 1px !important;
2294
- }
2295
-
2296
- .tina-tailwind .border-gray-200 {
2297
- --tw-border-opacity: 1 !important;
2298
- border-color: rgba(225, 221, 236, var(--tw-border-opacity)) !important;
2299
- }
2300
-
2301
- .tina-tailwind .border-transparent {
2302
- border-color: transparent !important;
2303
- }
2304
-
2305
- .tina-tailwind .bg-white {
2306
- --tw-bg-opacity: 1 !important;
2307
- background-color: rgba(255, 255, 255, var(--tw-bg-opacity)) !important;
2308
- }
2309
-
2310
- .tina-tailwind .bg-gray-50 {
2311
- --tw-bg-opacity: 1 !important;
2312
- background-color: rgba(246, 246, 249, var(--tw-bg-opacity)) !important;
2313
- }
2314
-
2315
- .tina-tailwind .bg-blue-500 {
2316
- --tw-bg-opacity: 1 !important;
2317
- background-color: rgba(0, 132, 255, var(--tw-bg-opacity)) !important;
2318
- }
2319
-
2320
- .tina-tailwind .bg-gradient-to-b {
2321
- background-image: linear-gradient(to bottom, var(--tw-gradient-stops)) !important;
2322
- }
2323
-
2324
- .tina-tailwind .from-blue-900 {
2325
- --tw-gradient-from: #1D2C6C !important;
2326
- --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(29, 44, 108, 0)) !important;
2327
- }
2328
-
2329
- .tina-tailwind .to-gray-900 {
2330
- --tw-gradient-to: #252336 !important;
2331
- }
2332
-
2333
- .tina-tailwind .px-4 {
2334
- padding-left: 16px !important;
2335
- padding-right: 16px !important;
2336
- }
2337
-
2338
- .tina-tailwind .py-6 {
2339
- padding-top: 24px !important;
2340
- padding-bottom: 24px !important;
2341
- }
2342
-
2343
- .tina-tailwind .px-5 {
2344
- padding-left: 20px !important;
2345
- padding-right: 20px !important;
2346
- }
2347
-
2348
- .tina-tailwind .py-4 {
2349
- padding-top: 16px !important;
2350
- padding-bottom: 16px !important;
2351
- }
2352
-
2353
- .tina-tailwind .px-12 {
2354
- padding-left: 48px !important;
2355
- padding-right: 48px !important;
2356
- }
2357
-
2358
- .tina-tailwind .py-10 {
2359
- padding-top: 40px !important;
2360
- padding-bottom: 40px !important;
2361
- }
2362
-
2363
- .tina-tailwind .px-20 {
2364
- padding-left: 80px !important;
2365
- padding-right: 80px !important;
2366
- }
2367
-
2368
- .tina-tailwind .px-6 {
2369
- padding-left: 24px !important;
2370
- padding-right: 24px !important;
2371
- }
2372
-
2373
- .tina-tailwind .py-1 {
2374
- padding-top: 4px !important;
2375
- padding-bottom: 4px !important;
2376
- }
2377
-
2378
- .tina-tailwind .py-2 {
2379
- padding-top: 8px !important;
2380
- padding-bottom: 8px !important;
2381
- }
2382
-
2383
- .tina-tailwind .py-3 {
2384
- padding-top: 12px !important;
2385
- padding-bottom: 12px !important;
2386
- }
2387
-
2388
- .tina-tailwind .px-8 {
2389
- padding-left: 32px !important;
2390
- padding-right: 32px !important;
2391
- }
2392
-
2393
- .tina-tailwind .pb-4 {
2394
- padding-bottom: 16px !important;
2395
- }
2396
-
2397
- .tina-tailwind .pt-18 {
2398
- padding-top: 72px !important;
2399
- }
2400
-
2401
- .tina-tailwind .text-left {
2402
- text-align: left !important;
2403
- }
2404
-
2405
- .tina-tailwind .text-center {
2406
- text-align: center !important;
2407
- }
2408
-
2409
- .tina-tailwind .font-sans {
2410
- font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
2411
- }
2412
-
2413
- .tina-tailwind .text-2xl {
2414
- font-size: 24px !important;
2415
- line-height: 1.33 !important;
2416
- }
2417
-
2418
- .tina-tailwind .text-base {
2419
- font-size: 16px !important;
2420
- line-height: 1.5 !important;
2421
- }
2422
-
2423
- .tina-tailwind .text-sm {
2424
- font-size: 14px !important;
2425
- line-height: 1.43 !important;
2426
- }
2427
-
2428
- .tina-tailwind .text-xl {
2429
- font-size: 20px !important;
2430
- line-height: 1.4 !important;
2431
- }
2432
-
2433
- .tina-tailwind .text-md {
2434
- font-size: 16px !important;
2435
- line-height: 1.5 !important;
2436
- }
2437
-
2438
- .tina-tailwind .text-xs {
2439
- font-size: 13px !important;
2440
- line-height: 1.33 !important;
2441
- }
2442
-
2443
- .tina-tailwind .font-medium {
2444
- font-weight: 500 !important;
2445
- }
2446
-
2447
- .tina-tailwind .uppercase {
2448
- text-transform: uppercase !important;
2449
- }
2450
-
2451
- .tina-tailwind .italic {
2452
- font-style: italic !important;
2453
- }
2454
-
2455
- .tina-tailwind .leading-normal {
2456
- line-height: 1.5 !important;
2457
- }
2458
-
2459
- .tina-tailwind .leading-tight {
2460
- line-height: 1.25 !important;
2461
- }
2462
-
2463
- .tina-tailwind .leading-5 {
2464
- line-height: 20px !important;
2465
- }
2466
-
2467
- .tina-tailwind .leading-4 {
2468
- line-height: 16px !important;
2469
- }
2470
-
2471
- .tina-tailwind .tracking-wide {
2472
- letter-spacing: 0.025em !important;
2473
- }
2474
-
2475
- .tina-tailwind .text-gray-700 {
2476
- --tw-text-opacity: 1 !important;
2477
- color: rgba(67, 62, 82, var(--tw-text-opacity)) !important;
2478
- }
2479
-
2480
- .tina-tailwind .text-blue-600 {
2481
- --tw-text-opacity: 1 !important;
2482
- color: rgba(5, 116, 228, var(--tw-text-opacity)) !important;
2483
- }
2484
-
2485
- .tina-tailwind .text-gray-500 {
2486
- --tw-text-opacity: 1 !important;
2487
- color: rgba(113, 108, 127, var(--tw-text-opacity)) !important;
2488
- }
2489
-
2490
- .tina-tailwind .text-gray-400 {
2491
- --tw-text-opacity: 1 !important;
2492
- color: rgba(145, 140, 158, var(--tw-text-opacity)) !important;
2493
- }
2494
-
2495
- .tina-tailwind .text-current {
2496
- color: currentColor !important;
2497
- }
2498
-
2499
- .tina-tailwind .text-white {
2500
- --tw-text-opacity: 1 !important;
2501
- color: rgba(255, 255, 255, var(--tw-text-opacity)) !important;
2502
- }
2503
-
2504
- .tina-tailwind .text-gray-600 {
2505
- --tw-text-opacity: 1 !important;
2506
- color: rgba(86, 81, 101, var(--tw-text-opacity)) !important;
2507
- }
2508
-
2509
- .tina-tailwind .text-gray-800 {
2510
- --tw-text-opacity: 1 !important;
2511
- color: rgba(54, 49, 69, var(--tw-text-opacity)) !important;
2512
- }
2513
-
2514
- .tina-tailwind .text-gray-900 {
2515
- --tw-text-opacity: 1 !important;
2516
- color: rgba(37, 35, 54, var(--tw-text-opacity)) !important;
2517
- }
2518
-
2519
- .tina-tailwind .text-blue-500 {
2520
- --tw-text-opacity: 1 !important;
2521
- color: rgba(0, 132, 255, var(--tw-text-opacity)) !important;
2522
- }
2523
-
2524
- .tina-tailwind .text-blue-400 {
2525
- --tw-text-opacity: 1 !important;
2526
- color: rgba(34, 150, 254, var(--tw-text-opacity)) !important;
2527
- }
2528
-
2529
- .tina-tailwind .underline {
2530
- text-decoration: underline !important;
2531
- }
2532
-
2533
- .tina-tailwind .opacity-100 {
2534
- opacity: 1 !important;
2535
- }
2536
-
2537
- .tina-tailwind .opacity-90 {
2538
- opacity: .9 !important;
2539
- }
2540
-
2541
- .tina-tailwind .opacity-80 {
2542
- opacity: .8 !important;
2543
- }
2544
-
2545
- .tina-tailwind .opacity-50 {
2546
- opacity: .5 !important;
2547
- }
2548
-
2549
- .tina-tailwind .opacity-70 {
2550
- opacity: .7 !important;
2551
- }
2552
-
2553
- .tina-tailwind .opacity-0 {
2554
- opacity: 0 !important;
2555
- }
2556
-
2557
- .tina-tailwind .shadow-lg {
2558
- --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
2559
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2560
- }
2561
-
2562
- .tina-tailwind .shadow-2xl {
2563
- --tw-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
2564
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2565
- }
2566
-
2567
- .tina-tailwind .shadow {
2568
- --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
2569
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2570
- }
2571
-
2572
- .tina-tailwind .shadow-sm {
2573
- --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
2574
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2575
- }
2576
-
2577
- .tina-tailwind .ring-1 {
2578
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
2579
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
2580
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
2581
- }
2582
-
2583
- .tina-tailwind .ring-black {
2584
- --tw-ring-opacity: 1 !important;
2585
- --tw-ring-color: rgba(0, 0, 0, var(--tw-ring-opacity)) !important;
2586
- }
2587
-
2588
- .tina-tailwind .ring-opacity-5 {
2589
- --tw-ring-opacity: .05 !important;
2590
- }
2591
-
2592
- .tina-tailwind .filter {
2593
- filter: var(--tw-filter) !important;
2594
- }
2595
-
2596
- .tina-tailwind .transition-opacity {
2597
- transition-property: opacity !important;
2598
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2599
- transition-duration: 150ms !important;
2600
- }
2601
-
2602
- .tina-tailwind .transition-colors {
2603
- transition-property: background-color, border-color, color, fill, stroke !important;
2604
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2605
- transition-duration: 150ms !important;
2606
- }
2607
-
2608
- .tina-tailwind .transition-all {
2609
- transition-property: all !important;
2610
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2611
- transition-duration: 150ms !important;
2612
- }
2613
-
2614
- .tina-tailwind .transition {
2615
- transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;
2616
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2617
- transition-duration: 150ms !important;
2618
- }
2619
-
2620
- .tina-tailwind .duration-300 {
2621
- transition-duration: 300ms !important;
2622
- }
2623
-
2624
- .tina-tailwind .duration-150 {
2625
- transition-duration: 150ms !important;
2626
- }
2627
-
2628
- .tina-tailwind .duration-100 {
2629
- transition-duration: 100ms !important;
2630
- }
2631
-
2632
- .tina-tailwind .duration-75 {
2633
- transition-duration: 75ms !important;
2634
- }
2635
-
2636
- .tina-tailwind .ease-out {
2637
- transition-timing-function: cubic-bezier(0, 0, 0.2, 1) !important;
2638
- }
2639
-
2640
- .tina-tailwind .ease-in {
2641
- transition-timing-function: cubic-bezier(0.4, 0, 1, 1) !important;
2642
- }
2643
-
2644
- .tina-tailwind .ease-in-out {
2645
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2646
- }
2647
-
2648
- .tina-tailwind .icon-parent svg {
2649
- fill: currentColor !important;
2650
- }
2651
-
2652
- .tina-tailwind {
2653
- font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
2654
- --tw-text-opacity: 1;
2655
- color: rgba(86, 81, 101, var(--tw-text-opacity));
2656
- }
2657
-
2658
- .first\\:pt-3:first-child {
2659
- padding-top: 12px !important;
2660
- }
2661
-
2662
- .last\\:pb-3:last-child {
2663
- padding-bottom: 12px !important;
2664
- }
2665
-
2666
- .hover\\:bg-blue-600:hover {
2667
- --tw-bg-opacity: 1 !important;
2668
- background-color: rgba(5, 116, 228, var(--tw-bg-opacity)) !important;
2669
- }
2670
-
2671
- .hover\\:bg-gray-50:hover {
2672
- --tw-bg-opacity: 1 !important;
2673
- background-color: rgba(246, 246, 249, var(--tw-bg-opacity)) !important;
2674
- }
2675
-
2676
- .hover\\:text-blue-600:hover {
2677
- --tw-text-opacity: 1 !important;
2678
- color: rgba(5, 116, 228, var(--tw-text-opacity)) !important;
2679
- }
2680
-
2681
- .hover\\:text-blue-400:hover {
2682
- --tw-text-opacity: 1 !important;
2683
- color: rgba(34, 150, 254, var(--tw-text-opacity)) !important;
2684
- }
2685
-
2686
- .hover\\:opacity-100:hover {
2687
- opacity: 1 !important;
2688
- }
2689
-
2690
- .hover\\:opacity-80:hover {
2691
- opacity: .8 !important;
2692
- }
2693
-
2694
- .focus\\:text-blue-400:focus {
2695
- --tw-text-opacity: 1 !important;
2696
- color: rgba(34, 150, 254, var(--tw-text-opacity)) !important;
2697
- }
2698
-
2699
- .focus\\:underline:focus {
2700
- text-decoration: underline !important;
2701
- }
2702
-
2703
- .focus\\:shadow-outline:focus {
2704
- --tw-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5) !important;
2705
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2706
- }
2707
-
2708
- .focus\\:outline-none:focus {
2709
- outline: 2px solid transparent !important;
2710
- outline-offset: 2px !important;
2711
- }
2712
-
2713
- .focus\\:ring-2:focus {
2714
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
2715
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
2716
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
2717
- }
2718
-
2719
- .focus\\:ring-blue-500:focus {
2720
- --tw-ring-opacity: 1 !important;
2721
- --tw-ring-color: rgba(0, 132, 255, var(--tw-ring-opacity)) !important;
2722
- }
2723
-
2724
- .group:hover .group-hover\\:opacity-100 {
2725
- opacity: 1 !important;
2726
- }
2727
- `;
1858
+ var styles = '*, ::before, ::after {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(0 132 255 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n.tina-tailwind .static {\n position: static;\n}\n.tina-tailwind .fixed {\n position: fixed;\n}\n.tina-tailwind .absolute {\n position: absolute;\n}\n.tina-tailwind .relative {\n position: relative;\n}\n.tina-tailwind .left-0 {\n left: 0px;\n}\n.tina-tailwind .right-0 {\n right: 0px;\n}\n.tina-tailwind .mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.tina-tailwind .mr-2 {\n margin-right: 8px;\n}\n.tina-tailwind .mb-2 {\n margin-bottom: 8px;\n}\n.tina-tailwind .mb-1 {\n margin-bottom: 4px;\n}\n.tina-tailwind .-mt-0\\.5 {\n margin-top: -2px;\n}\n.tina-tailwind .-mt-0 {\n margin-top: -0px;\n}\n.tina-tailwind .ml-1 {\n margin-left: 4px;\n}\n.tina-tailwind .mt-2 {\n margin-top: 8px;\n}\n.tina-tailwind .mr-1\\.5 {\n margin-right: 6px;\n}\n.tina-tailwind .mr-1 {\n margin-right: 4px;\n}\n.tina-tailwind .block {\n display: block;\n}\n.tina-tailwind .inline-block {\n display: inline-block;\n}\n.tina-tailwind .inline {\n display: inline;\n}\n.tina-tailwind .flex {\n display: flex;\n}\n.tina-tailwind .inline-flex {\n display: inline-flex;\n}\n.tina-tailwind .table {\n display: table;\n}\n.tina-tailwind .h-screen {\n height: 100vh;\n}\n.tina-tailwind .h-auto {\n height: auto;\n}\n.tina-tailwind .h-full {\n height: 100%;\n}\n.tina-tailwind .h-6 {\n height: 24px;\n}\n.tina-tailwind .h-10 {\n height: 40px;\n}\n.tina-tailwind .h-5 {\n height: 20px;\n}\n.tina-tailwind .h-12 {\n height: 48px;\n}\n.tina-tailwind .w-full {\n width: 100%;\n}\n.tina-tailwind .w-10 {\n width: 40px;\n}\n.tina-tailwind .w-auto {\n width: auto;\n}\n.tina-tailwind .w-5 {\n width: 20px;\n}\n.tina-tailwind .w-56 {\n width: 224px;\n}\n.tina-tailwind .w-6 {\n width: 24px;\n}\n.tina-tailwind .max-w-lg {\n max-width: 32rem;\n}\n.tina-tailwind .max-w-screen-xl {\n max-width: 1280px;\n}\n.tina-tailwind .max-w-form {\n max-width: 900px;\n}\n.tina-tailwind .max-w-full {\n max-width: 100%;\n}\n.tina-tailwind .flex-1 {\n flex: 1 1 0%;\n}\n.tina-tailwind .flex-shrink-0 {\n flex-shrink: 0;\n}\n.tina-tailwind .flex-grow-0 {\n flex-grow: 0;\n}\n.tina-tailwind .table-auto {\n table-layout: auto;\n}\n.tina-tailwind .origin-top-right {\n transform-origin: top right;\n}\n.tina-tailwind .scale-95 {\n --tw-scale-x: .95;\n --tw-scale-y: .95;\n 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));\n}\n.tina-tailwind .scale-100 {\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n 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));\n}\n.tina-tailwind .transform {\n 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));\n}\n.tina-tailwind .cursor-pointer {\n cursor: pointer;\n}\n.tina-tailwind .flex-col {\n flex-direction: column;\n}\n.tina-tailwind .items-end {\n align-items: flex-end;\n}\n.tina-tailwind .items-center {\n align-items: center;\n}\n.tina-tailwind .items-stretch {\n align-items: stretch;\n}\n.tina-tailwind .justify-end {\n justify-content: flex-end;\n}\n.tina-tailwind .justify-center {\n justify-content: center;\n}\n.tina-tailwind .justify-between {\n justify-content: space-between;\n}\n.tina-tailwind .gap-0\\.5 {\n gap: 2px;\n}\n.tina-tailwind .gap-0 {\n gap: 0px;\n}\n.tina-tailwind .gap-4 {\n gap: 16px;\n}\n.tina-tailwind .gap-3 {\n gap: 12px;\n}\n.tina-tailwind .divide-y > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n.tina-tailwind .divide-gray-150 > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-opacity: 1;\n border-color: rgb(230 227 239 / var(--tw-divide-opacity));\n}\n.tina-tailwind .overflow-hidden {\n overflow: hidden;\n}\n.tina-tailwind .overflow-y-auto {\n overflow-y: auto;\n}\n.tina-tailwind .whitespace-nowrap {\n white-space: nowrap;\n}\n.tina-tailwind .rounded-lg {\n border-radius: 8px;\n}\n.tina-tailwind .rounded-full {\n border-radius: 9999px;\n}\n.tina-tailwind .rounded-md {\n border-radius: 6px;\n}\n.tina-tailwind .border {\n border-width: 1px;\n}\n.tina-tailwind .border-b {\n border-bottom-width: 1px;\n}\n.tina-tailwind .border-gray-150 {\n --tw-border-opacity: 1;\n border-color: rgb(230 227 239 / var(--tw-border-opacity));\n}\n.tina-tailwind .border-gray-200 {\n --tw-border-opacity: 1;\n border-color: rgb(225 221 236 / var(--tw-border-opacity));\n}\n.tina-tailwind .bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n.tina-tailwind .bg-gray-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(246 246 249 / var(--tw-bg-opacity));\n}\n.tina-tailwind .bg-blue-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(0 132 255 / var(--tw-bg-opacity));\n}\n.tina-tailwind .bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n}\n.tina-tailwind .from-blue-900 {\n --tw-gradient-from: #1D2C6C;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(29 44 108 / 0));\n}\n.tina-tailwind .to-gray-900 {\n --tw-gradient-to: #252336;\n}\n.tina-tailwind .px-4 {\n padding-left: 16px;\n padding-right: 16px;\n}\n.tina-tailwind .py-6 {\n padding-top: 24px;\n padding-bottom: 24px;\n}\n.tina-tailwind .px-5 {\n padding-left: 20px;\n padding-right: 20px;\n}\n.tina-tailwind .py-4 {\n padding-top: 16px;\n padding-bottom: 16px;\n}\n.tina-tailwind .px-12 {\n padding-left: 48px;\n padding-right: 48px;\n}\n.tina-tailwind .py-10 {\n padding-top: 40px;\n padding-bottom: 40px;\n}\n.tina-tailwind .px-20 {\n padding-left: 80px;\n padding-right: 80px;\n}\n.tina-tailwind .px-6 {\n padding-left: 24px;\n padding-right: 24px;\n}\n.tina-tailwind .py-1 {\n padding-top: 4px;\n padding-bottom: 4px;\n}\n.tina-tailwind .py-2 {\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.tina-tailwind .pt-4 {\n padding-top: 16px;\n}\n.tina-tailwind .pb-4 {\n padding-bottom: 16px;\n}\n.tina-tailwind .pt-18 {\n padding-top: 72px;\n}\n.tina-tailwind .text-left {\n text-align: left;\n}\n.tina-tailwind .text-center {\n text-align: center;\n}\n.tina-tailwind .font-sans {\n font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n.tina-tailwind .text-2xl {\n font-size: 24px;\n line-height: 1.33;\n}\n.tina-tailwind .text-base {\n font-size: 16px;\n line-height: 1.5;\n}\n.tina-tailwind .text-sm {\n font-size: 14px;\n line-height: 1.43;\n}\n.tina-tailwind .text-xl {\n font-size: 20px;\n line-height: 1.4;\n}\n.tina-tailwind .text-md {\n font-size: 16px;\n line-height: 1.5;\n}\n.tina-tailwind .text-xs {\n font-size: 13px;\n line-height: 1.33;\n}\n.tina-tailwind .font-medium {\n font-weight: 500;\n}\n.tina-tailwind .uppercase {\n text-transform: uppercase;\n}\n.tina-tailwind .italic {\n font-style: italic;\n}\n.tina-tailwind .leading-normal {\n line-height: 1.5;\n}\n.tina-tailwind .leading-tight {\n line-height: 1.25;\n}\n.tina-tailwind .leading-5 {\n line-height: 20px;\n}\n.tina-tailwind .tracking-wide {\n letter-spacing: 0.025em;\n}\n.tina-tailwind .text-gray-700 {\n --tw-text-opacity: 1;\n color: rgb(67 62 82 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-blue-600 {\n --tw-text-opacity: 1;\n color: rgb(5 116 228 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(113 108 127 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-gray-400 {\n --tw-text-opacity: 1;\n color: rgb(145 140 158 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-current {\n color: currentColor;\n}\n.tina-tailwind .text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(86 81 101 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-gray-800 {\n --tw-text-opacity: 1;\n color: rgb(54 49 69 / var(--tw-text-opacity));\n}\n.tina-tailwind .text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(37 35 54 / var(--tw-text-opacity));\n}\n.tina-tailwind .underline {\n text-decoration-line: underline;\n}\n.tina-tailwind .opacity-100 {\n opacity: 1;\n}\n.tina-tailwind .opacity-90 {\n opacity: .9;\n}\n.tina-tailwind .opacity-80 {\n opacity: .8;\n}\n.tina-tailwind .opacity-50 {\n opacity: .5;\n}\n.tina-tailwind .opacity-70 {\n opacity: .7;\n}\n.tina-tailwind .opacity-0 {\n opacity: 0;\n}\n.tina-tailwind .shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.tina-tailwind .shadow-2xl {\n --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.tina-tailwind .shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.tina-tailwind .ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n.tina-tailwind .ring-black {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity));\n}\n.tina-tailwind .ring-opacity-5 {\n --tw-ring-opacity: .05;\n}\n.tina-tailwind .filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.tina-tailwind .transition-opacity {\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .duration-300 {\n transition-duration: 300ms;\n}\n.tina-tailwind .duration-150 {\n transition-duration: 150ms;\n}\n.tina-tailwind .duration-100 {\n transition-duration: 100ms;\n}\n.tina-tailwind .duration-75 {\n transition-duration: 75ms;\n}\n.tina-tailwind .ease-out {\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n}\n.tina-tailwind .ease-in {\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.tina-tailwind .icon-parent svg {\n fill: currentColor;\n }\n\n.tina-tailwind {\n font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n font-size: 16px;\n line-height: 1.5;\n --tw-text-opacity: 1;\n color: rgb(86 81 101 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .hover\\:bg-blue-600:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(5 116 228 / var(--tw-bg-opacity));\n}\n\n.tina-tailwind .hover\\:text-blue-600:hover {\n --tw-text-opacity: 1;\n color: rgb(5 116 228 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .hover\\:text-blue-400:hover {\n --tw-text-opacity: 1;\n color: rgb(34 150 254 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .hover\\:opacity-100:hover {\n opacity: 1;\n}\n\n.tina-tailwind .focus\\:text-blue-400:focus {\n --tw-text-opacity: 1;\n color: rgb(34 150 254 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .focus\\:underline:focus {\n text-decoration-line: underline;\n}\n\n.tina-tailwind .focus\\:shadow-outline:focus {\n --tw-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);\n --tw-shadow-colored: 0 0 0 3px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tina-tailwind .focus\\:outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.tina-tailwind .focus\\:ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.tina-tailwind .focus\\:ring-blue-500:focus {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(0 132 255 / var(--tw-ring-opacity));\n}\n';
2728
1859
  function useTina({
2729
1860
  query,
2730
1861
  variables,
@@ -3132,10 +2263,10 @@ This will work when developing locally but NOT when deployed to production.
3132
2263
  return t;
3133
2264
  };
3134
2265
  function Tree2Element(tree) {
3135
- return tree && tree.map(function(node, i) {
3136
- return React__default["default"].createElement(node.tag, __assign({
2266
+ return tree && tree.map(function(node2, i) {
2267
+ return React__default["default"].createElement(node2.tag, __assign({
3137
2268
  key: i
3138
- }, node.attr), Tree2Element(node.child));
2269
+ }, node2.attr), Tree2Element(node2.child));
3139
2270
  });
3140
2271
  }
3141
2272
  function GenIcon(data) {
@@ -3177,41 +2308,37 @@ This will work when developing locally but NOT when deployed to production.
3177
2308
  }
3178
2309
  const useGetCollections = (cms) => {
3179
2310
  const api = new TinaAdminApi(cms);
3180
- const [info, setInfo] = React.useState({ collections: [], loading: true, error: false });
2311
+ const [collections, setCollections] = React.useState([]);
2312
+ const [loading, setLoading] = React.useState(true);
2313
+ const [error, setError] = React.useState(void 0);
3181
2314
  React.useEffect(() => {
3182
2315
  const fetchCollections = async () => {
3183
- const response = await api.fetchCollections();
3184
- setInfo({
3185
- collections: response.getCollections,
3186
- loading: false,
3187
- error: false
3188
- });
2316
+ try {
2317
+ const response = await api.fetchCollections();
2318
+ setCollections(response.getCollections);
2319
+ } catch (error2) {
2320
+ cms.alerts.error(`[${error2.name}] GetCollections failed: ${error2.message}`, 30 * 1e3);
2321
+ console.error(error2);
2322
+ setCollections([]);
2323
+ setError(error2);
2324
+ }
2325
+ setLoading(false);
3189
2326
  };
2327
+ setLoading(true);
3190
2328
  fetchCollections();
3191
2329
  }, [cms]);
3192
- return info;
3193
- };
3194
- const GetCollections = ({ cms, children }) => {
3195
- const { collections, loading, error } = useGetCollections(cms);
3196
- if (!collections)
3197
- return null;
3198
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(collections, loading, error));
2330
+ return { collections, loading, error };
3199
2331
  };
3200
2332
  const slugify = (text) => {
3201
2333
  return text.toString().toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "_").replace(/^-+|-+$/g, "");
3202
2334
  };
3203
2335
  const Sidebar = ({ cms }) => {
2336
+ const collectionsInfo = useGetCollections(cms);
3204
2337
  const screens = cms.plugins.getType("screen").all();
3205
- return /* @__PURE__ */ React__default["default"].createElement(GetCollections, {
3206
- cms
3207
- }, (collections, loading, error) => /* @__PURE__ */ React__default["default"].createElement(toolkit.Nav, {
2338
+ return /* @__PURE__ */ React__default["default"].createElement(toolkit.Nav, {
3208
2339
  sidebarWidth: 360,
3209
2340
  showCollections: true,
3210
- collectionsInfo: {
3211
- collections,
3212
- loading,
3213
- error
3214
- },
2341
+ collectionsInfo,
3215
2342
  screens,
3216
2343
  contentCreators: [],
3217
2344
  RenderNavSite: ({ view }) => /* @__PURE__ */ React__default["default"].createElement(SidebarLink, {
@@ -3224,7 +2351,7 @@ This will work when developing locally but NOT when deployed to production.
3224
2351
  to: `collections/${collection.name}`,
3225
2352
  Icon: ImFilesEmpty
3226
2353
  })
3227
- }));
2354
+ });
3228
2355
  };
3229
2356
  const SidebarLink = (props) => {
3230
2357
  const { to, label, Icon } = props;
@@ -3281,8 +2408,8 @@ This will work when developing locally but NOT when deployed to production.
3281
2408
  d: "M18.6466 14.5553C19.9018 13.5141 20.458 7.36086 21.0014 5.14903C21.5447 2.9372 23.7919 3.04938 23.7919 3.04938C23.7919 3.04938 23.2085 4.06764 23.4464 4.82751C23.6844 5.58738 25.3145 6.26662 25.3145 6.26662L24.9629 7.19622C24.9629 7.19622 24.2288 7.10204 23.7919 7.9785C23.355 8.85496 24.3392 17.4442 24.3392 17.4442C24.3392 17.4442 21.4469 22.7275 21.4469 24.9206C21.4469 27.1136 22.4819 28.9515 22.4819 28.9515H21.0296C21.0296 28.9515 18.899 26.4086 18.462 25.1378C18.0251 23.8669 18.1998 22.596 18.1998 22.596C18.1998 22.596 15.8839 22.4646 13.8303 22.596C11.7767 22.7275 10.4072 24.498 10.16 25.4884C9.91287 26.4787 9.81048 28.9515 9.81048 28.9515H8.66211C7.96315 26.7882 7.40803 26.0129 7.70918 24.9206C8.54334 21.8949 8.37949 20.1788 8.18635 19.4145C7.99321 18.6501 6.68552 17.983 6.68552 17.983C7.32609 16.6741 7.97996 16.0452 10.7926 15.9796C13.6052 15.914 17.3915 15.5965 18.6466 14.5553Z"
3282
2409
  }), /* @__PURE__ */ React__default["default"].createElement("path", {
3283
2410
  d: "M11.1268 24.7939C11.1268 24.7939 11.4236 27.5481 13.0001 28.9516H14.3511C13.0001 27.4166 12.8527 23.4155 12.8527 23.4155C12.1656 23.6399 11.3045 24.3846 11.1268 24.7939Z"
3284
- })), /* @__PURE__ */ React__default["default"].createElement("span", null, "Tina Admin"))), message && /* @__PURE__ */ React__default["default"].createElement("div", {
3285
- className: "px-5 py-4 "
2411
+ })), /* @__PURE__ */ React__default["default"].createElement("span", null, "Tina"))), message && /* @__PURE__ */ React__default["default"].createElement("div", {
2412
+ className: "px-5 pt-4"
3286
2413
  }, /* @__PURE__ */ React__default["default"].createElement("p", {
3287
2414
  className: "text-base font-sans leading-normal"
3288
2415
  }, message)), /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -3292,38 +2419,52 @@ This will work when developing locally but NOT when deployed to production.
3292
2419
  const LoginPage = () => {
3293
2420
  const { setEdit } = sharedctx.useEditState();
3294
2421
  const login = () => setEdit(true);
3295
- return /* @__PURE__ */ React__default["default"].createElement(AuthTemplate, null, /* @__PURE__ */ React__default["default"].createElement("a", {
3296
- href: "/",
3297
- className: "flex-1 text-center inline-flex justify-center items-center px-8 py-3 shadow-sm text-sm leading-4 font-medium rounded-full text-gray-600 border border-gray-150 hover:opacity-80 hover:bg-gray-50 focus:outline-none focus:shadow-outline-blue transition duration-150 ease-out"
2422
+ return /* @__PURE__ */ React__default["default"].createElement(AuthTemplate, null, /* @__PURE__ */ React__default["default"].createElement("div", {
2423
+ className: "flex w-full flex-1 gap-4 items-center justify-end"
2424
+ }, /* @__PURE__ */ React__default["default"].createElement(toolkit.Button, {
2425
+ onClick: () => {
2426
+ window.location.href = "/";
2427
+ },
2428
+ variant: "white",
2429
+ size: "custom",
2430
+ className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
3298
2431
  }, /* @__PURE__ */ React__default["default"].createElement(MdOutlineArrowBack, {
3299
2432
  className: "w-6 h-auto mr-1.5 opacity-80"
3300
- }), " Back to site"), /* @__PURE__ */ React__default["default"].createElement("button", {
3301
- type: "submit",
2433
+ }), " Back To Site"), /* @__PURE__ */ React__default["default"].createElement(toolkit.Button, {
3302
2434
  onClick: () => login(),
3303
- className: "flex-1 justify-center text-center inline-flex items-center px-8 py-3 shadow-sm border border-transparent text-sm leading-4 font-medium rounded-full text-white hover:opacity-80 focus:outline-none focus:shadow-outline-blue transition duration-150 ease-out",
3304
- style: { background: "#0084FF" }
2435
+ variant: "primary",
2436
+ size: "custom",
2437
+ className: "text-base h-12 px-6 flex-1",
2438
+ type: "submit"
3305
2439
  }, /* @__PURE__ */ React__default["default"].createElement(BiLogIn, {
3306
- className: "w-6 h-auto mr-1.5 opacity-80"
3307
- }), " Enter edit-mode"));
2440
+ className: "w-6 h-auto mr-2 opacity-80"
2441
+ }), " Edit With Tina")));
3308
2442
  };
3309
2443
  const logout = () => {
3310
2444
  sharedctx.setEditing(false);
3311
2445
  window.location.href = "/";
3312
2446
  };
3313
2447
  const LogoutPage = () => {
3314
- return /* @__PURE__ */ React__default["default"].createElement(AuthTemplate, null, /* @__PURE__ */ React__default["default"].createElement("a", {
3315
- href: "/",
3316
- className: "flex-1 text-center inline-flex justify-center items-center px-8 py-3 shadow-sm text-sm leading-4 font-medium rounded-full text-gray-600 border border-gray-150 hover:opacity-80 hover:bg-gray-50 focus:outline-none focus:shadow-outline-blue transition duration-150 ease-out"
2448
+ return /* @__PURE__ */ React__default["default"].createElement(AuthTemplate, null, /* @__PURE__ */ React__default["default"].createElement("div", {
2449
+ className: "flex w-full flex-1 gap-4 items-center justify-end"
2450
+ }, /* @__PURE__ */ React__default["default"].createElement(toolkit.Button, {
2451
+ onClick: () => {
2452
+ window.location.href = "/";
2453
+ },
2454
+ variant: "white",
2455
+ size: "custom",
2456
+ className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
3317
2457
  }, /* @__PURE__ */ React__default["default"].createElement(MdOutlineArrowBack, {
3318
2458
  className: "w-6 h-auto mr-1.5 opacity-80"
3319
- }), " Back to site"), /* @__PURE__ */ React__default["default"].createElement("button", {
3320
- type: "submit",
2459
+ }), " Back To Site"), /* @__PURE__ */ React__default["default"].createElement(toolkit.Button, {
3321
2460
  onClick: () => logout(),
3322
- className: "flex-1 justify-center text-center inline-flex items-center px-8 py-3 shadow-sm border border-transparent text-sm leading-4 font-medium rounded-full text-white hover:opacity-80 focus:outline-none focus:shadow-outline-blue transition duration-150 ease-out",
3323
- style: { background: "#0084FF" }
2461
+ type: "submit",
2462
+ variant: "primary",
2463
+ size: "custom",
2464
+ className: "text-base h-12 px-6 flex-1"
3324
2465
  }, /* @__PURE__ */ React__default["default"].createElement(BiLogOut, {
3325
2466
  className: "w-6 h-auto mr-1.5 opacity-80"
3326
- }), " Log out"));
2467
+ }), " Log Out of Tina")));
3327
2468
  };
3328
2469
  const PageWrapper = ({
3329
2470
  children
@@ -3364,17 +2505,127 @@ This will work when developing locally but NOT when deployed to production.
3364
2505
  }, "Welcome to Tina!")), /* @__PURE__ */ React__default["default"].createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
3365
2506
  });
3366
2507
  };
2508
+ const LoadingPage = () => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
2509
+ style: {
2510
+ position: "absolute",
2511
+ top: 0,
2512
+ left: 0,
2513
+ width: "100%",
2514
+ height: "100%",
2515
+ zIndex: 200,
2516
+ opacity: "0.8",
2517
+ display: "flex",
2518
+ alignItems: "start",
2519
+ justifyContent: "center",
2520
+ padding: "120px 40px 40px 40px"
2521
+ }
2522
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
2523
+ style: {
2524
+ background: "#FFF",
2525
+ border: "1px solid #EDECF3",
2526
+ boxShadow: "0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1)",
2527
+ borderRadius: "8px",
2528
+ padding: "32px 24px",
2529
+ width: "460px",
2530
+ maxWidth: "90%",
2531
+ display: "flex",
2532
+ alignItems: "center",
2533
+ justifyContent: "center",
2534
+ flexDirection: "column"
2535
+ }
2536
+ }, /* @__PURE__ */ React__default["default"].createElement("svg", {
2537
+ style: {
2538
+ width: "64px",
2539
+ color: "#2296fe",
2540
+ marginTop: "-8px",
2541
+ marginBottom: "16px"
2542
+ },
2543
+ version: "1.1",
2544
+ id: "L5",
2545
+ xmlns: "http://www.w3.org/2000/svg",
2546
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
2547
+ x: "0px",
2548
+ y: "0px",
2549
+ viewBox: "0 0 100 64",
2550
+ enableBackground: "new 0 0 0 0",
2551
+ xmlSpace: "preserve"
2552
+ }, /* @__PURE__ */ React__default["default"].createElement("circle", {
2553
+ fill: "currentColor",
2554
+ stroke: "none",
2555
+ cx: 6,
2556
+ cy: 32,
2557
+ r: 6
2558
+ }, /* @__PURE__ */ React__default["default"].createElement("animateTransform", {
2559
+ attributeName: "transform",
2560
+ dur: "1s",
2561
+ type: "translate",
2562
+ values: "0 15 ; 0 -15; 0 15",
2563
+ calcMode: "spline",
2564
+ keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
2565
+ repeatCount: "indefinite",
2566
+ begin: "0.1"
2567
+ })), /* @__PURE__ */ React__default["default"].createElement("circle", {
2568
+ fill: "currentColor",
2569
+ stroke: "none",
2570
+ cx: 30,
2571
+ cy: 32,
2572
+ r: 6
2573
+ }, /* @__PURE__ */ React__default["default"].createElement("animateTransform", {
2574
+ attributeName: "transform",
2575
+ dur: "1s",
2576
+ type: "translate",
2577
+ values: "0 15 ; 0 -10; 0 15",
2578
+ calcMode: "spline",
2579
+ keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
2580
+ repeatCount: "indefinite",
2581
+ begin: "0.2"
2582
+ })), /* @__PURE__ */ React__default["default"].createElement("circle", {
2583
+ fill: "currentColor",
2584
+ stroke: "none",
2585
+ cx: 54,
2586
+ cy: 32,
2587
+ r: 6
2588
+ }, /* @__PURE__ */ React__default["default"].createElement("animateTransform", {
2589
+ attributeName: "transform",
2590
+ dur: "1s",
2591
+ type: "translate",
2592
+ values: "0 15 ; 0 -5; 0 15",
2593
+ calcMode: "spline",
2594
+ keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
2595
+ repeatCount: "indefinite",
2596
+ begin: "0.3"
2597
+ }))), /* @__PURE__ */ React__default["default"].createElement("p", {
2598
+ style: {
2599
+ fontSize: "16px",
2600
+ color: "#716c7f",
2601
+ textAlign: "center",
2602
+ lineHeight: "1.3",
2603
+ fontFamily: "'Inter', sans-serif",
2604
+ fontWeight: "normal"
2605
+ }
2606
+ }, "Please wait, Tina is loading data..."))));
3367
2607
  const useGetCollection = (cms, collectionName, includeDocuments = true) => {
3368
2608
  const api = new TinaAdminApi(cms);
3369
2609
  const [collection, setCollection] = React.useState(void 0);
2610
+ const [loading, setLoading] = React.useState(true);
2611
+ const [error, setError] = React.useState(void 0);
3370
2612
  React.useEffect(() => {
3371
2613
  const fetchCollection = async () => {
3372
- const response = await api.fetchCollection(collectionName, includeDocuments);
3373
- setCollection(response.getCollection);
2614
+ try {
2615
+ const response = await api.fetchCollection(collectionName, includeDocuments);
2616
+ setCollection(response.getCollection);
2617
+ } catch (error2) {
2618
+ cms.alerts.error(`[${error2.name}] GetCollection failed: ${error2.message}`, 30 * 1e3);
2619
+ console.error(error2);
2620
+ setCollection(void 0);
2621
+ setError(error2);
2622
+ }
2623
+ setLoading(false);
3374
2624
  };
2625
+ setLoading(true);
3375
2626
  fetchCollection();
3376
2627
  }, [cms, collectionName]);
3377
- return collection;
2628
+ return { collection, loading, error };
3378
2629
  };
3379
2630
  const GetCollection = ({
3380
2631
  cms,
@@ -3382,11 +2633,16 @@ This will work when developing locally but NOT when deployed to production.
3382
2633
  includeDocuments = true,
3383
2634
  children
3384
2635
  }) => {
3385
- const collection = useGetCollection(cms, collectionName, includeDocuments);
2636
+ const { collection, loading, error } = useGetCollection(cms, collectionName, includeDocuments);
3386
2637
  if (!collection) {
3387
- return null;
2638
+ if (loading) {
2639
+ return /* @__PURE__ */ React__default["default"].createElement(LoadingPage, null);
2640
+ }
2641
+ if (error) {
2642
+ return null;
2643
+ }
3388
2644
  }
3389
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(collection));
2645
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(collection, loading));
3390
2646
  };
3391
2647
  const TemplateMenu = ({ templates }) => {
3392
2648
  return /* @__PURE__ */ React__default["default"].createElement(react.Menu, {
@@ -3415,12 +2671,21 @@ This will work when developing locally but NOT when deployed to production.
3415
2671
  className: `w-full text-md px-4 py-2 tracking-wide flex items-center opacity-80 text-gray-600 ${active && "text-gray-800 opacity-100"}`
3416
2672
  }, template.label))))))));
3417
2673
  };
2674
+ const handleNavigate = (navigate, cms, collection, document) => {
2675
+ const plugins = cms.plugins.all("tina-admin");
2676
+ const routeMapping = plugins.find(({ name }) => name === "route-mapping");
2677
+ const routeOverride = routeMapping ? routeMapping.mapper(collection, document) : void 0;
2678
+ if (routeOverride) {
2679
+ window.location.href = routeOverride;
2680
+ return null;
2681
+ } else {
2682
+ navigate(document.sys.filename);
2683
+ }
2684
+ };
3418
2685
  const CollectionListPage = () => {
2686
+ const navigate = reactRouterDom.useNavigate();
3419
2687
  const { collectionName } = reactRouterDom.useParams();
3420
- reactRouterDom.useNavigate();
3421
2688
  return /* @__PURE__ */ React__default["default"].createElement(GetCMS, null, (cms) => {
3422
- const plugins = cms.plugins.all("tina-admin");
3423
- const routeMapping = plugins.find(({ name }) => name === "route-mapping");
3424
2689
  return /* @__PURE__ */ React__default["default"].createElement(GetCollection, {
3425
2690
  cms,
3426
2691
  collectionName,
@@ -3447,24 +2712,16 @@ This will work when developing locally but NOT when deployed to production.
3447
2712
  }, /* @__PURE__ */ React__default["default"].createElement("tbody", {
3448
2713
  className: "divide-y divide-gray-150"
3449
2714
  }, documents.map((document) => {
3450
- const overrideRoute = routeMapping ? routeMapping.mapper(collection, document.node) : void 0;
3451
2715
  return /* @__PURE__ */ React__default["default"].createElement("tr", {
3452
2716
  key: `document-${document.node.sys.filename}`,
3453
2717
  className: ""
3454
2718
  }, /* @__PURE__ */ React__default["default"].createElement("td", {
3455
2719
  className: "px-6 py-2 whitespace-nowrap"
3456
- }, overrideRoute && /* @__PURE__ */ React__default["default"].createElement("a", {
3457
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3",
3458
- href: `${overrideRoute}`
3459
- }, /* @__PURE__ */ React__default["default"].createElement(BiEdit, {
3460
- className: "inline-block h-6 w-auto opacity-70"
3461
- }), /* @__PURE__ */ React__default["default"].createElement("span", null, /* @__PURE__ */ React__default["default"].createElement("span", {
3462
- className: "block text-xs text-gray-400 mb-1 uppercase"
3463
- }, "Filename"), /* @__PURE__ */ React__default["default"].createElement("span", {
3464
- className: "h-5 leading-5 block whitespace-nowrap"
3465
- }, document.node.sys.filename))), !overrideRoute && /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Link, {
3466
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3",
3467
- to: `${document.node.sys.filename}`
2720
+ }, /* @__PURE__ */ React__default["default"].createElement("a", {
2721
+ className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer",
2722
+ onClick: () => {
2723
+ handleNavigate(navigate, cms, collection, document.node);
2724
+ }
3468
2725
  }, /* @__PURE__ */ React__default["default"].createElement(BiEdit, {
3469
2726
  className: "inline-block h-6 w-auto opacity-70"
3470
2727
  }), /* @__PURE__ */ React__default["default"].createElement("span", null, /* @__PURE__ */ React__default["default"].createElement("span", {
@@ -3499,30 +2756,46 @@ This will work when developing locally but NOT when deployed to production.
3499
2756
  fields: void 0,
3500
2757
  mutationInfo: void 0
3501
2758
  });
2759
+ const [loading, setLoading] = React.useState(true);
2760
+ const [error, setError] = React.useState(void 0);
3502
2761
  React.useEffect(() => {
3503
2762
  const fetchDocumentFields = async () => {
3504
- const response = await api.fetchDocumentFields();
3505
- const documentFields = response.getDocumentFields;
3506
- const collection = documentFields[collectionName].collection;
3507
- const mutationInfo = documentFields[collectionName].mutationInfo;
3508
- let fields = void 0;
3509
- let template = void 0;
3510
- if (templateName && documentFields[collectionName].templates && documentFields[collectionName].templates[templateName]) {
3511
- template = documentFields[collectionName].templates[templateName].template;
3512
- fields = documentFields[collectionName].templates[templateName].fields;
3513
- } else {
3514
- fields = documentFields[collectionName].fields;
2763
+ try {
2764
+ const response = await api.fetchDocumentFields();
2765
+ const documentFields = response.getDocumentFields;
2766
+ const collection = documentFields[collectionName].collection;
2767
+ const mutationInfo = documentFields[collectionName].mutationInfo;
2768
+ let fields = void 0;
2769
+ let template = void 0;
2770
+ if (templateName && documentFields[collectionName].templates && documentFields[collectionName].templates[templateName]) {
2771
+ template = documentFields[collectionName].templates[templateName].template;
2772
+ fields = documentFields[collectionName].templates[templateName].fields;
2773
+ } else {
2774
+ fields = documentFields[collectionName].fields;
2775
+ }
2776
+ setInfo({
2777
+ collection,
2778
+ template,
2779
+ fields,
2780
+ mutationInfo
2781
+ });
2782
+ } catch (error2) {
2783
+ cms.alerts.error(`[${error2.name}] GetDocumentFields failed: ${error2.message}`, 30 * 1e3);
2784
+ console.error(error2);
2785
+ setInfo({
2786
+ collection: void 0,
2787
+ template: void 0,
2788
+ fields: void 0,
2789
+ mutationInfo: void 0
2790
+ });
2791
+ setError(error2);
3515
2792
  }
3516
- setInfo({
3517
- collection,
3518
- template,
3519
- fields,
3520
- mutationInfo
3521
- });
2793
+ setLoading(false);
3522
2794
  };
2795
+ setLoading(true);
3523
2796
  fetchDocumentFields();
3524
2797
  }, [cms, collectionName]);
3525
- return info;
2798
+ return __spreadProps(__spreadValues({}, info), { loading, error });
3526
2799
  };
3527
2800
  const GetDocumentFields = ({
3528
2801
  cms,
@@ -3530,11 +2803,16 @@ This will work when developing locally but NOT when deployed to production.
3530
2803
  templateName,
3531
2804
  children
3532
2805
  }) => {
3533
- const { collection, template, fields, mutationInfo } = useGetDocumentFields(cms, collectionName, templateName);
2806
+ const { collection, template, fields, mutationInfo, loading, error } = useGetDocumentFields(cms, collectionName, templateName);
3534
2807
  if (!collection) {
3535
- return null;
2808
+ if (loading) {
2809
+ return /* @__PURE__ */ React__default["default"].createElement(LoadingPage, null);
2810
+ }
2811
+ if (error) {
2812
+ return null;
2813
+ }
3536
2814
  }
3537
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children({ collection, template, fields, mutationInfo }));
2815
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children({ collection, template, fields, mutationInfo, loading }));
3538
2816
  };
3539
2817
  const createDocument = async (cms, collection, template, mutationInfo, values) => {
3540
2818
  const api = new TinaAdminApi(cms);
@@ -3594,8 +2872,14 @@ This will work when developing locally but NOT when deployed to production.
3594
2872
  ...fields
3595
2873
  ],
3596
2874
  onSubmit: async (values) => {
3597
- await createDocument(cms, collection, template, mutationInfo, values);
3598
- navigate(`/collections/${collection.name}`);
2875
+ try {
2876
+ await createDocument(cms, collection, template, mutationInfo, values);
2877
+ cms.alerts.success("Document created!");
2878
+ navigate(`/collections/${collection.name}`);
2879
+ } catch (error) {
2880
+ cms.alerts.error(`[${error.name}] CreateDocument failed: ${error.message}`, 30 * 1e3);
2881
+ console.error(error);
2882
+ }
3599
2883
  }
3600
2884
  });
3601
2885
  }, [cms, collection, template, fields, mutationInfo]);
@@ -3624,14 +2908,25 @@ This will work when developing locally but NOT when deployed to production.
3624
2908
  const useGetDocument = (cms, collectionName, relativePath) => {
3625
2909
  const api = new TinaAdminApi(cms);
3626
2910
  const [document, setDocument] = React.useState(void 0);
2911
+ const [loading, setLoading] = React.useState(true);
2912
+ const [error, setError] = React.useState(void 0);
3627
2913
  React.useEffect(() => {
3628
2914
  const fetchDocument = async () => {
3629
- const response = await api.fetchDocument(collectionName, relativePath);
3630
- setDocument(response.getDocument);
2915
+ try {
2916
+ const response = await api.fetchDocument(collectionName, relativePath);
2917
+ setDocument(response.getDocument);
2918
+ } catch (error2) {
2919
+ cms.alerts.error(`[${error2.name}] GetDocument failed: ${error2.message}`, 30 * 1e3);
2920
+ console.error(error2);
2921
+ setDocument(void 0);
2922
+ setError(error2);
2923
+ }
2924
+ setLoading(false);
3631
2925
  };
2926
+ setLoading(true);
3632
2927
  fetchDocument();
3633
2928
  }, [cms, collectionName, relativePath]);
3634
- return document;
2929
+ return { document, loading, error };
3635
2930
  };
3636
2931
  const GetDocument = ({
3637
2932
  cms,
@@ -3639,11 +2934,16 @@ This will work when developing locally but NOT when deployed to production.
3639
2934
  relativePath,
3640
2935
  children
3641
2936
  }) => {
3642
- const document = useGetDocument(cms, collectionName, relativePath);
2937
+ const { document, loading, error } = useGetDocument(cms, collectionName, relativePath);
3643
2938
  if (!document) {
3644
- return null;
2939
+ if (loading) {
2940
+ return /* @__PURE__ */ React__default["default"].createElement(LoadingPage, null);
2941
+ }
2942
+ if (error) {
2943
+ return null;
2944
+ }
3645
2945
  }
3646
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(document));
2946
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(document, loading));
3647
2947
  };
3648
2948
  const updateDocument = async (cms, relativePath, collection, mutationInfo, values) => {
3649
2949
  const api = new TinaAdminApi(cms);
@@ -3684,7 +2984,7 @@ This will work when developing locally but NOT when deployed to production.
3684
2984
  mutationInfo
3685
2985
  }) => {
3686
2986
  var _a, _b;
3687
- const navigate = reactRouterDom.useNavigate();
2987
+ reactRouterDom.useNavigate();
3688
2988
  const [formIsPristine, setFormIsPristine] = React.useState(true);
3689
2989
  const form = React.useMemo(() => {
3690
2990
  return new toolkit.Form({
@@ -3693,8 +2993,13 @@ This will work when developing locally but NOT when deployed to production.
3693
2993
  fields: document.form.fields,
3694
2994
  initialValues: document.values,
3695
2995
  onSubmit: async (values) => {
3696
- await updateDocument(cms, relativePath, collection, mutationInfo, values);
3697
- navigate(`/collections/${collection.name}`);
2996
+ try {
2997
+ await updateDocument(cms, relativePath, collection, mutationInfo, values);
2998
+ cms.alerts.success("Document updated!");
2999
+ } catch (error) {
3000
+ cms.alerts.error(`[${error.name}] UpdateDocument failed: ${error.message}`, 30 * 1e3);
3001
+ console.error(error);
3002
+ }
3698
3003
  }
3699
3004
  });
3700
3005
  }, [cms, document, relativePath, collection, mutationInfo]);
@@ -3754,16 +3059,14 @@ This will work when developing locally but NOT when deployed to production.
3754
3059
  return /* @__PURE__ */ React__default["default"].createElement(Layout, null, /* @__PURE__ */ React__default["default"].createElement(LoginPage, null));
3755
3060
  }
3756
3061
  return /* @__PURE__ */ React__default["default"].createElement(GetCMS, null, (cms) => {
3757
- const isTinaAdminEnabled = cms.flags.get("tina-admin");
3062
+ const isTinaAdminEnabled = cms.flags.get("tina-admin") === false ? false : true;
3758
3063
  if (isTinaAdminEnabled) {
3759
- return /* @__PURE__ */ React__default["default"].createElement(Layout, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.BrowserRouter, {
3760
- basename: "/admin"
3761
- }, /* @__PURE__ */ React__default["default"].createElement("div", {
3064
+ return /* @__PURE__ */ React__default["default"].createElement(Layout, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.HashRouter, null, /* @__PURE__ */ React__default["default"].createElement("div", {
3762
3065
  className: "flex items-stretch h-screen overflow-hidden"
3763
3066
  }, /* @__PURE__ */ React__default["default"].createElement(Sidebar, {
3764
3067
  cms
3765
3068
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
3766
- className: "flex-1"
3069
+ className: "flex-1 relative"
3767
3070
  }, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Routes, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
3768
3071
  path: "collections/:collectionName/new",
3769
3072
  element: /* @__PURE__ */ React__default["default"].createElement(CollectionCreatePage, null)
@@ -3784,9 +3087,7 @@ This will work when developing locally but NOT when deployed to production.
3784
3087
  element: /* @__PURE__ */ React__default["default"].createElement(DashboardPage, null)
3785
3088
  }))))));
3786
3089
  } else {
3787
- return /* @__PURE__ */ React__default["default"].createElement(Layout, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.BrowserRouter, {
3788
- basename: "/admin"
3789
- }, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Routes, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
3090
+ return /* @__PURE__ */ React__default["default"].createElement(Layout, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.HashRouter, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Routes, null, /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
3790
3091
  path: "logout",
3791
3092
  element: /* @__PURE__ */ React__default["default"].createElement(LogoutPage, null)
3792
3093
  }), /* @__PURE__ */ React__default["default"].createElement(reactRouterDom.Route, {
@@ -3803,6 +3104,12 @@ This will work when developing locally but NOT when deployed to production.
3803
3104
  this.mapper = mapper;
3804
3105
  }
3805
3106
  }
3107
+ const defineSchema = (config) => {
3108
+ return config;
3109
+ };
3110
+ const defineConfig = (config) => {
3111
+ return config;
3112
+ };
3806
3113
  exports2.AuthWallInner = AuthWallInner;
3807
3114
  exports2.Client = Client;
3808
3115
  exports2.DEFAULT_LOCAL_TINA_GQL_SERVER_URL = DEFAULT_LOCAL_TINA_GQL_SERVER_URL;
@@ -3817,6 +3124,8 @@ This will work when developing locally but NOT when deployed to production.
3817
3124
  exports2.assertShape = assertShape;
3818
3125
  exports2.createClient = createClient;
3819
3126
  exports2["default"] = TinaCMSProvider2;
3127
+ exports2.defineConfig = defineConfig;
3128
+ exports2.defineSchema = defineSchema;
3820
3129
  exports2.getStaticPropsForTina = getStaticPropsForTina;
3821
3130
  exports2.gql = gql;
3822
3131
  exports2.safeAssertShape = safeAssertShape;