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.es.js CHANGED
@@ -31,16 +31,17 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import { EventBus, Modal, ModalPopup, ModalHeader, ModalBody, ModalActions, Button, LoadingDots, useLocalStorage, TinaCMS, BranchSwitcherPlugin, BranchDataProvider, TinaProvider, useCMS, useBranchData, FormMetaPlugin, Form, GlobalFormPlugin, Nav, LocalWarning, FormStatus, FormBuilder } from "@tinacms/toolkit";
33
33
  export * from "@tinacms/toolkit";
34
- import { TypeInfo, visit, visitWithTypeInfo, getNamedType, GraphQLObjectType, isLeafType, GraphQLUnionType, isScalarType, getIntrospectionQuery, buildClientSchema, print } from "graphql";
34
+ import * as G from "graphql";
35
+ import { TypeInfo, visit, visitWithTypeInfo, getNamedType, GraphQLObjectType, isLeafType, GraphQLUnionType, isScalarType, getIntrospectionQuery, buildClientSchema, print, parse } from "graphql";
35
36
  import set from "lodash.set";
36
- import gql$1 from "graphql-tag";
37
37
  import React, { useState, useCallback, useEffect, Fragment, useMemo } from "react";
38
+ import gql$1 from "graphql-tag";
38
39
  import styled from "styled-components";
39
40
  import * as yup from "yup";
40
41
  import { setEditing, TinaDataContext, useEditState } from "@tinacms/sharedctx";
41
42
  import { getIn, setIn } from "final-form";
42
43
  import UrlPattern from "url-pattern";
43
- import { NavLink, useParams, useNavigate, Link, BrowserRouter, Routes, Route } from "react-router-dom";
44
+ import { NavLink, useNavigate, useParams, Link, HashRouter, Routes, Route } from "react-router-dom";
44
45
  import { Menu, Transition } from "@headlessui/react";
45
46
  function popupWindow(url, title, window2, w, h) {
46
47
  const y = window2.top.outerHeight / 2 + window2.top.screenY - h / 2;
@@ -68,11 +69,11 @@ const authenticate = (clientId, frontendUrl) => {
68
69
  authTab = popupWindow(`${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`, "_blank", window, 1e3, 700);
69
70
  });
70
71
  };
71
- const formify = (query, schema) => {
72
+ const formify$1 = (query, schema) => {
72
73
  const typeInfo = new TypeInfo(schema);
73
74
  const pathsToPopulate = [];
74
75
  const visitor = {
75
- leave(node, key, parent, path, ancestors) {
76
+ leave(node2, key, parent, path, ancestors) {
76
77
  const type = typeInfo.getType();
77
78
  if (type) {
78
79
  const namedType = getNamedType(type);
@@ -375,6 +376,435 @@ function assertIsUnionType(type) {
375
376
  throw new Error(`Expected an instance of GraphQLUnionType for type ${type.name}`);
376
377
  }
377
378
  }
379
+ const isNodeField = (type) => {
380
+ if (G.isUnionType(type)) {
381
+ return type.getTypes().every((type2) => {
382
+ return type2.getInterfaces().find((intfc) => intfc.name === "Node");
383
+ });
384
+ } else if (G.isObjectType(type)) {
385
+ return !!type.getInterfaces().find((intfc) => intfc.name === "Node");
386
+ } else if (G.isInterfaceType(type)) {
387
+ if (type.name === "Node") {
388
+ return true;
389
+ }
390
+ } else {
391
+ throw new Error(`Expected GraphQLObjectType or GraphQLUnionType for isNodeField check`);
392
+ }
393
+ };
394
+ const isConnectionField = (type) => {
395
+ if (G.isObjectType(type)) {
396
+ return !!type.getInterfaces().find((intfc) => intfc.name === "Connection");
397
+ } else {
398
+ throw new Error(`Expected GraphQLObjectType for isCollectionField check`);
399
+ }
400
+ };
401
+ const getObjectField = (object, selectionNode) => {
402
+ return object.getFields()[selectionNode.name.value];
403
+ };
404
+ const getSelectedUnionType = (unionType, selectionNode) => {
405
+ return unionType.getTypes().find((type) => type.name === selectionNode.typeCondition.name.value);
406
+ };
407
+ function ensureNodeField(field) {
408
+ if (!isNodeField(field)) {
409
+ throw new Error(`Expected field to implement Node interface`);
410
+ }
411
+ }
412
+ function ensureUnionType(type) {
413
+ if (!G.isUnionType(type)) {
414
+ throw new Error(`Expected type to be GraphQLUnionType`);
415
+ }
416
+ }
417
+ function ensureObjectType(type) {
418
+ if (!G.isObjectType(type)) {
419
+ console.log(type);
420
+ throw new Error(`Expected type to be GraphQLObjectType`);
421
+ }
422
+ }
423
+ function ensureOperationDefinition(type) {
424
+ if (type.kind !== "OperationDefinition") {
425
+ throw new Error(`Expected top-level definition to be an OperationDefinition node, ensure your query has been optimized before calling formify`);
426
+ }
427
+ }
428
+ function getNameAndAlias(fieldNode, list) {
429
+ return {
430
+ name: fieldNode.name.value,
431
+ alias: fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value,
432
+ list: !!list
433
+ };
434
+ }
435
+ const node = G.parse(`
436
+ query Sample {
437
+ _internalSys: sys {
438
+ path
439
+ collection {
440
+ name
441
+ }
442
+ }
443
+ form
444
+ values
445
+ }`);
446
+ const metaFields = node.definitions[0].selectionSet.selections;
447
+ const NOOP = "This is either an error or is not yet supported";
448
+ const UNEXPECTED = "Formify encountered an unexpected error, please contact support";
449
+ const DATA_NODE_NAME = "data";
450
+ const EDGES_NODE_NAME = "edges";
451
+ const NODE_NAME = "node";
452
+ const COLLECTION_FIELD_NAME = "getCollection";
453
+ const COLLECTIONS_FIELD_NAME = "getCollections";
454
+ const COLLECTIONS_DOCUMENTS_NAME = "documents";
455
+ class FormifyError extends Error {
456
+ constructor(code, details) {
457
+ let message;
458
+ switch (code) {
459
+ case "NOOP":
460
+ message = NOOP;
461
+ break;
462
+ case "UNEXPECTED":
463
+ message = UNEXPECTED;
464
+ break;
465
+ default:
466
+ message = "";
467
+ break;
468
+ }
469
+ super(`${message} ${details || ""}`);
470
+ this.name = "FormifyError";
471
+ }
472
+ }
473
+ const formify = async ({
474
+ schema,
475
+ query,
476
+ getOptimizedQuery
477
+ }) => {
478
+ const nodes = [];
479
+ const documentNode = G.parse(query);
480
+ const visitor2 = {
481
+ OperationDefinition: (node2) => {
482
+ if (!node2.name) {
483
+ return __spreadProps(__spreadValues({}, node2), {
484
+ name: {
485
+ kind: "Name",
486
+ value: `QueryOperation`
487
+ }
488
+ });
489
+ }
490
+ return node2;
491
+ }
492
+ };
493
+ const documentNodeWithName = visit(documentNode, visitor2);
494
+ const optimizedQuery = await getOptimizedQuery(documentNodeWithName);
495
+ const typeInfo = new G.TypeInfo(schema);
496
+ const formifyConnection = ({
497
+ namedFieldType,
498
+ selectionNode,
499
+ path
500
+ }) => {
501
+ ensureObjectType(namedFieldType);
502
+ return __spreadProps(__spreadValues({}, selectionNode), {
503
+ selectionSet: {
504
+ kind: "SelectionSet",
505
+ selections: selectionNode.selectionSet.selections.map((selectionNode2) => {
506
+ switch (selectionNode2.kind) {
507
+ case "Field":
508
+ if (selectionNode2.name.value === EDGES_NODE_NAME) {
509
+ const edgeField = namedFieldType.getFields()[EDGES_NODE_NAME];
510
+ const edgeType = G.getNamedType(edgeField.type);
511
+ ensureObjectType(edgeType);
512
+ return __spreadProps(__spreadValues({}, selectionNode2), {
513
+ selectionSet: {
514
+ kind: "SelectionSet",
515
+ selections: selectionNode2.selectionSet.selections.map((subSelectionNode) => {
516
+ switch (subSelectionNode.kind) {
517
+ case "Field":
518
+ if (subSelectionNode.name.value === NODE_NAME) {
519
+ const nodeField = edgeType.getFields()[NODE_NAME];
520
+ return formifyNode({
521
+ fieldOrInlineFragmentNode: subSelectionNode,
522
+ parentType: nodeField.type,
523
+ path: [
524
+ ...path,
525
+ getNameAndAlias(selectionNode2),
526
+ getNameAndAlias(subSelectionNode, true)
527
+ ]
528
+ });
529
+ } else {
530
+ return subSelectionNode;
531
+ }
532
+ default:
533
+ throw new FormifyError("NOOP");
534
+ }
535
+ })
536
+ }
537
+ });
538
+ }
539
+ return selectionNode2;
540
+ default:
541
+ throw new FormifyError("UNEXPECTED");
542
+ }
543
+ })
544
+ }
545
+ });
546
+ };
547
+ function formifyNode({
548
+ fieldOrInlineFragmentNode,
549
+ parentType,
550
+ path
551
+ }) {
552
+ let extraFields = [];
553
+ const namedParentType = G.getNamedType(parentType);
554
+ const formifiedNode = __spreadProps(__spreadValues({}, fieldOrInlineFragmentNode), {
555
+ selectionSet: {
556
+ kind: "SelectionSet",
557
+ selections: [
558
+ ...fieldOrInlineFragmentNode.selectionSet.selections.map((selectionNode) => {
559
+ switch (selectionNode.kind) {
560
+ case "InlineFragment":
561
+ if (G.isInterfaceType(namedParentType)) {
562
+ const type2 = schema.getImplementations(namedParentType).objects[selectionNode.typeCondition.name.value];
563
+ return formifyNode({
564
+ fieldOrInlineFragmentNode: selectionNode,
565
+ parentType: type2,
566
+ path
567
+ });
568
+ }
569
+ ensureUnionType(namedParentType);
570
+ const type = getSelectedUnionType(namedParentType, selectionNode);
571
+ return formifyNode({
572
+ fieldOrInlineFragmentNode: selectionNode,
573
+ parentType: type,
574
+ path
575
+ });
576
+ case "Field":
577
+ if (selectionNode.name.value === DATA_NODE_NAME) {
578
+ extraFields = metaFields;
579
+ if (G.isObjectType(namedParentType)) {
580
+ const field = getObjectField(namedParentType, selectionNode);
581
+ const namedType = G.getNamedType(field.type);
582
+ ensureObjectType(namedType);
583
+ return __spreadProps(__spreadValues({}, selectionNode), {
584
+ selectionSet: {
585
+ kind: "SelectionSet",
586
+ selections: [
587
+ ...selectionNode.selectionSet.selections.map((subSelectionNode) => {
588
+ switch (subSelectionNode.kind) {
589
+ case "Field":
590
+ const subSelectionField = getObjectField(namedType, subSelectionNode);
591
+ if (!subSelectionField) {
592
+ return subSelectionNode;
593
+ }
594
+ return formifyField({
595
+ fieldNode: subSelectionNode,
596
+ parentType: field.type,
597
+ path: [
598
+ ...path,
599
+ getNameAndAlias(subSelectionNode, G.isListType(subSelectionField.type))
600
+ ]
601
+ });
602
+ default:
603
+ throw new FormifyError("UNEXPECTED", `selection ${subSelectionNode.kind}`);
604
+ }
605
+ })
606
+ ]
607
+ }
608
+ });
609
+ }
610
+ return selectionNode;
611
+ }
612
+ return selectionNode;
613
+ default:
614
+ throw new FormifyError("UNEXPECTED");
615
+ }
616
+ }),
617
+ ...extraFields
618
+ ]
619
+ }
620
+ });
621
+ return formifiedNode;
622
+ }
623
+ const formifyField = ({
624
+ fieldNode,
625
+ parentType,
626
+ path
627
+ }) => {
628
+ const namedParentType = G.getNamedType(parentType);
629
+ ensureObjectType(namedParentType);
630
+ const field = getObjectField(namedParentType, fieldNode);
631
+ if (!field) {
632
+ if (fieldNode.name.value === "__typename") {
633
+ return fieldNode;
634
+ } else {
635
+ throw new FormifyError("UNEXPECTED", `field with no associated type ${fieldNode.name.value}`);
636
+ }
637
+ }
638
+ const namedType = G.getNamedType(field.type);
639
+ if (G.isScalarType(namedType)) {
640
+ return fieldNode;
641
+ }
642
+ return __spreadProps(__spreadValues({}, fieldNode), {
643
+ selectionSet: {
644
+ kind: "SelectionSet",
645
+ selections: [
646
+ ...fieldNode.selectionSet.selections.map((selectionNode) => {
647
+ switch (selectionNode.kind) {
648
+ case "Field":
649
+ if (selectionNode.name.value === "__typename") {
650
+ return selectionNode;
651
+ }
652
+ ensureObjectType(namedType);
653
+ const field2 = getObjectField(namedType, selectionNode);
654
+ if (!field2) {
655
+ return fieldNode;
656
+ }
657
+ if (G.isScalarType(G.getNamedType(field2.type))) {
658
+ return selectionNode;
659
+ }
660
+ return __spreadProps(__spreadValues({}, selectionNode), {
661
+ selectionSet: {
662
+ kind: "SelectionSet",
663
+ selections: selectionNode.selectionSet.selections.map((selectionNode2) => {
664
+ switch (selectionNode2.kind) {
665
+ case "Field":
666
+ if (selectionNode2.name.value === "__typename") {
667
+ return selectionNode2;
668
+ }
669
+ return formifyField({
670
+ fieldNode: selectionNode2,
671
+ parentType: field2.type,
672
+ path
673
+ });
674
+ case "InlineFragment":
675
+ const namedType2 = G.getNamedType(field2.type);
676
+ ensureNodeField(namedType2);
677
+ return formifyNode({
678
+ fieldOrInlineFragmentNode: selectionNode2,
679
+ parentType: field2.type,
680
+ path
681
+ });
682
+ default:
683
+ throw new FormifyError("UNEXPECTED", `selection ${selectionNode2.kind}`);
684
+ }
685
+ })
686
+ }
687
+ });
688
+ case "InlineFragment":
689
+ ensureUnionType(namedType);
690
+ if (isNodeField(namedType)) {
691
+ const parentType2 = getSelectedUnionType(namedType, selectionNode);
692
+ return formifyNode({
693
+ fieldOrInlineFragmentNode: selectionNode,
694
+ parentType: parentType2,
695
+ path
696
+ });
697
+ }
698
+ return __spreadProps(__spreadValues({}, selectionNode), {
699
+ selectionSet: {
700
+ kind: "SelectionSet",
701
+ selections: selectionNode.selectionSet.selections.map((subSelectionNode) => {
702
+ switch (subSelectionNode.kind) {
703
+ case "Field":
704
+ const parentType2 = getSelectedUnionType(namedType, selectionNode);
705
+ return formifyField({
706
+ fieldNode: subSelectionNode,
707
+ parentType: parentType2,
708
+ path
709
+ });
710
+ default:
711
+ throw new FormifyError("UNEXPECTED", `selection ${subSelectionNode.kind}`);
712
+ }
713
+ })
714
+ }
715
+ });
716
+ default:
717
+ throw new FormifyError("UNEXPECTED", `selection ${selectionNode.kind}`);
718
+ }
719
+ })
720
+ ]
721
+ }
722
+ });
723
+ };
724
+ const formifiedQuery = {
725
+ kind: "Document",
726
+ definitions: optimizedQuery.definitions.map((definition) => {
727
+ typeInfo.enter(definition);
728
+ ensureOperationDefinition(definition);
729
+ const type = typeInfo.getType();
730
+ const namedType = G.getNamedType(type);
731
+ ensureObjectType(namedType);
732
+ return __spreadProps(__spreadValues({}, definition), {
733
+ selectionSet: {
734
+ kind: "SelectionSet",
735
+ selections: definition.selectionSet.selections.map((selectionNode) => {
736
+ switch (selectionNode.kind) {
737
+ case "Field":
738
+ const parentType = type;
739
+ const namedParentType = G.getNamedType(parentType);
740
+ ensureObjectType(namedParentType);
741
+ const field = getObjectField(namedParentType, selectionNode);
742
+ const namedFieldType = G.getNamedType(field.type);
743
+ if (isNodeField(namedFieldType)) {
744
+ return formifyNode({
745
+ fieldOrInlineFragmentNode: selectionNode,
746
+ parentType: field.type,
747
+ path: [getNameAndAlias(selectionNode)]
748
+ });
749
+ } else if (isConnectionField(namedFieldType)) {
750
+ return formifyConnection({
751
+ namedFieldType,
752
+ selectionNode,
753
+ path: [getNameAndAlias(selectionNode)]
754
+ });
755
+ }
756
+ if (selectionNode.name.value === COLLECTION_FIELD_NAME || selectionNode.name.value === COLLECTIONS_FIELD_NAME) {
757
+ return __spreadProps(__spreadValues({}, selectionNode), {
758
+ selectionSet: {
759
+ kind: "SelectionSet",
760
+ selections: selectionNode.selectionSet.selections.map((selectionNode2) => {
761
+ switch (selectionNode2.kind) {
762
+ case "Field":
763
+ if (selectionNode2.name.value === COLLECTIONS_DOCUMENTS_NAME) {
764
+ ensureObjectType(namedFieldType);
765
+ const n = namedFieldType.getFields()[COLLECTIONS_DOCUMENTS_NAME];
766
+ const docType = G.getNamedType(n.type);
767
+ return formifyConnection({
768
+ namedFieldType: docType,
769
+ selectionNode: selectionNode2,
770
+ path: [getNameAndAlias(selectionNode2)]
771
+ });
772
+ }
773
+ return selectionNode2;
774
+ default:
775
+ throw new FormifyError("NOOP");
776
+ }
777
+ })
778
+ }
779
+ });
780
+ }
781
+ throw new FormifyError("NOOP");
782
+ default:
783
+ throw new FormifyError("UNEXPECTED");
784
+ }
785
+ })
786
+ }
787
+ });
788
+ })
789
+ };
790
+ nodes.map((node2) => {
791
+ const namePath = [];
792
+ const aliasPath = [];
793
+ node2.path.forEach((p) => {
794
+ namePath.push(p.name);
795
+ aliasPath.push(p.alias);
796
+ if (p.list) {
797
+ namePath.push("NUM");
798
+ aliasPath.push("NUM");
799
+ }
800
+ });
801
+ JSON.stringify({
802
+ namePath: namePath.join("."),
803
+ aliasPath: aliasPath.join(".")
804
+ }, null, 2);
805
+ });
806
+ return { formifiedQuery, nodes };
807
+ };
378
808
  const captureBranchName = /^refs\/heads\/(.*)/;
379
809
  const parseRefForBranchName = (ref) => {
380
810
  const matches = ref.match(captureBranchName);
@@ -422,6 +852,14 @@ mutation addPendingDocumentMutation(
422
852
  }
423
853
  return this.schema;
424
854
  };
855
+ this.getOptimizedQuery = async (documentNode) => {
856
+ const data = await this.request(`query GetOptimizedQuery($queryString: String!) {
857
+ getOptimizedQuery(queryString: $queryString)
858
+ }`, {
859
+ variables: { queryString: print(documentNode) }
860
+ });
861
+ return parse(data.getOptimizedQuery);
862
+ };
425
863
  this.options = options;
426
864
  this.setBranch(options.branch);
427
865
  this.events.subscribe("branch:change", ({ branchName }) => {
@@ -481,9 +919,22 @@ mutation addPendingDocumentMutation(
481
919
  this.contentApiBase = ((_c = this.options.tinaioConfig) == null ? void 0 : _c.contentApiUrlOverride) || `https://content.tinajs.io`;
482
920
  this.contentApiUrl = this.options.customContentApiUrl || `${this.contentApiBase}/content/${this.options.clientId}/github/${encodedBranch}`;
483
921
  }
484
- async requestWithForm(query, { variables }) {
922
+ async requestWithForm(query, {
923
+ variables,
924
+ useUnstableFormify
925
+ }) {
485
926
  const schema = await this.getSchema();
486
- const formifiedQuery = formify(query(gql$1), schema);
927
+ let formifiedQuery;
928
+ if (useUnstableFormify) {
929
+ const res = await formify({
930
+ schema,
931
+ query: print(query(gql$1)),
932
+ getOptimizedQuery: this.getOptimizedQuery
933
+ });
934
+ formifiedQuery = res.formifiedQuery;
935
+ } else {
936
+ formifiedQuery = formify$1(query(gql$1), schema);
937
+ }
487
938
  return this.request(print(formifiedQuery), { variables });
488
939
  }
489
940
  async request(query, { variables }) {
@@ -519,7 +970,7 @@ mutation addPendingDocumentMutation(
519
970
  async getRefreshedToken(tokens) {
520
971
  const { access_token, id_token, refresh_token } = JSON.parse(tokens);
521
972
  const { exp, iss, client_id } = this.parseJwt(access_token);
522
- if (Date.now() / 1e3 >= exp) {
973
+ if (Date.now() / 1e3 >= exp - 120) {
523
974
  const refreshResponse = await fetch(iss, {
524
975
  method: "POST",
525
976
  headers: {
@@ -877,6 +1328,9 @@ const TinaCloudProvider = (props) => {
877
1328
  if (!cms.api.tina) {
878
1329
  cms.registerApi("tina", createClient(props));
879
1330
  }
1331
+ if (!cms.api.admin) {
1332
+ cms.registerApi("admin", new TinaAdminApi(cms));
1333
+ }
880
1334
  const setupMedia = async () => {
881
1335
  var _a;
882
1336
  if (props.mediaStore) {
@@ -901,11 +1355,6 @@ const TinaCloudProvider = (props) => {
901
1355
  return newBranch;
902
1356
  };
903
1357
  setupMedia();
904
- React.useMemo(() => {
905
- if (cms.flags.get("tina-admin") === true) {
906
- cms.registerApi("admin", new TinaAdminApi(cms));
907
- }
908
- }, [cms, cms.flags.get("tina-admin")]);
909
1358
  const [branchingEnabled, setBranchingEnabled] = React.useState(() => cms.flags.get("branch-switcher"));
910
1359
  React.useEffect(() => {
911
1360
  cms.events.subscribe("flag:set", ({ key, value }) => {
@@ -1014,7 +1463,8 @@ function useGraphqlForms({
1014
1463
  const formIds = [];
1015
1464
  setIsLoading(true);
1016
1465
  cms.api.tina.requestWithForm((gql2) => gql2(query), {
1017
- variables
1466
+ variables,
1467
+ useUnstableFormify: cms.flags.get("use-unstable-formify")
1018
1468
  }).then((payload) => {
1019
1469
  cms.plugins.remove(new FormMetaPlugin({ name: "tina-admin-link" }));
1020
1470
  setData(payload);
@@ -1385,1423 +1835,104 @@ const useDocumentCreatorPlugin = (args) => {
1385
1835
  };
1386
1836
  }, [plugin]);
1387
1837
  };
1388
- var styles = `/**
1389
- Use a better box model (opinionated).
1390
- */
1391
-
1392
- .tina-tailwind *,
1393
- .tina-tailwind ::before,
1394
- .tina-tailwind ::after {
1395
- box-sizing: border-box;
1396
- }
1397
-
1398
- /**
1399
- Use a more readable tab size (opinionated).
1400
- */
1401
-
1402
- .tina-tailwind html {
1403
- -moz-tab-size: 4;
1404
- tab-size: 4;
1405
- }
1406
-
1407
- /**
1408
- 1. Correct the line height in all browsers.
1409
- 2. Prevent adjustments of font size after orientation changes in iOS.
1410
- */
1411
-
1412
- .tina-tailwind html {
1413
- line-height: 1.15; /* 1 */
1414
- -webkit-text-size-adjust: 100%; /* 2 */
1415
- }
1416
-
1417
- /**
1418
- Remove the margin in all browsers.
1419
- */
1420
-
1421
- .tina-tailwind body {
1422
- margin: 0;
1423
- }
1424
-
1425
- /**
1426
- Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
1427
- */
1428
-
1429
- .tina-tailwind body {
1430
- font-family:
1431
- system-ui,
1432
- -apple-system, /* Firefox supports this but not yet \`system-ui\` */
1433
- 'Segoe UI',
1434
- Roboto,
1435
- Helvetica,
1436
- Arial,
1437
- sans-serif,
1438
- 'Apple Color Emoji',
1439
- 'Segoe UI Emoji';
1440
- }
1441
-
1442
- /**
1443
- 1. Add the correct height in Firefox.
1444
- 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
1445
- */
1446
-
1447
- .tina-tailwind hr {
1448
- height: 0; /* 1 */
1449
- color: inherit; /* 2 */
1450
- }
1451
-
1452
- /**
1453
- Add the correct text decoration in Chrome, Edge, and Safari.
1454
- */
1455
-
1456
- .tina-tailwind abbr[title] {
1457
- text-decoration: underline dotted;
1458
- }
1459
-
1460
- /**
1461
- Add the correct font weight in Edge and Safari.
1462
- */
1463
-
1464
- .tina-tailwind b,
1465
- .tina-tailwind strong {
1466
- font-weight: bolder;
1467
- }
1468
-
1469
- /**
1470
- 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
1471
- 2. Correct the odd 'em' font sizing in all browsers.
1472
- */
1473
-
1474
- .tina-tailwind code,
1475
- .tina-tailwind kbd,
1476
- .tina-tailwind samp,
1477
- .tina-tailwind pre {
1478
- font-family:
1479
- ui-monospace,
1480
- SFMono-Regular,
1481
- Consolas,
1482
- 'Liberation Mono',
1483
- Menlo,
1484
- monospace; /* 1 */
1485
- font-size: 1em; /* 2 */
1486
- }
1487
-
1488
- /**
1489
- Add the correct font size in all browsers.
1490
- */
1491
-
1492
- .tina-tailwind small {
1493
- font-size: 80%;
1494
- }
1495
-
1496
- /**
1497
- Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
1498
- */
1499
-
1500
- .tina-tailwind sub,
1501
- .tina-tailwind sup {
1502
- font-size: 75%;
1503
- line-height: 0;
1504
- position: relative;
1505
- vertical-align: baseline;
1506
- }
1507
-
1508
- /*
1509
- Text-level semantics
1510
- ====================
1511
- */
1512
-
1513
- .tina-tailwind sub {
1514
- bottom: -0.25em;
1515
- }
1516
-
1517
- /*
1518
- Grouping content
1519
- ================
1520
- */
1521
-
1522
- .tina-tailwind sup {
1523
- top: -0.5em;
1524
- }
1525
-
1526
- /**
1527
- 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)
1528
- 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)
1529
- */
1530
-
1531
- .tina-tailwind table {
1532
- text-indent: 0; /* 1 */
1533
- border-color: inherit; /* 2 */
1534
- }
1535
-
1536
- /**
1537
- 1. Change the font styles in all browsers.
1538
- 2. Remove the margin in Firefox and Safari.
1539
- */
1540
-
1541
- .tina-tailwind button,
1542
- .tina-tailwind input,
1543
- .tina-tailwind optgroup,
1544
- .tina-tailwind select,
1545
- .tina-tailwind textarea {
1546
- font-family: inherit; /* 1 */
1547
- font-size: 100%; /* 1 */
1548
- line-height: 1.15; /* 1 */
1549
- margin: 0; /* 2 */
1550
- }
1551
-
1552
- /**
1553
- Remove the inheritance of text transform in Edge and Firefox.
1554
- 1. Remove the inheritance of text transform in Firefox.
1555
- */
1556
-
1557
- .tina-tailwind button,
1558
- .tina-tailwind select { /* 1 */
1559
- text-transform: none;
1560
- }
1561
-
1562
- /**
1563
- Correct the inability to style clickable types in iOS and Safari.
1564
- */
1565
-
1566
- .tina-tailwind button,
1567
- .tina-tailwind [type='button'],
1568
- .tina-tailwind [type='reset'],
1569
- .tina-tailwind [type='submit'] {
1570
- -webkit-appearance: button;
1838
+ 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';
1839
+ function useTina({
1840
+ query,
1841
+ variables,
1842
+ data
1843
+ }) {
1844
+ const {
1845
+ setRequest,
1846
+ state,
1847
+ isDummyContainer,
1848
+ isLoading: contextLoading
1849
+ } = React.useContext(TinaDataContext);
1850
+ const [waitForContextRerender, setWaitForContextRerender] = useState(!isDummyContainer);
1851
+ const isLoading = contextLoading || waitForContextRerender;
1852
+ React.useEffect(() => {
1853
+ setRequest({ query, variables });
1854
+ }, [JSON.stringify(variables), query]);
1855
+ useEffect(() => {
1856
+ if (!isDummyContainer) {
1857
+ setTimeout(() => setWaitForContextRerender(false), 0);
1858
+ }
1859
+ return () => {
1860
+ setRequest(void 0);
1861
+ };
1862
+ }, [isDummyContainer]);
1863
+ return {
1864
+ data: isDummyContainer || isLoading ? data : state.payload,
1865
+ isLoading
1866
+ };
1571
1867
  }
1572
-
1573
- /**
1574
- Remove the inner border and padding in Firefox.
1575
- */
1576
-
1577
- .tina-tailwind ::-moz-focus-inner {
1578
- border-style: none;
1579
- padding: 0;
1580
- }
1581
-
1582
- /**
1583
- Restore the focus styles unset by the previous rule.
1584
- */
1585
-
1586
- .tina-tailwind :-moz-focusring {
1587
- outline: 1px dotted ButtonText;
1588
- }
1589
-
1590
- /**
1591
- Remove the additional ':invalid' styles in Firefox.
1592
- See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
1593
- */
1594
-
1595
- .tina-tailwind :-moz-ui-invalid {
1596
- box-shadow: none;
1597
- }
1598
-
1599
- /**
1600
- Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
1601
- */
1602
-
1603
- .tina-tailwind legend {
1604
- padding: 0;
1605
- }
1606
-
1607
- /**
1608
- Add the correct vertical alignment in Chrome and Firefox.
1609
- */
1610
-
1611
- .tina-tailwind progress {
1612
- vertical-align: baseline;
1613
- }
1614
-
1615
- /**
1616
- Correct the cursor style of increment and decrement buttons in Safari.
1617
- */
1618
-
1619
- .tina-tailwind ::-webkit-inner-spin-button,
1620
- .tina-tailwind ::-webkit-outer-spin-button {
1621
- height: auto;
1622
- }
1623
-
1624
- /**
1625
- 1. Correct the odd appearance in Chrome and Safari.
1626
- 2. Correct the outline style in Safari.
1627
- */
1628
-
1629
- .tina-tailwind [type='search'] {
1630
- -webkit-appearance: textfield; /* 1 */
1631
- outline-offset: -2px; /* 2 */
1632
- }
1633
-
1634
- /**
1635
- Remove the inner padding in Chrome and Safari on macOS.
1636
- */
1637
-
1638
- .tina-tailwind ::-webkit-search-decoration {
1639
- -webkit-appearance: none;
1640
- }
1641
-
1642
- /**
1643
- 1. Correct the inability to style clickable types in iOS and Safari.
1644
- 2. Change font properties to 'inherit' in Safari.
1645
- */
1646
-
1647
- .tina-tailwind ::-webkit-file-upload-button {
1648
- -webkit-appearance: button; /* 1 */
1649
- font: inherit; /* 2 */
1650
- }
1651
-
1652
- /*
1653
- Add the correct display in Chrome and Safari.
1654
- */
1655
-
1656
- .tina-tailwind summary {
1657
- display: list-item;
1658
- }
1659
-
1660
- /**
1661
- * Removes the default spacing and border for appropriate elements.
1662
- */
1663
-
1664
- .tina-tailwind blockquote,
1665
- .tina-tailwind dl,
1666
- .tina-tailwind dd,
1667
- .tina-tailwind h1,
1668
- .tina-tailwind h2,
1669
- .tina-tailwind h3,
1670
- .tina-tailwind h4,
1671
- .tina-tailwind h5,
1672
- .tina-tailwind h6,
1673
- .tina-tailwind hr,
1674
- .tina-tailwind figure,
1675
- .tina-tailwind p,
1676
- .tina-tailwind pre {
1677
- margin: 0;
1678
- }
1679
-
1680
- /**
1681
- * Manually forked from SUIT CSS Base: https://github.com/suitcss/base
1682
- * A thin layer on top of normalize.css that provides a starting point more
1683
- * suitable for web applications.
1684
- */
1685
-
1686
- .tina-tailwind button {
1687
- background-color: transparent;
1688
- background-image: none;
1689
- }
1690
-
1691
- /*
1692
- Interactive
1693
- ===========
1694
- */
1695
-
1696
- .tina-tailwind fieldset {
1697
- margin: 0;
1698
- padding: 0;
1699
- }
1700
-
1701
- /*
1702
- Forms
1703
- =====
1704
- */
1705
-
1706
- .tina-tailwind ol,
1707
- .tina-tailwind ul {
1708
- list-style: none;
1709
- margin: 0;
1710
- padding: 0;
1711
- }
1712
-
1713
- /**
1714
- * 1. Use the user's configured \`sans\` font-family (with Tailwind's default
1715
- * sans-serif font stack as a fallback) as a sane default.
1716
- * 2. Use Tailwind's default "normal" line-height so the user isn't forced
1717
- * to override it to ensure consistency even when using the default theme.
1718
- */
1719
-
1720
- .tina-tailwind html {
1721
- 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 */
1722
- line-height: 1.5; /* 2 */
1723
- }
1724
-
1725
- /**
1726
- * Inherit font-family and line-height from \`html\` so users can set them as
1727
- * a class directly on the \`html\` element.
1728
- */
1729
-
1730
- .tina-tailwind body {
1731
- font-family: inherit;
1732
- line-height: inherit;
1733
- }
1734
-
1735
- /**
1736
- * 1. Prevent padding and border from affecting element width.
1737
- *
1738
- * We used to set this in the html element and inherit from
1739
- * the parent element for everything else. This caused issues
1740
- * in shadow-dom-enhanced elements like <details> where the content
1741
- * is wrapped by a div with box-sizing set to \`content-box\`.
1742
- *
1743
- * https://github.com/mozdevs/cssremedy/issues/4
1744
- *
1745
- *
1746
- * 2. Allow adding a border to an element by just adding a border-width.
1747
- *
1748
- * By default, the way the browser specifies that an element should have no
1749
- * border is by setting it's border-style to \`none\` in the user-agent
1750
- * stylesheet.
1751
- *
1752
- * In order to easily add borders to elements by just setting the \`border-width\`
1753
- * property, we change the default border-style for all elements to \`solid\`, and
1754
- * use border-width to hide them instead. This way our \`border\` utilities only
1755
- * need to set the \`border-width\` property instead of the entire \`border\`
1756
- * shorthand, making our border utilities much more straightforward to compose.
1757
- *
1758
- * https://github.com/tailwindcss/tailwindcss/pull/116
1759
- */
1760
-
1761
- .tina-tailwind *,
1762
- .tina-tailwind ::before,
1763
- .tina-tailwind ::after {
1764
- box-sizing: border-box; /* 1 */
1765
- border-width: 0; /* 2 */
1766
- border-style: solid; /* 2 */
1767
- border-color: currentColor; /* 2 */
1768
- }
1769
-
1770
- /*
1771
- * Ensure horizontal rules are visible by default
1772
- */
1773
-
1774
- .tina-tailwind hr {
1775
- border-top-width: 1px;
1776
- }
1777
-
1778
- /**
1779
- * Undo the \`border-style: none\` reset that Normalize applies to images so that
1780
- * our \`border-{width}\` utilities have the expected effect.
1781
- *
1782
- * The Normalize reset is unnecessary for us since we default the border-width
1783
- * to 0 on all elements.
1784
- *
1785
- * https://github.com/tailwindcss/tailwindcss/issues/362
1786
- */
1787
-
1788
- .tina-tailwind img {
1789
- border-style: solid;
1790
- }
1791
-
1792
- /**
1793
- * Tailwind custom reset styles
1794
- */
1795
-
1796
- .tina-tailwind textarea {
1797
- resize: vertical;
1798
- }
1799
-
1800
- /*
1801
- Tabular data
1802
- ============
1803
- */
1804
-
1805
- .tina-tailwind input::placeholder,
1806
- .tina-tailwind textarea::placeholder {
1807
- opacity: 1;
1808
- color: #918c9e;
1809
- }
1810
-
1811
- /*
1812
- Sections
1813
- ========
1814
- */
1815
-
1816
- .tina-tailwind button,
1817
- .tina-tailwind [role="button"] {
1818
- cursor: pointer;
1819
- }
1820
-
1821
- /**
1822
- * Override legacy focus reset from Normalize with modern Firefox focus styles.
1823
- *
1824
- * This is actually an improvement over the new defaults in Firefox in our testing,
1825
- * as it triggers the better focus styles even for links, which still use a dotted
1826
- * outline in Firefox by default.
1827
- */
1828
-
1829
- .tina-tailwind :-moz-focusring {
1830
- outline: auto;
1831
- }
1832
-
1833
- /*
1834
- Document
1835
- ========
1836
- */
1837
-
1838
- .tina-tailwind table {
1839
- border-collapse: collapse;
1840
- }
1841
-
1842
- /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
1843
-
1844
- .tina-tailwind h1,
1845
- .tina-tailwind h2,
1846
- .tina-tailwind h3,
1847
- .tina-tailwind h4,
1848
- .tina-tailwind h5,
1849
- .tina-tailwind h6 {
1850
- font-size: inherit;
1851
- font-weight: inherit;
1852
- }
1853
-
1854
- /**
1855
- * Reset links to optimize for opt-in styling instead of
1856
- * opt-out.
1857
- */
1858
-
1859
- .tina-tailwind a {
1860
- color: inherit;
1861
- text-decoration: inherit;
1862
- }
1863
-
1864
- /**
1865
- * Reset form element properties that are easy to forget to
1866
- * style explicitly so you don't inadvertently introduce
1867
- * styles that deviate from your design system. These styles
1868
- * supplement a partial reset that is already applied by
1869
- * normalize.css.
1870
- */
1871
-
1872
- .tina-tailwind button,
1873
- .tina-tailwind input,
1874
- .tina-tailwind optgroup,
1875
- .tina-tailwind select,
1876
- .tina-tailwind textarea {
1877
- padding: 0;
1878
- line-height: inherit;
1879
- color: inherit;
1880
- }
1881
-
1882
- /**
1883
- * Use the configured 'mono' font family for elements that
1884
- * are expected to be rendered with a monospace font, falling
1885
- * back to the system monospace stack if there is no configured
1886
- * 'mono' font family.
1887
- */
1888
-
1889
- .tina-tailwind pre,
1890
- .tina-tailwind code,
1891
- .tina-tailwind kbd,
1892
- .tina-tailwind samp {
1893
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1894
- }
1895
-
1896
- /**
1897
- * 1. Make replaced elements \`display: block\` by default as that's
1898
- * the behavior you want almost all of the time. Inspired by
1899
- * CSS Remedy, with \`svg\` added as well.
1900
- *
1901
- * https://github.com/mozdevs/cssremedy/issues/14
1902
- *
1903
- * 2. Add \`vertical-align: middle\` to align replaced elements more
1904
- * sensibly by default when overriding \`display\` by adding a
1905
- * utility like \`inline\`.
1906
- *
1907
- * This can trigger a poorly considered linting error in some
1908
- * tools but is included by design.
1909
- *
1910
- * https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210
1911
- */
1912
-
1913
- .tina-tailwind img,
1914
- .tina-tailwind svg,
1915
- .tina-tailwind video,
1916
- .tina-tailwind canvas,
1917
- .tina-tailwind audio,
1918
- .tina-tailwind iframe,
1919
- .tina-tailwind embed,
1920
- .tina-tailwind object {
1921
- display: block; /* 1 */
1922
- vertical-align: middle; /* 2 */
1923
- }
1924
-
1925
- /**
1926
- * Constrain images and videos to the parent width and preserve
1927
- * their intrinsic aspect ratio.
1928
- *
1929
- * https://github.com/mozdevs/cssremedy/issues/14
1930
- */
1931
-
1932
- .tina-tailwind img,
1933
- .tina-tailwind video {
1934
- max-width: 100%;
1935
- height: auto;
1936
- }
1937
-
1938
- /**
1939
- * Ensure the default browser behavior of the \`hidden\` attribute.
1940
- */
1941
-
1942
- .tina-tailwind [hidden] {
1943
- display: none;
1944
- }
1945
-
1946
- /*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com
1947
- */
1948
-
1949
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1950
- --tw-translate-x: 0;
1951
- --tw-translate-y: 0;
1952
- --tw-rotate: 0;
1953
- --tw-skew-x: 0;
1954
- --tw-skew-y: 0;
1955
- --tw-scale-x: 1;
1956
- --tw-scale-y: 1;
1957
- --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));
1958
- }
1959
-
1960
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1961
- --tw-border-opacity: 1;
1962
- border-color: rgba(225, 221, 236, var(--tw-border-opacity));
1963
- }
1964
-
1965
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1966
- --tw-ring-offset-shadow: 0 0 #0000;
1967
- --tw-ring-shadow: 0 0 #0000;
1968
- --tw-shadow: 0 0 #0000;
1969
- }
1970
-
1971
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1972
- --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
1973
- --tw-ring-offset-width: 0px;
1974
- --tw-ring-offset-color: #fff;
1975
- --tw-ring-color: rgba(0, 132, 255, 0.5);
1976
- --tw-ring-offset-shadow: 0 0 #0000;
1977
- --tw-ring-shadow: 0 0 #0000;
1978
- --tw-shadow: 0 0 #0000;
1979
- }
1980
-
1981
- .tina-tailwind *, .tina-tailwind ::before, .tina-tailwind ::after {
1982
- --tw-blur: var(--tw-empty,/*!*/ /*!*/);
1983
- --tw-brightness: var(--tw-empty,/*!*/ /*!*/);
1984
- --tw-contrast: var(--tw-empty,/*!*/ /*!*/);
1985
- --tw-grayscale: var(--tw-empty,/*!*/ /*!*/);
1986
- --tw-hue-rotate: var(--tw-empty,/*!*/ /*!*/);
1987
- --tw-invert: var(--tw-empty,/*!*/ /*!*/);
1988
- --tw-saturate: var(--tw-empty,/*!*/ /*!*/);
1989
- --tw-sepia: var(--tw-empty,/*!*/ /*!*/);
1990
- --tw-drop-shadow: var(--tw-empty,/*!*/ /*!*/);
1991
- --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);
1992
- }
1993
-
1994
- .tina-tailwind .static {
1995
- position: static !important;
1996
- }
1997
-
1998
- .tina-tailwind .fixed {
1999
- position: fixed !important;
2000
- }
2001
-
2002
- .tina-tailwind .absolute {
2003
- position: absolute !important;
2004
- }
2005
-
2006
- .tina-tailwind .relative {
2007
- position: relative !important;
2008
- }
2009
-
2010
- .tina-tailwind .left-0 {
2011
- left: 0px !important;
2012
- }
2013
-
2014
- .tina-tailwind .right-0 {
2015
- right: 0px !important;
2016
- }
2017
-
2018
- .tina-tailwind .bottom-2 {
2019
- bottom: 8px !important;
2020
- }
2021
-
2022
- .tina-tailwind .right-5 {
2023
- right: 20px !important;
2024
- }
2025
-
2026
- .tina-tailwind .z-50 {
2027
- z-index: 50 !important;
2028
- }
2029
-
2030
- .tina-tailwind .mx-auto {
2031
- margin-left: auto !important;
2032
- margin-right: auto !important;
2033
- }
2034
-
2035
- .tina-tailwind .mr-2 {
2036
- margin-right: 8px !important;
2037
- }
2038
-
2039
- .tina-tailwind .mb-2 {
2040
- margin-bottom: 8px !important;
2041
- }
2042
-
2043
- .tina-tailwind .mb-1 {
2044
- margin-bottom: 4px !important;
2045
- }
2046
-
2047
- .tina-tailwind .-mt-0\\.5 {
2048
- margin-top: -2px !important;
2049
- }
2050
-
2051
- .tina-tailwind .-mt-0 {
2052
- margin-top: 0px !important;
2053
- }
2054
-
2055
- .tina-tailwind .ml-1 {
2056
- margin-left: 4px !important;
2057
- }
2058
-
2059
- .tina-tailwind .mt-2 {
2060
- margin-top: 8px !important;
2061
- }
2062
-
2063
- .tina-tailwind .mr-1\\.5 {
2064
- margin-right: 6px !important;
2065
- }
2066
-
2067
- .tina-tailwind .mr-1 {
2068
- margin-right: 4px !important;
2069
- }
2070
-
2071
- .tina-tailwind .block {
2072
- display: block !important;
2073
- }
2074
-
2075
- .tina-tailwind .inline-block {
2076
- display: inline-block !important;
2077
- }
2078
-
2079
- .tina-tailwind .flex {
2080
- display: flex !important;
2081
- }
2082
-
2083
- .tina-tailwind .inline-flex {
2084
- display: inline-flex !important;
2085
- }
2086
-
2087
- .tina-tailwind .table {
2088
- display: table !important;
2089
- }
2090
-
2091
- .tina-tailwind .h-screen {
2092
- height: 100vh !important;
2093
- }
2094
-
2095
- .tina-tailwind .h-auto {
2096
- height: auto !important;
2097
- }
2098
-
2099
- .tina-tailwind .h-full {
2100
- height: 100% !important;
2101
- }
2102
-
2103
- .tina-tailwind .h-6 {
2104
- height: 24px !important;
2105
- }
2106
-
2107
- .tina-tailwind .h-10 {
2108
- height: 40px !important;
2109
- }
2110
-
2111
- .tina-tailwind .h-5 {
2112
- height: 20px !important;
2113
- }
2114
-
2115
- .tina-tailwind .w-full {
2116
- width: 100% !important;
2117
- }
2118
-
2119
- .tina-tailwind .w-10 {
2120
- width: 40px !important;
2121
- }
2122
-
2123
- .tina-tailwind .w-auto {
2124
- width: auto !important;
2125
- }
2126
-
2127
- .tina-tailwind .w-5 {
2128
- width: 20px !important;
2129
- }
2130
-
2131
- .tina-tailwind .w-56 {
2132
- width: 224px !important;
2133
- }
2134
-
2135
- .tina-tailwind .w-6 {
2136
- width: 24px !important;
2137
- }
2138
-
2139
- .tina-tailwind .max-w-lg {
2140
- max-width: 32rem !important;
2141
- }
2142
-
2143
- .tina-tailwind .max-w-screen-xl {
2144
- max-width: 1280px !important;
2145
- }
2146
-
2147
- .tina-tailwind .max-w-form {
2148
- max-width: 900px !important;
2149
- }
2150
-
2151
- .tina-tailwind .max-w-full {
2152
- max-width: 100% !important;
2153
- }
2154
-
2155
- .tina-tailwind .flex-1 {
2156
- flex: 1 1 0% !important;
2157
- }
2158
-
2159
- .tina-tailwind .table-auto {
2160
- table-layout: auto !important;
2161
- }
2162
-
2163
- .tina-tailwind .origin-top-right {
2164
- transform-origin: top right !important;
2165
- }
2166
-
2167
- .tina-tailwind .translate-y-full {
2168
- --tw-translate-y: 100% !important;
2169
- transform: var(--tw-transform) !important;
2170
- }
2171
-
2172
- .tina-tailwind .-translate-y-2 {
2173
- --tw-translate-y: -8px !important;
2174
- transform: var(--tw-transform) !important;
2175
- }
2176
-
2177
- .tina-tailwind .translate-y-0 {
2178
- --tw-translate-y: 0px !important;
2179
- transform: var(--tw-transform) !important;
2180
- }
2181
-
2182
- .tina-tailwind .scale-95 {
2183
- --tw-scale-x: .95 !important;
2184
- --tw-scale-y: .95 !important;
2185
- transform: var(--tw-transform) !important;
2186
- }
2187
-
2188
- .tina-tailwind .scale-100 {
2189
- --tw-scale-x: 1 !important;
2190
- --tw-scale-y: 1 !important;
2191
- transform: var(--tw-transform) !important;
2192
- }
2193
-
2194
- .tina-tailwind .transform {
2195
- transform: var(--tw-transform) !important;
2196
- }
2197
-
2198
- .tina-tailwind .flex-col {
2199
- flex-direction: column !important;
2200
- }
2201
-
2202
- .tina-tailwind .items-end {
2203
- align-items: flex-end !important;
2204
- }
2205
-
2206
- .tina-tailwind .items-center {
2207
- align-items: center !important;
2208
- }
2209
-
2210
- .tina-tailwind .items-stretch {
2211
- align-items: stretch !important;
2212
- }
2213
-
2214
- .tina-tailwind .justify-center {
2215
- justify-content: center !important;
2216
- }
2217
-
2218
- .tina-tailwind .justify-between {
2219
- justify-content: space-between !important;
2220
- }
2221
-
2222
- .tina-tailwind .gap-0\\.5 {
2223
- gap: 2px !important;
2224
- }
2225
-
2226
- .tina-tailwind .gap-0 {
2227
- gap: 0px !important;
2228
- }
2229
-
2230
- .tina-tailwind .gap-4 {
2231
- gap: 16px !important;
2232
- }
2233
-
2234
- .tina-tailwind .gap-3 {
2235
- gap: 12px !important;
2236
- }
2237
-
2238
- .tina-tailwind .divide-y > :not([hidden]) ~ :not([hidden]) {
2239
- --tw-divide-y-reverse: 0 !important;
2240
- border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse))) !important;
2241
- border-bottom-width: calc(1px * var(--tw-divide-y-reverse)) !important;
2242
- }
2243
-
2244
- .tina-tailwind .overflow-hidden {
2245
- overflow: hidden !important;
2246
- }
2247
-
2248
- .tina-tailwind .overflow-y-auto {
2249
- overflow-y: auto !important;
2250
- }
2251
-
2252
- .tina-tailwind .whitespace-nowrap {
2253
- white-space: nowrap !important;
2254
- }
2255
-
2256
- .tina-tailwind .rounded-lg {
2257
- border-radius: 8px !important;
2258
- }
2259
-
2260
- .tina-tailwind .rounded-full {
2261
- border-radius: 9999px !important;
2262
- }
2263
-
2264
- .tina-tailwind .rounded-md {
2265
- border-radius: 6px !important;
2266
- }
2267
-
2268
- .tina-tailwind .border {
2269
- border-width: 1px !important;
2270
- }
2271
-
2272
- .tina-tailwind .border-b {
2273
- border-bottom-width: 1px !important;
2274
- }
2275
-
2276
- .tina-tailwind .border-gray-200 {
2277
- --tw-border-opacity: 1 !important;
2278
- border-color: rgba(225, 221, 236, var(--tw-border-opacity)) !important;
2279
- }
2280
-
2281
- .tina-tailwind .border-transparent {
2282
- border-color: transparent !important;
2283
- }
2284
-
2285
- .tina-tailwind .bg-white {
2286
- --tw-bg-opacity: 1 !important;
2287
- background-color: rgba(255, 255, 255, var(--tw-bg-opacity)) !important;
2288
- }
2289
-
2290
- .tina-tailwind .bg-gray-50 {
2291
- --tw-bg-opacity: 1 !important;
2292
- background-color: rgba(246, 246, 249, var(--tw-bg-opacity)) !important;
2293
- }
2294
-
2295
- .tina-tailwind .bg-blue-500 {
2296
- --tw-bg-opacity: 1 !important;
2297
- background-color: rgba(0, 132, 255, var(--tw-bg-opacity)) !important;
2298
- }
2299
-
2300
- .tina-tailwind .bg-gradient-to-b {
2301
- background-image: linear-gradient(to bottom, var(--tw-gradient-stops)) !important;
2302
- }
2303
-
2304
- .tina-tailwind .from-blue-900 {
2305
- --tw-gradient-from: #1D2C6C !important;
2306
- --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(29, 44, 108, 0)) !important;
2307
- }
2308
-
2309
- .tina-tailwind .to-gray-900 {
2310
- --tw-gradient-to: #252336 !important;
2311
- }
2312
-
2313
- .tina-tailwind .px-4 {
2314
- padding-left: 16px !important;
2315
- padding-right: 16px !important;
2316
- }
2317
-
2318
- .tina-tailwind .py-6 {
2319
- padding-top: 24px !important;
2320
- padding-bottom: 24px !important;
2321
- }
2322
-
2323
- .tina-tailwind .px-5 {
2324
- padding-left: 20px !important;
2325
- padding-right: 20px !important;
2326
- }
2327
-
2328
- .tina-tailwind .py-4 {
2329
- padding-top: 16px !important;
2330
- padding-bottom: 16px !important;
2331
- }
2332
-
2333
- .tina-tailwind .px-12 {
2334
- padding-left: 48px !important;
2335
- padding-right: 48px !important;
2336
- }
2337
-
2338
- .tina-tailwind .py-10 {
2339
- padding-top: 40px !important;
2340
- padding-bottom: 40px !important;
2341
- }
2342
-
2343
- .tina-tailwind .px-20 {
2344
- padding-left: 80px !important;
2345
- padding-right: 80px !important;
2346
- }
2347
-
2348
- .tina-tailwind .px-6 {
2349
- padding-left: 24px !important;
2350
- padding-right: 24px !important;
2351
- }
2352
-
2353
- .tina-tailwind .py-1 {
2354
- padding-top: 4px !important;
2355
- padding-bottom: 4px !important;
2356
- }
2357
-
2358
- .tina-tailwind .py-2 {
2359
- padding-top: 8px !important;
2360
- padding-bottom: 8px !important;
2361
- }
2362
-
2363
- .tina-tailwind .py-3 {
2364
- padding-top: 12px !important;
2365
- padding-bottom: 12px !important;
2366
- }
2367
-
2368
- .tina-tailwind .px-8 {
2369
- padding-left: 32px !important;
2370
- padding-right: 32px !important;
2371
- }
2372
-
2373
- .tina-tailwind .pb-4 {
2374
- padding-bottom: 16px !important;
2375
- }
2376
-
2377
- .tina-tailwind .pt-18 {
2378
- padding-top: 72px !important;
2379
- }
2380
-
2381
- .tina-tailwind .text-left {
2382
- text-align: left !important;
2383
- }
2384
-
2385
- .tina-tailwind .text-center {
2386
- text-align: center !important;
2387
- }
2388
-
2389
- .tina-tailwind .font-sans {
2390
- 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;
2391
- }
2392
-
2393
- .tina-tailwind .text-2xl {
2394
- font-size: 24px !important;
2395
- line-height: 1.33 !important;
2396
- }
2397
-
2398
- .tina-tailwind .text-base {
2399
- font-size: 16px !important;
2400
- line-height: 1.5 !important;
2401
- }
2402
-
2403
- .tina-tailwind .text-sm {
2404
- font-size: 14px !important;
2405
- line-height: 1.43 !important;
2406
- }
2407
-
2408
- .tina-tailwind .text-xl {
2409
- font-size: 20px !important;
2410
- line-height: 1.4 !important;
2411
- }
2412
-
2413
- .tina-tailwind .text-md {
2414
- font-size: 16px !important;
2415
- line-height: 1.5 !important;
2416
- }
2417
-
2418
- .tina-tailwind .text-xs {
2419
- font-size: 13px !important;
2420
- line-height: 1.33 !important;
2421
- }
2422
-
2423
- .tina-tailwind .font-medium {
2424
- font-weight: 500 !important;
2425
- }
2426
-
2427
- .tina-tailwind .uppercase {
2428
- text-transform: uppercase !important;
2429
- }
2430
-
2431
- .tina-tailwind .italic {
2432
- font-style: italic !important;
2433
- }
2434
-
2435
- .tina-tailwind .leading-normal {
2436
- line-height: 1.5 !important;
2437
- }
2438
-
2439
- .tina-tailwind .leading-tight {
2440
- line-height: 1.25 !important;
2441
- }
2442
-
2443
- .tina-tailwind .leading-5 {
2444
- line-height: 20px !important;
2445
- }
2446
-
2447
- .tina-tailwind .leading-4 {
2448
- line-height: 16px !important;
2449
- }
2450
-
2451
- .tina-tailwind .tracking-wide {
2452
- letter-spacing: 0.025em !important;
2453
- }
2454
-
2455
- .tina-tailwind .text-gray-700 {
2456
- --tw-text-opacity: 1 !important;
2457
- color: rgba(67, 62, 82, var(--tw-text-opacity)) !important;
2458
- }
2459
-
2460
- .tina-tailwind .text-blue-600 {
2461
- --tw-text-opacity: 1 !important;
2462
- color: rgba(5, 116, 228, var(--tw-text-opacity)) !important;
2463
- }
2464
-
2465
- .tina-tailwind .text-gray-500 {
2466
- --tw-text-opacity: 1 !important;
2467
- color: rgba(113, 108, 127, var(--tw-text-opacity)) !important;
2468
- }
2469
-
2470
- .tina-tailwind .text-gray-400 {
2471
- --tw-text-opacity: 1 !important;
2472
- color: rgba(145, 140, 158, var(--tw-text-opacity)) !important;
2473
- }
2474
-
2475
- .tina-tailwind .text-current {
2476
- color: currentColor !important;
2477
- }
2478
-
2479
- .tina-tailwind .text-white {
2480
- --tw-text-opacity: 1 !important;
2481
- color: rgba(255, 255, 255, var(--tw-text-opacity)) !important;
2482
- }
2483
-
2484
- .tina-tailwind .text-gray-600 {
2485
- --tw-text-opacity: 1 !important;
2486
- color: rgba(86, 81, 101, var(--tw-text-opacity)) !important;
2487
- }
2488
-
2489
- .tina-tailwind .text-gray-800 {
2490
- --tw-text-opacity: 1 !important;
2491
- color: rgba(54, 49, 69, var(--tw-text-opacity)) !important;
2492
- }
2493
-
2494
- .tina-tailwind .text-gray-900 {
2495
- --tw-text-opacity: 1 !important;
2496
- color: rgba(37, 35, 54, var(--tw-text-opacity)) !important;
2497
- }
2498
-
2499
- .tina-tailwind .text-blue-500 {
2500
- --tw-text-opacity: 1 !important;
2501
- color: rgba(0, 132, 255, var(--tw-text-opacity)) !important;
2502
- }
2503
-
2504
- .tina-tailwind .text-blue-400 {
2505
- --tw-text-opacity: 1 !important;
2506
- color: rgba(34, 150, 254, var(--tw-text-opacity)) !important;
2507
- }
2508
-
2509
- .tina-tailwind .underline {
2510
- text-decoration: underline !important;
2511
- }
2512
-
2513
- .tina-tailwind .opacity-100 {
2514
- opacity: 1 !important;
2515
- }
2516
-
2517
- .tina-tailwind .opacity-90 {
2518
- opacity: .9 !important;
2519
- }
2520
-
2521
- .tina-tailwind .opacity-80 {
2522
- opacity: .8 !important;
2523
- }
2524
-
2525
- .tina-tailwind .opacity-50 {
2526
- opacity: .5 !important;
2527
- }
2528
-
2529
- .tina-tailwind .opacity-70 {
2530
- opacity: .7 !important;
2531
- }
2532
-
2533
- .tina-tailwind .opacity-0 {
2534
- opacity: 0 !important;
2535
- }
2536
-
2537
- .tina-tailwind .shadow-lg {
2538
- --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
2539
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2540
- }
2541
-
2542
- .tina-tailwind .shadow-2xl {
2543
- --tw-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
2544
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2545
- }
2546
-
2547
- .tina-tailwind .shadow {
2548
- --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
2549
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2550
- }
2551
-
2552
- .tina-tailwind .shadow-sm {
2553
- --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
2554
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2555
- }
2556
-
2557
- .tina-tailwind .ring-1 {
2558
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
2559
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
2560
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
2561
- }
2562
-
2563
- .tina-tailwind .ring-black {
2564
- --tw-ring-opacity: 1 !important;
2565
- --tw-ring-color: rgba(0, 0, 0, var(--tw-ring-opacity)) !important;
2566
- }
2567
-
2568
- .tina-tailwind .ring-opacity-5 {
2569
- --tw-ring-opacity: .05 !important;
2570
- }
2571
-
2572
- .tina-tailwind .filter {
2573
- filter: var(--tw-filter) !important;
2574
- }
2575
-
2576
- .tina-tailwind .transition-opacity {
2577
- transition-property: opacity !important;
2578
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2579
- transition-duration: 150ms !important;
2580
- }
2581
-
2582
- .tina-tailwind .transition-colors {
2583
- transition-property: background-color, border-color, color, fill, stroke !important;
2584
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2585
- transition-duration: 150ms !important;
2586
- }
2587
-
2588
- .tina-tailwind .transition-all {
2589
- transition-property: all !important;
2590
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2591
- transition-duration: 150ms !important;
2592
- }
2593
-
2594
- .tina-tailwind .transition {
2595
- transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;
2596
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2597
- transition-duration: 150ms !important;
2598
- }
2599
-
2600
- .tina-tailwind .duration-300 {
2601
- transition-duration: 300ms !important;
2602
- }
2603
-
2604
- .tina-tailwind .duration-150 {
2605
- transition-duration: 150ms !important;
2606
- }
2607
-
2608
- .tina-tailwind .duration-100 {
2609
- transition-duration: 100ms !important;
2610
- }
2611
-
2612
- .tina-tailwind .duration-75 {
2613
- transition-duration: 75ms !important;
2614
- }
2615
-
2616
- .tina-tailwind .ease-out {
2617
- transition-timing-function: cubic-bezier(0, 0, 0.2, 1) !important;
2618
- }
2619
-
2620
- .tina-tailwind .ease-in {
2621
- transition-timing-function: cubic-bezier(0.4, 0, 1, 1) !important;
2622
- }
2623
-
2624
- .tina-tailwind .ease-in-out {
2625
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
2626
- }
2627
-
2628
- .tina-tailwind .icon-parent svg {
2629
- fill: currentColor !important;
2630
- }
2631
-
2632
- .tina-tailwind {
2633
- 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";
2634
- --tw-text-opacity: 1;
2635
- color: rgba(86, 81, 101, var(--tw-text-opacity));
2636
- }
2637
-
2638
- .first\\:pt-3:first-child {
2639
- padding-top: 12px !important;
2640
- }
2641
-
2642
- .last\\:pb-3:last-child {
2643
- padding-bottom: 12px !important;
2644
- }
2645
-
2646
- .hover\\:bg-blue-600:hover {
2647
- --tw-bg-opacity: 1 !important;
2648
- background-color: rgba(5, 116, 228, var(--tw-bg-opacity)) !important;
2649
- }
2650
-
2651
- .hover\\:bg-gray-50:hover {
2652
- --tw-bg-opacity: 1 !important;
2653
- background-color: rgba(246, 246, 249, var(--tw-bg-opacity)) !important;
2654
- }
2655
-
2656
- .hover\\:text-blue-600:hover {
2657
- --tw-text-opacity: 1 !important;
2658
- color: rgba(5, 116, 228, var(--tw-text-opacity)) !important;
2659
- }
2660
-
2661
- .hover\\:text-blue-400:hover {
2662
- --tw-text-opacity: 1 !important;
2663
- color: rgba(34, 150, 254, var(--tw-text-opacity)) !important;
2664
- }
2665
-
2666
- .hover\\:opacity-100:hover {
2667
- opacity: 1 !important;
2668
- }
2669
-
2670
- .hover\\:opacity-80:hover {
2671
- opacity: .8 !important;
2672
- }
2673
-
2674
- .focus\\:text-blue-400:focus {
2675
- --tw-text-opacity: 1 !important;
2676
- color: rgba(34, 150, 254, var(--tw-text-opacity)) !important;
2677
- }
2678
-
2679
- .focus\\:underline:focus {
2680
- text-decoration: underline !important;
2681
- }
2682
-
2683
- .focus\\:shadow-outline:focus {
2684
- --tw-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5) !important;
2685
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
2686
- }
2687
-
2688
- .focus\\:outline-none:focus {
2689
- outline: 2px solid transparent !important;
2690
- outline-offset: 2px !important;
2691
- }
2692
-
2693
- .focus\\:ring-2:focus {
2694
- --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
2695
- --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
2696
- box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
2697
- }
2698
-
2699
- .focus\\:ring-blue-500:focus {
2700
- --tw-ring-opacity: 1 !important;
2701
- --tw-ring-color: rgba(0, 132, 255, var(--tw-ring-opacity)) !important;
2702
- }
2703
-
2704
- .group:hover .group-hover\\:opacity-100 {
2705
- opacity: 1 !important;
2706
- }
2707
- `;
2708
- function useTina({
2709
- query,
2710
- variables,
2711
- data
2712
- }) {
2713
- const {
2714
- setRequest,
2715
- state,
2716
- isDummyContainer,
2717
- isLoading: contextLoading
2718
- } = React.useContext(TinaDataContext);
2719
- const [waitForContextRerender, setWaitForContextRerender] = useState(!isDummyContainer);
2720
- const isLoading = contextLoading || waitForContextRerender;
2721
- React.useEffect(() => {
2722
- setRequest({ query, variables });
2723
- }, [JSON.stringify(variables), query]);
2724
- useEffect(() => {
2725
- if (!isDummyContainer) {
2726
- setTimeout(() => setWaitForContextRerender(false), 0);
2727
- }
2728
- return () => {
2729
- setRequest(void 0);
2730
- };
2731
- }, [isDummyContainer]);
2732
- return {
2733
- data: isDummyContainer || isLoading ? data : state.payload,
2734
- isLoading
2735
- };
2736
- }
2737
- const errorButtonStyles = {
2738
- background: "#eb6337",
2739
- padding: "12px 18px",
2740
- cursor: "pointer",
2741
- borderRadius: "50px",
2742
- textTransform: "uppercase",
2743
- letterSpacing: "2px",
2744
- fontWeight: "bold",
2745
- border: "none",
2746
- color: "white",
2747
- margin: "1rem 0"
2748
- };
2749
- class ErrorBoundary extends React.Component {
2750
- constructor(props) {
2751
- super(props);
2752
- this.state = {
2753
- hasError: props.hasError,
2754
- message: "",
2755
- pageRefresh: false
2756
- };
2757
- }
2758
- static getDerivedStateFromError(error) {
2759
- return { hasError: true, message: error.message };
2760
- }
2761
- render() {
2762
- const branchData = window.localStorage && window.localStorage.getItem("tinacms-current-branch");
2763
- const hasBranchData = branchData && branchData.length > 0;
2764
- if (this.state.hasError && !this.state.pageRefresh) {
2765
- return /* @__PURE__ */ React.createElement("div", {
2766
- style: {
2767
- background: "#efefef",
2768
- height: "100vh",
2769
- display: "flex",
2770
- alignItems: "center",
2771
- justifyContent: "center"
2772
- }
2773
- }, /* @__PURE__ */ React.createElement("style", null, " body { margin: 0; } "), /* @__PURE__ */ React.createElement("div", {
2774
- style: {
2775
- background: "#fff",
2776
- maxWidth: "400px",
2777
- padding: "20px",
2778
- fontFamily: "'Inter', sans-serif",
2779
- borderRadius: "5px",
2780
- boxShadow: "0 6px 24px rgb(0 37 91 / 5%), 0 2px 4px rgb(0 37 91 / 3%)"
2781
- }
2782
- }, /* @__PURE__ */ React.createElement("h3", {
2783
- style: { color: "#eb6337" }
2784
- }, "TinaCMS Render Error"), /* @__PURE__ */ React.createElement("p", null, "Tina caught an error while updating the page:"), /* @__PURE__ */ React.createElement("pre", {
2785
- style: { marginTop: "1rem", overflowX: "auto" }
2786
- }, this.state.message), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("p", null, `If you've just updated the form, undo your most recent changes and click "refresh". If after a few refreshes, you're still encountering this error. There is a bigger issue with the site. Please reach out to your site admin.`), /* @__PURE__ */ React.createElement("button", {
2787
- style: errorButtonStyles,
2788
- onClick: () => {
2789
- this.setState({ pageRefresh: true });
2790
- setTimeout(() => this.setState({ hasError: false, pageRefresh: false }), 3e3);
2791
- }
2792
- }, "Refresh"), hasBranchData && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, `If you're using the branch switcher, you may currently be on a "stale" branch that has been deleted or whose content is not compatible with the latest version of the site's layout. Click the button below to switch back to the default branch for this deployment.`), /* @__PURE__ */ React.createElement("button", {
2793
- style: errorButtonStyles,
2794
- onClick: () => {
2795
- window.localStorage.removeItem("tinacms-current-branch");
2796
- window.location.reload();
2797
- }
2798
- }, "Switch to default branch"))));
2799
- }
2800
- if (this.state.pageRefresh) {
2801
- return /* @__PURE__ */ React.createElement(Loader, null, "Let's try that again.");
2802
- }
2803
- return this.props.children;
2804
- }
1868
+ const errorButtonStyles = {
1869
+ background: "#eb6337",
1870
+ padding: "12px 18px",
1871
+ cursor: "pointer",
1872
+ borderRadius: "50px",
1873
+ textTransform: "uppercase",
1874
+ letterSpacing: "2px",
1875
+ fontWeight: "bold",
1876
+ border: "none",
1877
+ color: "white",
1878
+ margin: "1rem 0"
1879
+ };
1880
+ class ErrorBoundary extends React.Component {
1881
+ constructor(props) {
1882
+ super(props);
1883
+ this.state = {
1884
+ hasError: props.hasError,
1885
+ message: "",
1886
+ pageRefresh: false
1887
+ };
1888
+ }
1889
+ static getDerivedStateFromError(error) {
1890
+ return { hasError: true, message: error.message };
1891
+ }
1892
+ render() {
1893
+ const branchData = window.localStorage && window.localStorage.getItem("tinacms-current-branch");
1894
+ const hasBranchData = branchData && branchData.length > 0;
1895
+ if (this.state.hasError && !this.state.pageRefresh) {
1896
+ return /* @__PURE__ */ React.createElement("div", {
1897
+ style: {
1898
+ background: "#efefef",
1899
+ height: "100vh",
1900
+ display: "flex",
1901
+ alignItems: "center",
1902
+ justifyContent: "center"
1903
+ }
1904
+ }, /* @__PURE__ */ React.createElement("style", null, " body { margin: 0; } "), /* @__PURE__ */ React.createElement("div", {
1905
+ style: {
1906
+ background: "#fff",
1907
+ maxWidth: "400px",
1908
+ padding: "20px",
1909
+ fontFamily: "'Inter', sans-serif",
1910
+ borderRadius: "5px",
1911
+ boxShadow: "0 6px 24px rgb(0 37 91 / 5%), 0 2px 4px rgb(0 37 91 / 3%)"
1912
+ }
1913
+ }, /* @__PURE__ */ React.createElement("h3", {
1914
+ style: { color: "#eb6337" }
1915
+ }, "TinaCMS Render Error"), /* @__PURE__ */ React.createElement("p", null, "Tina caught an error while updating the page:"), /* @__PURE__ */ React.createElement("pre", {
1916
+ style: { marginTop: "1rem", overflowX: "auto" }
1917
+ }, this.state.message), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("p", null, `If you've just updated the form, undo your most recent changes and click "refresh". If after a few refreshes, you're still encountering this error. There is a bigger issue with the site. Please reach out to your site admin.`), /* @__PURE__ */ React.createElement("button", {
1918
+ style: errorButtonStyles,
1919
+ onClick: () => {
1920
+ this.setState({ pageRefresh: true });
1921
+ setTimeout(() => this.setState({ hasError: false, pageRefresh: false }), 3e3);
1922
+ }
1923
+ }, "Refresh"), hasBranchData && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, `If you're using the branch switcher, you may currently be on a "stale" branch that has been deleted or whose content is not compatible with the latest version of the site's layout. Click the button below to switch back to the default branch for this deployment.`), /* @__PURE__ */ React.createElement("button", {
1924
+ style: errorButtonStyles,
1925
+ onClick: () => {
1926
+ window.localStorage.removeItem("tinacms-current-branch");
1927
+ window.location.reload();
1928
+ }
1929
+ }, "Switch to default branch"))));
1930
+ }
1931
+ if (this.state.pageRefresh) {
1932
+ return /* @__PURE__ */ React.createElement(Loader, null, "Let's try that again.");
1933
+ }
1934
+ return this.props.children;
1935
+ }
2805
1936
  }
2806
1937
  const parseURL = (url) => {
2807
1938
  if (url.includes("localhost")) {
@@ -3112,10 +2243,10 @@ var __rest = function(s, e) {
3112
2243
  return t;
3113
2244
  };
3114
2245
  function Tree2Element(tree) {
3115
- return tree && tree.map(function(node, i) {
3116
- return React.createElement(node.tag, __assign({
2246
+ return tree && tree.map(function(node2, i) {
2247
+ return React.createElement(node2.tag, __assign({
3117
2248
  key: i
3118
- }, node.attr), Tree2Element(node.child));
2249
+ }, node2.attr), Tree2Element(node2.child));
3119
2250
  });
3120
2251
  }
3121
2252
  function GenIcon(data) {
@@ -3157,41 +2288,37 @@ function ImFilesEmpty(props) {
3157
2288
  }
3158
2289
  const useGetCollections = (cms) => {
3159
2290
  const api = new TinaAdminApi(cms);
3160
- const [info, setInfo] = useState({ collections: [], loading: true, error: false });
2291
+ const [collections, setCollections] = useState([]);
2292
+ const [loading, setLoading] = useState(true);
2293
+ const [error, setError] = useState(void 0);
3161
2294
  useEffect(() => {
3162
2295
  const fetchCollections = async () => {
3163
- const response = await api.fetchCollections();
3164
- setInfo({
3165
- collections: response.getCollections,
3166
- loading: false,
3167
- error: false
3168
- });
2296
+ try {
2297
+ const response = await api.fetchCollections();
2298
+ setCollections(response.getCollections);
2299
+ } catch (error2) {
2300
+ cms.alerts.error(`[${error2.name}] GetCollections failed: ${error2.message}`, 30 * 1e3);
2301
+ console.error(error2);
2302
+ setCollections([]);
2303
+ setError(error2);
2304
+ }
2305
+ setLoading(false);
3169
2306
  };
2307
+ setLoading(true);
3170
2308
  fetchCollections();
3171
2309
  }, [cms]);
3172
- return info;
3173
- };
3174
- const GetCollections = ({ cms, children }) => {
3175
- const { collections, loading, error } = useGetCollections(cms);
3176
- if (!collections)
3177
- return null;
3178
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collections, loading, error));
2310
+ return { collections, loading, error };
3179
2311
  };
3180
2312
  const slugify = (text) => {
3181
2313
  return text.toString().toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "_").replace(/^-+|-+$/g, "");
3182
2314
  };
3183
2315
  const Sidebar = ({ cms }) => {
2316
+ const collectionsInfo = useGetCollections(cms);
3184
2317
  const screens = cms.plugins.getType("screen").all();
3185
- return /* @__PURE__ */ React.createElement(GetCollections, {
3186
- cms
3187
- }, (collections, loading, error) => /* @__PURE__ */ React.createElement(Nav, {
2318
+ return /* @__PURE__ */ React.createElement(Nav, {
3188
2319
  sidebarWidth: 360,
3189
2320
  showCollections: true,
3190
- collectionsInfo: {
3191
- collections,
3192
- loading,
3193
- error
3194
- },
2321
+ collectionsInfo,
3195
2322
  screens,
3196
2323
  contentCreators: [],
3197
2324
  RenderNavSite: ({ view }) => /* @__PURE__ */ React.createElement(SidebarLink, {
@@ -3204,7 +2331,7 @@ const Sidebar = ({ cms }) => {
3204
2331
  to: `collections/${collection.name}`,
3205
2332
  Icon: ImFilesEmpty
3206
2333
  })
3207
- }));
2334
+ });
3208
2335
  };
3209
2336
  const SidebarLink = (props) => {
3210
2337
  const { to, label, Icon } = props;
@@ -3261,8 +2388,8 @@ const AuthTemplate = ({
3261
2388
  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"
3262
2389
  }), /* @__PURE__ */ React.createElement("path", {
3263
2390
  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"
3264
- })), /* @__PURE__ */ React.createElement("span", null, "Tina Admin"))), message && /* @__PURE__ */ React.createElement("div", {
3265
- className: "px-5 py-4 "
2391
+ })), /* @__PURE__ */ React.createElement("span", null, "Tina"))), message && /* @__PURE__ */ React.createElement("div", {
2392
+ className: "px-5 pt-4"
3266
2393
  }, /* @__PURE__ */ React.createElement("p", {
3267
2394
  className: "text-base font-sans leading-normal"
3268
2395
  }, message)), /* @__PURE__ */ React.createElement("div", {
@@ -3272,38 +2399,52 @@ const AuthTemplate = ({
3272
2399
  const LoginPage = () => {
3273
2400
  const { setEdit } = useEditState();
3274
2401
  const login = () => setEdit(true);
3275
- return /* @__PURE__ */ React.createElement(AuthTemplate, null, /* @__PURE__ */ React.createElement("a", {
3276
- href: "/",
3277
- 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"
2402
+ return /* @__PURE__ */ React.createElement(AuthTemplate, null, /* @__PURE__ */ React.createElement("div", {
2403
+ className: "flex w-full flex-1 gap-4 items-center justify-end"
2404
+ }, /* @__PURE__ */ React.createElement(Button, {
2405
+ onClick: () => {
2406
+ window.location.href = "/";
2407
+ },
2408
+ variant: "white",
2409
+ size: "custom",
2410
+ className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
3278
2411
  }, /* @__PURE__ */ React.createElement(MdOutlineArrowBack, {
3279
2412
  className: "w-6 h-auto mr-1.5 opacity-80"
3280
- }), " Back to site"), /* @__PURE__ */ React.createElement("button", {
3281
- type: "submit",
2413
+ }), " Back To Site"), /* @__PURE__ */ React.createElement(Button, {
3282
2414
  onClick: () => login(),
3283
- 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",
3284
- style: { background: "#0084FF" }
2415
+ variant: "primary",
2416
+ size: "custom",
2417
+ className: "text-base h-12 px-6 flex-1",
2418
+ type: "submit"
3285
2419
  }, /* @__PURE__ */ React.createElement(BiLogIn, {
3286
- className: "w-6 h-auto mr-1.5 opacity-80"
3287
- }), " Enter edit-mode"));
2420
+ className: "w-6 h-auto mr-2 opacity-80"
2421
+ }), " Edit With Tina")));
3288
2422
  };
3289
2423
  const logout = () => {
3290
2424
  setEditing(false);
3291
2425
  window.location.href = "/";
3292
2426
  };
3293
2427
  const LogoutPage = () => {
3294
- return /* @__PURE__ */ React.createElement(AuthTemplate, null, /* @__PURE__ */ React.createElement("a", {
3295
- href: "/",
3296
- 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"
2428
+ return /* @__PURE__ */ React.createElement(AuthTemplate, null, /* @__PURE__ */ React.createElement("div", {
2429
+ className: "flex w-full flex-1 gap-4 items-center justify-end"
2430
+ }, /* @__PURE__ */ React.createElement(Button, {
2431
+ onClick: () => {
2432
+ window.location.href = "/";
2433
+ },
2434
+ variant: "white",
2435
+ size: "custom",
2436
+ className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
3297
2437
  }, /* @__PURE__ */ React.createElement(MdOutlineArrowBack, {
3298
2438
  className: "w-6 h-auto mr-1.5 opacity-80"
3299
- }), " Back to site"), /* @__PURE__ */ React.createElement("button", {
3300
- type: "submit",
2439
+ }), " Back To Site"), /* @__PURE__ */ React.createElement(Button, {
3301
2440
  onClick: () => logout(),
3302
- 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",
3303
- style: { background: "#0084FF" }
2441
+ type: "submit",
2442
+ variant: "primary",
2443
+ size: "custom",
2444
+ className: "text-base h-12 px-6 flex-1"
3304
2445
  }, /* @__PURE__ */ React.createElement(BiLogOut, {
3305
2446
  className: "w-6 h-auto mr-1.5 opacity-80"
3306
- }), " Log out"));
2447
+ }), " Log Out of Tina")));
3307
2448
  };
3308
2449
  const PageWrapper = ({
3309
2450
  children
@@ -3344,17 +2485,127 @@ const DashboardPage = () => {
3344
2485
  }, "Welcome to Tina!")), /* @__PURE__ */ React.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
3345
2486
  });
3346
2487
  };
2488
+ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
2489
+ style: {
2490
+ position: "absolute",
2491
+ top: 0,
2492
+ left: 0,
2493
+ width: "100%",
2494
+ height: "100%",
2495
+ zIndex: 200,
2496
+ opacity: "0.8",
2497
+ display: "flex",
2498
+ alignItems: "start",
2499
+ justifyContent: "center",
2500
+ padding: "120px 40px 40px 40px"
2501
+ }
2502
+ }, /* @__PURE__ */ React.createElement("div", {
2503
+ style: {
2504
+ background: "#FFF",
2505
+ border: "1px solid #EDECF3",
2506
+ boxShadow: "0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1)",
2507
+ borderRadius: "8px",
2508
+ padding: "32px 24px",
2509
+ width: "460px",
2510
+ maxWidth: "90%",
2511
+ display: "flex",
2512
+ alignItems: "center",
2513
+ justifyContent: "center",
2514
+ flexDirection: "column"
2515
+ }
2516
+ }, /* @__PURE__ */ React.createElement("svg", {
2517
+ style: {
2518
+ width: "64px",
2519
+ color: "#2296fe",
2520
+ marginTop: "-8px",
2521
+ marginBottom: "16px"
2522
+ },
2523
+ version: "1.1",
2524
+ id: "L5",
2525
+ xmlns: "http://www.w3.org/2000/svg",
2526
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
2527
+ x: "0px",
2528
+ y: "0px",
2529
+ viewBox: "0 0 100 64",
2530
+ enableBackground: "new 0 0 0 0",
2531
+ xmlSpace: "preserve"
2532
+ }, /* @__PURE__ */ React.createElement("circle", {
2533
+ fill: "currentColor",
2534
+ stroke: "none",
2535
+ cx: 6,
2536
+ cy: 32,
2537
+ r: 6
2538
+ }, /* @__PURE__ */ React.createElement("animateTransform", {
2539
+ attributeName: "transform",
2540
+ dur: "1s",
2541
+ type: "translate",
2542
+ values: "0 15 ; 0 -15; 0 15",
2543
+ calcMode: "spline",
2544
+ keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
2545
+ repeatCount: "indefinite",
2546
+ begin: "0.1"
2547
+ })), /* @__PURE__ */ React.createElement("circle", {
2548
+ fill: "currentColor",
2549
+ stroke: "none",
2550
+ cx: 30,
2551
+ cy: 32,
2552
+ r: 6
2553
+ }, /* @__PURE__ */ React.createElement("animateTransform", {
2554
+ attributeName: "transform",
2555
+ dur: "1s",
2556
+ type: "translate",
2557
+ values: "0 15 ; 0 -10; 0 15",
2558
+ calcMode: "spline",
2559
+ keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
2560
+ repeatCount: "indefinite",
2561
+ begin: "0.2"
2562
+ })), /* @__PURE__ */ React.createElement("circle", {
2563
+ fill: "currentColor",
2564
+ stroke: "none",
2565
+ cx: 54,
2566
+ cy: 32,
2567
+ r: 6
2568
+ }, /* @__PURE__ */ React.createElement("animateTransform", {
2569
+ attributeName: "transform",
2570
+ dur: "1s",
2571
+ type: "translate",
2572
+ values: "0 15 ; 0 -5; 0 15",
2573
+ calcMode: "spline",
2574
+ keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
2575
+ repeatCount: "indefinite",
2576
+ begin: "0.3"
2577
+ }))), /* @__PURE__ */ React.createElement("p", {
2578
+ style: {
2579
+ fontSize: "16px",
2580
+ color: "#716c7f",
2581
+ textAlign: "center",
2582
+ lineHeight: "1.3",
2583
+ fontFamily: "'Inter', sans-serif",
2584
+ fontWeight: "normal"
2585
+ }
2586
+ }, "Please wait, Tina is loading data..."))));
3347
2587
  const useGetCollection = (cms, collectionName, includeDocuments = true) => {
3348
2588
  const api = new TinaAdminApi(cms);
3349
2589
  const [collection, setCollection] = useState(void 0);
2590
+ const [loading, setLoading] = useState(true);
2591
+ const [error, setError] = useState(void 0);
3350
2592
  useEffect(() => {
3351
2593
  const fetchCollection = async () => {
3352
- const response = await api.fetchCollection(collectionName, includeDocuments);
3353
- setCollection(response.getCollection);
2594
+ try {
2595
+ const response = await api.fetchCollection(collectionName, includeDocuments);
2596
+ setCollection(response.getCollection);
2597
+ } catch (error2) {
2598
+ cms.alerts.error(`[${error2.name}] GetCollection failed: ${error2.message}`, 30 * 1e3);
2599
+ console.error(error2);
2600
+ setCollection(void 0);
2601
+ setError(error2);
2602
+ }
2603
+ setLoading(false);
3354
2604
  };
2605
+ setLoading(true);
3355
2606
  fetchCollection();
3356
2607
  }, [cms, collectionName]);
3357
- return collection;
2608
+ return { collection, loading, error };
3358
2609
  };
3359
2610
  const GetCollection = ({
3360
2611
  cms,
@@ -3362,11 +2613,16 @@ const GetCollection = ({
3362
2613
  includeDocuments = true,
3363
2614
  children
3364
2615
  }) => {
3365
- const collection = useGetCollection(cms, collectionName, includeDocuments);
2616
+ const { collection, loading, error } = useGetCollection(cms, collectionName, includeDocuments);
3366
2617
  if (!collection) {
3367
- return null;
2618
+ if (loading) {
2619
+ return /* @__PURE__ */ React.createElement(LoadingPage, null);
2620
+ }
2621
+ if (error) {
2622
+ return null;
2623
+ }
3368
2624
  }
3369
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection));
2625
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading));
3370
2626
  };
3371
2627
  const TemplateMenu = ({ templates }) => {
3372
2628
  return /* @__PURE__ */ React.createElement(Menu, {
@@ -3395,12 +2651,21 @@ const TemplateMenu = ({ templates }) => {
3395
2651
  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"}`
3396
2652
  }, template.label))))))));
3397
2653
  };
2654
+ const handleNavigate = (navigate, cms, collection, document) => {
2655
+ const plugins = cms.plugins.all("tina-admin");
2656
+ const routeMapping = plugins.find(({ name }) => name === "route-mapping");
2657
+ const routeOverride = routeMapping ? routeMapping.mapper(collection, document) : void 0;
2658
+ if (routeOverride) {
2659
+ window.location.href = routeOverride;
2660
+ return null;
2661
+ } else {
2662
+ navigate(document.sys.filename);
2663
+ }
2664
+ };
3398
2665
  const CollectionListPage = () => {
2666
+ const navigate = useNavigate();
3399
2667
  const { collectionName } = useParams();
3400
- useNavigate();
3401
2668
  return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
3402
- const plugins = cms.plugins.all("tina-admin");
3403
- const routeMapping = plugins.find(({ name }) => name === "route-mapping");
3404
2669
  return /* @__PURE__ */ React.createElement(GetCollection, {
3405
2670
  cms,
3406
2671
  collectionName,
@@ -3427,24 +2692,16 @@ const CollectionListPage = () => {
3427
2692
  }, /* @__PURE__ */ React.createElement("tbody", {
3428
2693
  className: "divide-y divide-gray-150"
3429
2694
  }, documents.map((document) => {
3430
- const overrideRoute = routeMapping ? routeMapping.mapper(collection, document.node) : void 0;
3431
2695
  return /* @__PURE__ */ React.createElement("tr", {
3432
2696
  key: `document-${document.node.sys.filename}`,
3433
2697
  className: ""
3434
2698
  }, /* @__PURE__ */ React.createElement("td", {
3435
2699
  className: "px-6 py-2 whitespace-nowrap"
3436
- }, overrideRoute && /* @__PURE__ */ React.createElement("a", {
3437
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3",
3438
- href: `${overrideRoute}`
3439
- }, /* @__PURE__ */ React.createElement(BiEdit, {
3440
- className: "inline-block h-6 w-auto opacity-70"
3441
- }), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("span", {
3442
- className: "block text-xs text-gray-400 mb-1 uppercase"
3443
- }, "Filename"), /* @__PURE__ */ React.createElement("span", {
3444
- className: "h-5 leading-5 block whitespace-nowrap"
3445
- }, document.node.sys.filename))), !overrideRoute && /* @__PURE__ */ React.createElement(Link, {
3446
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3",
3447
- to: `${document.node.sys.filename}`
2700
+ }, /* @__PURE__ */ React.createElement("a", {
2701
+ className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer",
2702
+ onClick: () => {
2703
+ handleNavigate(navigate, cms, collection, document.node);
2704
+ }
3448
2705
  }, /* @__PURE__ */ React.createElement(BiEdit, {
3449
2706
  className: "inline-block h-6 w-auto opacity-70"
3450
2707
  }), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("span", {
@@ -3479,30 +2736,46 @@ const useGetDocumentFields = (cms, collectionName, templateName) => {
3479
2736
  fields: void 0,
3480
2737
  mutationInfo: void 0
3481
2738
  });
2739
+ const [loading, setLoading] = useState(true);
2740
+ const [error, setError] = useState(void 0);
3482
2741
  useEffect(() => {
3483
2742
  const fetchDocumentFields = async () => {
3484
- const response = await api.fetchDocumentFields();
3485
- const documentFields = response.getDocumentFields;
3486
- const collection = documentFields[collectionName].collection;
3487
- const mutationInfo = documentFields[collectionName].mutationInfo;
3488
- let fields = void 0;
3489
- let template = void 0;
3490
- if (templateName && documentFields[collectionName].templates && documentFields[collectionName].templates[templateName]) {
3491
- template = documentFields[collectionName].templates[templateName].template;
3492
- fields = documentFields[collectionName].templates[templateName].fields;
3493
- } else {
3494
- fields = documentFields[collectionName].fields;
2743
+ try {
2744
+ const response = await api.fetchDocumentFields();
2745
+ const documentFields = response.getDocumentFields;
2746
+ const collection = documentFields[collectionName].collection;
2747
+ const mutationInfo = documentFields[collectionName].mutationInfo;
2748
+ let fields = void 0;
2749
+ let template = void 0;
2750
+ if (templateName && documentFields[collectionName].templates && documentFields[collectionName].templates[templateName]) {
2751
+ template = documentFields[collectionName].templates[templateName].template;
2752
+ fields = documentFields[collectionName].templates[templateName].fields;
2753
+ } else {
2754
+ fields = documentFields[collectionName].fields;
2755
+ }
2756
+ setInfo({
2757
+ collection,
2758
+ template,
2759
+ fields,
2760
+ mutationInfo
2761
+ });
2762
+ } catch (error2) {
2763
+ cms.alerts.error(`[${error2.name}] GetDocumentFields failed: ${error2.message}`, 30 * 1e3);
2764
+ console.error(error2);
2765
+ setInfo({
2766
+ collection: void 0,
2767
+ template: void 0,
2768
+ fields: void 0,
2769
+ mutationInfo: void 0
2770
+ });
2771
+ setError(error2);
3495
2772
  }
3496
- setInfo({
3497
- collection,
3498
- template,
3499
- fields,
3500
- mutationInfo
3501
- });
2773
+ setLoading(false);
3502
2774
  };
2775
+ setLoading(true);
3503
2776
  fetchDocumentFields();
3504
2777
  }, [cms, collectionName]);
3505
- return info;
2778
+ return __spreadProps(__spreadValues({}, info), { loading, error });
3506
2779
  };
3507
2780
  const GetDocumentFields = ({
3508
2781
  cms,
@@ -3510,11 +2783,16 @@ const GetDocumentFields = ({
3510
2783
  templateName,
3511
2784
  children
3512
2785
  }) => {
3513
- const { collection, template, fields, mutationInfo } = useGetDocumentFields(cms, collectionName, templateName);
2786
+ const { collection, template, fields, mutationInfo, loading, error } = useGetDocumentFields(cms, collectionName, templateName);
3514
2787
  if (!collection) {
3515
- return null;
2788
+ if (loading) {
2789
+ return /* @__PURE__ */ React.createElement(LoadingPage, null);
2790
+ }
2791
+ if (error) {
2792
+ return null;
2793
+ }
3516
2794
  }
3517
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children({ collection, template, fields, mutationInfo }));
2795
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children({ collection, template, fields, mutationInfo, loading }));
3518
2796
  };
3519
2797
  const createDocument = async (cms, collection, template, mutationInfo, values) => {
3520
2798
  const api = new TinaAdminApi(cms);
@@ -3574,8 +2852,14 @@ const RenderForm$1 = ({ cms, collection, template, fields, mutationInfo }) => {
3574
2852
  ...fields
3575
2853
  ],
3576
2854
  onSubmit: async (values) => {
3577
- await createDocument(cms, collection, template, mutationInfo, values);
3578
- navigate(`/collections/${collection.name}`);
2855
+ try {
2856
+ await createDocument(cms, collection, template, mutationInfo, values);
2857
+ cms.alerts.success("Document created!");
2858
+ navigate(`/collections/${collection.name}`);
2859
+ } catch (error) {
2860
+ cms.alerts.error(`[${error.name}] CreateDocument failed: ${error.message}`, 30 * 1e3);
2861
+ console.error(error);
2862
+ }
3579
2863
  }
3580
2864
  });
3581
2865
  }, [cms, collection, template, fields, mutationInfo]);
@@ -3604,14 +2888,25 @@ const RenderForm$1 = ({ cms, collection, template, fields, mutationInfo }) => {
3604
2888
  const useGetDocument = (cms, collectionName, relativePath) => {
3605
2889
  const api = new TinaAdminApi(cms);
3606
2890
  const [document, setDocument] = useState(void 0);
2891
+ const [loading, setLoading] = useState(true);
2892
+ const [error, setError] = useState(void 0);
3607
2893
  useEffect(() => {
3608
2894
  const fetchDocument = async () => {
3609
- const response = await api.fetchDocument(collectionName, relativePath);
3610
- setDocument(response.getDocument);
2895
+ try {
2896
+ const response = await api.fetchDocument(collectionName, relativePath);
2897
+ setDocument(response.getDocument);
2898
+ } catch (error2) {
2899
+ cms.alerts.error(`[${error2.name}] GetDocument failed: ${error2.message}`, 30 * 1e3);
2900
+ console.error(error2);
2901
+ setDocument(void 0);
2902
+ setError(error2);
2903
+ }
2904
+ setLoading(false);
3611
2905
  };
2906
+ setLoading(true);
3612
2907
  fetchDocument();
3613
2908
  }, [cms, collectionName, relativePath]);
3614
- return document;
2909
+ return { document, loading, error };
3615
2910
  };
3616
2911
  const GetDocument = ({
3617
2912
  cms,
@@ -3619,11 +2914,16 @@ const GetDocument = ({
3619
2914
  relativePath,
3620
2915
  children
3621
2916
  }) => {
3622
- const document = useGetDocument(cms, collectionName, relativePath);
2917
+ const { document, loading, error } = useGetDocument(cms, collectionName, relativePath);
3623
2918
  if (!document) {
3624
- return null;
2919
+ if (loading) {
2920
+ return /* @__PURE__ */ React.createElement(LoadingPage, null);
2921
+ }
2922
+ if (error) {
2923
+ return null;
2924
+ }
3625
2925
  }
3626
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(document));
2926
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(document, loading));
3627
2927
  };
3628
2928
  const updateDocument = async (cms, relativePath, collection, mutationInfo, values) => {
3629
2929
  const api = new TinaAdminApi(cms);
@@ -3664,7 +2964,7 @@ const RenderForm = ({
3664
2964
  mutationInfo
3665
2965
  }) => {
3666
2966
  var _a, _b;
3667
- const navigate = useNavigate();
2967
+ useNavigate();
3668
2968
  const [formIsPristine, setFormIsPristine] = useState(true);
3669
2969
  const form = useMemo(() => {
3670
2970
  return new Form({
@@ -3673,8 +2973,13 @@ const RenderForm = ({
3673
2973
  fields: document.form.fields,
3674
2974
  initialValues: document.values,
3675
2975
  onSubmit: async (values) => {
3676
- await updateDocument(cms, relativePath, collection, mutationInfo, values);
3677
- navigate(`/collections/${collection.name}`);
2976
+ try {
2977
+ await updateDocument(cms, relativePath, collection, mutationInfo, values);
2978
+ cms.alerts.success("Document updated!");
2979
+ } catch (error) {
2980
+ cms.alerts.error(`[${error.name}] UpdateDocument failed: ${error.message}`, 30 * 1e3);
2981
+ console.error(error);
2982
+ }
3678
2983
  }
3679
2984
  });
3680
2985
  }, [cms, document, relativePath, collection, mutationInfo]);
@@ -3734,16 +3039,14 @@ const TinaAdmin = () => {
3734
3039
  return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement(LoginPage, null));
3735
3040
  }
3736
3041
  return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
3737
- const isTinaAdminEnabled = cms.flags.get("tina-admin");
3042
+ const isTinaAdminEnabled = cms.flags.get("tina-admin") === false ? false : true;
3738
3043
  if (isTinaAdminEnabled) {
3739
- return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement(BrowserRouter, {
3740
- basename: "/admin"
3741
- }, /* @__PURE__ */ React.createElement("div", {
3044
+ return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement(HashRouter, null, /* @__PURE__ */ React.createElement("div", {
3742
3045
  className: "flex items-stretch h-screen overflow-hidden"
3743
3046
  }, /* @__PURE__ */ React.createElement(Sidebar, {
3744
3047
  cms
3745
3048
  }), /* @__PURE__ */ React.createElement("div", {
3746
- className: "flex-1"
3049
+ className: "flex-1 relative"
3747
3050
  }, /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
3748
3051
  path: "collections/:collectionName/new",
3749
3052
  element: /* @__PURE__ */ React.createElement(CollectionCreatePage, null)
@@ -3764,9 +3067,7 @@ const TinaAdmin = () => {
3764
3067
  element: /* @__PURE__ */ React.createElement(DashboardPage, null)
3765
3068
  }))))));
3766
3069
  } else {
3767
- return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement(BrowserRouter, {
3768
- basename: "/admin"
3769
- }, /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
3070
+ return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement(HashRouter, null, /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
3770
3071
  path: "logout",
3771
3072
  element: /* @__PURE__ */ React.createElement(LogoutPage, null)
3772
3073
  }), /* @__PURE__ */ React.createElement(Route, {
@@ -3783,4 +3084,10 @@ class RouteMappingPlugin {
3783
3084
  this.mapper = mapper;
3784
3085
  }
3785
3086
  }
3786
- export { AuthWallInner, Client, DEFAULT_LOCAL_TINA_GQL_SERVER_URL, LocalClient, RouteMappingPlugin, TinaAdmin, TinaAdminApi, TinaCMSProvider2, TinaCloudAuthWall, TinaCloudProvider, TinaDataProvider, assertShape, createClient, TinaCMSProvider2 as default, getStaticPropsForTina, gql, safeAssertShape, staticRequest, useDocumentCreatorPlugin, useGraphqlForms, useTinaAuthRedirect };
3087
+ const defineSchema = (config) => {
3088
+ return config;
3089
+ };
3090
+ const defineConfig = (config) => {
3091
+ return config;
3092
+ };
3093
+ export { AuthWallInner, Client, DEFAULT_LOCAL_TINA_GQL_SERVER_URL, LocalClient, RouteMappingPlugin, TinaAdmin, TinaAdminApi, TinaCMSProvider2, TinaCloudAuthWall, TinaCloudProvider, TinaDataProvider, assertShape, createClient, TinaCMSProvider2 as default, defineConfig, defineSchema, getStaticPropsForTina, gql, safeAssertShape, staticRequest, useDocumentCreatorPlugin, useGraphqlForms, useTinaAuthRedirect };