tinacms 0.68.5 → 0.68.8
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 +29 -0
- package/dist/admin/api.d.ts +1 -1
- package/dist/admin/components/GetCollection.d.ts +3 -2
- package/dist/admin/types.d.ts +6 -0
- package/dist/client.es.js +33 -1
- package/dist/client.js +35 -2
- package/dist/index.es.js +548 -257
- package/dist/index.js +332 -42
- package/dist/style.css +90 -9
- package/dist/unifiedClient/index.d.ts +8 -0
- package/package.json +3 -2
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 = () => {
|
|
@@ -2448,19 +2450,25 @@ class TinaAdminApi {
|
|
|
2448
2450
|
}
|
|
2449
2451
|
}`, { variables: { collection, relativePath } });
|
|
2450
2452
|
}
|
|
2451
|
-
async fetchCollection(collectionName, includeDocuments) {
|
|
2453
|
+
async fetchCollection(collectionName, includeDocuments, after) {
|
|
2452
2454
|
if (includeDocuments === true) {
|
|
2453
2455
|
if (this.useDataLayer) {
|
|
2454
2456
|
const sort = this.schema.getIsTitleFieldName(collectionName);
|
|
2455
2457
|
const response = await this.api.request(`#graphql
|
|
2456
|
-
query($collection: String!, $includeDocuments: Boolean!, $sort: String){
|
|
2458
|
+
query($collection: String!, $includeDocuments: Boolean!, $sort: String, $limit: Float, $after: String){
|
|
2457
2459
|
collection(collection: $collection){
|
|
2458
2460
|
name
|
|
2459
2461
|
label
|
|
2460
2462
|
format
|
|
2461
2463
|
templates
|
|
2462
|
-
documents(sort: $sort) @include(if: $includeDocuments) {
|
|
2464
|
+
documents(sort: $sort, after: $after, first: $limit) @include(if: $includeDocuments) {
|
|
2463
2465
|
totalCount
|
|
2466
|
+
pageInfo {
|
|
2467
|
+
hasPreviousPage
|
|
2468
|
+
hasNextPage
|
|
2469
|
+
startCursor
|
|
2470
|
+
endCursor
|
|
2471
|
+
}
|
|
2464
2472
|
edges {
|
|
2465
2473
|
node {
|
|
2466
2474
|
... on Document {
|
|
@@ -2479,7 +2487,15 @@ class TinaAdminApi {
|
|
|
2479
2487
|
}
|
|
2480
2488
|
}
|
|
2481
2489
|
}
|
|
2482
|
-
}`, {
|
|
2490
|
+
}`, {
|
|
2491
|
+
variables: {
|
|
2492
|
+
collection: collectionName,
|
|
2493
|
+
includeDocuments,
|
|
2494
|
+
sort,
|
|
2495
|
+
limit: 10,
|
|
2496
|
+
after
|
|
2497
|
+
}
|
|
2498
|
+
});
|
|
2483
2499
|
return response.collection;
|
|
2484
2500
|
} else {
|
|
2485
2501
|
const response = await this.api.request(`#graphql
|
|
@@ -2495,7 +2511,6 @@ class TinaAdminApi {
|
|
|
2495
2511
|
node {
|
|
2496
2512
|
... on Document {
|
|
2497
2513
|
_sys {
|
|
2498
|
-
# TODO: only include title if we need to
|
|
2499
2514
|
template
|
|
2500
2515
|
breadcrumbs
|
|
2501
2516
|
path
|
|
@@ -2580,7 +2595,7 @@ const AuthWallInner = ({
|
|
|
2580
2595
|
const client = cms.api.tina;
|
|
2581
2596
|
const [activeModal, setActiveModal] = useState(null);
|
|
2582
2597
|
const [showChildren, setShowChildren] = useState(false);
|
|
2583
|
-
|
|
2598
|
+
React__default.useEffect(() => {
|
|
2584
2599
|
client.isAuthenticated().then((isAuthenticated) => {
|
|
2585
2600
|
if (isAuthenticated) {
|
|
2586
2601
|
setShowChildren(true);
|
|
@@ -2605,7 +2620,7 @@ const AuthWallInner = ({
|
|
|
2605
2620
|
setActiveModal(null);
|
|
2606
2621
|
}
|
|
2607
2622
|
}) : [];
|
|
2608
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, activeModal === "authenticate" && /* @__PURE__ */ React__default.createElement(ModalBuilder, {
|
|
2609
2624
|
title: "Tina Cloud Authorization",
|
|
2610
2625
|
message: "To save edits, Tina Cloud authorization is required. On save, changes will get commited using your account.",
|
|
2611
2626
|
close,
|
|
@@ -2634,12 +2649,14 @@ const TinaCloudProvider = (props) => {
|
|
|
2634
2649
|
const baseBranch = props.branch || "main";
|
|
2635
2650
|
const [currentBranch, setCurrentBranch] = useLocalStorage("tinacms-current-branch", baseBranch);
|
|
2636
2651
|
useTinaAuthRedirect();
|
|
2637
|
-
const cms =
|
|
2652
|
+
const cms = React__default.useMemo(() => props.cms || new TinaCMS({
|
|
2638
2653
|
enabled: true,
|
|
2639
2654
|
sidebar: true
|
|
2640
2655
|
}), [props.cms]);
|
|
2641
2656
|
if (!cms.api.tina) {
|
|
2642
|
-
cms.registerApi("tina", createClient(props));
|
|
2657
|
+
cms.registerApi("tina", createClient(__spreadProps(__spreadValues({}, props), { branch: currentBranch })));
|
|
2658
|
+
} else {
|
|
2659
|
+
cms.api.tina.setBranch(currentBranch);
|
|
2643
2660
|
}
|
|
2644
2661
|
if (!cms.api.admin) {
|
|
2645
2662
|
cms.registerApi("admin", new TinaAdminApi(cms));
|
|
@@ -2668,15 +2685,15 @@ const TinaCloudProvider = (props) => {
|
|
|
2668
2685
|
return newBranch;
|
|
2669
2686
|
};
|
|
2670
2687
|
setupMedia();
|
|
2671
|
-
const [branchingEnabled, setBranchingEnabled] =
|
|
2672
|
-
|
|
2688
|
+
const [branchingEnabled, setBranchingEnabled] = React__default.useState(() => cms.flags.get("branch-switcher"));
|
|
2689
|
+
React__default.useEffect(() => {
|
|
2673
2690
|
cms.events.subscribe("flag:set", ({ key, value }) => {
|
|
2674
2691
|
if (key === "branch-switcher") {
|
|
2675
2692
|
setBranchingEnabled(value);
|
|
2676
2693
|
}
|
|
2677
2694
|
});
|
|
2678
2695
|
}, [cms.events]);
|
|
2679
|
-
|
|
2696
|
+
React__default.useEffect(() => {
|
|
2680
2697
|
let branchSwitcher;
|
|
2681
2698
|
if (branchingEnabled) {
|
|
2682
2699
|
branchSwitcher = new BranchSwitcherPlugin({
|
|
@@ -2691,24 +2708,24 @@ const TinaCloudProvider = (props) => {
|
|
|
2691
2708
|
}
|
|
2692
2709
|
};
|
|
2693
2710
|
}, [branchingEnabled, props.branch]);
|
|
2694
|
-
|
|
2711
|
+
React__default.useEffect(() => {
|
|
2695
2712
|
if (props.cmsCallback) {
|
|
2696
2713
|
props.cmsCallback(cms);
|
|
2697
2714
|
}
|
|
2698
2715
|
}, []);
|
|
2699
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ React__default.createElement(BranchDataProvider, {
|
|
2700
2717
|
currentBranch,
|
|
2701
2718
|
setCurrentBranch: (b) => {
|
|
2702
2719
|
setCurrentBranch(b);
|
|
2703
2720
|
}
|
|
2704
|
-
}, /* @__PURE__ */
|
|
2721
|
+
}, /* @__PURE__ */ React__default.createElement(TinaProvider, {
|
|
2705
2722
|
cms
|
|
2706
|
-
}, /* @__PURE__ */
|
|
2723
|
+
}, /* @__PURE__ */ React__default.createElement(AuthWallInner, __spreadProps(__spreadValues({}, props), {
|
|
2707
2724
|
cms
|
|
2708
2725
|
}))));
|
|
2709
2726
|
};
|
|
2710
2727
|
const TinaCloudAuthWall = TinaCloudProvider;
|
|
2711
|
-
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';
|
|
2712
2729
|
class ContentCreatorPlugin {
|
|
2713
2730
|
constructor(options) {
|
|
2714
2731
|
this.__type = "content-creator";
|
|
@@ -2757,9 +2774,9 @@ class ContentCreatorPlugin {
|
|
|
2757
2774
|
}
|
|
2758
2775
|
const useDocumentCreatorPlugin = (args) => {
|
|
2759
2776
|
const cms = useCMS();
|
|
2760
|
-
const [values, setValues] =
|
|
2761
|
-
const [plugin, setPlugin] =
|
|
2762
|
-
|
|
2777
|
+
const [values, setValues] = React__default.useState({});
|
|
2778
|
+
const [plugin, setPlugin] = React__default.useState(null);
|
|
2779
|
+
React__default.useEffect(() => {
|
|
2763
2780
|
const run = async () => {
|
|
2764
2781
|
var _a;
|
|
2765
2782
|
const res = await cms.api.tina.request((gql2) => gql2`
|
|
@@ -2860,7 +2877,7 @@ const useDocumentCreatorPlugin = (args) => {
|
|
|
2860
2877
|
};
|
|
2861
2878
|
run();
|
|
2862
2879
|
}, [cms]);
|
|
2863
|
-
|
|
2880
|
+
React__default.useEffect(() => {
|
|
2864
2881
|
if (plugin) {
|
|
2865
2882
|
cms.plugins.add(plugin);
|
|
2866
2883
|
}
|
|
@@ -2881,10 +2898,10 @@ function useTina({
|
|
|
2881
2898
|
state,
|
|
2882
2899
|
isDummyContainer,
|
|
2883
2900
|
isLoading: contextLoading
|
|
2884
|
-
} =
|
|
2901
|
+
} = React__default.useContext(TinaDataContext);
|
|
2885
2902
|
const [waitForContextRerender, setWaitForContextRerender] = useState(!isDummyContainer);
|
|
2886
2903
|
const isLoading = contextLoading || waitForContextRerender;
|
|
2887
|
-
|
|
2904
|
+
React__default.useEffect(() => {
|
|
2888
2905
|
setRequest({ query, variables });
|
|
2889
2906
|
}, [JSON.stringify(variables), query]);
|
|
2890
2907
|
useEffect(() => {
|
|
@@ -2936,7 +2953,7 @@ const errorButtonStyles = {
|
|
|
2936
2953
|
color: "white",
|
|
2937
2954
|
margin: "1rem 0"
|
|
2938
2955
|
};
|
|
2939
|
-
class ErrorBoundary extends
|
|
2956
|
+
class ErrorBoundary extends React__default.Component {
|
|
2940
2957
|
constructor(props) {
|
|
2941
2958
|
super(props);
|
|
2942
2959
|
this.state = {
|
|
@@ -2952,7 +2969,7 @@ class ErrorBoundary extends React.Component {
|
|
|
2952
2969
|
const branchData = window.localStorage && window.localStorage.getItem("tinacms-current-branch");
|
|
2953
2970
|
const hasBranchData = branchData && branchData.length > 0;
|
|
2954
2971
|
if (this.state.hasError && !this.state.pageRefresh) {
|
|
2955
|
-
return /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
2956
2973
|
style: {
|
|
2957
2974
|
background: "#efefef",
|
|
2958
2975
|
height: "100vh",
|
|
@@ -2960,7 +2977,7 @@ class ErrorBoundary extends React.Component {
|
|
|
2960
2977
|
alignItems: "center",
|
|
2961
2978
|
justifyContent: "center"
|
|
2962
2979
|
}
|
|
2963
|
-
}, /* @__PURE__ */
|
|
2980
|
+
}, /* @__PURE__ */ React__default.createElement("style", null, " body { margin: 0; } "), /* @__PURE__ */ React__default.createElement("div", {
|
|
2964
2981
|
style: {
|
|
2965
2982
|
background: "#fff",
|
|
2966
2983
|
maxWidth: "400px",
|
|
@@ -2969,27 +2986,27 @@ class ErrorBoundary extends React.Component {
|
|
|
2969
2986
|
borderRadius: "5px",
|
|
2970
2987
|
boxShadow: "0 6px 24px rgb(0 37 91 / 5%), 0 2px 4px rgb(0 37 91 / 3%)"
|
|
2971
2988
|
}
|
|
2972
|
-
}, /* @__PURE__ */
|
|
2989
|
+
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
2973
2990
|
style: { color: "#eb6337" }
|
|
2974
|
-
}, "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", {
|
|
2975
2992
|
style: { marginTop: "1rem", overflowX: "auto" }
|
|
2976
|
-
}, 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", {
|
|
2977
2994
|
className: "text-gray-600",
|
|
2978
2995
|
style: { textDecoration: "underline" },
|
|
2979
2996
|
href: "https://tina.io/docs/errors/faq/",
|
|
2980
2997
|
target: "_blank"
|
|
2981
|
-
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */
|
|
2998
|
+
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */ React__default.createElement("button", {
|
|
2982
2999
|
style: errorButtonStyles,
|
|
2983
3000
|
onClick: () => {
|
|
2984
3001
|
this.setState({ pageRefresh: true });
|
|
2985
3002
|
setTimeout(() => this.setState({ hasError: false, pageRefresh: false }), 3e3);
|
|
2986
3003
|
}
|
|
2987
|
-
}, "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", {
|
|
2988
3005
|
className: "text-gray-600",
|
|
2989
3006
|
style: { textDecoration: "underline" },
|
|
2990
3007
|
href: "https://tina.io/docs/errors/faq/",
|
|
2991
3008
|
target: "_blank"
|
|
2992
|
-
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */
|
|
3009
|
+
}, " ", "Error FAQ", " "), " ", "for more information."), /* @__PURE__ */ React__default.createElement("button", {
|
|
2993
3010
|
style: errorButtonStyles,
|
|
2994
3011
|
onClick: () => {
|
|
2995
3012
|
window.localStorage.removeItem("tinacms-current-branch");
|
|
@@ -2998,7 +3015,7 @@ class ErrorBoundary extends React.Component {
|
|
|
2998
3015
|
}, "Switch to default branch"))));
|
|
2999
3016
|
}
|
|
3000
3017
|
if (this.state.pageRefresh) {
|
|
3001
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ React__default.createElement(Loader, null, "Let's try that again.");
|
|
3002
3019
|
}
|
|
3003
3020
|
return this.props.children;
|
|
3004
3021
|
}
|
|
@@ -3029,7 +3046,7 @@ const TinaCMSProvider2 = (_c) => {
|
|
|
3029
3046
|
if (!schema) {
|
|
3030
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");
|
|
3031
3048
|
}
|
|
3032
|
-
return /* @__PURE__ */
|
|
3049
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TinaCloudProvider, {
|
|
3033
3050
|
branch,
|
|
3034
3051
|
clientId,
|
|
3035
3052
|
tinaioConfig: props.tinaioConfig,
|
|
@@ -3037,11 +3054,11 @@ const TinaCMSProvider2 = (_c) => {
|
|
|
3037
3054
|
cmsCallback: props.cmsCallback,
|
|
3038
3055
|
mediaStore: props.mediaStore,
|
|
3039
3056
|
schema
|
|
3040
|
-
}, /* @__PURE__ */
|
|
3057
|
+
}, /* @__PURE__ */ React__default.createElement("style", null, styles), /* @__PURE__ */ React__default.createElement(ErrorBoundary, null, /* @__PURE__ */ React__default.createElement(DocumentCreator, {
|
|
3041
3058
|
documentCreatorCallback
|
|
3042
|
-
}), /* @__PURE__ */
|
|
3059
|
+
}), /* @__PURE__ */ React__default.createElement(TinaDataProvider, {
|
|
3043
3060
|
formifyCallback
|
|
3044
|
-
}, typeof props.children == "function" ? /* @__PURE__ */
|
|
3061
|
+
}, typeof props.children == "function" ? /* @__PURE__ */ React__default.createElement(TinaQuery, __spreadProps(__spreadValues({}, props), {
|
|
3045
3062
|
variables: props.variables,
|
|
3046
3063
|
data: props.data,
|
|
3047
3064
|
query,
|
|
@@ -3056,7 +3073,7 @@ const DocumentCreator = ({
|
|
|
3056
3073
|
return null;
|
|
3057
3074
|
};
|
|
3058
3075
|
const TinaQuery = (props) => {
|
|
3059
|
-
return /* @__PURE__ */
|
|
3076
|
+
return /* @__PURE__ */ React__default.createElement(TinaQueryInner, __spreadValues({
|
|
3060
3077
|
key: `rootQuery-${props.query}`
|
|
3061
3078
|
}, props));
|
|
3062
3079
|
};
|
|
@@ -3067,24 +3084,24 @@ const TinaQueryInner = (_e) => {
|
|
|
3067
3084
|
variables: props.variables,
|
|
3068
3085
|
data: props.data
|
|
3069
3086
|
});
|
|
3070
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(isLoading || !props.query ? props : __spreadProps(__spreadValues({}, props), { data: liveData })));
|
|
3071
3088
|
};
|
|
3072
3089
|
const TinaDataProvider = ({
|
|
3073
3090
|
children,
|
|
3074
3091
|
formifyCallback
|
|
3075
3092
|
}) => {
|
|
3076
3093
|
const [request, setRequest] = useState();
|
|
3077
|
-
const [state, setState] =
|
|
3094
|
+
const [state, setState] = React__default.useState({
|
|
3078
3095
|
payload: void 0,
|
|
3079
3096
|
isLoading: true
|
|
3080
3097
|
});
|
|
3081
|
-
return /* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ React__default.createElement(TinaDataContext.Provider, {
|
|
3082
3099
|
value: {
|
|
3083
3100
|
setRequest,
|
|
3084
3101
|
isLoading: state.isLoading,
|
|
3085
3102
|
state: { payload: state.payload }
|
|
3086
3103
|
}
|
|
3087
|
-
}, /* @__PURE__ */
|
|
3104
|
+
}, /* @__PURE__ */ React__default.createElement(FormRegistrar, {
|
|
3088
3105
|
key: request == null ? void 0 : request.query,
|
|
3089
3106
|
request,
|
|
3090
3107
|
formifyCallback,
|
|
@@ -3108,13 +3125,13 @@ const FormRegistrar = ({
|
|
|
3108
3125
|
}
|
|
3109
3126
|
}
|
|
3110
3127
|
});
|
|
3111
|
-
|
|
3128
|
+
React__default.useEffect(() => {
|
|
3112
3129
|
onPayloadStateChange({ payload, isLoading });
|
|
3113
3130
|
}, [JSON.stringify(payload), isLoading]);
|
|
3114
|
-
return isLoading ? /* @__PURE__ */
|
|
3131
|
+
return isLoading ? /* @__PURE__ */ React__default.createElement(Loader, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null)) : null;
|
|
3115
3132
|
};
|
|
3116
3133
|
const Loader = (props) => {
|
|
3117
|
-
return /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3118
3135
|
style: {
|
|
3119
3136
|
position: "fixed",
|
|
3120
3137
|
background: "rgba(0, 0, 0, 0.5)",
|
|
@@ -3126,7 +3143,7 @@ const Loader = (props) => {
|
|
|
3126
3143
|
justifyContent: "center",
|
|
3127
3144
|
padding: "40px"
|
|
3128
3145
|
}
|
|
3129
|
-
}, /* @__PURE__ */
|
|
3146
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3130
3147
|
style: {
|
|
3131
3148
|
background: "#f6f6f9",
|
|
3132
3149
|
boxShadow: "0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
@@ -3139,7 +3156,7 @@ const Loader = (props) => {
|
|
|
3139
3156
|
justifyContent: "center",
|
|
3140
3157
|
flexDirection: "column"
|
|
3141
3158
|
}
|
|
3142
|
-
}, /* @__PURE__ */
|
|
3159
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
3143
3160
|
style: {
|
|
3144
3161
|
width: "64px",
|
|
3145
3162
|
color: "#2296fe",
|
|
@@ -3155,13 +3172,13 @@ const Loader = (props) => {
|
|
|
3155
3172
|
viewBox: "0 0 100 64",
|
|
3156
3173
|
enableBackground: "new 0 0 0 0",
|
|
3157
3174
|
xmlSpace: "preserve"
|
|
3158
|
-
}, /* @__PURE__ */
|
|
3175
|
+
}, /* @__PURE__ */ React__default.createElement("circle", {
|
|
3159
3176
|
fill: "currentColor",
|
|
3160
3177
|
stroke: "none",
|
|
3161
3178
|
cx: 6,
|
|
3162
3179
|
cy: 32,
|
|
3163
3180
|
r: 6
|
|
3164
|
-
}, /* @__PURE__ */
|
|
3181
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3165
3182
|
attributeName: "transform",
|
|
3166
3183
|
dur: "1s",
|
|
3167
3184
|
type: "translate",
|
|
@@ -3170,13 +3187,13 @@ const Loader = (props) => {
|
|
|
3170
3187
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3171
3188
|
repeatCount: "indefinite",
|
|
3172
3189
|
begin: "0.1"
|
|
3173
|
-
})), /* @__PURE__ */
|
|
3190
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3174
3191
|
fill: "currentColor",
|
|
3175
3192
|
stroke: "none",
|
|
3176
3193
|
cx: 30,
|
|
3177
3194
|
cy: 32,
|
|
3178
3195
|
r: 6
|
|
3179
|
-
}, /* @__PURE__ */
|
|
3196
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3180
3197
|
attributeName: "transform",
|
|
3181
3198
|
dur: "1s",
|
|
3182
3199
|
type: "translate",
|
|
@@ -3185,13 +3202,13 @@ const Loader = (props) => {
|
|
|
3185
3202
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3186
3203
|
repeatCount: "indefinite",
|
|
3187
3204
|
begin: "0.2"
|
|
3188
|
-
})), /* @__PURE__ */
|
|
3205
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3189
3206
|
fill: "currentColor",
|
|
3190
3207
|
stroke: "none",
|
|
3191
3208
|
cx: 54,
|
|
3192
3209
|
cy: 32,
|
|
3193
3210
|
r: 6
|
|
3194
|
-
}, /* @__PURE__ */
|
|
3211
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3195
3212
|
attributeName: "transform",
|
|
3196
3213
|
dur: "1s",
|
|
3197
3214
|
type: "translate",
|
|
@@ -3200,7 +3217,7 @@ const Loader = (props) => {
|
|
|
3200
3217
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3201
3218
|
repeatCount: "indefinite",
|
|
3202
3219
|
begin: "0.3"
|
|
3203
|
-
}))), /* @__PURE__ */
|
|
3220
|
+
}))), /* @__PURE__ */ React__default.createElement("p", {
|
|
3204
3221
|
style: {
|
|
3205
3222
|
fontSize: "18px",
|
|
3206
3223
|
color: "#252336",
|
|
@@ -3257,7 +3274,7 @@ function gql(strings, ...args) {
|
|
|
3257
3274
|
return str;
|
|
3258
3275
|
}
|
|
3259
3276
|
const Layout = ({ children }) => {
|
|
3260
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("style", null, styles), /* @__PURE__ */ React__default.createElement("div", {
|
|
3261
3278
|
className: "tina-tailwind",
|
|
3262
3279
|
style: {
|
|
3263
3280
|
position: "fixed",
|
|
@@ -3279,7 +3296,7 @@ var DefaultContext = {
|
|
|
3279
3296
|
style: void 0,
|
|
3280
3297
|
attr: void 0
|
|
3281
3298
|
};
|
|
3282
|
-
var IconContext =
|
|
3299
|
+
var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
|
|
3283
3300
|
var __assign = function() {
|
|
3284
3301
|
__assign = Object.assign || function(t) {
|
|
3285
3302
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -3306,14 +3323,14 @@ var __rest = function(s, e) {
|
|
|
3306
3323
|
};
|
|
3307
3324
|
function Tree2Element(tree) {
|
|
3308
3325
|
return tree && tree.map(function(node2, i) {
|
|
3309
|
-
return
|
|
3326
|
+
return React__default.createElement(node2.tag, __assign({
|
|
3310
3327
|
key: i
|
|
3311
3328
|
}, node2.attr), Tree2Element(node2.child));
|
|
3312
3329
|
});
|
|
3313
3330
|
}
|
|
3314
3331
|
function GenIcon(data) {
|
|
3315
3332
|
return function(props) {
|
|
3316
|
-
return
|
|
3333
|
+
return React__default.createElement(IconBase, __assign({
|
|
3317
3334
|
attr: __assign({}, data.attr)
|
|
3318
3335
|
}, props), Tree2Element(data.child));
|
|
3319
3336
|
};
|
|
@@ -3327,7 +3344,7 @@ function IconBase(props) {
|
|
|
3327
3344
|
className = conf.className;
|
|
3328
3345
|
if (props.className)
|
|
3329
3346
|
className = (className ? className + " " : "") + props.className;
|
|
3330
|
-
return
|
|
3347
|
+
return React__default.createElement("svg", __assign({
|
|
3331
3348
|
stroke: "currentColor",
|
|
3332
3349
|
fill: "currentColor",
|
|
3333
3350
|
strokeWidth: "0"
|
|
@@ -3339,9 +3356,9 @@ function IconBase(props) {
|
|
|
3339
3356
|
height: computedSize,
|
|
3340
3357
|
width: computedSize,
|
|
3341
3358
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3342
|
-
}), title &&
|
|
3359
|
+
}), title && React__default.createElement("title", null, title), props.children);
|
|
3343
3360
|
};
|
|
3344
|
-
return IconContext !== void 0 ?
|
|
3361
|
+
return IconContext !== void 0 ? React__default.createElement(IconContext.Consumer, null, function(conf) {
|
|
3345
3362
|
return elem(conf);
|
|
3346
3363
|
}) : elem(DefaultContext);
|
|
3347
3364
|
}
|
|
@@ -3373,64 +3390,153 @@ const useGetCollections = (cms) => {
|
|
|
3373
3390
|
}, [cms]);
|
|
3374
3391
|
return { collections, loading, error };
|
|
3375
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
|
+
}
|
|
3376
3420
|
const slugify = (text) => {
|
|
3377
3421
|
return text.toString().toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "_").replace(/^-+|-+$/g, "");
|
|
3378
3422
|
};
|
|
3379
3423
|
const Sidebar = ({ cms }) => {
|
|
3424
|
+
var _a, _b;
|
|
3380
3425
|
const collectionsInfo = useGetCollections(cms);
|
|
3381
3426
|
const screens = cms.plugins.getType("screen").all();
|
|
3382
|
-
|
|
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, {
|
|
3383
3433
|
sidebarWidth: 360,
|
|
3384
3434
|
showCollections: true,
|
|
3385
3435
|
collectionsInfo,
|
|
3386
3436
|
screens,
|
|
3387
3437
|
contentCreators: [],
|
|
3388
|
-
RenderNavSite: ({ view }) => /* @__PURE__ */
|
|
3438
|
+
RenderNavSite: ({ view }) => /* @__PURE__ */ React__default.createElement(SidebarLink, {
|
|
3389
3439
|
label: view.name,
|
|
3390
3440
|
to: `screens/${slugify(view.name)}`,
|
|
3391
3441
|
Icon: view.Icon ? view.Icon : ImFilesEmpty
|
|
3392
3442
|
}),
|
|
3393
|
-
RenderNavCollection: ({ collection }) => /* @__PURE__ */
|
|
3443
|
+
RenderNavCollection: ({ collection }) => /* @__PURE__ */ React__default.createElement(SidebarLink, {
|
|
3394
3444
|
label: collection.label ? collection.label : collection.name,
|
|
3395
3445
|
to: `collections/${collection.name}`,
|
|
3396
3446
|
Icon: ImFilesEmpty
|
|
3397
3447
|
})
|
|
3398
|
-
})
|
|
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
|
+
})));
|
|
3399
3518
|
};
|
|
3400
3519
|
const SidebarLink = (props) => {
|
|
3401
3520
|
const { to, label, Icon } = props;
|
|
3402
|
-
return /* @__PURE__ */
|
|
3521
|
+
return /* @__PURE__ */ React__default.createElement(NavLink, {
|
|
3403
3522
|
className: ({ isActive }) => {
|
|
3404
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`;
|
|
3405
3524
|
},
|
|
3525
|
+
onClick: props.onClick ? props.onClick : () => {
|
|
3526
|
+
},
|
|
3406
3527
|
to
|
|
3407
|
-
}, /* @__PURE__ */
|
|
3528
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
3408
3529
|
className: "mr-2 h-6 opacity-80 w-auto"
|
|
3409
3530
|
}), " ", label);
|
|
3410
3531
|
};
|
|
3411
3532
|
const GetCMS = ({ children }) => {
|
|
3412
3533
|
try {
|
|
3413
3534
|
const cms = useCMS();
|
|
3414
|
-
return /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(cms));
|
|
3415
3536
|
} catch (e) {
|
|
3416
3537
|
return null;
|
|
3417
3538
|
}
|
|
3418
3539
|
};
|
|
3419
|
-
function BiEdit(props) {
|
|
3420
|
-
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);
|
|
3421
|
-
}
|
|
3422
|
-
function BiLogIn(props) {
|
|
3423
|
-
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);
|
|
3424
|
-
}
|
|
3425
|
-
function BiLogOut(props) {
|
|
3426
|
-
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);
|
|
3427
|
-
}
|
|
3428
|
-
function BiPlus(props) {
|
|
3429
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z" } }] })(props);
|
|
3430
|
-
}
|
|
3431
|
-
function BiTrash(props) {
|
|
3432
|
-
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);
|
|
3433
|
-
}
|
|
3434
3540
|
function MdOutlineArrowBack(props) {
|
|
3435
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);
|
|
3436
3542
|
}
|
|
@@ -3438,52 +3544,52 @@ const AuthTemplate = ({
|
|
|
3438
3544
|
message,
|
|
3439
3545
|
children
|
|
3440
3546
|
}) => {
|
|
3441
|
-
return /* @__PURE__ */
|
|
3547
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3442
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"
|
|
3443
|
-
}, /* @__PURE__ */
|
|
3549
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3444
3550
|
className: "bg-white rounded-lg overflow-hidden shadow-lg w-full max-w-lg"
|
|
3445
|
-
}, /* @__PURE__ */
|
|
3551
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3446
3552
|
className: "px-5 py-4 border-b border-gray-150"
|
|
3447
|
-
}, /* @__PURE__ */
|
|
3448
|
-
className: "text-2xl tracking-wide text-gray-700 flex items-center gap-0.5"
|
|
3449
|
-
}, /* @__PURE__ */
|
|
3553
|
+
}, /* @__PURE__ */ React__default.createElement("h2", {
|
|
3554
|
+
className: "text-2xl font-sans tracking-wide text-gray-700 flex items-center gap-0.5"
|
|
3555
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
3450
3556
|
viewBox: "0 0 32 32",
|
|
3451
3557
|
fill: "#EC4815",
|
|
3452
3558
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3453
3559
|
className: "w-10 h-auto"
|
|
3454
|
-
}, /* @__PURE__ */
|
|
3560
|
+
}, /* @__PURE__ */ React__default.createElement("path", {
|
|
3455
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"
|
|
3456
|
-
}), /* @__PURE__ */
|
|
3562
|
+
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
3457
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"
|
|
3458
|
-
})), /* @__PURE__ */
|
|
3564
|
+
})), /* @__PURE__ */ React__default.createElement("span", null, "Tina"))), message && /* @__PURE__ */ React__default.createElement("div", {
|
|
3459
3565
|
className: "px-5 pt-4"
|
|
3460
|
-
}, /* @__PURE__ */
|
|
3566
|
+
}, /* @__PURE__ */ React__default.createElement("p", {
|
|
3461
3567
|
className: "text-base font-sans leading-normal"
|
|
3462
|
-
}, message)), /* @__PURE__ */
|
|
3568
|
+
}, message)), /* @__PURE__ */ React__default.createElement("div", {
|
|
3463
3569
|
className: "px-5 py-4 flex gap-4 w-full justify-between"
|
|
3464
3570
|
}, children)));
|
|
3465
3571
|
};
|
|
3466
3572
|
const LoginPage = () => {
|
|
3467
3573
|
const { setEdit } = useEditState();
|
|
3468
3574
|
const login = () => setEdit(true);
|
|
3469
|
-
return /* @__PURE__ */
|
|
3575
|
+
return /* @__PURE__ */ React__default.createElement(AuthTemplate, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3470
3576
|
className: "flex w-full flex-1 gap-4 items-center justify-end"
|
|
3471
|
-
}, /* @__PURE__ */
|
|
3577
|
+
}, /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3472
3578
|
onClick: () => {
|
|
3473
3579
|
window.location.href = "/";
|
|
3474
3580
|
},
|
|
3475
3581
|
variant: "white",
|
|
3476
3582
|
size: "custom",
|
|
3477
3583
|
className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
|
|
3478
|
-
}, /* @__PURE__ */
|
|
3584
|
+
}, /* @__PURE__ */ React__default.createElement(MdOutlineArrowBack, {
|
|
3479
3585
|
className: "w-6 h-auto mr-1.5 opacity-80"
|
|
3480
|
-
}), " Back To Site"), /* @__PURE__ */
|
|
3586
|
+
}), " Back To Site"), /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3481
3587
|
onClick: () => login(),
|
|
3482
3588
|
variant: "primary",
|
|
3483
3589
|
size: "custom",
|
|
3484
3590
|
className: "text-base h-12 px-6 flex-1",
|
|
3485
3591
|
type: "submit"
|
|
3486
|
-
}, /* @__PURE__ */
|
|
3592
|
+
}, /* @__PURE__ */ React__default.createElement(BiLogIn, {
|
|
3487
3593
|
className: "w-6 h-auto mr-2 opacity-80"
|
|
3488
3594
|
}), " Edit With Tina")));
|
|
3489
3595
|
};
|
|
@@ -3492,67 +3598,67 @@ const logout = () => {
|
|
|
3492
3598
|
window.location.href = "/";
|
|
3493
3599
|
};
|
|
3494
3600
|
const LogoutPage = () => {
|
|
3495
|
-
return /* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ React__default.createElement(AuthTemplate, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3496
3602
|
className: "flex w-full flex-1 gap-4 items-center justify-end"
|
|
3497
|
-
}, /* @__PURE__ */
|
|
3603
|
+
}, /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3498
3604
|
onClick: () => {
|
|
3499
3605
|
window.location.href = "/";
|
|
3500
3606
|
},
|
|
3501
3607
|
variant: "white",
|
|
3502
3608
|
size: "custom",
|
|
3503
3609
|
className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
|
|
3504
|
-
}, /* @__PURE__ */
|
|
3610
|
+
}, /* @__PURE__ */ React__default.createElement(MdOutlineArrowBack, {
|
|
3505
3611
|
className: "w-6 h-auto mr-1.5 opacity-80"
|
|
3506
|
-
}), " Back To Site"), /* @__PURE__ */
|
|
3612
|
+
}), " Back To Site"), /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3507
3613
|
onClick: () => logout(),
|
|
3508
3614
|
type: "submit",
|
|
3509
3615
|
variant: "primary",
|
|
3510
3616
|
size: "custom",
|
|
3511
3617
|
className: "text-base h-12 px-6 flex-1"
|
|
3512
|
-
}, /* @__PURE__ */
|
|
3618
|
+
}, /* @__PURE__ */ React__default.createElement(BiLogOut, {
|
|
3513
3619
|
className: "w-6 h-auto mr-1.5 opacity-80"
|
|
3514
3620
|
}), " Log Out of Tina")));
|
|
3515
3621
|
};
|
|
3516
3622
|
const PageWrapper = ({
|
|
3517
3623
|
children
|
|
3518
3624
|
}) => {
|
|
3519
|
-
return /* @__PURE__ */
|
|
3625
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
3520
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"
|
|
3521
3627
|
}, children);
|
|
3522
3628
|
};
|
|
3523
3629
|
const PageHeader = ({
|
|
3524
3630
|
isLocalMode,
|
|
3525
3631
|
children
|
|
3526
|
-
}) => /* @__PURE__ */
|
|
3632
|
+
}) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement("div", {
|
|
3527
3633
|
className: "bg-white pb-4 pt-18 border-b border-gray-200 px-12"
|
|
3528
|
-
}, /* @__PURE__ */
|
|
3634
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3529
3635
|
className: "w-full mx-auto max-w-screen-xl"
|
|
3530
|
-
}, /* @__PURE__ */
|
|
3636
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3531
3637
|
className: "w-full flex justify-between items-end"
|
|
3532
3638
|
}, children))));
|
|
3533
3639
|
const PageBody = ({
|
|
3534
3640
|
children
|
|
3535
|
-
}) => /* @__PURE__ */
|
|
3641
|
+
}) => /* @__PURE__ */ React__default.createElement("div", {
|
|
3536
3642
|
className: "py-10 px-12"
|
|
3537
3643
|
}, children);
|
|
3538
3644
|
const PageBodyNarrow = ({
|
|
3539
3645
|
children
|
|
3540
|
-
}) => /* @__PURE__ */
|
|
3646
|
+
}) => /* @__PURE__ */ React__default.createElement("div", {
|
|
3541
3647
|
className: "py-10 px-12"
|
|
3542
|
-
}, /* @__PURE__ */
|
|
3648
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3543
3649
|
className: "w-full mx-auto max-w-screen-xl"
|
|
3544
3650
|
}, children));
|
|
3545
3651
|
const DashboardPage = () => {
|
|
3546
|
-
return /* @__PURE__ */
|
|
3652
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
3547
3653
|
var _a, _b;
|
|
3548
|
-
return /* @__PURE__ */
|
|
3654
|
+
return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(PageHeader, {
|
|
3549
3655
|
isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode
|
|
3550
|
-
}, /* @__PURE__ */
|
|
3551
|
-
className: "text-2xl text-gray-700"
|
|
3552
|
-
}, "Welcome to Tina!")), /* @__PURE__ */
|
|
3656
|
+
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
3657
|
+
className: "text-2xl font-sans text-gray-700"
|
|
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.")));
|
|
3553
3659
|
});
|
|
3554
3660
|
};
|
|
3555
|
-
const LoadingPage = () => /* @__PURE__ */
|
|
3661
|
+
const LoadingPage = () => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3556
3662
|
style: {
|
|
3557
3663
|
position: "absolute",
|
|
3558
3664
|
top: 0,
|
|
@@ -3566,7 +3672,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3566
3672
|
justifyContent: "center",
|
|
3567
3673
|
padding: "120px 40px 40px 40px"
|
|
3568
3674
|
}
|
|
3569
|
-
}, /* @__PURE__ */
|
|
3675
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3570
3676
|
style: {
|
|
3571
3677
|
background: "#FFF",
|
|
3572
3678
|
border: "1px solid #EDECF3",
|
|
@@ -3580,7 +3686,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3580
3686
|
justifyContent: "center",
|
|
3581
3687
|
flexDirection: "column"
|
|
3582
3688
|
}
|
|
3583
|
-
}, /* @__PURE__ */
|
|
3689
|
+
}, /* @__PURE__ */ React__default.createElement("svg", {
|
|
3584
3690
|
style: {
|
|
3585
3691
|
width: "64px",
|
|
3586
3692
|
color: "#2296fe",
|
|
@@ -3596,13 +3702,13 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3596
3702
|
viewBox: "0 0 100 64",
|
|
3597
3703
|
enableBackground: "new 0 0 0 0",
|
|
3598
3704
|
xmlSpace: "preserve"
|
|
3599
|
-
}, /* @__PURE__ */
|
|
3705
|
+
}, /* @__PURE__ */ React__default.createElement("circle", {
|
|
3600
3706
|
fill: "currentColor",
|
|
3601
3707
|
stroke: "none",
|
|
3602
3708
|
cx: 6,
|
|
3603
3709
|
cy: 32,
|
|
3604
3710
|
r: 6
|
|
3605
|
-
}, /* @__PURE__ */
|
|
3711
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3606
3712
|
attributeName: "transform",
|
|
3607
3713
|
dur: "1s",
|
|
3608
3714
|
type: "translate",
|
|
@@ -3611,13 +3717,13 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3611
3717
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3612
3718
|
repeatCount: "indefinite",
|
|
3613
3719
|
begin: "0.1"
|
|
3614
|
-
})), /* @__PURE__ */
|
|
3720
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3615
3721
|
fill: "currentColor",
|
|
3616
3722
|
stroke: "none",
|
|
3617
3723
|
cx: 30,
|
|
3618
3724
|
cy: 32,
|
|
3619
3725
|
r: 6
|
|
3620
|
-
}, /* @__PURE__ */
|
|
3726
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3621
3727
|
attributeName: "transform",
|
|
3622
3728
|
dur: "1s",
|
|
3623
3729
|
type: "translate",
|
|
@@ -3626,13 +3732,13 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3626
3732
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3627
3733
|
repeatCount: "indefinite",
|
|
3628
3734
|
begin: "0.2"
|
|
3629
|
-
})), /* @__PURE__ */
|
|
3735
|
+
})), /* @__PURE__ */ React__default.createElement("circle", {
|
|
3630
3736
|
fill: "currentColor",
|
|
3631
3737
|
stroke: "none",
|
|
3632
3738
|
cx: 54,
|
|
3633
3739
|
cy: 32,
|
|
3634
3740
|
r: 6
|
|
3635
|
-
}, /* @__PURE__ */
|
|
3741
|
+
}, /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
3636
3742
|
attributeName: "transform",
|
|
3637
3743
|
dur: "1s",
|
|
3638
3744
|
type: "translate",
|
|
@@ -3641,7 +3747,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3641
3747
|
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
3642
3748
|
repeatCount: "indefinite",
|
|
3643
3749
|
begin: "0.3"
|
|
3644
|
-
}))), /* @__PURE__ */
|
|
3750
|
+
}))), /* @__PURE__ */ React__default.createElement("p", {
|
|
3645
3751
|
style: {
|
|
3646
3752
|
fontSize: "16px",
|
|
3647
3753
|
color: "#716c7f",
|
|
@@ -3651,7 +3757,7 @@ const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, nu
|
|
|
3651
3757
|
fontWeight: "normal"
|
|
3652
3758
|
}
|
|
3653
3759
|
}, "Please wait, Tina is loading data..."))));
|
|
3654
|
-
const useGetCollection = (cms, collectionName, includeDocuments = true) => {
|
|
3760
|
+
const useGetCollection = (cms, collectionName, includeDocuments = true, after = "") => {
|
|
3655
3761
|
const api = new TinaAdminApi(cms);
|
|
3656
3762
|
const [collection, setCollection] = useState(void 0);
|
|
3657
3763
|
const [loading, setLoading] = useState(true);
|
|
@@ -3661,7 +3767,7 @@ const useGetCollection = (cms, collectionName, includeDocuments = true) => {
|
|
|
3661
3767
|
const fetchCollection = async () => {
|
|
3662
3768
|
if (await api.isAuthenticated()) {
|
|
3663
3769
|
try {
|
|
3664
|
-
const collection2 = await api.fetchCollection(collectionName, includeDocuments);
|
|
3770
|
+
const collection2 = await api.fetchCollection(collectionName, includeDocuments, after);
|
|
3665
3771
|
setCollection(collection2);
|
|
3666
3772
|
} catch (error2) {
|
|
3667
3773
|
cms.alerts.error(`[${error2.name}] GetCollection failed: ${error2.message}`, 30 * 1e3);
|
|
@@ -3674,7 +3780,7 @@ const useGetCollection = (cms, collectionName, includeDocuments = true) => {
|
|
|
3674
3780
|
};
|
|
3675
3781
|
setLoading(true);
|
|
3676
3782
|
fetchCollection();
|
|
3677
|
-
}, [cms, collectionName, resetState]);
|
|
3783
|
+
}, [cms, collectionName, resetState, after]);
|
|
3678
3784
|
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
3679
3785
|
return { collection, loading, error, reFetchCollection };
|
|
3680
3786
|
};
|
|
@@ -3682,26 +3788,169 @@ const GetCollection = ({
|
|
|
3682
3788
|
cms,
|
|
3683
3789
|
collectionName,
|
|
3684
3790
|
includeDocuments = true,
|
|
3791
|
+
startCursor,
|
|
3685
3792
|
children
|
|
3686
3793
|
}) => {
|
|
3687
|
-
const { collection, loading, error, reFetchCollection } = useGetCollection(cms, collectionName, includeDocuments);
|
|
3794
|
+
const { collection, loading, error, reFetchCollection } = useGetCollection(cms, collectionName, includeDocuments, startCursor || "");
|
|
3688
3795
|
if (error) {
|
|
3689
3796
|
return null;
|
|
3690
3797
|
}
|
|
3691
3798
|
if (loading) {
|
|
3692
|
-
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;
|
|
3693
3869
|
}
|
|
3694
|
-
|
|
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);
|
|
3695
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
|
+
}
|
|
3696
3945
|
const TemplateMenu = ({ templates }) => {
|
|
3697
|
-
return /* @__PURE__ */
|
|
3946
|
+
return /* @__PURE__ */ React__default.createElement(Menu, {
|
|
3698
3947
|
as: "div",
|
|
3699
3948
|
className: "relative inline-block text-left"
|
|
3700
|
-
}, () => /* @__PURE__ */
|
|
3949
|
+
}, () => /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Menu.Button, {
|
|
3701
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"
|
|
3702
|
-
}, "Create New ", /* @__PURE__ */
|
|
3951
|
+
}, "Create New ", /* @__PURE__ */ React__default.createElement(BiPlus, {
|
|
3703
3952
|
className: "w-5 h-full ml-1 opacity-70"
|
|
3704
|
-
}))), /* @__PURE__ */
|
|
3953
|
+
}))), /* @__PURE__ */ React__default.createElement(Transition, {
|
|
3705
3954
|
as: Fragment,
|
|
3706
3955
|
enter: "transition ease-out duration-100",
|
|
3707
3956
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -3709,13 +3958,13 @@ const TemplateMenu = ({ templates }) => {
|
|
|
3709
3958
|
leave: "transition ease-in duration-75",
|
|
3710
3959
|
leaveFrom: "transform opacity-100 scale-100",
|
|
3711
3960
|
leaveTo: "transform opacity-0 scale-95"
|
|
3712
|
-
}, /* @__PURE__ */
|
|
3961
|
+
}, /* @__PURE__ */ React__default.createElement(Menu.Items, {
|
|
3713
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"
|
|
3714
|
-
}, /* @__PURE__ */
|
|
3963
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3715
3964
|
className: "py-1"
|
|
3716
|
-
}, templates.map((template) => /* @__PURE__ */
|
|
3965
|
+
}, templates.map((template) => /* @__PURE__ */ React__default.createElement(Menu.Item, {
|
|
3717
3966
|
key: `${template.label}-${template.name}`
|
|
3718
|
-
}, ({ active }) => /* @__PURE__ */
|
|
3967
|
+
}, ({ active }) => /* @__PURE__ */ React__default.createElement(Link, {
|
|
3719
3968
|
to: `${template.name}/new`,
|
|
3720
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"}`
|
|
3721
3970
|
}, template.label))))))));
|
|
@@ -3734,22 +3983,32 @@ const handleNavigate = (navigate, cms, collection, document) => {
|
|
|
3734
3983
|
const CollectionListPage = () => {
|
|
3735
3984
|
const navigate = useNavigate();
|
|
3736
3985
|
const { collectionName } = useParams();
|
|
3737
|
-
const [open, setOpen] =
|
|
3738
|
-
const [vars, setVars] =
|
|
3986
|
+
const [open, setOpen] = React__default.useState(false);
|
|
3987
|
+
const [vars, setVars] = React__default.useState({
|
|
3739
3988
|
collection: collectionName,
|
|
3740
3989
|
relativePath: ""
|
|
3741
3990
|
});
|
|
3742
|
-
|
|
3743
|
-
|
|
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, {
|
|
3744
4000
|
cms,
|
|
3745
4001
|
collectionName,
|
|
3746
|
-
includeDocuments: true
|
|
4002
|
+
includeDocuments: true,
|
|
4003
|
+
startCursor: endCursor
|
|
3747
4004
|
}, (collection, _loading, reFetchCollection) => {
|
|
3748
4005
|
var _a, _b;
|
|
3749
4006
|
const totalCount = collection.documents.totalCount;
|
|
3750
4007
|
const documents = collection.documents.edges;
|
|
3751
4008
|
const admin = cms.api.admin;
|
|
3752
|
-
|
|
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, {
|
|
3753
4012
|
filename: vars.relativePath,
|
|
3754
4013
|
deleteFunc: async () => {
|
|
3755
4014
|
try {
|
|
@@ -3763,114 +4022,133 @@ const CollectionListPage = () => {
|
|
|
3763
4022
|
}
|
|
3764
4023
|
},
|
|
3765
4024
|
close: () => setOpen(false)
|
|
3766
|
-
}), /* @__PURE__ */
|
|
4025
|
+
}), /* @__PURE__ */ React__default.createElement(PageHeader, {
|
|
3767
4026
|
isLocalMode: (_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode
|
|
3768
|
-
}, /* @__PURE__ */
|
|
3769
|
-
className: "text-2xl text-gray-700"
|
|
3770
|
-
}, collection.label ? collection.label : collection.name), !collection.templates && /* @__PURE__ */
|
|
4027
|
+
}, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("h3", {
|
|
4028
|
+
className: "font-sans text-2xl text-gray-700"
|
|
4029
|
+
}, collection.label ? collection.label : collection.name), !collection.templates && /* @__PURE__ */ React__default.createElement(Link, {
|
|
3771
4030
|
to: `new`,
|
|
3772
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"
|
|
3773
|
-
}, "Create New", " ", /* @__PURE__ */
|
|
4032
|
+
}, "Create New", " ", /* @__PURE__ */ React__default.createElement(BiPlus, {
|
|
3774
4033
|
className: "w-5 h-full ml-1 opacity-70"
|
|
3775
|
-
})), collection.templates && /* @__PURE__ */
|
|
4034
|
+
})), collection.templates && /* @__PURE__ */ React__default.createElement(TemplateMenu, {
|
|
3776
4035
|
templates: collection.templates
|
|
3777
|
-
}))), /* @__PURE__ */
|
|
4036
|
+
}))), /* @__PURE__ */ React__default.createElement(PageBody, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
3778
4037
|
className: "w-full mx-auto max-w-screen-xl"
|
|
3779
|
-
}, totalCount > 0 && /* @__PURE__ */
|
|
4038
|
+
}, totalCount > 0 && /* @__PURE__ */ React__default.createElement("table", {
|
|
3780
4039
|
className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg"
|
|
3781
|
-
}, /* @__PURE__ */
|
|
4040
|
+
}, /* @__PURE__ */ React__default.createElement("tbody", {
|
|
3782
4041
|
className: "divide-y divide-gray-150"
|
|
3783
4042
|
}, documents.map((document) => {
|
|
3784
4043
|
var _a2;
|
|
3785
4044
|
const hasTitle = Boolean(document.node._sys.title);
|
|
3786
4045
|
const subfolders = document.node._sys.breadcrumbs.slice(0, -1).join("/");
|
|
3787
|
-
return /* @__PURE__ */
|
|
4046
|
+
return /* @__PURE__ */ React__default.createElement("tr", {
|
|
3788
4047
|
key: `document-${document.node._sys.relativePath}`,
|
|
3789
4048
|
className: ""
|
|
3790
|
-
}, /* @__PURE__ */
|
|
4049
|
+
}, /* @__PURE__ */ React__default.createElement("td", {
|
|
3791
4050
|
className: "px-6 py-2 whitespace-nowrap"
|
|
3792
|
-
}, /* @__PURE__ */
|
|
4051
|
+
}, /* @__PURE__ */ React__default.createElement("a", {
|
|
3793
4052
|
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer",
|
|
3794
4053
|
onClick: () => {
|
|
3795
4054
|
handleNavigate(navigate, cms, collection, document.node);
|
|
3796
4055
|
}
|
|
3797
|
-
}, /* @__PURE__ */
|
|
4056
|
+
}, /* @__PURE__ */ React__default.createElement(BiEdit, {
|
|
3798
4057
|
className: "inline-block h-6 w-auto opacity-70"
|
|
3799
|
-
}), /* @__PURE__ */
|
|
4058
|
+
}), /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", {
|
|
3800
4059
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3801
|
-
}, hasTitle ? "Title" : "Filename"), /* @__PURE__ */
|
|
4060
|
+
}, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3802
4061
|
className: "h-5 leading-5 block whitespace-nowrap"
|
|
3803
|
-
}, subfolders && /* @__PURE__ */
|
|
4062
|
+
}, subfolders && /* @__PURE__ */ React__default.createElement("span", {
|
|
3804
4063
|
className: "text-xs text-gray-400"
|
|
3805
|
-
}, `${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", {
|
|
3806
4065
|
className: "px-6 py-4 whitespace-nowrap"
|
|
3807
|
-
}, /* @__PURE__ */
|
|
4066
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3808
4067
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3809
|
-
}, "Filename"), /* @__PURE__ */
|
|
4068
|
+
}, "Filename"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3810
4069
|
className: "h-5 leading-5 block text-sm font-medium text-gray-900"
|
|
3811
|
-
}, document.node._sys.filename)), /* @__PURE__ */
|
|
4070
|
+
}, document.node._sys.filename)), /* @__PURE__ */ React__default.createElement("td", {
|
|
3812
4071
|
className: "px-6 py-4 whitespace-nowrap"
|
|
3813
|
-
}, /* @__PURE__ */
|
|
4072
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3814
4073
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3815
|
-
}, "Extension"), /* @__PURE__ */
|
|
4074
|
+
}, "Extension"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3816
4075
|
className: "h-5 leading-5 block text-sm font-medium text-gray-900"
|
|
3817
|
-
}, document.node._sys.extension)), /* @__PURE__ */
|
|
4076
|
+
}, document.node._sys.extension)), /* @__PURE__ */ React__default.createElement("td", {
|
|
3818
4077
|
className: "px-6 py-4 whitespace-nowrap"
|
|
3819
|
-
}, /* @__PURE__ */
|
|
4078
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3820
4079
|
className: "block text-xs text-gray-400 mb-1 uppercase"
|
|
3821
|
-
}, "Template"), /* @__PURE__ */
|
|
4080
|
+
}, "Template"), /* @__PURE__ */ React__default.createElement("span", {
|
|
3822
4081
|
className: "h-5 leading-5 block text-sm font-medium text-gray-900"
|
|
3823
|
-
}, document.node._sys.template)), /* @__PURE__ */
|
|
4082
|
+
}, document.node._sys.template)), /* @__PURE__ */ React__default.createElement("td", {
|
|
3824
4083
|
className: "w-0"
|
|
3825
|
-
}, /* @__PURE__ */
|
|
4084
|
+
}, /* @__PURE__ */ React__default.createElement(OverflowMenu, {
|
|
3826
4085
|
toolbarItems: [
|
|
3827
4086
|
{
|
|
3828
4087
|
name: "edit",
|
|
3829
4088
|
label: "Edit in Admin",
|
|
3830
|
-
Icon: /* @__PURE__ */
|
|
4089
|
+
Icon: /* @__PURE__ */ React__default.createElement(BiEdit, {
|
|
3831
4090
|
size: "1.3rem"
|
|
3832
4091
|
}),
|
|
3833
4092
|
onMouseDown: () => {
|
|
3834
|
-
navigate(`${document.node._sys.
|
|
4093
|
+
navigate(`${document.node._sys.breadcrumbs.join("/")}`, { replace: true });
|
|
3835
4094
|
}
|
|
3836
4095
|
},
|
|
3837
4096
|
{
|
|
3838
4097
|
name: "delete",
|
|
3839
4098
|
label: "Delete",
|
|
3840
|
-
Icon: /* @__PURE__ */
|
|
4099
|
+
Icon: /* @__PURE__ */ React__default.createElement(BiTrash, {
|
|
3841
4100
|
size: "1.3rem",
|
|
3842
4101
|
className: "text-red-500"
|
|
3843
4102
|
}),
|
|
3844
4103
|
onMouseDown: () => {
|
|
3845
4104
|
setVars({
|
|
3846
4105
|
collection: collectionName,
|
|
3847
|
-
relativePath: document.node._sys.
|
|
4106
|
+
relativePath: document.node._sys.breadcrumbs.join("/") + document.node._sys.extension
|
|
3848
4107
|
});
|
|
3849
4108
|
setOpen(true);
|
|
3850
4109
|
}
|
|
3851
4110
|
}
|
|
3852
4111
|
]
|
|
3853
4112
|
})));
|
|
3854
|
-
})))
|
|
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
|
+
}))))));
|
|
3855
4133
|
});
|
|
3856
4134
|
});
|
|
3857
4135
|
};
|
|
3858
4136
|
const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
|
|
3859
|
-
return /* @__PURE__ */
|
|
4137
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, {
|
|
3860
4138
|
close: close2
|
|
3861
|
-
}, "Delete ", filename), /* @__PURE__ */
|
|
4139
|
+
}, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, {
|
|
3862
4140
|
padded: true
|
|
3863
|
-
}, /* @__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, {
|
|
3864
4142
|
style: { flexGrow: 2 },
|
|
3865
4143
|
onClick: close2
|
|
3866
|
-
}, "Cancel"), /* @__PURE__ */
|
|
4144
|
+
}, "Cancel"), /* @__PURE__ */ React__default.createElement(Button$1, {
|
|
3867
4145
|
style: { flexGrow: 3 },
|
|
3868
4146
|
variant: "danger",
|
|
3869
4147
|
onClick: async () => {
|
|
3870
4148
|
await deleteFunc();
|
|
3871
4149
|
close2();
|
|
3872
4150
|
}
|
|
3873
|
-
}, "Delete")))
|
|
4151
|
+
}, "Delete")));
|
|
3874
4152
|
};
|
|
3875
4153
|
function HiChevronRight(props) {
|
|
3876
4154
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 20 20", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", "clipRule": "evenodd" } }] })(props);
|
|
@@ -3897,7 +4175,7 @@ const createDocument = async (cms, collection, template, mutationInfo, values) =
|
|
|
3897
4175
|
};
|
|
3898
4176
|
const CollectionCreatePage = () => {
|
|
3899
4177
|
const { collectionName, templateName } = useParams();
|
|
3900
|
-
return /* @__PURE__ */
|
|
4178
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => /* @__PURE__ */ React__default.createElement(GetCollection, {
|
|
3901
4179
|
cms,
|
|
3902
4180
|
collectionName,
|
|
3903
4181
|
includeDocuments: false
|
|
@@ -3906,7 +4184,7 @@ const CollectionCreatePage = () => {
|
|
|
3906
4184
|
includeCollection: true,
|
|
3907
4185
|
includeTemplate: !!collection.templates
|
|
3908
4186
|
};
|
|
3909
|
-
return /* @__PURE__ */
|
|
4187
|
+
return /* @__PURE__ */ React__default.createElement(RenderForm$1, {
|
|
3910
4188
|
cms,
|
|
3911
4189
|
collection,
|
|
3912
4190
|
templateName,
|
|
@@ -3939,7 +4217,7 @@ const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
|
3939
4217
|
name: "filename",
|
|
3940
4218
|
label: "Filename",
|
|
3941
4219
|
component: "text",
|
|
3942
|
-
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")),
|
|
3943
4221
|
placeholder: `My_Document`,
|
|
3944
4222
|
validate: (value, allValues, meta) => {
|
|
3945
4223
|
if (!value) {
|
|
@@ -3968,24 +4246,28 @@ const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
|
3968
4246
|
}
|
|
3969
4247
|
});
|
|
3970
4248
|
}, [cms, collection, mutationInfo]);
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
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", {
|
|
3974
4256
|
className: "max-w-form mx-auto"
|
|
3975
|
-
}, /* @__PURE__ */
|
|
4257
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
3976
4258
|
className: "mb-2"
|
|
3977
|
-
}, /* @__PURE__ */
|
|
4259
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
3978
4260
|
className: "block text-sm leading-tight uppercase text-gray-400 mb-1"
|
|
3979
|
-
}, /* @__PURE__ */
|
|
4261
|
+
}, /* @__PURE__ */ React__default.createElement(Link, {
|
|
3980
4262
|
to: `/collections/${collection.name}`,
|
|
3981
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"
|
|
3982
|
-
}, collection.label ? collection.label : collection.name), /* @__PURE__ */
|
|
4264
|
+
}, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement(HiChevronRight, {
|
|
3983
4265
|
className: "inline-block -mt-0.5 opacity-50"
|
|
3984
|
-
})), /* @__PURE__ */
|
|
4266
|
+
})), /* @__PURE__ */ React__default.createElement("span", {
|
|
3985
4267
|
className: "text-xl text-gray-700 font-medium leading-tight"
|
|
3986
|
-
}, "Create New")), /* @__PURE__ */
|
|
4268
|
+
}, "Create New")), /* @__PURE__ */ React__default.createElement(FormStatus, {
|
|
3987
4269
|
pristine: formIsPristine
|
|
3988
|
-
}))), /* @__PURE__ */
|
|
4270
|
+
}))), /* @__PURE__ */ React__default.createElement(FormBuilder, {
|
|
3989
4271
|
form,
|
|
3990
4272
|
onPristineChange: setFormIsPristine
|
|
3991
4273
|
})));
|
|
@@ -4026,9 +4308,9 @@ const GetDocument = ({
|
|
|
4026
4308
|
return null;
|
|
4027
4309
|
}
|
|
4028
4310
|
if (loading) {
|
|
4029
|
-
return /* @__PURE__ */
|
|
4311
|
+
return /* @__PURE__ */ React__default.createElement(LoadingPage, null);
|
|
4030
4312
|
}
|
|
4031
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(document, loading));
|
|
4032
4314
|
};
|
|
4033
4315
|
const updateDocument = async (cms, relativePath, collection, mutationInfo, values) => {
|
|
4034
4316
|
const api = new TinaAdminApi(cms);
|
|
@@ -4049,7 +4331,7 @@ const updateDocument = async (cms, relativePath, collection, mutationInfo, value
|
|
|
4049
4331
|
const CollectionUpdatePage = () => {
|
|
4050
4332
|
const _a = useParams(), { collectionName } = _a, rest = __objRest(_a, ["collectionName"]);
|
|
4051
4333
|
const { "*": filename } = rest;
|
|
4052
|
-
return /* @__PURE__ */
|
|
4334
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => /* @__PURE__ */ React__default.createElement(GetCollection, {
|
|
4053
4335
|
cms,
|
|
4054
4336
|
collectionName,
|
|
4055
4337
|
includeDocuments: false
|
|
@@ -4059,11 +4341,11 @@ const CollectionUpdatePage = () => {
|
|
|
4059
4341
|
includeCollection: true,
|
|
4060
4342
|
includeTemplate: !!collection.templates
|
|
4061
4343
|
};
|
|
4062
|
-
return /* @__PURE__ */
|
|
4344
|
+
return /* @__PURE__ */ React__default.createElement(GetDocument, {
|
|
4063
4345
|
cms,
|
|
4064
4346
|
collectionName: collection.name,
|
|
4065
4347
|
relativePath
|
|
4066
|
-
}, (document) => /* @__PURE__ */
|
|
4348
|
+
}, (document) => /* @__PURE__ */ React__default.createElement(RenderForm, {
|
|
4067
4349
|
cms,
|
|
4068
4350
|
document,
|
|
4069
4351
|
filename,
|
|
@@ -4112,46 +4394,55 @@ const RenderForm = ({
|
|
|
4112
4394
|
}
|
|
4113
4395
|
});
|
|
4114
4396
|
}, [cms, document, relativePath, collection, mutationInfo]);
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
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", {
|
|
4118
4404
|
className: "max-w-form mx-auto"
|
|
4119
|
-
}, /* @__PURE__ */
|
|
4405
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
4120
4406
|
className: "mb-2"
|
|
4121
|
-
}, /* @__PURE__ */
|
|
4407
|
+
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
4122
4408
|
className: "block text-sm leading-tight uppercase text-gray-400 mb-1"
|
|
4123
|
-
}, /* @__PURE__ */
|
|
4409
|
+
}, /* @__PURE__ */ React__default.createElement(Link, {
|
|
4124
4410
|
to: `/collections/${collection.name}`,
|
|
4125
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"
|
|
4126
|
-
}, collection.label ? collection.label : collection.name), /* @__PURE__ */
|
|
4412
|
+
}, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement(HiChevronRight, {
|
|
4127
4413
|
className: "inline-block -mt-0.5 opacity-50"
|
|
4128
|
-
})), /* @__PURE__ */
|
|
4414
|
+
})), /* @__PURE__ */ React__default.createElement("span", {
|
|
4129
4415
|
className: "text-xl text-gray-700 font-medium leading-tight"
|
|
4130
|
-
}, "Edit ", `${filename}.${collection.format}`)), /* @__PURE__ */
|
|
4416
|
+
}, "Edit ", `${filename}.${collection.format}`)), /* @__PURE__ */ React__default.createElement(FormStatus, {
|
|
4131
4417
|
pristine: formIsPristine
|
|
4132
|
-
}))), /* @__PURE__ */
|
|
4418
|
+
}))), /* @__PURE__ */ React__default.createElement(FormBuilder, {
|
|
4133
4419
|
form,
|
|
4134
4420
|
onPristineChange: setFormIsPristine
|
|
4135
4421
|
})));
|
|
4136
4422
|
};
|
|
4137
4423
|
const ScreenPage = () => {
|
|
4138
4424
|
const { screenName } = useParams();
|
|
4139
|
-
|
|
4425
|
+
const navBreakpoint = 1e3;
|
|
4426
|
+
const windowWidth = useWindowWidth();
|
|
4427
|
+
const renderNavToggle = windowWidth < navBreakpoint + 1;
|
|
4428
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
4140
4429
|
var _a, _b;
|
|
4141
4430
|
const screens = cms.plugins.getType("screen").all();
|
|
4142
4431
|
const selectedScreen = screens.find(({ name }) => slugify(name) === screenName);
|
|
4143
|
-
return /* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
4144
4433
|
className: "relative w-full h-full flex flex-col items-stretch justify-between"
|
|
4145
|
-
}, ((_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", {
|
|
4146
4437
|
className: "flex-1 overflow-y-auto relative flex flex-col items-stretch justify-between"
|
|
4147
|
-
}, /* @__PURE__ */
|
|
4438
|
+
}, /* @__PURE__ */ React__default.createElement(selectedScreen.Component, {
|
|
4148
4439
|
close: () => {
|
|
4149
4440
|
}
|
|
4150
4441
|
})));
|
|
4151
4442
|
});
|
|
4152
4443
|
};
|
|
4153
4444
|
const Redirect = () => {
|
|
4154
|
-
|
|
4445
|
+
React__default.useEffect(() => {
|
|
4155
4446
|
if (window) {
|
|
4156
4447
|
window.location.assign("/");
|
|
4157
4448
|
}
|
|
@@ -4165,43 +4456,43 @@ const TinaAdmin = () => {
|
|
|
4165
4456
|
return null;
|
|
4166
4457
|
}
|
|
4167
4458
|
if (!edit) {
|
|
4168
|
-
return /* @__PURE__ */
|
|
4459
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(LoginPage, null));
|
|
4169
4460
|
}
|
|
4170
|
-
return /* @__PURE__ */
|
|
4461
|
+
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
4171
4462
|
const isTinaAdminEnabled = cms.flags.get("tina-admin") === false ? false : true;
|
|
4172
4463
|
if (isTinaAdminEnabled) {
|
|
4173
|
-
return /* @__PURE__ */
|
|
4464
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(HashRouter, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
4174
4465
|
className: "flex items-stretch h-screen overflow-hidden"
|
|
4175
|
-
}, /* @__PURE__ */
|
|
4466
|
+
}, /* @__PURE__ */ React__default.createElement(Sidebar, {
|
|
4176
4467
|
cms
|
|
4177
|
-
}), /* @__PURE__ */
|
|
4468
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
4178
4469
|
className: "flex-1 relative"
|
|
4179
|
-
}, /* @__PURE__ */
|
|
4470
|
+
}, /* @__PURE__ */ React__default.createElement(Routes, null, /* @__PURE__ */ React__default.createElement(Route, {
|
|
4180
4471
|
path: "collections/:collectionName/new",
|
|
4181
|
-
element: /* @__PURE__ */
|
|
4182
|
-
}), /* @__PURE__ */
|
|
4472
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionCreatePage, null)
|
|
4473
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4183
4474
|
path: "collections/:collectionName/:templateName/new",
|
|
4184
|
-
element: /* @__PURE__ */
|
|
4185
|
-
}), /* @__PURE__ */
|
|
4475
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionCreatePage, null)
|
|
4476
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4186
4477
|
path: "collections/:collectionName/*",
|
|
4187
|
-
element: /* @__PURE__ */
|
|
4188
|
-
}), /* @__PURE__ */
|
|
4478
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionUpdatePage, null)
|
|
4479
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4189
4480
|
path: "collections/:collectionName",
|
|
4190
|
-
element: /* @__PURE__ */
|
|
4191
|
-
}), /* @__PURE__ */
|
|
4481
|
+
element: /* @__PURE__ */ React__default.createElement(CollectionListPage, null)
|
|
4482
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4192
4483
|
path: "screens/:screenName",
|
|
4193
|
-
element: /* @__PURE__ */
|
|
4194
|
-
}), /* @__PURE__ */
|
|
4484
|
+
element: /* @__PURE__ */ React__default.createElement(ScreenPage, null)
|
|
4485
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4195
4486
|
path: "/",
|
|
4196
|
-
element: /* @__PURE__ */
|
|
4487
|
+
element: /* @__PURE__ */ React__default.createElement(DashboardPage, null)
|
|
4197
4488
|
}))))));
|
|
4198
4489
|
} else {
|
|
4199
|
-
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, {
|
|
4200
4491
|
path: "logout",
|
|
4201
|
-
element: /* @__PURE__ */
|
|
4202
|
-
}), /* @__PURE__ */
|
|
4492
|
+
element: /* @__PURE__ */ React__default.createElement(LogoutPage, null)
|
|
4493
|
+
}), /* @__PURE__ */ React__default.createElement(Route, {
|
|
4203
4494
|
path: "/",
|
|
4204
|
-
element: /* @__PURE__ */
|
|
4495
|
+
element: /* @__PURE__ */ React__default.createElement(Redirect, null)
|
|
4205
4496
|
}))));
|
|
4206
4497
|
}
|
|
4207
4498
|
});
|