tinacms 0.68.4 → 0.68.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/CHANGELOG.md +34 -0
- package/dist/admin/api.d.ts +8 -10
- package/dist/admin/components/GetCollection.d.ts +3 -2
- package/dist/admin/types.d.ts +7 -0
- package/dist/client.es.js +39 -4
- package/dist/client.js +41 -5
- package/dist/index.es.js +583 -249
- package/dist/index.js +371 -38
- package/dist/style.css +90 -9
- package/dist/tina-cms.d.ts +1 -1
- package/dist/unifiedClient/index.d.ts +18 -5
- package/package.json +4 -3
package/dist/index.es.js
CHANGED
|
@@ -29,21 +29,23 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { useCMS, Form, GlobalFormPlugin, EventBus, Modal, ModalPopup, ModalHeader, ModalBody, ModalActions, Button, LoadingDots, useLocalStorage, TinaCMS, BranchSwitcherPlugin, BranchDataProvider, TinaProvider, Nav, LocalWarning, OverflowMenu, FormStatus, FormBuilder } from "@tinacms/toolkit";
|
|
32
|
+
import { useCMS, Form, GlobalFormPlugin, EventBus, Modal, ModalPopup, ModalHeader, ModalBody, ModalActions, Button as Button$1, LoadingDots, useLocalStorage, TinaCMS, BranchSwitcherPlugin, BranchDataProvider, TinaProvider, Nav, LocalWarning, OverflowMenu, FormStatus, FormBuilder } from "@tinacms/toolkit";
|
|
33
33
|
export * from "@tinacms/toolkit";
|
|
34
34
|
import * as G from "graphql";
|
|
35
35
|
import { TypeInfo, visit, visitWithTypeInfo, getNamedType, GraphQLObjectType, isLeafType, GraphQLUnionType, isScalarType as isScalarType$1, getIntrospectionQuery, buildClientSchema, print, parse } from "graphql";
|
|
36
36
|
import set from "lodash.set";
|
|
37
|
-
import
|
|
37
|
+
import * as React from "react";
|
|
38
|
+
import React__default, { useState, useCallback, useEffect, Fragment, useMemo } from "react";
|
|
38
39
|
import { getIn, setIn } from "final-form";
|
|
39
40
|
import { resolveForm, TinaSchema, addNamespaceToSchema, validateSchema } from "@tinacms/schema-tools";
|
|
40
41
|
import gql$1 from "graphql-tag";
|
|
41
42
|
import * as yup from "yup";
|
|
42
|
-
import styled from "styled-components";
|
|
43
|
+
import styled, { css, createGlobalStyle } from "styled-components";
|
|
43
44
|
import { setEditing, TinaDataContext, useEditState } from "@tinacms/sharedctx";
|
|
44
45
|
import UrlPattern from "url-pattern";
|
|
45
|
-
import { NavLink, useNavigate, useParams, Link, HashRouter, Routes, Route } from "react-router-dom";
|
|
46
|
-
import {
|
|
46
|
+
import { NavLink, useNavigate, useParams, useLocation, Link, HashRouter, Routes, Route } from "react-router-dom";
|
|
47
|
+
import { Transition, Menu } from "@headlessui/react";
|
|
48
|
+
import { useWindowWidth } from "@react-hook/window-size";
|
|
47
49
|
function popupWindow(url, title, window2, w, h) {
|
|
48
50
|
const y = window2.top.outerHeight / 2 + window2.top.screenY - h / 2;
|
|
49
51
|
const x = window2.top.outerWidth / 2 + window2.top.screenX - w / 2;
|
|
@@ -1660,8 +1662,8 @@ const useFormify = ({
|
|
|
1660
1662
|
formify: formifyFunc,
|
|
1661
1663
|
eventList
|
|
1662
1664
|
}) => {
|
|
1663
|
-
const formIds =
|
|
1664
|
-
const [state, dispatch] =
|
|
1665
|
+
const formIds = React__default.useRef([]);
|
|
1666
|
+
const [state, dispatch] = React__default.useReducer(reducer, {
|
|
1665
1667
|
status: "idle",
|
|
1666
1668
|
schema: void 0,
|
|
1667
1669
|
query: query ? G.parse(query) : null,
|
|
@@ -1673,7 +1675,7 @@ const useFormify = ({
|
|
|
1673
1675
|
formNodes: [],
|
|
1674
1676
|
documentForms: []
|
|
1675
1677
|
});
|
|
1676
|
-
|
|
1678
|
+
React__default.useEffect(() => {
|
|
1677
1679
|
if (query) {
|
|
1678
1680
|
dispatch({ type: "start", value: { query } });
|
|
1679
1681
|
formIds.current.forEach((formId) => {
|
|
@@ -1684,7 +1686,7 @@ const useFormify = ({
|
|
|
1684
1686
|
});
|
|
1685
1687
|
}
|
|
1686
1688
|
}, [query, JSON.stringify(variables)]);
|
|
1687
|
-
|
|
1689
|
+
React__default.useEffect(() => {
|
|
1688
1690
|
if (state.status === "initialized") {
|
|
1689
1691
|
cms.api.tina.request(query, { variables }).then((res) => {
|
|
1690
1692
|
delete res.paths;
|
|
@@ -1692,7 +1694,7 @@ const useFormify = ({
|
|
|
1692
1694
|
});
|
|
1693
1695
|
}
|
|
1694
1696
|
}, [state.status]);
|
|
1695
|
-
|
|
1697
|
+
React__default.useEffect(() => {
|
|
1696
1698
|
const run = async () => {
|
|
1697
1699
|
const schema = await cms.api.tina.getSchema();
|
|
1698
1700
|
const result = await formify({
|
|
@@ -1709,7 +1711,7 @@ const useFormify = ({
|
|
|
1709
1711
|
run();
|
|
1710
1712
|
}
|
|
1711
1713
|
}, [state.status]);
|
|
1712
|
-
|
|
1714
|
+
React__default.useEffect(() => {
|
|
1713
1715
|
const run = async () => {
|
|
1714
1716
|
const result = await cms.api.tina.request(G.print(state.query), {
|
|
1715
1717
|
variables
|
|
@@ -1761,7 +1763,7 @@ const useFormify = ({
|
|
|
1761
1763
|
run();
|
|
1762
1764
|
}
|
|
1763
1765
|
}, [state.status]);
|
|
1764
|
-
|
|
1766
|
+
React__default.useEffect(() => {
|
|
1765
1767
|
if (state.status === "ready") {
|
|
1766
1768
|
cms.events.subscribe(`forms:reset`, (event) => {
|
|
1767
1769
|
if (eventList) {
|
|
@@ -1815,7 +1817,7 @@ const useFormify = ({
|
|
|
1815
1817
|
dispatch({ type: "done" });
|
|
1816
1818
|
}
|
|
1817
1819
|
}, [state.status]);
|
|
1818
|
-
|
|
1820
|
+
React__default.useEffect(() => {
|
|
1819
1821
|
state.changeSets.forEach((changeSet) => {
|
|
1820
1822
|
if (changeSet.mutationType.type === "reset") {
|
|
1821
1823
|
const form = cms.forms.find(changeSet.formId);
|
|
@@ -1911,10 +1913,10 @@ const useFormify = ({
|
|
|
1911
1913
|
}
|
|
1912
1914
|
});
|
|
1913
1915
|
}, [state.changeSets.length]);
|
|
1914
|
-
|
|
1916
|
+
React__default.useEffect(() => {
|
|
1915
1917
|
formIds.current = state.documentForms.map((df) => df.id);
|
|
1916
1918
|
}, [state.documentForms.length]);
|
|
1917
|
-
|
|
1919
|
+
React__default.useEffect(() => {
|
|
1918
1920
|
return () => {
|
|
1919
1921
|
formIds.current.forEach((formId) => {
|
|
1920
1922
|
const form = cms.forms.find(formId);
|
|
@@ -1924,7 +1926,7 @@ const useFormify = ({
|
|
|
1924
1926
|
});
|
|
1925
1927
|
};
|
|
1926
1928
|
}, []);
|
|
1927
|
-
const resolveSubFields =
|
|
1929
|
+
const resolveSubFields = React__default.useCallback(async (args) => {
|
|
1928
1930
|
const { form, formNode, prefix, loc } = args;
|
|
1929
1931
|
const data = {};
|
|
1930
1932
|
await sequential(form.fields, async (field) => {
|
|
@@ -2376,9 +2378,9 @@ class LocalClient extends Client {
|
|
|
2376
2378
|
}
|
|
2377
2379
|
}
|
|
2378
2380
|
function ModalBuilder(modalProps) {
|
|
2379
|
-
return /* @__PURE__ */
|
|
2381
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(ModalPopup, null, /* @__PURE__ */ React__default.createElement(ModalHeader, null, modalProps.title), /* @__PURE__ */ React__default.createElement(ModalBody, {
|
|
2380
2382
|
padded: true
|
|
2381
|
-
}, /* @__PURE__ */
|
|
2383
|
+
}, /* @__PURE__ */ React__default.createElement("p", null, modalProps.message), modalProps.error && /* @__PURE__ */ React__default.createElement(ErrorLabel, null, modalProps.error)), /* @__PURE__ */ React__default.createElement(ModalActions, null, modalProps.actions.map((action) => /* @__PURE__ */ React__default.createElement(AsyncButton, __spreadValues({
|
|
2382
2384
|
key: action.name
|
|
2383
2385
|
}, action))))));
|
|
2384
2386
|
}
|
|
@@ -2397,12 +2399,12 @@ const AsyncButton = ({ name, primary, action }) => {
|
|
|
2397
2399
|
throw e;
|
|
2398
2400
|
}
|
|
2399
2401
|
}, [action, setSubmitting]);
|
|
2400
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
2401
2403
|
variant: primary ? "primary" : "secondary",
|
|
2402
2404
|
onClick,
|
|
2403
2405
|
busy: submitting,
|
|
2404
2406
|
disabled: submitting
|
|
2405
|
-
}, submitting && /* @__PURE__ */
|
|
2407
|
+
}, submitting && /* @__PURE__ */ React__default.createElement(LoadingDots, null), !submitting && name);
|
|
2406
2408
|
};
|
|
2407
2409
|
const TINA_AUTH_CONFIG = "tina_auth_config";
|
|
2408
2410
|
const useTinaAuthRedirect = () => {
|
|
@@ -2423,6 +2425,7 @@ class TinaAdminApi {
|
|
|
2423
2425
|
constructor(cms) {
|
|
2424
2426
|
this.api = cms.api.tina;
|
|
2425
2427
|
this.schema = cms.api.tina.schema;
|
|
2428
|
+
this.useDataLayer = cms.flags.get("experimentalData");
|
|
2426
2429
|
}
|
|
2427
2430
|
async isAuthenticated() {
|
|
2428
2431
|
return await this.api.isAuthenticated();
|
|
@@ -2447,21 +2450,30 @@ class TinaAdminApi {
|
|
|
2447
2450
|
}
|
|
2448
2451
|
}`, { variables: { collection, relativePath } });
|
|
2449
2452
|
}
|
|
2450
|
-
async fetchCollection(collectionName, includeDocuments) {
|
|
2453
|
+
async fetchCollection(collectionName, includeDocuments, after) {
|
|
2451
2454
|
if (includeDocuments === true) {
|
|
2452
|
-
|
|
2453
|
-
|
|
2455
|
+
if (this.useDataLayer) {
|
|
2456
|
+
const sort = this.schema.getIsTitleFieldName(collectionName);
|
|
2457
|
+
const response = await this.api.request(`#graphql
|
|
2458
|
+
query($collection: String!, $includeDocuments: Boolean!, $sort: String, $limit: Float, $after: String){
|
|
2454
2459
|
collection(collection: $collection){
|
|
2455
2460
|
name
|
|
2456
2461
|
label
|
|
2457
2462
|
format
|
|
2458
2463
|
templates
|
|
2459
|
-
documents @include(if: $includeDocuments) {
|
|
2464
|
+
documents(sort: $sort, after: $after, first: $limit) @include(if: $includeDocuments) {
|
|
2460
2465
|
totalCount
|
|
2466
|
+
pageInfo {
|
|
2467
|
+
hasPreviousPage
|
|
2468
|
+
hasNextPage
|
|
2469
|
+
startCursor
|
|
2470
|
+
endCursor
|
|
2471
|
+
}
|
|
2461
2472
|
edges {
|
|
2462
2473
|
node {
|
|
2463
2474
|
... on Document {
|
|
2464
2475
|
_sys {
|
|
2476
|
+
title
|
|
2465
2477
|
template
|
|
2466
2478
|
breadcrumbs
|
|
2467
2479
|
path
|
|
@@ -2475,8 +2487,46 @@ class TinaAdminApi {
|
|
|
2475
2487
|
}
|
|
2476
2488
|
}
|
|
2477
2489
|
}
|
|
2478
|
-
}`, {
|
|
2479
|
-
|
|
2490
|
+
}`, {
|
|
2491
|
+
variables: {
|
|
2492
|
+
collection: collectionName,
|
|
2493
|
+
includeDocuments,
|
|
2494
|
+
sort,
|
|
2495
|
+
limit: 10,
|
|
2496
|
+
after
|
|
2497
|
+
}
|
|
2498
|
+
});
|
|
2499
|
+
return response.collection;
|
|
2500
|
+
} else {
|
|
2501
|
+
const response = await this.api.request(`#graphql
|
|
2502
|
+
query($collection: String!, $includeDocuments: Boolean!){
|
|
2503
|
+
collection(collection: $collection){
|
|
2504
|
+
name
|
|
2505
|
+
label
|
|
2506
|
+
format
|
|
2507
|
+
templates
|
|
2508
|
+
documents @include(if: $includeDocuments) {
|
|
2509
|
+
totalCount
|
|
2510
|
+
edges {
|
|
2511
|
+
node {
|
|
2512
|
+
... on Document {
|
|
2513
|
+
_sys {
|
|
2514
|
+
template
|
|
2515
|
+
breadcrumbs
|
|
2516
|
+
path
|
|
2517
|
+
basename
|
|
2518
|
+
relativePath
|
|
2519
|
+
filename
|
|
2520
|
+
extension
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
}`, { variables: { collection: collectionName, includeDocuments } });
|
|
2528
|
+
return response.collection;
|
|
2529
|
+
}
|
|
2480
2530
|
} else {
|
|
2481
2531
|
try {
|
|
2482
2532
|
const collection = this.schema.getCollection(collectionName);
|
|
@@ -2545,7 +2595,7 @@ const AuthWallInner = ({
|
|
|
2545
2595
|
const client = cms.api.tina;
|
|
2546
2596
|
const [activeModal, setActiveModal] = useState(null);
|
|
2547
2597
|
const [showChildren, setShowChildren] = useState(false);
|
|
2548
|
-
|
|
2598
|
+
React__default.useEffect(() => {
|
|
2549
2599
|
client.isAuthenticated().then((isAuthenticated) => {
|
|
2550
2600
|
if (isAuthenticated) {
|
|
2551
2601
|
setShowChildren(true);
|
|
@@ -2570,7 +2620,7 @@ const AuthWallInner = ({
|
|
|
2570
2620
|
setActiveModal(null);
|
|
2571
2621
|
}
|
|
2572
2622
|
}) : [];
|
|
2573
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, activeModal === "authenticate" && /* @__PURE__ */ React__default.createElement(ModalBuilder, {
|
|
2574
2624
|
title: "Tina Cloud Authorization",
|
|
2575
2625
|
message: "To save edits, Tina Cloud authorization is required. On save, changes will get commited using your account.",
|
|
2576
2626
|
close,
|
|
@@ -2599,12 +2649,14 @@ const TinaCloudProvider = (props) => {
|
|
|
2599
2649
|
const baseBranch = props.branch || "main";
|
|
2600
2650
|
const [currentBranch, setCurrentBranch] = useLocalStorage("tinacms-current-branch", baseBranch);
|
|
2601
2651
|
useTinaAuthRedirect();
|
|
2602
|
-
const cms =
|
|
2652
|
+
const cms = React__default.useMemo(() => props.cms || new TinaCMS({
|
|
2603
2653
|
enabled: true,
|
|
2604
2654
|
sidebar: true
|
|
2605
2655
|
}), [props.cms]);
|
|
2606
2656
|
if (!cms.api.tina) {
|
|
2607
|
-
cms.registerApi("tina", createClient(props));
|
|
2657
|
+
cms.registerApi("tina", createClient(__spreadProps(__spreadValues({}, props), { branch: currentBranch })));
|
|
2658
|
+
} else {
|
|
2659
|
+
cms.api.tina.setBranch(currentBranch);
|
|
2608
2660
|
}
|
|
2609
2661
|
if (!cms.api.admin) {
|
|
2610
2662
|
cms.registerApi("admin", new TinaAdminApi(cms));
|
|
@@ -2633,15 +2685,15 @@ const TinaCloudProvider = (props) => {
|
|
|
2633
2685
|
return newBranch;
|
|
2634
2686
|
};
|
|
2635
2687
|
setupMedia();
|
|
2636
|
-
const [branchingEnabled, setBranchingEnabled] =
|
|
2637
|
-
|
|
2688
|
+
const [branchingEnabled, setBranchingEnabled] = React__default.useState(() => cms.flags.get("branch-switcher"));
|
|
2689
|
+
React__default.useEffect(() => {
|
|
2638
2690
|
cms.events.subscribe("flag:set", ({ key, value }) => {
|
|
2639
2691
|
if (key === "branch-switcher") {
|
|
2640
2692
|
setBranchingEnabled(value);
|
|
2641
2693
|
}
|
|
2642
2694
|
});
|
|
2643
2695
|
}, [cms.events]);
|
|
2644
|
-
|
|
2696
|
+
React__default.useEffect(() => {
|
|
2645
2697
|
let branchSwitcher;
|
|
2646
2698
|
if (branchingEnabled) {
|
|
2647
2699
|
branchSwitcher = new BranchSwitcherPlugin({
|
|
@@ -2656,24 +2708,24 @@ const TinaCloudProvider = (props) => {
|
|
|
2656
2708
|
}
|
|
2657
2709
|
};
|
|
2658
2710
|
}, [branchingEnabled, props.branch]);
|
|
2659
|
-
|
|
2711
|
+
React__default.useEffect(() => {
|
|
2660
2712
|
if (props.cmsCallback) {
|
|
2661
2713
|
props.cmsCallback(cms);
|
|
2662
2714
|
}
|
|
2663
2715
|
}, []);
|
|
2664
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ React__default.createElement(BranchDataProvider, {
|
|
2665
2717
|
currentBranch,
|
|
2666
2718
|
setCurrentBranch: (b) => {
|
|
2667
2719
|
setCurrentBranch(b);
|
|
2668
2720
|
}
|
|
2669
|
-
}, /* @__PURE__ */
|
|
2721
|
+
}, /* @__PURE__ */ React__default.createElement(TinaProvider, {
|
|
2670
2722
|
cms
|
|
2671
|
-
}, /* @__PURE__ */
|
|
2723
|
+
}, /* @__PURE__ */ React__default.createElement(AuthWallInner, __spreadProps(__spreadValues({}, props), {
|
|
2672
2724
|
cms
|
|
2673
2725
|
}))));
|
|
2674
2726
|
};
|
|
2675
2727
|
const TinaCloudAuthWall = TinaCloudProvider;
|
|
2676
|
-
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-0 {\n width: 0px;\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-600 {\n --tw-text-opacity: 1;\n color: rgb(86 81 101 / var(--tw-text-opacity));\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-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 .text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity));\n}\n.tina-tailwind .underline {\n text-decoration-line: underline;\n}\n.tina-tailwind .opacity-100 {\n opacity: 1;\n}\n.tina-tailwind .opacity-90 {\n opacity: .9;\n}\n.tina-tailwind .opacity-80 {\n opacity: .8;\n}\n.tina-tailwind .opacity-50 {\n opacity: .5;\n}\n.tina-tailwind .opacity-70 {\n opacity: .7;\n}\n.tina-tailwind .opacity-0 {\n opacity: 0;\n}\n.tina-tailwind .shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.tina-tailwind .shadow-2xl {\n --tw-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.tina-tailwind .shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.tina-tailwind .ring-1 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n.tina-tailwind .ring-black {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity));\n}\n.tina-tailwind .ring-opacity-5 {\n --tw-ring-opacity: .05;\n}\n.tina-tailwind .filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.tina-tailwind .transition-opacity {\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.tina-tailwind .duration-300 {\n transition-duration: 300ms;\n}\n.tina-tailwind .duration-150 {\n transition-duration: 150ms;\n}\n.tina-tailwind .duration-100 {\n transition-duration: 100ms;\n}\n.tina-tailwind .duration-75 {\n transition-duration: 75ms;\n}\n.tina-tailwind .ease-out {\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n}\n.tina-tailwind .ease-in {\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.tina-tailwind .icon-parent svg {\n fill: currentColor;\n }\n\n.tina-tailwind {\n font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n font-size: 16px;\n line-height: 1.5;\n --tw-text-opacity: 1;\n color: rgb(86 81 101 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .hover\\:bg-blue-600:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(5 116 228 / var(--tw-bg-opacity));\n}\n\n.tina-tailwind .hover\\:text-blue-600:hover {\n --tw-text-opacity: 1;\n color: rgb(5 116 228 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .hover\\:text-blue-400:hover {\n --tw-text-opacity: 1;\n color: rgb(34 150 254 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .hover\\:opacity-100:hover {\n opacity: 1;\n}\n\n.tina-tailwind .focus\\:text-blue-400:focus {\n --tw-text-opacity: 1;\n color: rgb(34 150 254 / var(--tw-text-opacity));\n}\n\n.tina-tailwind .focus\\:underline:focus {\n text-decoration-line: underline;\n}\n\n.tina-tailwind .focus\\:shadow-outline:focus {\n --tw-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);\n --tw-shadow-colored: 0 0 0 3px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.tina-tailwind .focus\\:outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.tina-tailwind .focus\\:ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.tina-tailwind .focus\\:ring-blue-500:focus {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(0 132 255 / var(--tw-ring-opacity));\n}\n';
|
|
2728
|
+
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 .pointer-events-auto {\n pointer-events: auto;\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 .inset-0 {\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n}\n.tina-tailwind .left-0 {\n left: 0px;\n}\n.tina-tailwind .top-0 {\n top: 0px;\n}\n.tina-tailwind .top-8 {\n top: 32px;\n}\n.tina-tailwind .right-0 {\n right: 0px;\n}\n.tina-tailwind .top-10 {\n top: 40px;\n}\n.tina-tailwind .top-4 {\n top: 16px;\n}\n.tina-tailwind .z-overlay {\n z-index: 10600;\n}\n.tina-tailwind .z-menu {\n z-index: 9800;\n}\n.tina-tailwind .z-50 {\n z-index: 50;\n}\n.tina-tailwind .mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.tina-tailwind .-ml-px {\n margin-left: -1px;\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-7 {\n height: 28px;\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-0 {\n width: 0px;\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 .-translate-x-full {\n --tw-translate-x: -100%;\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 .translate-x-0 {\n --tw-translate-x: 0px;\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 .translate-x-full {\n --tw-translate-x: 100%;\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-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 {\n border-radius: 4px;\n}\n.tina-tailwind .rounded-full {\n border-radius: 9999px;\n}\n.tina-tailwind .rounded-md {\n border-radius: 6px;\n}\n.tina-tailwind .rounded-r-md {\n border-top-right-radius: 6px;\n border-bottom-right-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 .bg-gradient-to-br {\n background-image: linear-gradient(to bottom right, 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 .from-gray-800 {\n --tw-gradient-from: #363145;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(54 49 69 / 0));\n}\n.tina-tailwind .via-gray-900 {\n --tw-gradient-stops: var(--tw-gradient-from), #252336, var(--tw-gradient-to, rgb(37 35 54 / 0));\n}\n.tina-tailwind .to-gray-900 {\n --tw-gradient-to: #252336;\n}\n.tina-tailwind .to-black {\n --tw-gradient-to: #000;\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 .py-5 {\n padding-top: 20px;\n padding-bottom: 20px;\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 .pt-3 {\n padding-top: 12px;\n}\n.tina-tailwind .pl-18 {\n padding-left: 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-600 {\n --tw-text-opacity: 1;\n color: rgb(86 81 101 / var(--tw-text-opacity));\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-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 .text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / 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-0 {\n opacity: 0;\n}\n.tina-tailwind .opacity-80 {\n opacity: .8;\n}\n.tina-tailwind .opacity-90 {\n opacity: .9;\n}\n.tina-tailwind .opacity-50 {\n opacity: .5;\n}\n.tina-tailwind .opacity-70 {\n opacity: .7;\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-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-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 {\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-200 {\n transition-duration: 200ms;\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';
|
|
2677
2729
|
class ContentCreatorPlugin {
|
|
2678
2730
|
constructor(options) {
|
|
2679
2731
|
this.__type = "content-creator";
|
|
@@ -2722,9 +2774,9 @@ class ContentCreatorPlugin {
|
|
|
2722
2774
|
}
|
|
2723
2775
|
const useDocumentCreatorPlugin = (args) => {
|
|
2724
2776
|
const cms = useCMS();
|
|
2725
|
-
const [values, setValues] =
|
|
2726
|
-
const [plugin, setPlugin] =
|
|
2727
|
-
|
|
2777
|
+
const [values, setValues] = React__default.useState({});
|
|
2778
|
+
const [plugin, setPlugin] = React__default.useState(null);
|
|
2779
|
+
React__default.useEffect(() => {
|
|
2728
2780
|
const run = async () => {
|
|
2729
2781
|
var _a;
|
|
2730
2782
|
const res = await cms.api.tina.request((gql2) => gql2`
|
|
@@ -2825,7 +2877,7 @@ const useDocumentCreatorPlugin = (args) => {
|
|
|
2825
2877
|
};
|
|
2826
2878
|
run();
|
|
2827
2879
|
}, [cms]);
|
|
2828
|
-
|
|
2880
|
+
React__default.useEffect(() => {
|
|
2829
2881
|
if (plugin) {
|
|
2830
2882
|
cms.plugins.add(plugin);
|
|
2831
2883
|
}
|
|
@@ -2846,10 +2898,10 @@ function useTina({
|
|
|
2846
2898
|
state,
|
|
2847
2899
|
isDummyContainer,
|
|
2848
2900
|
isLoading: contextLoading
|
|
2849
|
-
} =
|
|
2901
|
+
} = React__default.useContext(TinaDataContext);
|
|
2850
2902
|
const [waitForContextRerender, setWaitForContextRerender] = useState(!isDummyContainer);
|
|
2851
2903
|
const isLoading = contextLoading || waitForContextRerender;
|
|
2852
|
-
|
|
2904
|
+
React__default.useEffect(() => {
|
|
2853
2905
|
setRequest({ query, variables });
|
|
2854
2906
|
}, [JSON.stringify(variables), query]);
|
|
2855
2907
|
useEffect(() => {
|
|
@@ -2901,7 +2953,7 @@ const errorButtonStyles = {
|
|
|
2901
2953
|
color: "white",
|
|
2902
2954
|
margin: "1rem 0"
|
|
2903
2955
|
};
|
|
2904
|
-
class ErrorBoundary extends
|
|
2956
|
+
class ErrorBoundary extends React__default.Component {
|
|
2905
2957
|
constructor(props) {
|
|
2906
2958
|
super(props);
|
|
2907
2959
|
this.state = {
|
|
@@ -2917,7 +2969,7 @@ class ErrorBoundary extends React.Component {
|
|
|
2917
2969
|
const branchData = window.localStorage && window.localStorage.getItem("tinacms-current-branch");
|
|
2918
2970
|
const hasBranchData = branchData && branchData.length > 0;
|
|
2919
2971
|
if (this.state.hasError && !this.state.pageRefresh) {
|
|
2920
|
-
return /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2921
2973
|
style: {
|
|
2922
2974
|
background: "#efefef",
|
|
2923
2975
|
height: "100vh",
|
|
@@ -2925,7 +2977,7 @@ class ErrorBoundary extends React.Component {
|
|
|
2925
2977
|
alignItems: "center",
|
|
2926
2978
|
justifyContent: "center"
|
|
2927
2979
|
}
|
|
2928
|
-
}, /* @__PURE__ */
|
|
2980
|
+
}, /* @__PURE__ */ React__default.createElement("style", null, " body { margin: 0; } "), /* @__PURE__ */ React__default.createElement("div", {
|
|
2929
2981
|
style: {
|
|
2930
2982
|
background: "#fff",
|
|
2931
2983
|
maxWidth: "400px",
|
|
@@ -2934,27 +2986,27 @@ class ErrorBoundary extends React.Component {
|
|
|
2934
2986
|
borderRadius: "5px",
|
|
2935
2987
|
boxShadow: "0 6px 24px rgb(0 37 91 / 5%), 0 2px 4px rgb(0 37 91 / 3%)"
|
|
2936
2988
|
}
|
|
2937
|
-
}, /* @__PURE__ */
|
|
2989
|
+
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
2938
2990
|
style: { color: "#eb6337" }
|
|
2939
|
-
}, "TinaCMS Render Error"), /* @__PURE__ */
|
|
2991
|
+
}, "TinaCMS Render Error"), /* @__PURE__ */ React__default.createElement("p", null, "Tina caught an error while updating the page:"), /* @__PURE__ */ React__default.createElement("pre", {
|
|
2940
2992
|
style: { marginTop: "1rem", overflowX: "auto" }
|
|
2941
|
-
}, this.state.message), /* @__PURE__ */
|
|
2993
|
+
}, this.state.message), /* @__PURE__ */ React__default.createElement("br", null), /* @__PURE__ */ React__default.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__default.createElement("p", null, "See our", " ", /* @__PURE__ */ React__default.createElement("a", {
|
|
2942
2994
|
className: "text-gray-600",
|
|
2943
2995
|
style: { textDecoration: "underline" },
|
|
2944
2996
|
href: "https://tina.io/docs/errors/faq/",
|
|
2945
2997
|
target: "_blank"
|
|
2946
|
-
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */
|
|
2998
|
+
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */ React__default.createElement("button", {
|
|
2947
2999
|
style: errorButtonStyles,
|
|
2948
3000
|
onClick: () => {
|
|
2949
3001
|
this.setState({ pageRefresh: true });
|
|
2950
3002
|
setTimeout(() => this.setState({ hasError: false, pageRefresh: false }), 3e3);
|
|
2951
3003
|
}
|
|
2952
|
-
}, "Refresh"), hasBranchData && /* @__PURE__ */
|
|
3004
|
+
}, "Refresh"), hasBranchData && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.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__default.createElement("p", null, "See our", " ", /* @__PURE__ */ React__default.createElement("a", {
|
|
2953
3005
|
className: "text-gray-600",
|
|
2954
3006
|
style: { textDecoration: "underline" },
|
|
2955
3007
|
href: "https://tina.io/docs/errors/faq/",
|
|
2956
3008
|
target: "_blank"
|
|
2957
|
-
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */
|
|
3009
|
+
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */ React__default.createElement("button", {
|
|
2958
3010
|
style: errorButtonStyles,
|
|
2959
3011
|
onClick: () => {
|
|
2960
3012
|
window.localStorage.removeItem("tinacms-current-branch");
|
|
@@ -2963,7 +3015,7 @@ class ErrorBoundary extends React.Component {
|
|
|
2963
3015
|
}, "Switch to default branch"))));
|
|
2964
3016
|
}
|
|
2965
3017
|
if (this.state.pageRefresh) {
|
|
2966
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ React__default.createElement(Loader, null, "Let's try that again.");
|
|
2967
3019
|
}
|
|
2968
3020
|
return this.props.children;
|
|
2969
3021
|
}
|
|
@@ -2994,7 +3046,7 @@ const TinaCMSProvider2 = (_c) => {
|
|
|
2994
3046
|
if (!schema) {
|
|
2995
3047
|
throw new Error("`schema` is required to be passed as a property to `TinaProvider`. You can learn more about this change here: https://github.com/tinacms/tinacms/pull/2823");
|
|
2996
3048
|
}
|
|
2997
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TinaCloudProvider, {
|
|
2998
3050
|
branch,
|
|
2999
3051
|
clientId,
|
|
3000
3052
|
tinaioConfig: props.tinaioConfig,
|
|
@@ -3002,11 +3054,11 @@ const TinaCMSProvider2 = (_c) => {
|
|
|
3002
3054
|
cmsCallback: props.cmsCallback,
|
|
3003
3055
|
mediaStore: props.mediaStore,
|
|
3004
3056
|
schema
|
|
3005
|
-
}, /* @__PURE__ */
|
|
3057
|
+
}, /* @__PURE__ */ React__default.createElement("style", null, styles), /* @__PURE__ */ React__default.createElement(ErrorBoundary, null, /* @__PURE__ */ React__default.createElement(DocumentCreator, {
|
|
3006
3058
|
documentCreatorCallback
|
|
3007
|
-
}), /* @__PURE__ */
|
|
3059
|
+
}), /* @__PURE__ */ React__default.createElement(TinaDataProvider, {
|
|
3008
3060
|
formifyCallback
|
|
3009
|
-
}, typeof props.children == "function" ? /* @__PURE__ */
|
|
3061
|
+
}, typeof props.children == "function" ? /* @__PURE__ */ React__default.createElement(TinaQuery, __spreadProps(__spreadValues({}, props), {
|
|
3010
3062
|
variables: props.variables,
|
|
3011
3063
|
data: props.data,
|
|
3012
3064
|
query,
|
|
@@ -3021,7 +3073,7 @@ const DocumentCreator = ({
|
|
|
3021
3073
|
return null;
|
|
3022
3074
|
};
|
|
3023
3075
|
const TinaQuery = (props) => {
|
|
3024
|
-
return /* @__PURE__ */
|
|
3076
|
+
return /* @__PURE__ */ React__default.createElement(TinaQueryInner, __spreadValues({
|
|
3025
3077
|
key: `rootQuery-${props.query}`
|
|
3026
3078
|
}, props));
|
|
3027
3079
|
};
|
|
@@ -3032,24 +3084,24 @@ const TinaQueryInner = (_e) => {
|
|
|
3032
3084
|
variables: props.variables,
|
|
3033
3085
|
data: props.data
|
|
3034
3086
|
});
|
|
3035
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(isLoading || !props.query ? props : __spreadProps(__spreadValues({}, props), { data: liveData })));
|
|
3036
3088
|
};
|
|
3037
3089
|
const TinaDataProvider = ({
|
|
3038
3090
|
children,
|
|
3039
3091
|
formifyCallback
|
|
3040
3092
|
}) => {
|
|
3041
3093
|
const [request, setRequest] = useState();
|
|
3042
|
-
const [state, setState] =
|
|
3094
|
+
const [state, setState] = React__default.useState({
|
|
3043
3095
|
payload: void 0,
|
|
3044
3096
|
isLoading: true
|
|
3045
3097
|
});
|
|
3046
|
-
return /* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ React__default.createElement(TinaDataContext.Provider, {
|
|
3047
3099
|
value: {
|
|
3048
3100
|
setRequest,
|
|
3049
3101
|
isLoading: state.isLoading,
|
|
3050
3102
|
state: { payload: state.payload }
|
|
3051
3103
|
}
|
|
3052
|
-
}, /* @__PURE__ */
|
|
3104
|
+
}, /* @__PURE__ */ React__default.createElement(FormRegistrar, {
|
|
3053
3105
|
key: request == null ? void 0 : request.query,
|
|
3054
3106
|
request,
|
|
3055
3107
|
formifyCallback,
|
|
@@ -3073,13 +3125,13 @@ const FormRegistrar = ({
|
|
|
3073
3125
|
}
|
|
3074
3126
|
}
|
|
3075
3127
|
});
|
|
3076
|
-
|
|
3128
|
+
React__default.useEffect(() => {
|
|
3077
3129
|
onPayloadStateChange({ payload, isLoading });
|
|
3078
3130
|
}, [JSON.stringify(payload), isLoading]);
|
|
3079
|
-
return isLoading ? /* @__PURE__ */
|
|
3131
|
+
return isLoading ? /* @__PURE__ */ React__default.createElement(Loader, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null)) : null;
|
|
3080
3132
|
};
|
|
3081
3133
|
const Loader = (props) => {
|
|
3082
|
-
return /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3083
3135
|
style: {
|
|
3084
3136
|
position: "fixed",
|
|
3085
3137
|
background: "rgba(0, 0, 0, 0.5)",
|
|
@@ -3091,7 +3143,7 @@ const Loader = (props) => {
|
|
|
3091
3143
|
justifyContent: "center",
|
|
3092
3144
|
padding: "40px"
|
|
3093
3145
|
}
|
|
3094
|
-
}, /* @__PURE__ */
|
|
3146
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3095
3147
|
style: {
|
|
3096
3148
|
background: "#f6f6f9",
|
|
3097
3149
|
boxShadow: "0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
@@ -3104,7 +3156,7 @@ const Loader = (props) => {
|
|
|
3104
3156
|
justifyContent: "center",
|
|
3105
3157
|
flexDirection: "column"
|
|
3106
3158
|
}
|
|
3107
|
-
}, /* @__PURE__ */
|
|
3159
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
3108
3160
|
style: {
|
|
3109
3161
|
width: "64px",
|
|
3110
3162
|
color: "#2296fe",
|
|
@@ -3120,13 +3172,13 @@ const Loader = (props) => {
|
|
|
3120
3172
|
viewBox: "0 0 100 64",
|
|
3121
3173
|
enableBackground: "new 0 0 0 0",
|
|
3122
3174
|
xmlSpace: "preserve"
|
|
3123
|
-
}, /* @__PURE__ */
|
|
3175
|
+
}, /* @__PURE__ */ React__default.createElement("circle", {
|
|
3124
3176
|
fill: "currentColor",
|
|
3125
3177
|
stroke: "none",
|
|
3126
3178
|
cx: 6,
|
|
3127
3179
|
cy: 32,
|
|
3128
3180
|
r: 6
|
|
3129
|
-
}, /* @__PURE__ */
|
|
3181
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3130
3182
|
attributeName: "transform",
|
|
3131
3183
|
dur: "1s",
|
|
3132
3184
|
type: "translate",
|
|
@@ -3135,13 +3187,13 @@ const Loader = (props) => {
|
|
|
3135
3187
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3136
3188
|
repeatCount: "indefinite",
|
|
3137
3189
|
begin: "0.1"
|
|
3138
|
-
})), /* @__PURE__ */
|
|
3190
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3139
3191
|
fill: "currentColor",
|
|
3140
3192
|
stroke: "none",
|
|
3141
3193
|
cx: 30,
|
|
3142
3194
|
cy: 32,
|
|
3143
3195
|
r: 6
|
|
3144
|
-
}, /* @__PURE__ */
|
|
3196
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3145
3197
|
attributeName: "transform",
|
|
3146
3198
|
dur: "1s",
|
|
3147
3199
|
type: "translate",
|
|
@@ -3150,13 +3202,13 @@ const Loader = (props) => {
|
|
|
3150
3202
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3151
3203
|
repeatCount: "indefinite",
|
|
3152
3204
|
begin: "0.2"
|
|
3153
|
-
})), /* @__PURE__ */
|
|
3205
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3154
3206
|
fill: "currentColor",
|
|
3155
3207
|
stroke: "none",
|
|
3156
3208
|
cx: 54,
|
|
3157
3209
|
cy: 32,
|
|
3158
3210
|
r: 6
|
|
3159
|
-
}, /* @__PURE__ */
|
|
3211
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3160
3212
|
attributeName: "transform",
|
|
3161
3213
|
dur: "1s",
|
|
3162
3214
|
type: "translate",
|
|
@@ -3165,7 +3217,7 @@ const Loader = (props) => {
|
|
|
3165
3217
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3166
3218
|
repeatCount: "indefinite",
|
|
3167
3219
|
begin: "0.3"
|
|
3168
|
-
}))), /* @__PURE__ */
|
|
3220
|
+
}))), /* @__PURE__ */ React__default.createElement("p", {
|
|
3169
3221
|
style: {
|
|
3170
3222
|
fontSize: "18px",
|
|
3171
3223
|
color: "#252336",
|
|
@@ -3222,7 +3274,7 @@ function gql(strings, ...args) {
|
|
|
3222
3274
|
return str;
|
|
3223
3275
|
}
|
|
3224
3276
|
const Layout = ({ children }) => {
|
|
3225
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("style", null, styles), /* @__PURE__ */ React__default.createElement("div", {
|
|
3226
3278
|
className: "tina-tailwind",
|
|
3227
3279
|
style: {
|
|
3228
3280
|
position: "fixed",
|
|
@@ -3244,7 +3296,7 @@ var DefaultContext = {
|
|
|
3244
3296
|
style: void 0,
|
|
3245
3297
|
attr: void 0
|
|
3246
3298
|
};
|
|
3247
|
-
var IconContext =
|
|
3299
|
+
var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
|
|
3248
3300
|
var __assign = function() {
|
|
3249
3301
|
__assign = Object.assign || function(t) {
|
|
3250
3302
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -3271,14 +3323,14 @@ var __rest = function(s, e) {
|
|
|
3271
3323
|
};
|
|
3272
3324
|
function Tree2Element(tree) {
|
|
3273
3325
|
return tree && tree.map(function(node2, i) {
|
|
3274
|
-
return
|
|
3326
|
+
return React__default.createElement(node2.tag, __assign({
|
|
3275
3327
|
key: i
|
|
3276
3328
|
}, node2.attr), Tree2Element(node2.child));
|
|
3277
3329
|
});
|
|
3278
3330
|
}
|
|
3279
3331
|
function GenIcon(data) {
|
|
3280
3332
|
return function(props) {
|
|
3281
|
-
return
|
|
3333
|
+
return React__default.createElement(IconBase, __assign({
|
|
3282
3334
|
attr: __assign({}, data.attr)
|
|
3283
3335
|
}, props), Tree2Element(data.child));
|
|
3284
3336
|
};
|
|
@@ -3292,7 +3344,7 @@ function IconBase(props) {
|
|
|
3292
3344
|
className = conf.className;
|
|
3293
3345
|
if (props.className)
|
|
3294
3346
|
className = (className ? className + " " : "") + props.className;
|
|
3295
|
-
return
|
|
3347
|
+
return React__default.createElement("svg", __assign({
|
|
3296
3348
|
stroke: "currentColor",
|
|
3297
3349
|
fill: "currentColor",
|
|
3298
3350
|
strokeWidth: "0"
|
|
@@ -3304,9 +3356,9 @@ function IconBase(props) {
|
|
|
3304
3356
|
height: computedSize,
|
|
3305
3357
|
width: computedSize,
|
|
3306
3358
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3307
|
-
}), title &&
|
|
3359
|
+
}), title && React__default.createElement("title", null, title), props.children);
|
|
3308
3360
|
};
|
|
3309
|
-
return IconContext !== void 0 ?
|
|
3361
|
+
return IconContext !== void 0 ? React__default.createElement(IconContext.Consumer, null, function(conf) {
|
|
3310
3362
|
return elem(conf);
|
|
3311
3363
|
}) : elem(DefaultContext);
|
|
3312
3364
|
}
|
|
@@ -3338,64 +3390,153 @@ const useGetCollections = (cms) => {
|
|
|
3338
3390
|
}, [cms]);
|
|
3339
3391
|
return { collections, loading, error };
|
|
3340
3392
|
};
|
|
3393
|
+
function IoMdClose(props) {
|
|
3394
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z" } }] })(props);
|
|
3395
|
+
}
|
|
3396
|
+
function BiEdit(props) {
|
|
3397
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m7 17.013 4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z" } }, { "tag": "path", "attr": { "d": "M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z" } }] })(props);
|
|
3398
|
+
}
|
|
3399
|
+
function BiLeftArrowAlt(props) {
|
|
3400
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M12.707 17.293 8.414 13H18v-2H8.414l4.293-4.293-1.414-1.414L4.586 12l6.707 6.707z" } }] })(props);
|
|
3401
|
+
}
|
|
3402
|
+
function BiLogIn(props) {
|
|
3403
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m13 16 5-4-5-4v3H4v2h9z" } }, { "tag": "path", "attr": { "d": "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" } }] })(props);
|
|
3404
|
+
}
|
|
3405
|
+
function BiLogOut(props) {
|
|
3406
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M16 13v-2H7V8l-5 4 5 4v-3z" } }, { "tag": "path", "attr": { "d": "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" } }] })(props);
|
|
3407
|
+
}
|
|
3408
|
+
function BiMenu(props) {
|
|
3409
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" } }] })(props);
|
|
3410
|
+
}
|
|
3411
|
+
function BiPlus(props) {
|
|
3412
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z" } }] })(props);
|
|
3413
|
+
}
|
|
3414
|
+
function BiRightArrowAlt(props) {
|
|
3415
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m11.293 17.293 1.414 1.414L19.414 12l-6.707-6.707-1.414 1.414L15.586 11H6v2h9.586z" } }] })(props);
|
|
3416
|
+
}
|
|
3417
|
+
function BiTrash(props) {
|
|
3418
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z" } }, { "tag": "path", "attr": { "d": "M9 10h2v8H9zm4 0h2v8h-2z" } }] })(props);
|
|
3419
|
+
}
|
|
3341
3420
|
const slugify = (text) => {
|
|
3342
3421
|
return text.toString().toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "_").replace(/^-+|-+$/g, "");
|
|
3343
3422
|
};
|
|
3344
3423
|
const Sidebar = ({ cms }) => {
|
|
3424
|
+
var _a, _b;
|
|
3345
3425
|
const collectionsInfo = useGetCollections(cms);
|
|
3346
3426
|
const screens = cms.plugins.getType("screen").all();
|
|
3347
|
-
|
|
3427
|
+
const [menuIsOpen, setMenuIsOpen] = React__default.useState(false);
|
|
3428
|
+
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
3429
|
+
const navBreakpoint = 1e3;
|
|
3430
|
+
const windowWidth = useWindowWidth();
|
|
3431
|
+
const renderDesktopNav = windowWidth > navBreakpoint;
|
|
3432
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDesktopNav && /* @__PURE__ */ React__default.createElement(Nav, {
|
|
3348
3433
|
sidebarWidth: 360,
|
|
3349
3434
|
showCollections: true,
|
|
3350
3435
|
collectionsInfo,
|
|
3351
3436
|
screens,
|
|
3352
3437
|
contentCreators: [],
|
|
3353
|
-
RenderNavSite: ({ view }) => /* @__PURE__ */
|
|
3438
|
+
RenderNavSite: ({ view }) => /* @__PURE__ */ React__default.createElement(SidebarLink, {
|
|
3354
3439
|
label: view.name,
|
|
3355
3440
|
to: `screens/${slugify(view.name)}`,
|
|
3356
3441
|
Icon: view.Icon ? view.Icon : ImFilesEmpty
|
|
3357
3442
|
}),
|
|
3358
|
-
RenderNavCollection: ({ collection }) => /* @__PURE__ */
|
|
3443
|
+
RenderNavCollection: ({ collection }) => /* @__PURE__ */ React__default.createElement(SidebarLink, {
|
|
3359
3444
|
label: collection.label ? collection.label : collection.name,
|
|
3360
3445
|
to: `collections/${collection.name}`,
|
|
3361
3446
|
Icon: ImFilesEmpty
|
|
3362
3447
|
})
|
|
3363
|
-
})
|
|
3448
|
+
}), !renderDesktopNav && /* @__PURE__ */ React__default.createElement(Transition, {
|
|
3449
|
+
show: menuIsOpen
|
|
3450
|
+
}, /* @__PURE__ */ React__default.createElement(Transition.Child, {
|
|
3451
|
+
as: React__default.Fragment,
|
|
3452
|
+
enter: "transform transition-all ease-out duration-300",
|
|
3453
|
+
enterFrom: "opacity-0 -translate-x-full",
|
|
3454
|
+
enterTo: "opacity-100 translate-x-0",
|
|
3455
|
+
leave: "transform transition-all ease-in duration-200",
|
|
3456
|
+
leaveFrom: "opacity-100 translate-x-0",
|
|
3457
|
+
leaveTo: "opacity-0 -translate-x-full"
|
|
3458
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3459
|
+
className: "fixed left-0 top-0 z-overlay h-full transform"
|
|
3460
|
+
}, /* @__PURE__ */ React__default.createElement(Nav, {
|
|
3461
|
+
className: "rounded-r-md",
|
|
3462
|
+
sidebarWidth: 360,
|
|
3463
|
+
showCollections: true,
|
|
3464
|
+
collectionsInfo,
|
|
3465
|
+
screens,
|
|
3466
|
+
contentCreators: [],
|
|
3467
|
+
RenderNavSite: ({ view }) => /* @__PURE__ */ React__default.createElement(SidebarLink, {
|
|
3468
|
+
label: view.name,
|
|
3469
|
+
to: `screens/${slugify(view.name)}`,
|
|
3470
|
+
Icon: view.Icon ? view.Icon : ImFilesEmpty,
|
|
3471
|
+
onClick: () => {
|
|
3472
|
+
setMenuIsOpen(false);
|
|
3473
|
+
}
|
|
3474
|
+
}),
|
|
3475
|
+
RenderNavCollection: ({ collection }) => /* @__PURE__ */ React__default.createElement(SidebarLink, {
|
|
3476
|
+
label: collection.label ? collection.label : collection.name,
|
|
3477
|
+
to: `collections/${collection.name}`,
|
|
3478
|
+
Icon: ImFilesEmpty,
|
|
3479
|
+
onClick: () => {
|
|
3480
|
+
setMenuIsOpen(false);
|
|
3481
|
+
}
|
|
3482
|
+
})
|
|
3483
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3484
|
+
className: "absolute top-8 right-0 transform translate-x-full overflow-hidden"
|
|
3485
|
+
}, /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3486
|
+
rounded: "right",
|
|
3487
|
+
variant: "secondary",
|
|
3488
|
+
onClick: () => {
|
|
3489
|
+
setMenuIsOpen(false);
|
|
3490
|
+
},
|
|
3491
|
+
className: `transition-opacity duration-150 ease-out`
|
|
3492
|
+
}, /* @__PURE__ */ React__default.createElement(IoMdClose, {
|
|
3493
|
+
className: "h-6 w-auto"
|
|
3494
|
+
})))))), /* @__PURE__ */ React__default.createElement(Transition.Child, {
|
|
3495
|
+
as: React__default.Fragment,
|
|
3496
|
+
enter: "ease-out duration-300",
|
|
3497
|
+
enterFrom: "opacity-0",
|
|
3498
|
+
enterTo: "opacity-80",
|
|
3499
|
+
entered: "opacity-80",
|
|
3500
|
+
leave: "ease-in duration-200",
|
|
3501
|
+
leaveFrom: "opacity-80",
|
|
3502
|
+
leaveTo: "opacity-0"
|
|
3503
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3504
|
+
onClick: () => {
|
|
3505
|
+
setMenuIsOpen(false);
|
|
3506
|
+
},
|
|
3507
|
+
className: "fixed z-menu inset-0 bg-gradient-to-br from-gray-800 via-gray-900 to-black"
|
|
3508
|
+
}))), !renderDesktopNav && /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3509
|
+
rounded: "right",
|
|
3510
|
+
variant: "secondary",
|
|
3511
|
+
onClick: () => {
|
|
3512
|
+
setMenuIsOpen(true);
|
|
3513
|
+
},
|
|
3514
|
+
className: `pointer-events-auto -ml-px absolute left-0 z-50 ${isLocalMode ? `top-10` : `top-4`}`
|
|
3515
|
+
}, /* @__PURE__ */ React__default.createElement(BiMenu, {
|
|
3516
|
+
className: "h-7 w-auto"
|
|
3517
|
+
})));
|
|
3364
3518
|
};
|
|
3365
3519
|
const SidebarLink = (props) => {
|
|
3366
3520
|
const { to, label, Icon } = props;
|
|
3367
|
-
return /* @__PURE__ */
|
|
3521
|
+
return /* @__PURE__ */ React__default.createElement(NavLink, {
|
|
3368
3522
|
className: ({ isActive }) => {
|
|
3369
3523
|
return `text-base tracking-wide ${isActive ? "text-blue-600" : "text-gray-500"} hover:text-blue-600 flex items-center opacity-90 hover:opacity-100`;
|
|
3370
3524
|
},
|
|
3525
|
+
onClick: props.onClick ? props.onClick : () => {
|
|
3526
|
+
},
|
|
3371
3527
|
to
|
|
3372
|
-
}, /* @__PURE__ */
|
|
3528
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
3373
3529
|
className: "mr-2 h-6 opacity-80 w-auto"
|
|
3374
3530
|
}), " ", label);
|
|
3375
3531
|
};
|
|
3376
3532
|
const GetCMS = ({ children }) => {
|
|
3377
3533
|
try {
|
|
3378
3534
|
const cms = useCMS();
|
|
3379
|
-
return /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(cms));
|
|
3380
3536
|
} catch (e) {
|
|
3381
3537
|
return null;
|
|
3382
3538
|
}
|
|
3383
3539
|
};
|
|
3384
|
-
function BiEdit(props) {
|
|
3385
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m7 17.013 4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z" } }, { "tag": "path", "attr": { "d": "M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z" } }] })(props);
|
|
3386
|
-
}
|
|
3387
|
-
function BiLogIn(props) {
|
|
3388
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m13 16 5-4-5-4v3H4v2h9z" } }, { "tag": "path", "attr": { "d": "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" } }] })(props);
|
|
3389
|
-
}
|
|
3390
|
-
function BiLogOut(props) {
|
|
3391
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M16 13v-2H7V8l-5 4 5 4v-3z" } }, { "tag": "path", "attr": { "d": "M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z" } }] })(props);
|
|
3392
|
-
}
|
|
3393
|
-
function BiPlus(props) {
|
|
3394
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z" } }] })(props);
|
|
3395
|
-
}
|
|
3396
|
-
function BiTrash(props) {
|
|
3397
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z" } }, { "tag": "path", "attr": { "d": "M9 10h2v8H9zm4 0h2v8h-2z" } }] })(props);
|
|
3398
|
-
}
|
|
3399
3540
|
function MdOutlineArrowBack(props) {
|
|
3400
3541
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" } }] })(props);
|
|
3401
3542
|
}
|
|
@@ -3403,52 +3544,52 @@ const AuthTemplate = ({
|
|
|
3403
3544
|
message,
|
|
3404
3545
|
children
|
|
3405
3546
|
}) => {
|
|
3406
|
-
return /* @__PURE__ */
|
|
3547
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3407
3548
|
className: "h-screen w-full bg-gradient-to-b from-blue-900 to-gray-900 flex items-center justify-center px-4 py-6"
|
|
3408
|
-
}, /* @__PURE__ */
|
|
3549
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3409
3550
|
className: "bg-white rounded-lg overflow-hidden shadow-lg w-full max-w-lg"
|
|
3410
|
-
}, /* @__PURE__ */
|
|
3551
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3411
3552
|
className: "px-5 py-4 border-b border-gray-150"
|
|
3412
|
-
}, /* @__PURE__ */
|
|
3553
|
+
}, /* @__PURE__ */ React__default.createElement("h2", {
|
|
3413
3554
|
className: "text-2xl tracking-wide text-gray-700 flex items-center gap-0.5"
|
|
3414
|
-
}, /* @__PURE__ */
|
|
3555
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
3415
3556
|
viewBox: "0 0 32 32",
|
|
3416
3557
|
fill: "#EC4815",
|
|
3417
3558
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3418
3559
|
className: "w-10 h-auto"
|
|
3419
|
-
}, /* @__PURE__ */
|
|
3560
|
+
}, /* @__PURE__ */ React__default.createElement("path", {
|
|
3420
3561
|
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"
|
|
3421
|
-
}), /* @__PURE__ */
|
|
3562
|
+
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
3422
3563
|
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"
|
|
3423
|
-
})), /* @__PURE__ */
|
|
3564
|
+
})), /* @__PURE__ */ React__default.createElement("span", null, "Tina"))), message && /* @__PURE__ */ React__default.createElement("div", {
|
|
3424
3565
|
className: "px-5 pt-4"
|
|
3425
|
-
}, /* @__PURE__ */
|
|
3566
|
+
}, /* @__PURE__ */ React__default.createElement("p", {
|
|
3426
3567
|
className: "text-base font-sans leading-normal"
|
|
3427
|
-
}, message)), /* @__PURE__ */
|
|
3568
|
+
}, message)), /* @__PURE__ */ React__default.createElement("div", {
|
|
3428
3569
|
className: "px-5 py-4 flex gap-4 w-full justify-between"
|
|
3429
3570
|
}, children)));
|
|
3430
3571
|
};
|
|
3431
3572
|
const LoginPage = () => {
|
|
3432
3573
|
const { setEdit } = useEditState();
|
|
3433
3574
|
const login = () => setEdit(true);
|
|
3434
|
-
return /* @__PURE__ */
|
|
3575
|
+
return /* @__PURE__ */ React__default.createElement(AuthTemplate, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3435
3576
|
className: "flex w-full flex-1 gap-4 items-center justify-end"
|
|
3436
|
-
}, /* @__PURE__ */
|
|
3577
|
+
}, /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3437
3578
|
onClick: () => {
|
|
3438
3579
|
window.location.href = "/";
|
|
3439
3580
|
},
|
|
3440
3581
|
variant: "white",
|
|
3441
3582
|
size: "custom",
|
|
3442
3583
|
className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
|
|
3443
|
-
}, /* @__PURE__ */
|
|
3584
|
+
}, /* @__PURE__ */ React__default.createElement(MdOutlineArrowBack, {
|
|
3444
3585
|
className: "w-6 h-auto mr-1.5 opacity-80"
|
|
3445
|
-
}), " Back To Site"), /* @__PURE__ */
|
|
3586
|
+
}), " Back To Site"), /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3446
3587
|
onClick: () => login(),
|
|
3447
3588
|
variant: "primary",
|
|
3448
3589
|
size: "custom",
|
|
3449
3590
|
className: "text-base h-12 px-6 flex-1",
|
|
3450
3591
|
type: "submit"
|
|
3451
|
-
}, /* @__PURE__ */
|
|
3592
|
+
}, /* @__PURE__ */ React__default.createElement(BiLogIn, {
|
|
3452
3593
|
className: "w-6 h-auto mr-2 opacity-80"
|
|
3453
3594
|
}), " Edit With Tina")));
|
|
3454
3595
|
};
|
|
@@ -3457,67 +3598,67 @@ const logout = () => {
|
|
|
3457
3598
|
window.location.href = "/";
|
|
3458
3599
|
};
|
|
3459
3600
|
const LogoutPage = () => {
|
|
3460
|
-
return /* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ React__default.createElement(AuthTemplate, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3461
3602
|
className: "flex w-full flex-1 gap-4 items-center justify-end"
|
|
3462
|
-
}, /* @__PURE__ */
|
|
3603
|
+
}, /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3463
3604
|
onClick: () => {
|
|
3464
3605
|
window.location.href = "/";
|
|
3465
3606
|
},
|
|
3466
3607
|
variant: "white",
|
|
3467
3608
|
size: "custom",
|
|
3468
3609
|
className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
|
|
3469
|
-
}, /* @__PURE__ */
|
|
3610
|
+
}, /* @__PURE__ */ React__default.createElement(MdOutlineArrowBack, {
|
|
3470
3611
|
className: "w-6 h-auto mr-1.5 opacity-80"
|
|
3471
|
-
}), " Back To Site"), /* @__PURE__ */
|
|
3612
|
+
}), " Back To Site"), /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3472
3613
|
onClick: () => logout(),
|
|
3473
3614
|
type: "submit",
|
|
3474
3615
|
variant: "primary",
|
|
3475
3616
|
size: "custom",
|
|
3476
3617
|
className: "text-base h-12 px-6 flex-1"
|
|
3477
|
-
}, /* @__PURE__ */
|
|
3618
|
+
}, /* @__PURE__ */ React__default.createElement(BiLogOut, {
|
|
3478
3619
|
className: "w-6 h-auto mr-1.5 opacity-80"
|
|
3479
3620
|
}), " Log Out of Tina")));
|
|
3480
3621
|
};
|
|
3481
3622
|
const PageWrapper = ({
|
|
3482
3623
|
children
|
|
3483
3624
|
}) => {
|
|
3484
|
-
return /* @__PURE__ */
|
|
3625
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3485
3626
|
className: "relative left-0 w-full h-full bg-gray-50 shadow-2xl overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100"
|
|
3486
3627
|
}, children);
|
|
3487
3628
|
};
|
|
3488
3629
|
const PageHeader = ({
|
|
3489
3630
|
isLocalMode,
|
|
3490
3631
|
children
|
|
3491
|
-
}) => /* @__PURE__ */
|
|
3632
|
+
}) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement("div", {
|
|
3492
3633
|
className: "bg-white pb-4 pt-18 border-b border-gray-200 px-12"
|
|
3493
|
-
}, /* @__PURE__ */
|
|
3634
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3494
3635
|
className: "w-full mx-auto max-w-screen-xl"
|
|
3495
|
-
}, /* @__PURE__ */
|
|
3636
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3496
3637
|
className: "w-full flex justify-between items-end"
|
|
3497
3638
|
}, children))));
|
|
3498
3639
|
const PageBody = ({
|
|
3499
3640
|
children
|
|
3500
|
-
}) => /* @__PURE__ */
|
|
3641
|
+
}) => /* @__PURE__ */ React__default.createElement("div", {
|
|
3501
3642
|
className: "py-10 px-12"
|
|
3502
3643
|
}, children);
|
|
3503
3644
|
const PageBodyNarrow = ({
|
|
3504
3645
|
children
|
|
3505
|
-
}) => /* @__PURE__ */
|
|
3646
|
+
}) => /* @__PURE__ */ React__default.createElement("div", {
|
|
3506
3647
|
className: "py-10 px-12"
|
|
3507
|
-
}, /* @__PURE__ */
|
|
3648
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3508
3649
|
className: "w-full mx-auto max-w-screen-xl"
|
|
3509
3650
|
}, children));
|
|
3510
3651
|
const DashboardPage = () => {
|
|
3511
|
-
return /* @__PURE__ */
|
|
3652
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
3512
3653
|
var _a, _b;
|
|
3513
|
-
return /* @__PURE__ */
|
|
3654
|
+
return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(PageHeader, {
|
|
3514
3655
|
isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode
|
|
3515
|
-
}, /* @__PURE__ */
|
|
3656
|
+
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
3516
3657
|
className: "text-2xl text-gray-700"
|
|
3517
|
-
}, "Welcome to Tina!")), /* @__PURE__ */
|
|
3658
|
+
}, "Welcome to Tina!")), /* @__PURE__ */ React__default.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
|
|
3518
3659
|
});
|
|
3519
3660
|
};
|
|
3520
|
-
const LoadingPage = () => /* @__PURE__ */
|
|
3661
|
+
const LoadingPage = () => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3521
3662
|
style: {
|
|
3522
3663
|
position: "absolute",
|
|
3523
3664
|
top: 0,
|
|
@@ -3531,7 +3672,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3531
3672
|
justifyContent: "center",
|
|
3532
3673
|
padding: "120px 40px 40px 40px"
|
|
3533
3674
|
}
|
|
3534
|
-
}, /* @__PURE__ */
|
|
3675
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3535
3676
|
style: {
|
|
3536
3677
|
background: "#FFF",
|
|
3537
3678
|
border: "1px solid #EDECF3",
|
|
@@ -3545,7 +3686,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3545
3686
|
justifyContent: "center",
|
|
3546
3687
|
flexDirection: "column"
|
|
3547
3688
|
}
|
|
3548
|
-
}, /* @__PURE__ */
|
|
3689
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
3549
3690
|
style: {
|
|
3550
3691
|
width: "64px",
|
|
3551
3692
|
color: "#2296fe",
|
|
@@ -3561,13 +3702,13 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3561
3702
|
viewBox: "0 0 100 64",
|
|
3562
3703
|
enableBackground: "new 0 0 0 0",
|
|
3563
3704
|
xmlSpace: "preserve"
|
|
3564
|
-
}, /* @__PURE__ */
|
|
3705
|
+
}, /* @__PURE__ */ React__default.createElement("circle", {
|
|
3565
3706
|
fill: "currentColor",
|
|
3566
3707
|
stroke: "none",
|
|
3567
3708
|
cx: 6,
|
|
3568
3709
|
cy: 32,
|
|
3569
3710
|
r: 6
|
|
3570
|
-
}, /* @__PURE__ */
|
|
3711
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3571
3712
|
attributeName: "transform",
|
|
3572
3713
|
dur: "1s",
|
|
3573
3714
|
type: "translate",
|
|
@@ -3576,13 +3717,13 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3576
3717
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3577
3718
|
repeatCount: "indefinite",
|
|
3578
3719
|
begin: "0.1"
|
|
3579
|
-
})), /* @__PURE__ */
|
|
3720
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3580
3721
|
fill: "currentColor",
|
|
3581
3722
|
stroke: "none",
|
|
3582
3723
|
cx: 30,
|
|
3583
3724
|
cy: 32,
|
|
3584
3725
|
r: 6
|
|
3585
|
-
}, /* @__PURE__ */
|
|
3726
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3586
3727
|
attributeName: "transform",
|
|
3587
3728
|
dur: "1s",
|
|
3588
3729
|
type: "translate",
|
|
@@ -3591,13 +3732,13 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3591
3732
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3592
3733
|
repeatCount: "indefinite",
|
|
3593
3734
|
begin: "0.2"
|
|
3594
|
-
})), /* @__PURE__ */
|
|
3735
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3595
3736
|
fill: "currentColor",
|
|
3596
3737
|
stroke: "none",
|
|
3597
3738
|
cx: 54,
|
|
3598
3739
|
cy: 32,
|
|
3599
3740
|
r: 6
|
|
3600
|
-
}, /* @__PURE__ */
|
|
3741
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3601
3742
|
attributeName: "transform",
|
|
3602
3743
|
dur: "1s",
|
|
3603
3744
|
type: "translate",
|
|
@@ -3606,7 +3747,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3606
3747
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3607
3748
|
repeatCount: "indefinite",
|
|
3608
3749
|
begin: "0.3"
|
|
3609
|
-
}))), /* @__PURE__ */
|
|
3750
|
+
}))), /* @__PURE__ */ React__default.createElement("p", {
|
|
3610
3751
|
style: {
|
|
3611
3752
|
fontSize: "16px",
|
|
3612
3753
|
color: "#716c7f",
|
|
@@ -3616,7 +3757,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3616
3757
|
fontWeight: "normal"
|
|
3617
3758
|
}
|
|
3618
3759
|
}, "Please wait, Tina is loading data..."))));
|
|
3619
|
-
const useGetCollection = (cms, collectionName, includeDocuments = true) => {
|
|
3760
|
+
const useGetCollection = (cms, collectionName, includeDocuments = true, after = "") => {
|
|
3620
3761
|
const api = new TinaAdminApi(cms);
|
|
3621
3762
|
const [collection, setCollection] = useState(void 0);
|
|
3622
3763
|
const [loading, setLoading] = useState(true);
|
|
@@ -3626,7 +3767,7 @@ const useGetCollection = (cms, collectionName, includeDocuments = true) => {
|
|
|
3626
3767
|
const fetchCollection = async () => {
|
|
3627
3768
|
if (await api.isAuthenticated()) {
|
|
3628
3769
|
try {
|
|
3629
|
-
const collection2 = await api.fetchCollection(collectionName, includeDocuments);
|
|
3770
|
+
const collection2 = await api.fetchCollection(collectionName, includeDocuments, after);
|
|
3630
3771
|
setCollection(collection2);
|
|
3631
3772
|
} catch (error2) {
|
|
3632
3773
|
cms.alerts.error(`[${error2.name}] GetCollection failed: ${error2.message}`, 30 * 1e3);
|
|
@@ -3639,7 +3780,7 @@ const useGetCollection = (cms, collectionName, includeDocuments = true) => {
|
|
|
3639
3780
|
};
|
|
3640
3781
|
setLoading(true);
|
|
3641
3782
|
fetchCollection();
|
|
3642
|
-
}, [cms, collectionName, resetState]);
|
|
3783
|
+
}, [cms, collectionName, resetState, after]);
|
|
3643
3784
|
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
3644
3785
|
return { collection, loading, error, reFetchCollection };
|
|
3645
3786
|
};
|
|
@@ -3647,26 +3788,169 @@ const GetCollection = ({
|
|
|
3647
3788
|
cms,
|
|
3648
3789
|
collectionName,
|
|
3649
3790
|
includeDocuments = true,
|
|
3791
|
+
startCursor,
|
|
3650
3792
|
children
|
|
3651
3793
|
}) => {
|
|
3652
|
-
const { collection, loading, error, reFetchCollection } = useGetCollection(cms, collectionName, includeDocuments);
|
|
3794
|
+
const { collection, loading, error, reFetchCollection } = useGetCollection(cms, collectionName, includeDocuments, startCursor || "");
|
|
3653
3795
|
if (error) {
|
|
3654
3796
|
return null;
|
|
3655
3797
|
}
|
|
3656
3798
|
if (loading) {
|
|
3657
|
-
return /* @__PURE__ */
|
|
3799
|
+
return /* @__PURE__ */ React__default.createElement(LoadingPage, null);
|
|
3800
|
+
}
|
|
3801
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(collection, loading, reFetchCollection));
|
|
3802
|
+
};
|
|
3803
|
+
const theme = css`
|
|
3804
|
+
:root {
|
|
3805
|
+
--tina-color-primary-light: #2296fe;
|
|
3806
|
+
--tina-color-primary: #0084ff;
|
|
3807
|
+
--tina-color-primary-dark: #0574e4;
|
|
3808
|
+
--tina-color-error-light: #eb6337;
|
|
3809
|
+
--tina-color-error: #ec4815;
|
|
3810
|
+
--tina-color-error-dark: #dc4419;
|
|
3811
|
+
--tina-color-warning-light: #f5e06e;
|
|
3812
|
+
--tina-color-warning: #e9d050;
|
|
3813
|
+
--tina-color-warning-dark: #d3ba38;
|
|
3814
|
+
--tina-color-success-light: #57c355;
|
|
3815
|
+
--tina-color-success: #3cad3a;
|
|
3816
|
+
--tina-color-success-dark: #249a21;
|
|
3817
|
+
--tina-color-grey-0: #ffffff;
|
|
3818
|
+
--tina-color-grey-1: #f6f6f9;
|
|
3819
|
+
--tina-color-grey-2: #edecf3;
|
|
3820
|
+
--tina-color-grey-3: #e1ddec;
|
|
3821
|
+
--tina-color-grey-4: #b2adbe;
|
|
3822
|
+
--tina-color-grey-5: #918c9e;
|
|
3823
|
+
--tina-color-grey-6: #716c7f;
|
|
3824
|
+
--tina-color-grey-7: #565165;
|
|
3825
|
+
--tina-color-grey-8: #433e52;
|
|
3826
|
+
--tina-color-grey-9: #363145;
|
|
3827
|
+
--tina-color-grey-10: #252336;
|
|
3828
|
+
--tina-color-indicator: var(--tina-color-primary);
|
|
3829
|
+
|
|
3830
|
+
--tina-radius-small: 5px;
|
|
3831
|
+
--tina-radius-big: 24px;
|
|
3832
|
+
|
|
3833
|
+
--tina-padding-small: 12px;
|
|
3834
|
+
--tina-padding-big: 20px;
|
|
3835
|
+
|
|
3836
|
+
--tina-font-size-0: 12px;
|
|
3837
|
+
--tina-font-size-1: 13px;
|
|
3838
|
+
--tina-font-size-2: 15px;
|
|
3839
|
+
--tina-font-size-3: 16px;
|
|
3840
|
+
--tina-font-size-4: 18px;
|
|
3841
|
+
--tina-font-size-5: 20px;
|
|
3842
|
+
--tina-font-size-6: 22px;
|
|
3843
|
+
--tina-font-size-7: 26px;
|
|
3844
|
+
--tina-font-size-8: 32px;
|
|
3845
|
+
|
|
3846
|
+
--tina-font-family: 'Inter', sans-serif;
|
|
3847
|
+
|
|
3848
|
+
--tina-font-weight-regular: 400;
|
|
3849
|
+
--tina-font-weight-bold: 600;
|
|
3850
|
+
|
|
3851
|
+
--tina-shadow-big: 0px 2px 3px rgba(0, 0, 0, 0.05),
|
|
3852
|
+
0 4px 12px rgba(0, 0, 0, 0.1);
|
|
3853
|
+
--tina-shadow-small: 0px 2px 3px rgba(0, 0, 0, 0.12);
|
|
3854
|
+
|
|
3855
|
+
--tina-timing-short: 85ms;
|
|
3856
|
+
--tina-timing-medium: 150ms;
|
|
3857
|
+
--tina-timing-long: 250ms;
|
|
3858
|
+
|
|
3859
|
+
--tina-z-index-0: 0;
|
|
3860
|
+
--tina-z-index-1: 10;
|
|
3861
|
+
--tina-z-index-2: 20;
|
|
3862
|
+
--tina-z-index-3: 30;
|
|
3863
|
+
--tina-z-index-4: 40;
|
|
3864
|
+
--tina-z-index-5: 50;
|
|
3865
|
+
|
|
3866
|
+
--tina-sidebar-width: 340px;
|
|
3867
|
+
--tina-sidebar-header-height: 60px;
|
|
3868
|
+
--tina-toolbar-height: 62px;
|
|
3658
3869
|
}
|
|
3659
|
-
|
|
3870
|
+
`;
|
|
3871
|
+
createGlobalStyle`
|
|
3872
|
+
${theme};
|
|
3873
|
+
`;
|
|
3874
|
+
const Button = (_g) => {
|
|
3875
|
+
var _h = _g, {
|
|
3876
|
+
variant = "secondary",
|
|
3877
|
+
as: Tag = "button",
|
|
3878
|
+
size = "medium",
|
|
3879
|
+
busy,
|
|
3880
|
+
disabled,
|
|
3881
|
+
rounded = "full",
|
|
3882
|
+
children,
|
|
3883
|
+
className
|
|
3884
|
+
} = _h, props = __objRest(_h, [
|
|
3885
|
+
"variant",
|
|
3886
|
+
"as",
|
|
3887
|
+
"size",
|
|
3888
|
+
"busy",
|
|
3889
|
+
"disabled",
|
|
3890
|
+
"rounded",
|
|
3891
|
+
"children",
|
|
3892
|
+
"className"
|
|
3893
|
+
]);
|
|
3894
|
+
const baseClasses = "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out ";
|
|
3895
|
+
const variantClasses = {
|
|
3896
|
+
primary: `shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500`,
|
|
3897
|
+
secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
|
|
3898
|
+
white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
|
|
3899
|
+
ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
|
|
3900
|
+
danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`
|
|
3901
|
+
};
|
|
3902
|
+
const state = busy ? `busy` : disabled ? `disabled` : `default`;
|
|
3903
|
+
const stateClasses = {
|
|
3904
|
+
disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
|
|
3905
|
+
busy: `pointer-events-none opacity-70 cursor-wait`,
|
|
3906
|
+
default: ``
|
|
3907
|
+
};
|
|
3908
|
+
const roundedClasses = {
|
|
3909
|
+
full: `rounded-full`,
|
|
3910
|
+
left: `rounded-l-full`,
|
|
3911
|
+
right: `rounded-r-full`
|
|
3912
|
+
};
|
|
3913
|
+
const sizeClasses = {
|
|
3914
|
+
small: `text-xs h-8 px-3`,
|
|
3915
|
+
medium: `text-sm h-10 px-4`,
|
|
3916
|
+
custom: ``
|
|
3917
|
+
};
|
|
3918
|
+
return /* @__PURE__ */ React.createElement(Tag, __spreadValues({
|
|
3919
|
+
className: `${baseClasses} ${variantClasses[variant]} ${sizeClasses[size]} ${stateClasses[state]} ${roundedClasses[rounded]} ${className}`
|
|
3920
|
+
}, props), children);
|
|
3660
3921
|
};
|
|
3922
|
+
function CursorPaginator({
|
|
3923
|
+
navigateNext,
|
|
3924
|
+
navigatePrev,
|
|
3925
|
+
hasNext,
|
|
3926
|
+
hasPrev,
|
|
3927
|
+
variant = "secondary"
|
|
3928
|
+
}) {
|
|
3929
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3930
|
+
className: "w-full flex flex-shrink-0 justify-end gap-2 items-center"
|
|
3931
|
+
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
3932
|
+
variant,
|
|
3933
|
+
disabled: !hasPrev,
|
|
3934
|
+
onClick: navigatePrev
|
|
3935
|
+
}, /* @__PURE__ */ React__default.createElement(BiLeftArrowAlt, {
|
|
3936
|
+
className: "w-6 h-full mr-2 opacity-70"
|
|
3937
|
+
}), " Previous"), /* @__PURE__ */ React__default.createElement(Button, {
|
|
3938
|
+
variant,
|
|
3939
|
+
disabled: !hasNext,
|
|
3940
|
+
onClick: navigateNext
|
|
3941
|
+
}, "Next ", /* @__PURE__ */ React__default.createElement(BiRightArrowAlt, {
|
|
3942
|
+
className: "w-6 h-full ml-2 opacity-70"
|
|
3943
|
+
})));
|
|
3944
|
+
}
|
|
3661
3945
|
const TemplateMenu = ({ templates }) => {
|
|
3662
|
-
return /* @__PURE__ */
|
|
3946
|
+
return /* @__PURE__ */ React__default.createElement(Menu, {
|
|
3663
3947
|
as: "div",
|
|
3664
3948
|
className: "relative inline-block text-left"
|
|
3665
|
-
}, () => /* @__PURE__ */
|
|
3949
|
+
}, () => /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Menu.Button, {
|
|
3666
3950
|
className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 text-sm h-10 px-6"
|
|
3667
|
-
}, "Create New ", /* @__PURE__ */
|
|
3951
|
+
}, "Create New ", /* @__PURE__ */ React__default.createElement(BiPlus, {
|
|
3668
3952
|
className: "w-5 h-full ml-1 opacity-70"
|
|
3669
|
-
}))), /* @__PURE__ */
|
|
3953
|
+
}))), /* @__PURE__ */ React__default.createElement(Transition, {
|
|
3670
3954
|
as: Fragment,
|
|
3671
3955
|
enter: "transition ease-out duration-100",
|
|
3672
3956
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -3674,13 +3958,13 @@ const TemplateMenu = ({ templates }) => {
|
|
|
3674
3958
|
leave: "transition ease-in duration-75",
|
|
3675
3959
|
leaveFrom: "transform opacity-100 scale-100",
|
|
3676
3960
|
leaveTo: "transform opacity-0 scale-95"
|
|
3677
|
-
}, /* @__PURE__ */
|
|
3961
|
+
}, /* @__PURE__ */ React__default.createElement(Menu.Items, {
|
|
3678
3962
|
className: "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
|
|
3679
|
-
}, /* @__PURE__ */
|
|
3963
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3680
3964
|
className: "py-1"
|
|
3681
|
-
}, templates.map((template) => /* @__PURE__ */
|
|
3965
|
+
}, templates.map((template) => /* @__PURE__ */ React__default.createElement(Menu.Item, {
|
|
3682
3966
|
key: `${template.label}-${template.name}`
|
|
3683
|
-
}, ({ active }) => /* @__PURE__ */
|
|
3967
|
+
}, ({ active }) => /* @__PURE__ */ React__default.createElement(Link, {
|
|
3684
3968
|
to: `${template.name}/new`,
|
|
3685
3969
|
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"}`
|
|
3686
3970
|
}, template.label))))))));
|
|
@@ -3699,22 +3983,32 @@ const handleNavigate = (navigate, cms, collection, document) => {
|
|
|
3699
3983
|
const CollectionListPage = () => {
|
|
3700
3984
|
const navigate = useNavigate();
|
|
3701
3985
|
const { collectionName } = useParams();
|
|
3702
|
-
const [open, setOpen] =
|
|
3703
|
-
const [vars, setVars] =
|
|
3986
|
+
const [open, setOpen] = React__default.useState(false);
|
|
3987
|
+
const [vars, setVars] = React__default.useState({
|
|
3704
3988
|
collection: collectionName,
|
|
3705
3989
|
relativePath: ""
|
|
3706
3990
|
});
|
|
3707
|
-
|
|
3708
|
-
|
|
3991
|
+
const [endCursor, setEndCursor] = useState("");
|
|
3992
|
+
const [prevCursors, setPrevCursors] = useState([]);
|
|
3993
|
+
const loc = useLocation();
|
|
3994
|
+
useEffect(() => {
|
|
3995
|
+
setEndCursor("");
|
|
3996
|
+
setPrevCursors([]);
|
|
3997
|
+
}, [loc]);
|
|
3998
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
3999
|
+
return /* @__PURE__ */ React__default.createElement(GetCollection, {
|
|
3709
4000
|
cms,
|
|
3710
4001
|
collectionName,
|
|
3711
|
-
includeDocuments: true
|
|
4002
|
+
includeDocuments: true,
|
|
4003
|
+
startCursor: endCursor
|
|
3712
4004
|
}, (collection, _loading, reFetchCollection) => {
|
|
3713
4005
|
var _a, _b;
|
|
3714
4006
|
const totalCount = collection.documents.totalCount;
|
|
3715
4007
|
const documents = collection.documents.edges;
|
|
3716
4008
|
const admin = cms.api.admin;
|
|
3717
|
-
|
|
4009
|
+
const pageInfo = collection.documents.pageInfo;
|
|
4010
|
+
const useDataFlag = cms.flags.get("experimentalData");
|
|
4011
|
+
return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, open && /* @__PURE__ */ React__default.createElement(DeleteModal, {
|
|
3718
4012
|
filename: vars.relativePath,
|
|
3719
4013
|
deleteFunc: async () => {
|
|
3720
4014
|
try {
|
|
@@ -3728,63 +4022,71 @@ const CollectionListPage = () => {
|
|
|
3728
4022
|
}
|
|
3729
4023
|
},
|
|
3730
4024
|
close: () => setOpen(false)
|
|
3731
|
-
}), /* @__PURE__ */
|
|
4025
|
+
}), /* @__PURE__ */ React__default.createElement(PageHeader, {
|
|
3732
4026
|
isLocalMode: (_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode
|
|
3733
|
-
}, /* @__PURE__ */
|
|
4027
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("h3", {
|
|
3734
4028
|
className: "text-2xl text-gray-700"
|
|
3735
|
-
}, collection.label ? collection.label : collection.name), !collection.templates && /* @__PURE__ */
|
|
4029
|
+
}, collection.label ? collection.label : collection.name), !collection.templates && /* @__PURE__ */ React__default.createElement(Link, {
|
|
3736
4030
|
to: `new`,
|
|
3737
4031
|
className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 text-sm h-10 px-6"
|
|
3738
|
-
}, "Create New", " ", /* @__PURE__ */
|
|
4032
|
+
}, "Create New", " ", /* @__PURE__ */ React__default.createElement(BiPlus, {
|
|
3739
4033
|
className: "w-5 h-full ml-1 opacity-70"
|
|
3740
|
-
})), collection.templates && /* @__PURE__ */
|
|
4034
|
+
})), collection.templates && /* @__PURE__ */ React__default.createElement(TemplateMenu, {
|
|
3741
4035
|
templates: collection.templates
|
|
3742
|
-
}))), /* @__PURE__ */
|
|
4036
|
+
}))), /* @__PURE__ */ React__default.createElement(PageBody, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3743
4037
|
className: "w-full mx-auto max-w-screen-xl"
|
|
3744
|
-
}, totalCount > 0 && /* @__PURE__ */
|
|
4038
|
+
}, totalCount > 0 && /* @__PURE__ */ React__default.createElement("table", {
|
|
3745
4039
|
className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg"
|
|
3746
|
-
}, /* @__PURE__ */
|
|
4040
|
+
}, /* @__PURE__ */ React__default.createElement("tbody", {
|
|
3747
4041
|
className: "divide-y divide-gray-150"
|
|
3748
4042
|
}, documents.map((document) => {
|
|
4043
|
+
var _a2;
|
|
4044
|
+
const hasTitle = Boolean(document.node._sys.title);
|
|
3749
4045
|
const subfolders = document.node._sys.breadcrumbs.slice(0, -1).join("/");
|
|
3750
|
-
return /* @__PURE__ */
|
|
4046
|
+
return /* @__PURE__ */ React__default.createElement("tr", {
|
|
3751
4047
|
key: `document-${document.node._sys.relativePath}`,
|
|
3752
4048
|
className: ""
|
|
3753
|
-
}, /* @__PURE__ */
|
|
4049
|
+
}, /* @__PURE__ */ React__default.createElement("td", {
|
|
3754
4050
|
className: "px-6 py-2 whitespace-nowrap"
|
|
3755
|
-
}, /* @__PURE__ */
|
|
4051
|
+
}, /* @__PURE__ */ React__default.createElement("a", {
|
|
3756
4052
|
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer",
|
|
3757
4053
|
onClick: () => {
|
|
3758
4054
|
handleNavigate(navigate, cms, collection, document.node);
|
|
3759
4055
|
}
|
|
3760
|
-
}, /* @__PURE__ */
|
|
4056
|
+
}, /* @__PURE__ */ React__default.createElement(BiEdit, {
|
|
3761
4057
|
className: "inline-block h-6 w-auto opacity-70"
|
|
3762
|
-
}), /* @__PURE__ */
|
|
4058
|
+
}), /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", {
|
|
3763
4059
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3764
|
-
}, "Filename"), /* @__PURE__ */
|
|
4060
|
+
}, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3765
4061
|
className: "h-5 leading-5 block whitespace-nowrap"
|
|
3766
|
-
}, subfolders && /* @__PURE__ */
|
|
4062
|
+
}, subfolders && /* @__PURE__ */ React__default.createElement("span", {
|
|
3767
4063
|
className: "text-xs text-gray-400"
|
|
3768
|
-
}, `${subfolders}/`), /* @__PURE__ */
|
|
4064
|
+
}, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, hasTitle ? (_a2 = document.node._sys) == null ? void 0 : _a2.title : document.node._sys.filename))))), hasTitle && /* @__PURE__ */ React__default.createElement("td", {
|
|
4065
|
+
className: "px-6 py-4 whitespace-nowrap"
|
|
4066
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
4067
|
+
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
4068
|
+
}, "Filename"), /* @__PURE__ */ React__default.createElement("span", {
|
|
4069
|
+
className: "h-5 leading-5 block text-sm font-medium text-gray-900"
|
|
4070
|
+
}, document.node._sys.filename)), /* @__PURE__ */ React__default.createElement("td", {
|
|
3769
4071
|
className: "px-6 py-4 whitespace-nowrap"
|
|
3770
|
-
}, /* @__PURE__ */
|
|
4072
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3771
4073
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3772
|
-
}, "Extension"), /* @__PURE__ */
|
|
4074
|
+
}, "Extension"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3773
4075
|
className: "h-5 leading-5 block text-sm font-medium text-gray-900"
|
|
3774
|
-
}, document.node._sys.extension)), /* @__PURE__ */
|
|
4076
|
+
}, document.node._sys.extension)), /* @__PURE__ */ React__default.createElement("td", {
|
|
3775
4077
|
className: "px-6 py-4 whitespace-nowrap"
|
|
3776
|
-
}, /* @__PURE__ */
|
|
4078
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3777
4079
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3778
|
-
}, "Template"), /* @__PURE__ */
|
|
4080
|
+
}, "Template"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3779
4081
|
className: "h-5 leading-5 block text-sm font-medium text-gray-900"
|
|
3780
|
-
}, document.node._sys.template)), /* @__PURE__ */
|
|
4082
|
+
}, document.node._sys.template)), /* @__PURE__ */ React__default.createElement("td", {
|
|
3781
4083
|
className: "w-0"
|
|
3782
|
-
}, /* @__PURE__ */
|
|
4084
|
+
}, /* @__PURE__ */ React__default.createElement(OverflowMenu, {
|
|
3783
4085
|
toolbarItems: [
|
|
3784
4086
|
{
|
|
3785
4087
|
name: "edit",
|
|
3786
4088
|
label: "Edit in Admin",
|
|
3787
|
-
Icon: /* @__PURE__ */
|
|
4089
|
+
Icon: /* @__PURE__ */ React__default.createElement(BiEdit, {
|
|
3788
4090
|
size: "1.3rem"
|
|
3789
4091
|
}),
|
|
3790
4092
|
onMouseDown: () => {
|
|
@@ -3794,7 +4096,7 @@ const CollectionListPage = () => {
|
|
|
3794
4096
|
{
|
|
3795
4097
|
name: "delete",
|
|
3796
4098
|
label: "Delete",
|
|
3797
|
-
Icon: /* @__PURE__ */
|
|
4099
|
+
Icon: /* @__PURE__ */ React__default.createElement(BiTrash, {
|
|
3798
4100
|
size: "1.3rem",
|
|
3799
4101
|
className: "text-red-500"
|
|
3800
4102
|
}),
|
|
@@ -3808,19 +4110,38 @@ const CollectionListPage = () => {
|
|
|
3808
4110
|
}
|
|
3809
4111
|
]
|
|
3810
4112
|
})));
|
|
3811
|
-
})))
|
|
4113
|
+
}))), useDataFlag && /* @__PURE__ */ React__default.createElement("div", {
|
|
4114
|
+
className: "pt-3"
|
|
4115
|
+
}, /* @__PURE__ */ React__default.createElement(CursorPaginator, {
|
|
4116
|
+
variant: "white",
|
|
4117
|
+
hasNext: pageInfo == null ? void 0 : pageInfo.hasNextPage,
|
|
4118
|
+
navigateNext: () => {
|
|
4119
|
+
const newState = [...prevCursors, endCursor];
|
|
4120
|
+
setPrevCursors(newState);
|
|
4121
|
+
setEndCursor(pageInfo == null ? void 0 : pageInfo.endCursor);
|
|
4122
|
+
},
|
|
4123
|
+
hasPrev: prevCursors.length > 0,
|
|
4124
|
+
navigatePrev: () => {
|
|
4125
|
+
const prev = prevCursors[prevCursors.length - 1];
|
|
4126
|
+
if (typeof prev === "string") {
|
|
4127
|
+
const newState = prevCursors.slice(0, -1);
|
|
4128
|
+
setPrevCursors(newState);
|
|
4129
|
+
setEndCursor(prev);
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
}))))));
|
|
3812
4133
|
});
|
|
3813
4134
|
});
|
|
3814
4135
|
};
|
|
3815
4136
|
const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
|
|
3816
|
-
return /* @__PURE__ */
|
|
4137
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(ModalPopup, null, /* @__PURE__ */ React__default.createElement(ModalHeader, {
|
|
3817
4138
|
close: close2
|
|
3818
|
-
}, "Delete ", filename), /* @__PURE__ */
|
|
4139
|
+
}, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, {
|
|
3819
4140
|
padded: true
|
|
3820
|
-
}, /* @__PURE__ */
|
|
4141
|
+
}, /* @__PURE__ */ React__default.createElement("p", null, `Are you sure you want to delete ${filename}?`)), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3821
4142
|
style: { flexGrow: 2 },
|
|
3822
4143
|
onClick: close2
|
|
3823
|
-
}, "Cancel"), /* @__PURE__ */
|
|
4144
|
+
}, "Cancel"), /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3824
4145
|
style: { flexGrow: 3 },
|
|
3825
4146
|
variant: "danger",
|
|
3826
4147
|
onClick: async () => {
|
|
@@ -3854,7 +4175,7 @@ const createDocument = async (cms, collection, template, mutationInfo, values) =
|
|
|
3854
4175
|
};
|
|
3855
4176
|
const CollectionCreatePage = () => {
|
|
3856
4177
|
const { collectionName, templateName } = useParams();
|
|
3857
|
-
return /* @__PURE__ */
|
|
4178
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => /* @__PURE__ */ React__default.createElement(GetCollection, {
|
|
3858
4179
|
cms,
|
|
3859
4180
|
collectionName,
|
|
3860
4181
|
includeDocuments: false
|
|
@@ -3863,7 +4184,7 @@ const CollectionCreatePage = () => {
|
|
|
3863
4184
|
includeCollection: true,
|
|
3864
4185
|
includeTemplate: !!collection.templates
|
|
3865
4186
|
};
|
|
3866
|
-
return /* @__PURE__ */
|
|
4187
|
+
return /* @__PURE__ */ React__default.createElement(RenderForm$1, {
|
|
3867
4188
|
cms,
|
|
3868
4189
|
collection,
|
|
3869
4190
|
templateName,
|
|
@@ -3896,7 +4217,7 @@ const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
|
3896
4217
|
name: "filename",
|
|
3897
4218
|
label: "Filename",
|
|
3898
4219
|
component: "text",
|
|
3899
|
-
description: /* @__PURE__ */
|
|
4220
|
+
description: /* @__PURE__ */ React__default.createElement("span", null, "A unique filename for the content.", /* @__PURE__ */ React__default.createElement("br", null), "Examples: ", /* @__PURE__ */ React__default.createElement("code", null, "My_Document"), ", ", /* @__PURE__ */ React__default.createElement("code", null, "My_Document.en"), ",", " ", /* @__PURE__ */ React__default.createElement("code", null, "sub-folder/My_Document")),
|
|
3900
4221
|
placeholder: `My_Document`,
|
|
3901
4222
|
validate: (value, allValues, meta) => {
|
|
3902
4223
|
if (!value) {
|
|
@@ -3925,24 +4246,28 @@ const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
|
3925
4246
|
}
|
|
3926
4247
|
});
|
|
3927
4248
|
}, [cms, collection, mutationInfo]);
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
4249
|
+
const navBreakpoint = 1e3;
|
|
4250
|
+
const windowWidth = useWindowWidth();
|
|
4251
|
+
const renderNavToggle = windowWidth < navBreakpoint + 1;
|
|
4252
|
+
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
4253
|
+
return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) && /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement("div", {
|
|
4254
|
+
className: `py-4 border-b border-gray-200 bg-white ${headerPadding}`
|
|
4255
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3931
4256
|
className: "max-w-form mx-auto"
|
|
3932
|
-
}, /* @__PURE__ */
|
|
4257
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3933
4258
|
className: "mb-2"
|
|
3934
|
-
}, /* @__PURE__ */
|
|
4259
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3935
4260
|
className: "block text-sm leading-tight uppercase text-gray-400 mb-1"
|
|
3936
|
-
}, /* @__PURE__ */
|
|
4261
|
+
}, /* @__PURE__ */ React__default.createElement(Link, {
|
|
3937
4262
|
to: `/collections/${collection.name}`,
|
|
3938
4263
|
className: "inline-block text-current hover:text-blue-400 focus:underline focus:outline-none focus:text-blue-400 font-medium transition-colors duration-150 ease-out"
|
|
3939
|
-
}, collection.label ? collection.label : collection.name), /* @__PURE__ */
|
|
4264
|
+
}, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement(HiChevronRight, {
|
|
3940
4265
|
className: "inline-block -mt-0.5 opacity-50"
|
|
3941
|
-
})), /* @__PURE__ */
|
|
4266
|
+
})), /* @__PURE__ */ React__default.createElement("span", {
|
|
3942
4267
|
className: "text-xl text-gray-700 font-medium leading-tight"
|
|
3943
|
-
}, "Create New")), /* @__PURE__ */
|
|
4268
|
+
}, "Create New")), /* @__PURE__ */ React__default.createElement(FormStatus, {
|
|
3944
4269
|
pristine: formIsPristine
|
|
3945
|
-
}))), /* @__PURE__ */
|
|
4270
|
+
}))), /* @__PURE__ */ React__default.createElement(FormBuilder, {
|
|
3946
4271
|
form,
|
|
3947
4272
|
onPristineChange: setFormIsPristine
|
|
3948
4273
|
})));
|
|
@@ -3983,9 +4308,9 @@ const GetDocument = ({
|
|
|
3983
4308
|
return null;
|
|
3984
4309
|
}
|
|
3985
4310
|
if (loading) {
|
|
3986
|
-
return /* @__PURE__ */
|
|
4311
|
+
return /* @__PURE__ */ React__default.createElement(LoadingPage, null);
|
|
3987
4312
|
}
|
|
3988
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(document, loading));
|
|
3989
4314
|
};
|
|
3990
4315
|
const updateDocument = async (cms, relativePath, collection, mutationInfo, values) => {
|
|
3991
4316
|
const api = new TinaAdminApi(cms);
|
|
@@ -4006,7 +4331,7 @@ const updateDocument = async (cms, relativePath, collection, mutationInfo, value
|
|
|
4006
4331
|
const CollectionUpdatePage = () => {
|
|
4007
4332
|
const _a = useParams(), { collectionName } = _a, rest = __objRest(_a, ["collectionName"]);
|
|
4008
4333
|
const { "*": filename } = rest;
|
|
4009
|
-
return /* @__PURE__ */
|
|
4334
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => /* @__PURE__ */ React__default.createElement(GetCollection, {
|
|
4010
4335
|
cms,
|
|
4011
4336
|
collectionName,
|
|
4012
4337
|
includeDocuments: false
|
|
@@ -4016,11 +4341,11 @@ const CollectionUpdatePage = () => {
|
|
|
4016
4341
|
includeCollection: true,
|
|
4017
4342
|
includeTemplate: !!collection.templates
|
|
4018
4343
|
};
|
|
4019
|
-
return /* @__PURE__ */
|
|
4344
|
+
return /* @__PURE__ */ React__default.createElement(GetDocument, {
|
|
4020
4345
|
cms,
|
|
4021
4346
|
collectionName: collection.name,
|
|
4022
4347
|
relativePath
|
|
4023
|
-
}, (document) => /* @__PURE__ */
|
|
4348
|
+
}, (document) => /* @__PURE__ */ React__default.createElement(RenderForm, {
|
|
4024
4349
|
cms,
|
|
4025
4350
|
document,
|
|
4026
4351
|
filename,
|
|
@@ -4069,46 +4394,55 @@ const RenderForm = ({
|
|
|
4069
4394
|
}
|
|
4070
4395
|
});
|
|
4071
4396
|
}, [cms, document, relativePath, collection, mutationInfo]);
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4397
|
+
const navBreakpoint = 1e3;
|
|
4398
|
+
const windowWidth = useWindowWidth();
|
|
4399
|
+
const renderNavToggle = windowWidth < navBreakpoint + 1;
|
|
4400
|
+
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
4401
|
+
return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) && /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement("div", {
|
|
4402
|
+
className: `py-4 border-b border-gray-200 bg-white ${headerPadding}`
|
|
4403
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4075
4404
|
className: "max-w-form mx-auto"
|
|
4076
|
-
}, /* @__PURE__ */
|
|
4405
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4077
4406
|
className: "mb-2"
|
|
4078
|
-
}, /* @__PURE__ */
|
|
4407
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
4079
4408
|
className: "block text-sm leading-tight uppercase text-gray-400 mb-1"
|
|
4080
|
-
}, /* @__PURE__ */
|
|
4409
|
+
}, /* @__PURE__ */ React__default.createElement(Link, {
|
|
4081
4410
|
to: `/collections/${collection.name}`,
|
|
4082
4411
|
className: "inline-block text-current hover:text-blue-400 focus:underline focus:outline-none focus:text-blue-400 font-medium transition-colors duration-150 ease-out"
|
|
4083
|
-
}, collection.label ? collection.label : collection.name), /* @__PURE__ */
|
|
4412
|
+
}, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement(HiChevronRight, {
|
|
4084
4413
|
className: "inline-block -mt-0.5 opacity-50"
|
|
4085
|
-
})), /* @__PURE__ */
|
|
4414
|
+
})), /* @__PURE__ */ React__default.createElement("span", {
|
|
4086
4415
|
className: "text-xl text-gray-700 font-medium leading-tight"
|
|
4087
|
-
}, "Edit ", `${filename}.${collection.format}`)), /* @__PURE__ */
|
|
4416
|
+
}, "Edit ", `${filename}.${collection.format}`)), /* @__PURE__ */ React__default.createElement(FormStatus, {
|
|
4088
4417
|
pristine: formIsPristine
|
|
4089
|
-
}))), /* @__PURE__ */
|
|
4418
|
+
}))), /* @__PURE__ */ React__default.createElement(FormBuilder, {
|
|
4090
4419
|
form,
|
|
4091
4420
|
onPristineChange: setFormIsPristine
|
|
4092
4421
|
})));
|
|
4093
4422
|
};
|
|
4094
4423
|
const ScreenPage = () => {
|
|
4095
4424
|
const { screenName } = useParams();
|
|
4096
|
-
|
|
4425
|
+
const navBreakpoint = 1e3;
|
|
4426
|
+
const windowWidth = useWindowWidth();
|
|
4427
|
+
const renderNavToggle = windowWidth < navBreakpoint + 1;
|
|
4428
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
4097
4429
|
var _a, _b;
|
|
4098
4430
|
const screens = cms.plugins.getType("screen").all();
|
|
4099
4431
|
const selectedScreen = screens.find(({ name }) => slugify(name) === screenName);
|
|
4100
|
-
return /* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4101
4433
|
className: "relative w-full h-full flex flex-col items-stretch justify-between"
|
|
4102
|
-
}, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) && /* @__PURE__ */
|
|
4434
|
+
}, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) && /* @__PURE__ */ React__default.createElement(LocalWarning, null), renderNavToggle && /* @__PURE__ */ React__default.createElement("div", {
|
|
4435
|
+
className: `py-5 border-b border-gray-200 bg-white pl-18`
|
|
4436
|
+
}, selectedScreen.name), /* @__PURE__ */ React__default.createElement("div", {
|
|
4103
4437
|
className: "flex-1 overflow-y-auto relative flex flex-col items-stretch justify-between"
|
|
4104
|
-
}, /* @__PURE__ */
|
|
4438
|
+
}, /* @__PURE__ */ React__default.createElement(selectedScreen.Component, {
|
|
4105
4439
|
close: () => {
|
|
4106
4440
|
}
|
|
4107
4441
|
})));
|
|
4108
4442
|
});
|
|
4109
4443
|
};
|
|
4110
4444
|
const Redirect = () => {
|
|
4111
|
-
|
|
4445
|
+
React__default.useEffect(() => {
|
|
4112
4446
|
if (window) {
|
|
4113
4447
|
window.location.assign("/");
|
|
4114
4448
|
}
|
|
@@ -4122,43 +4456,43 @@ const TinaAdmin = () => {
|
|
|
4122
4456
|
return null;
|
|
4123
4457
|
}
|
|
4124
4458
|
if (!edit) {
|
|
4125
|
-
return /* @__PURE__ */
|
|
4459
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(LoginPage, null));
|
|
4126
4460
|
}
|
|
4127
|
-
return /* @__PURE__ */
|
|
4461
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
4128
4462
|
const isTinaAdminEnabled = cms.flags.get("tina-admin") === false ? false : true;
|
|
4129
4463
|
if (isTinaAdminEnabled) {
|
|
4130
|
-
return /* @__PURE__ */
|
|
4464
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(HashRouter, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
4131
4465
|
className: "flex items-stretch h-screen overflow-hidden"
|
|
4132
|
-
}, /* @__PURE__ */
|
|
4466
|
+
}, /* @__PURE__ */ React__default.createElement(Sidebar, {
|
|
4133
4467
|
cms
|
|
4134
|
-
}), /* @__PURE__ */
|
|
4468
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
4135
4469
|
className: "flex-1 relative"
|
|
4136
|
-
}, /* @__PURE__ */
|
|
4470
|
+
}, /* @__PURE__ */ React__default.createElement(Routes, null, /* @__PURE__ */ React__default.createElement(Route, {
|
|
4137
4471
|
path: "collections/:collectionName/new",
|
|
4138
|
-
element: /* @__PURE__ */
|
|
4139
|
-
}), /* @__PURE__ */
|
|
4472
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionCreatePage, null)
|
|
4473
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4140
4474
|
path: "collections/:collectionName/:templateName/new",
|
|
4141
|
-
element: /* @__PURE__ */
|
|
4142
|
-
}), /* @__PURE__ */
|
|
4475
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionCreatePage, null)
|
|
4476
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4143
4477
|
path: "collections/:collectionName/*",
|
|
4144
|
-
element: /* @__PURE__ */
|
|
4145
|
-
}), /* @__PURE__ */
|
|
4478
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionUpdatePage, null)
|
|
4479
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4146
4480
|
path: "collections/:collectionName",
|
|
4147
|
-
element: /* @__PURE__ */
|
|
4148
|
-
}), /* @__PURE__ */
|
|
4481
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionListPage, null)
|
|
4482
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4149
4483
|
path: "screens/:screenName",
|
|
4150
|
-
element: /* @__PURE__ */
|
|
4151
|
-
}), /* @__PURE__ */
|
|
4484
|
+
element: /* @__PURE__ */ React__default.createElement(ScreenPage, null)
|
|
4485
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4152
4486
|
path: "/",
|
|
4153
|
-
element: /* @__PURE__ */
|
|
4487
|
+
element: /* @__PURE__ */ React__default.createElement(DashboardPage, null)
|
|
4154
4488
|
}))))));
|
|
4155
4489
|
} else {
|
|
4156
|
-
return /* @__PURE__ */
|
|
4490
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(HashRouter, null, /* @__PURE__ */ React__default.createElement(Routes, null, /* @__PURE__ */ React__default.createElement(Route, {
|
|
4157
4491
|
path: "logout",
|
|
4158
|
-
element: /* @__PURE__ */
|
|
4159
|
-
}), /* @__PURE__ */
|
|
4492
|
+
element: /* @__PURE__ */ React__default.createElement(LogoutPage, null)
|
|
4493
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4160
4494
|
path: "/",
|
|
4161
|
-
element: /* @__PURE__ */
|
|
4495
|
+
element: /* @__PURE__ */ React__default.createElement(Redirect, null)
|
|
4162
4496
|
}))));
|
|
4163
4497
|
}
|
|
4164
4498
|
});
|