tinacms 1.6.6 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/AuthTemplate.d.ts +2 -2
- package/dist/admin/components/ErrorDialog.d.ts +2 -2
- package/dist/admin/components/FullscreenError.d.ts +2 -2
- package/dist/admin/components/GetCMS.d.ts +2 -2
- package/dist/admin/components/GetCollection.d.ts +2 -2
- package/dist/admin/components/GetCollections.d.ts +2 -2
- package/dist/admin/components/GetDocument.d.ts +2 -2
- package/dist/admin/components/Layout.d.ts +2 -2
- package/dist/admin/components/LoadingPage.d.ts +2 -2
- package/dist/admin/components/Page.d.ts +11 -11
- package/dist/admin/components/Sidebar.d.ts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/pages/CollectionCreatePage.d.ts +3 -3
- package/dist/admin/pages/CollectionDuplicatePage.d.ts +2 -2
- package/dist/admin/pages/CollectionListPage.d.ts +2 -2
- package/dist/admin/pages/CollectionUpdatePage.d.ts +2 -2
- package/dist/admin/pages/DashboardPage.d.ts +2 -2
- package/dist/admin/pages/ScreenPage.d.ts +2 -2
- package/dist/auth/AuthModal.d.ts +3 -3
- package/dist/auth/TinaCloudProvider.d.ts +3 -3
- package/dist/index.js +26 -185
- package/dist/index.mjs +26 -186
- package/dist/internalClient/formify.d.ts +1 -1
- package/dist/rich-text/index.d.ts +2 -2
- package/dist/rich-text/prism.d.ts +2 -2
- package/dist/tina-cms.d.ts +3 -9
- package/dist/toolkit/alerts/alerts.d.ts +1 -1
- package/dist/toolkit/components/account/update-password.d.ts +2 -2
- package/dist/toolkit/components/active-field-indicator.d.ts +2 -2
- package/dist/toolkit/components/media/breadcrumb.d.ts +2 -2
- package/dist/toolkit/components/media/copy-field.d.ts +2 -2
- package/dist/toolkit/components/media/media-item.d.ts +3 -3
- package/dist/toolkit/components/media/media-manager.d.ts +3 -3
- package/dist/toolkit/components/media/modal.d.ts +3 -3
- package/dist/toolkit/components/media/pagination.d.ts +2 -2
- package/dist/toolkit/components/mutation-signal.d.ts +1 -1
- package/dist/toolkit/fields/components/image-upload/image-upload.d.ts +3 -3
- package/dist/toolkit/fields/components/input.d.ts +2 -2
- package/dist/toolkit/fields/components/password-field.d.ts +1 -1
- package/dist/toolkit/fields/components/text-field.d.ts +1 -1
- package/dist/toolkit/fields/components/textarea.d.ts +1 -1
- package/dist/toolkit/fields/plugins/blocks-field-plugin/block-selector-big.d.ts +2 -2
- package/dist/toolkit/fields/plugins/blocks-field-plugin/block-selector.d.ts +2 -2
- package/dist/toolkit/fields/plugins/blocks-field-plugin/index.d.ts +3 -3
- package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +4 -4
- package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +7 -7
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +8 -8
- package/dist/toolkit/fields/plugins/hidden-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/image-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/list-field-meta.d.ts +6 -6
- package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/error-message.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/nested-form.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/component.d.ts +3 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-invalid-markdown-plugin/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +3 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +21 -21
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/dropdown.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/icons.d.ts +17 -17
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/floating-toolbar.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/index.d.ts +4 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/overflow-menu.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/toolbar-item.d.ts +4 -4
- package/dist/toolkit/fields/plugins/number-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/password-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/reference-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/tags-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/text-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/textarea-field-plugin.d.ts +3 -3
- package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +7 -7
- package/dist/toolkit/form-builder/fields-builder.d.ts +3 -3
- package/dist/toolkit/form-builder/form-actions.d.ts +2 -1
- package/dist/toolkit/form-builder/form-builder.d.ts +6 -6
- package/dist/toolkit/form-builder/form-portal.d.ts +5 -1
- package/dist/toolkit/form-builder/form.d.ts +2 -2
- package/dist/toolkit/form-builder/loading-dots.d.ts +2 -2
- package/dist/toolkit/icons/Add.d.ts +2 -2
- package/dist/toolkit/icons/Alert.d.ts +2 -2
- package/dist/toolkit/icons/AlignCenter.d.ts +2 -2
- package/dist/toolkit/icons/AlignLeft.d.ts +2 -2
- package/dist/toolkit/icons/AlignRight.d.ts +2 -2
- package/dist/toolkit/icons/Bold.d.ts +2 -2
- package/dist/toolkit/icons/ChevronDown.d.ts +2 -2
- package/dist/toolkit/icons/ChevronLeft.d.ts +2 -2
- package/dist/toolkit/icons/ChevronRight.d.ts +2 -2
- package/dist/toolkit/icons/ChevronUp.d.ts +2 -2
- package/dist/toolkit/icons/Circle.d.ts +2 -2
- package/dist/toolkit/icons/CircleCheck.d.ts +2 -2
- package/dist/toolkit/icons/Close.d.ts +2 -2
- package/dist/toolkit/icons/Code.d.ts +2 -2
- package/dist/toolkit/icons/Drag.d.ts +2 -2
- package/dist/toolkit/icons/Duplicate.d.ts +2 -2
- package/dist/toolkit/icons/Edit.d.ts +2 -2
- package/dist/toolkit/icons/EllipsisVertical.d.ts +2 -2
- package/dist/toolkit/icons/Error.d.ts +2 -2
- package/dist/toolkit/icons/Exit.d.ts +2 -2
- package/dist/toolkit/icons/File.d.ts +2 -2
- package/dist/toolkit/icons/Folder.d.ts +2 -2
- package/dist/toolkit/icons/Hamburger.d.ts +2 -2
- package/dist/toolkit/icons/Heading.d.ts +2 -2
- package/dist/toolkit/icons/Info.d.ts +2 -2
- package/dist/toolkit/icons/Italic.d.ts +2 -2
- package/dist/toolkit/icons/LeftArrow.d.ts +2 -2
- package/dist/toolkit/icons/Link.d.ts +2 -2
- package/dist/toolkit/icons/Lock.d.ts +2 -2
- package/dist/toolkit/icons/Markdown.d.ts +2 -2
- package/dist/toolkit/icons/Media.d.ts +2 -2
- package/dist/toolkit/icons/OrderedList.d.ts +2 -2
- package/dist/toolkit/icons/PullRequest.d.ts +2 -2
- package/dist/toolkit/icons/Quote.d.ts +2 -2
- package/dist/toolkit/icons/Redo.d.ts +2 -2
- package/dist/toolkit/icons/Reorder.d.ts +2 -2
- package/dist/toolkit/icons/ReorderRow.d.ts +2 -2
- package/dist/toolkit/icons/Reset.d.ts +2 -2
- package/dist/toolkit/icons/RightArrow.d.ts +2 -2
- package/dist/toolkit/icons/Settings.d.ts +2 -2
- package/dist/toolkit/icons/Strikethrough.d.ts +2 -2
- package/dist/toolkit/icons/Table.d.ts +2 -2
- package/dist/toolkit/icons/Tina.d.ts +2 -2
- package/dist/toolkit/icons/Trash.d.ts +2 -2
- package/dist/toolkit/icons/Underline.d.ts +2 -2
- package/dist/toolkit/icons/Undo.d.ts +2 -2
- package/dist/toolkit/icons/UnorderedList.d.ts +2 -2
- package/dist/toolkit/icons/Upload.d.ts +2 -2
- package/dist/toolkit/icons/Warning.d.ts +2 -2
- package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +2 -2
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +2 -2
- package/dist/toolkit/plugin-branch-switcher/branch-data.d.ts +2 -2
- package/dist/toolkit/plugin-branch-switcher/branch-modal.d.ts +2 -2
- package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +3 -3
- package/dist/toolkit/plugin-branch-switcher/plugin.d.ts +2 -2
- package/dist/toolkit/plugin-fields/markdown.d.ts +3 -3
- package/dist/toolkit/react-alerts/alerts.d.ts +3 -3
- package/dist/toolkit/react-core/with-plugin.d.ts +2 -2
- package/dist/toolkit/react-datetime/DateTime.d.ts +3 -3
- package/dist/toolkit/react-datetime/parts/ViewNavigation.d.ts +2 -1
- package/dist/toolkit/react-datetime/views/DaysView.d.ts +6 -6
- package/dist/toolkit/react-datetime/views/MonthsView.d.ts +3 -3
- package/dist/toolkit/react-datetime/views/TimeView.d.ts +3 -3
- package/dist/toolkit/react-datetime/views/YearsView.d.ts +4 -4
- package/dist/toolkit/react-dismissible/dismissible.d.ts +1 -0
- package/dist/toolkit/react-forms/form-modal.d.ts +2 -2
- package/dist/toolkit/react-modals/fullscreen-modal.d.ts +3 -3
- package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -2
- package/dist/toolkit/react-modals/modal/modal-body.d.ts +2 -2
- package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
- package/dist/toolkit/react-modals/modal/modal-overlay.d.ts +2 -2
- package/dist/toolkit/react-modals/modal-provider.d.ts +5 -1
- package/dist/toolkit/react-modals/popup-modal.d.ts +3 -3
- package/dist/toolkit/react-sidebar/components/form-list.d.ts +4 -4
- package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -3
- package/dist/toolkit/react-sidebar/components/nav.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +3 -3
- package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +2 -2
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +4 -4
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/sync-status.d.ts +4 -4
- package/dist/toolkit/react-tinacms/with-tina.d.ts +2 -2
- package/dist/toolkit/styles/button.d.ts +2 -2
- package/dist/toolkit/styles/container.d.ts +2 -2
- package/dist/toolkit/styles/message.d.ts +1 -1
- package/dist/toolkit/styles/overflow-menu.d.ts +2 -2
- package/dist/types/cms.d.ts +1 -0
- package/package.json +16 -25
- package/dist/admin/pages/LoginPage.d.ts +0 -6
- package/dist/admin/pages/LogoutPage.d.ts +0 -7
- package/dist/dev-tools.d.ts +0 -21
- package/dist/dev-tools.js +0 -492
- package/dist/dev-tools.mjs +0 -489
- package/dist/edit-state.d.ts +0 -38
- package/dist/edit-state.js +0 -110
- package/dist/edit-state.mjs +0 -103
- package/dist/toolkit/react-core/tina-error-boundary.d.ts +0 -21
package/dist/index.mjs
CHANGED
|
@@ -23,7 +23,6 @@ import * as Popover$1 from "@radix-ui/react-popover";
|
|
|
23
23
|
import * as pkg$1 from "react-color";
|
|
24
24
|
import * as pkg from "color-string";
|
|
25
25
|
import * as dropzone from "react-dropzone";
|
|
26
|
-
import { EditContext, useEditState, setEditing } from "@tinacms/sharedctx";
|
|
27
26
|
import get from "lodash.get";
|
|
28
27
|
import moment from "moment";
|
|
29
28
|
import { formatDistanceToNow } from "date-fns";
|
|
@@ -31,12 +30,12 @@ import { isHotkey } from "is-hotkey";
|
|
|
31
30
|
import { computePosition, flip, shift } from "@floating-ui/dom";
|
|
32
31
|
import { useWindowWidth } from "@react-hook/window-size";
|
|
33
32
|
import { getIntrospectionQuery, buildClientSchema, print, parse as parse$3, buildSchema } from "graphql";
|
|
34
|
-
import gql
|
|
33
|
+
import gql from "graphql-tag";
|
|
35
34
|
import { TinaSchema, addNamespaceToSchema, parseURL, resolveForm, normalizePath, validateSchema } from "@tinacms/schema-tools";
|
|
36
35
|
import { NAMER, resolveField } from "@tinacms/schema-tools";
|
|
37
36
|
import * as yup from "yup";
|
|
38
37
|
import { diff } from "@graphql-inspector/core";
|
|
39
|
-
import { NavLink,
|
|
38
|
+
import { NavLink, useNavigate, useLocation, useParams, Link, useSearchParams, HashRouter, Routes, Route } from "react-router-dom";
|
|
40
39
|
import { stringifyMDX } from "@tinacms/mdx";
|
|
41
40
|
const ModalProvider = ({ children }) => {
|
|
42
41
|
const [modalRootContainerRef, setModalRootContainerRef] = useState(
|
|
@@ -2802,12 +2801,6 @@ function BiLockAlt(props) {
|
|
|
2802
2801
|
function BiLock(props) {
|
|
2803
2802
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M12 2C9.243 2 7 4.243 7 7v2H6c-1.103 0-2 .897-2 2v9c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-9c0-1.103-.897-2-2-2h-1V7c0-2.757-2.243-5-5-5zM9 7c0-1.654 1.346-3 3-3s3 1.346 3 3v2H9V7zm9.002 13H13v-2.278c.595-.347 1-.985 1-1.722 0-1.103-.897-2-2-2s-2 .897-2 2c0 .736.405 1.375 1 1.722V20H6v-9h12l.002 9z" }, "child": [] }] })(props);
|
|
2804
2803
|
}
|
|
2805
|
-
function BiLogIn(props) {
|
|
2806
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m13 16 5-4-5-4v3H4v2h9z" }, "child": [] }, { "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" }, "child": [] }] })(props);
|
|
2807
|
-
}
|
|
2808
|
-
function BiLogOut(props) {
|
|
2809
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M16 13v-2H7V8l-5 4 5 4v-3z" }, "child": [] }, { "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" }, "child": [] }] })(props);
|
|
2810
|
-
}
|
|
2811
2804
|
function BiMenu(props) {
|
|
2812
2805
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, "child": [] }] })(props);
|
|
2813
2806
|
}
|
|
@@ -2943,7 +2936,9 @@ const FormPortalContext = React.createContext(() => {
|
|
|
2943
2936
|
function useFormPortal() {
|
|
2944
2937
|
return useContext(FormPortalContext);
|
|
2945
2938
|
}
|
|
2946
|
-
const FormPortalProvider = ({
|
|
2939
|
+
const FormPortalProvider = ({
|
|
2940
|
+
children
|
|
2941
|
+
}) => {
|
|
2947
2942
|
const wrapperRef = React.useRef(null);
|
|
2948
2943
|
const zIndexRef = React.useRef(0);
|
|
2949
2944
|
const FormPortal = React.useCallback(
|
|
@@ -3162,9 +3157,6 @@ function MdOutlinePhotoLibrary(props) {
|
|
|
3162
3157
|
function MdOutlineArrowBackIos(props) {
|
|
3163
3158
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z", "opacity": ".87" }, "child": [] }, { "tag": "path", "attr": { "d": "M17.51 3.87 15.73 2.1 5.84 12l9.9 9.9 1.77-1.77L9.38 12l8.13-8.13z" }, "child": [] }] })(props);
|
|
3164
3159
|
}
|
|
3165
|
-
function MdOutlineArrowBack(props) {
|
|
3166
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }, "child": [] }] })(props);
|
|
3167
|
-
}
|
|
3168
3160
|
function MdOutlinePerson(props) {
|
|
3169
3161
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }, "child": [] }] })(props);
|
|
3170
3162
|
}
|
|
@@ -8263,22 +8255,6 @@ let Alerts$1 = class Alerts {
|
|
|
8263
8255
|
return this.add("error", message, timeout);
|
|
8264
8256
|
}
|
|
8265
8257
|
};
|
|
8266
|
-
const PendingFormsPlaceholder = () => /* @__PURE__ */ React.createElement(
|
|
8267
|
-
"div",
|
|
8268
|
-
{
|
|
8269
|
-
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
8270
|
-
style: {
|
|
8271
|
-
animationName: "fade-in",
|
|
8272
|
-
animationDelay: "300ms",
|
|
8273
|
-
animationTimingFunction: "ease-out",
|
|
8274
|
-
animationIterationCount: 1,
|
|
8275
|
-
animationFillMode: "both",
|
|
8276
|
-
animationDuration: "150ms"
|
|
8277
|
-
}
|
|
8278
|
-
},
|
|
8279
|
-
/* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, "Please wait while Tina", /* @__PURE__ */ React.createElement("br", null), "loads your forms"),
|
|
8280
|
-
/* @__PURE__ */ React.createElement(LoadingDots, { color: "var(--tina-color-primary)" })
|
|
8281
|
-
);
|
|
8282
8258
|
const NoFormsPlaceholder = () => /* @__PURE__ */ React.createElement(
|
|
8283
8259
|
"div",
|
|
8284
8260
|
{
|
|
@@ -8531,38 +8507,19 @@ const FormsView = ({
|
|
|
8531
8507
|
}) => {
|
|
8532
8508
|
const cms = useCMS$1();
|
|
8533
8509
|
const { setFormIsPristine } = React.useContext(SidebarContext);
|
|
8534
|
-
const { formsRegistering, setFormsRegistering } = React.useContext(EditContext);
|
|
8535
|
-
React.useMemo(
|
|
8536
|
-
() => cms.events.subscribe("forms:register", (event) => {
|
|
8537
|
-
if (event.value === "start") {
|
|
8538
|
-
setFormsRegistering(true);
|
|
8539
|
-
} else {
|
|
8540
|
-
setFormsRegistering(false);
|
|
8541
|
-
}
|
|
8542
|
-
}),
|
|
8543
|
-
[]
|
|
8544
|
-
);
|
|
8545
8510
|
const isMultiform = cms.state.forms.length > 1;
|
|
8546
8511
|
const activeForm = cms.state.forms.find(
|
|
8547
8512
|
({ tinaForm }) => tinaForm.id === cms.state.activeFormId
|
|
8548
8513
|
);
|
|
8549
8514
|
const isEditing = !!activeForm;
|
|
8550
8515
|
if (!cms.state.formLists.length) {
|
|
8551
|
-
if (formsRegistering)
|
|
8552
|
-
return /* @__PURE__ */ React.createElement(PendingFormsPlaceholder, null);
|
|
8553
8516
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, " ", children, " ");
|
|
8554
8517
|
}
|
|
8555
8518
|
if (isMultiform && !activeForm) {
|
|
8556
8519
|
return /* @__PURE__ */ React.createElement(FormLists, { isEditing });
|
|
8557
8520
|
}
|
|
8558
8521
|
const formMetas = cms.plugins.all("form:meta");
|
|
8559
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, activeForm && /* @__PURE__ */ React.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React.createElement(FormHeader, { activeForm }), formMetas
|
|
8560
|
-
FormBuilder,
|
|
8561
|
-
{
|
|
8562
|
-
form: activeForm,
|
|
8563
|
-
onPristineChange: setFormIsPristine
|
|
8564
|
-
}
|
|
8565
|
-
)));
|
|
8522
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, activeForm && /* @__PURE__ */ React.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React.createElement(React.Fragment, { key: meta.name }, /* @__PURE__ */ React.createElement(meta.Component, null))), /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
|
|
8566
8523
|
};
|
|
8567
8524
|
const FormWrapper$1 = ({ isEditing, children }) => {
|
|
8568
8525
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -8591,11 +8548,12 @@ const MultiformFormHeader = ({
|
|
|
8591
8548
|
return /* @__PURE__ */ React.createElement(
|
|
8592
8549
|
"div",
|
|
8593
8550
|
{
|
|
8594
|
-
className:
|
|
8551
|
+
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
8595
8552
|
},
|
|
8596
8553
|
/* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React.createElement(
|
|
8597
8554
|
"button",
|
|
8598
8555
|
{
|
|
8556
|
+
type: "button",
|
|
8599
8557
|
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
8600
8558
|
onClick: () => {
|
|
8601
8559
|
const state = activeForm.tinaForm.finalForm.getState();
|
|
@@ -8616,7 +8574,7 @@ const FormHeader = ({ activeForm }) => {
|
|
|
8616
8574
|
return /* @__PURE__ */ React.createElement(
|
|
8617
8575
|
"div",
|
|
8618
8576
|
{
|
|
8619
|
-
className:
|
|
8577
|
+
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
8620
8578
|
},
|
|
8621
8579
|
/* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, shortFormLabel && /* @__PURE__ */ React.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
|
|
8622
8580
|
);
|
|
@@ -8880,7 +8838,6 @@ const Nav = ({
|
|
|
8880
8838
|
...props
|
|
8881
8839
|
}) => {
|
|
8882
8840
|
const cms = useCMS$1();
|
|
8883
|
-
const { setEdit } = useEditState();
|
|
8884
8841
|
const [eventsOpen, setEventsOpen] = React.useState(false);
|
|
8885
8842
|
const { contentCollections, authCollection } = collectionsInfo.collections.reduce(
|
|
8886
8843
|
(acc, collection) => {
|
|
@@ -8974,7 +8931,6 @@ const Nav = ({
|
|
|
8974
8931
|
window.location.href
|
|
8975
8932
|
).pathname;
|
|
8976
8933
|
}
|
|
8977
|
-
setEdit(false);
|
|
8978
8934
|
} catch (e) {
|
|
8979
8935
|
cms.alerts.error(`Error logging out: ${e}`);
|
|
8980
8936
|
console.error("Unexpected error calling logout");
|
|
@@ -10791,7 +10747,7 @@ function Alerts2({ alerts }) {
|
|
|
10791
10747
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "fixed bottom-0 left-0 right-0 p-6 flex flex-col items-center z-[999999] pointer-events-none" }, alerts.all.filter((alert) => {
|
|
10792
10748
|
return alert.level !== "error";
|
|
10793
10749
|
}).map((alert) => {
|
|
10794
|
-
return /* @__PURE__ */ React__default.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React__default.createElement(BiInfoCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React__default.createElement(BiCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React__default.createElement(BiError, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React__default.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, alert.message), /* @__PURE__ */ React__default.createElement(
|
|
10750
|
+
return /* @__PURE__ */ React__default.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React__default.createElement(BiInfoCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React__default.createElement(BiCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React__default.createElement(BiError, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React__default.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, alert.message.toString()), /* @__PURE__ */ React__default.createElement(
|
|
10795
10751
|
CloseAlert,
|
|
10796
10752
|
{
|
|
10797
10753
|
onClick: () => {
|
|
@@ -10803,7 +10759,7 @@ function Alerts2({ alerts }) {
|
|
|
10803
10759
|
return alert.level === "error";
|
|
10804
10760
|
}).map((alert) => {
|
|
10805
10761
|
const AlertMessage = typeof alert.message === "string" ? () => {
|
|
10806
|
-
return /* @__PURE__ */ React__default.createElement("p", { className: "text-base mb-3 overflow-y-auto" }, alert.message);
|
|
10762
|
+
return /* @__PURE__ */ React__default.createElement("p", { className: "text-base mb-3 overflow-y-auto" }, alert.message.toString());
|
|
10807
10763
|
} : alert.message;
|
|
10808
10764
|
return /* @__PURE__ */ React__default.createElement(Modal, { key: alert.id }, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(
|
|
10809
10765
|
ModalHeader,
|
|
@@ -10827,7 +10783,10 @@ function Alerts2({ alerts }) {
|
|
|
10827
10783
|
))));
|
|
10828
10784
|
}));
|
|
10829
10785
|
}
|
|
10830
|
-
const Alert = ({
|
|
10786
|
+
const Alert = ({
|
|
10787
|
+
level,
|
|
10788
|
+
...props
|
|
10789
|
+
}) => {
|
|
10831
10790
|
const colorClasses = {
|
|
10832
10791
|
info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
|
|
10833
10792
|
success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
|
|
@@ -11330,7 +11289,7 @@ const FormBuilder = ({
|
|
|
11330
11289
|
header: /* @__PURE__ */ React.createElement(PanelHeader, { ...fieldGroup, id: tinaForm.id }),
|
|
11331
11290
|
id: tinaForm.id
|
|
11332
11291
|
},
|
|
11333
|
-
tinaForm
|
|
11292
|
+
(tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
|
|
11334
11293
|
FieldsBuilder,
|
|
11335
11294
|
{
|
|
11336
11295
|
form: tinaForm,
|
|
@@ -11415,6 +11374,7 @@ const PanelHeader = (props) => {
|
|
|
11415
11374
|
return /* @__PURE__ */ React.createElement(
|
|
11416
11375
|
"button",
|
|
11417
11376
|
{
|
|
11377
|
+
type: "button",
|
|
11418
11378
|
className: `relative z-40 group text-left w-full bg-white hover:bg-gray-50 py-2 border-t border-b shadow-sm
|
|
11419
11379
|
border-gray-100 px-6 -mt-px`,
|
|
11420
11380
|
onClick: () => {
|
|
@@ -27206,7 +27166,7 @@ mutation addPendingDocumentMutation(
|
|
|
27206
27166
|
method: "POST",
|
|
27207
27167
|
headers: headers2,
|
|
27208
27168
|
body: JSON.stringify({
|
|
27209
|
-
query: typeof query === "function" ? print(query(gql
|
|
27169
|
+
query: typeof query === "function" ? print(query(gql)) : query,
|
|
27210
27170
|
variables
|
|
27211
27171
|
})
|
|
27212
27172
|
});
|
|
@@ -28567,6 +28527,7 @@ class ErrorBoundary extends React__default.Component {
|
|
|
28567
28527
|
/* @__PURE__ */ React__default.createElement(
|
|
28568
28528
|
"button",
|
|
28569
28529
|
{
|
|
28530
|
+
type: "button",
|
|
28570
28531
|
style: errorButtonStyles,
|
|
28571
28532
|
onClick: () => {
|
|
28572
28533
|
this.setState({ pageRefresh: true });
|
|
@@ -28790,13 +28751,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28790
28751
|
}
|
|
28791
28752
|
return client.request(query, { variables });
|
|
28792
28753
|
};
|
|
28793
|
-
function gql(strings, ...args) {
|
|
28794
|
-
let str = "";
|
|
28795
|
-
strings.forEach((string, i) => {
|
|
28796
|
-
str += string + (args[i] || "");
|
|
28797
|
-
});
|
|
28798
|
-
return str;
|
|
28799
|
-
}
|
|
28800
28754
|
const Layout = ({ children }) => {
|
|
28801
28755
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
28802
28756
|
"div",
|
|
@@ -29018,106 +28972,7 @@ const GetCMS = ({ children }) => {
|
|
|
29018
28972
|
return null;
|
|
29019
28973
|
}
|
|
29020
28974
|
};
|
|
29021
|
-
const
|
|
29022
|
-
message,
|
|
29023
|
-
children
|
|
29024
|
-
}) => {
|
|
29025
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: "h-screen w-full bg-gradient-to-b from-blue-900 to-gray-900 flex items-center justify-center px-4 py-6" }, /* @__PURE__ */ React__default.createElement("div", { className: "bg-white rounded-lg overflow-hidden shadow-lg w-full max-w-lg" }, /* @__PURE__ */ React__default.createElement("div", { className: "px-5 py-4 border-b border-gray-150" }, /* @__PURE__ */ React__default.createElement("h2", { className: "text-2xl font-sans tracking-wide text-gray-700 flex items-center gap-0.5" }, /* @__PURE__ */ React__default.createElement(
|
|
29026
|
-
"svg",
|
|
29027
|
-
{
|
|
29028
|
-
viewBox: "0 0 32 32",
|
|
29029
|
-
fill: "#EC4815",
|
|
29030
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
29031
|
-
className: "w-10 h-auto"
|
|
29032
|
-
},
|
|
29033
|
-
/* @__PURE__ */ React__default.createElement("path", { 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" }),
|
|
29034
|
-
/* @__PURE__ */ React__default.createElement("path", { 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" })
|
|
29035
|
-
), /* @__PURE__ */ React__default.createElement("span", null, "Tina"))), message && /* @__PURE__ */ React__default.createElement("div", { className: "px-5 pt-4" }, /* @__PURE__ */ React__default.createElement("p", { className: "text-base font-sans leading-normal" }, message)), /* @__PURE__ */ React__default.createElement("div", { className: "px-5 py-4 flex gap-4 w-full justify-between" }, children)));
|
|
29036
|
-
};
|
|
29037
|
-
const LoginPage = () => {
|
|
29038
|
-
const { setEdit } = useEditState();
|
|
29039
|
-
const login = () => setEdit(true);
|
|
29040
|
-
return /* @__PURE__ */ React__default.createElement(AuthTemplate, null, /* @__PURE__ */ React__default.createElement("div", { className: "flex w-full flex-1 gap-4 items-center justify-end" }, /* @__PURE__ */ React__default.createElement(
|
|
29041
|
-
Button,
|
|
29042
|
-
{
|
|
29043
|
-
onClick: () => {
|
|
29044
|
-
window.location.href = "/";
|
|
29045
|
-
},
|
|
29046
|
-
variant: "white",
|
|
29047
|
-
size: "custom",
|
|
29048
|
-
className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
|
|
29049
|
-
},
|
|
29050
|
-
/* @__PURE__ */ React__default.createElement(MdOutlineArrowBack, { className: "w-6 h-auto mr-1.5 opacity-80" }),
|
|
29051
|
-
" Back To Site"
|
|
29052
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
29053
|
-
Button,
|
|
29054
|
-
{
|
|
29055
|
-
onClick: () => login(),
|
|
29056
|
-
variant: "primary",
|
|
29057
|
-
size: "custom",
|
|
29058
|
-
className: "text-base h-12 px-6 flex-1",
|
|
29059
|
-
type: "submit"
|
|
29060
|
-
},
|
|
29061
|
-
/* @__PURE__ */ React__default.createElement(BiLogIn, { className: "w-6 h-auto mr-2 opacity-80" }),
|
|
29062
|
-
" Edit With Tina"
|
|
29063
|
-
)));
|
|
29064
|
-
};
|
|
29065
|
-
const LogoutRedirect = () => {
|
|
29066
|
-
const cms = useCMS$1();
|
|
29067
|
-
const { setEdit } = useEditState();
|
|
29068
|
-
const [searchParams] = useSearchParams();
|
|
29069
|
-
const slug = searchParams.get("slug") || "/";
|
|
29070
|
-
const logout2 = async () => {
|
|
29071
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
29072
|
-
if ((_c = (_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.authProvider) == null ? void 0 : _c.logout) {
|
|
29073
|
-
await ((_f = (_e = (_d = cms == null ? void 0 : cms.api) == null ? void 0 : _d.tina) == null ? void 0 : _e.authProvider) == null ? void 0 : _f.logout());
|
|
29074
|
-
if ((_h = (_g = cms == null ? void 0 : cms.api) == null ? void 0 : _g.tina) == null ? void 0 : _h.onLogout) {
|
|
29075
|
-
await ((_j = (_i = cms == null ? void 0 : cms.api) == null ? void 0 : _i.tina) == null ? void 0 : _j.onLogout());
|
|
29076
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
29077
|
-
}
|
|
29078
|
-
}
|
|
29079
|
-
setEdit(false);
|
|
29080
|
-
};
|
|
29081
|
-
useEffect(() => {
|
|
29082
|
-
logout2().then(() => {
|
|
29083
|
-
window.location.href = slug;
|
|
29084
|
-
});
|
|
29085
|
-
}, []);
|
|
29086
|
-
return /* @__PURE__ */ React__default.createElement("div", null, "Redirecting to ", slug, " ...");
|
|
29087
|
-
};
|
|
29088
|
-
const logout = () => {
|
|
29089
|
-
setEditing(false);
|
|
29090
|
-
window.location.href = "/";
|
|
29091
|
-
};
|
|
29092
|
-
const LogoutPage = () => {
|
|
29093
|
-
return /* @__PURE__ */ React__default.createElement(AuthTemplate, null, /* @__PURE__ */ React__default.createElement("div", { className: "flex w-full flex-1 gap-4 items-center justify-end" }, /* @__PURE__ */ React__default.createElement(
|
|
29094
|
-
Button,
|
|
29095
|
-
{
|
|
29096
|
-
onClick: () => {
|
|
29097
|
-
window.location.href = "/";
|
|
29098
|
-
},
|
|
29099
|
-
variant: "white",
|
|
29100
|
-
size: "custom",
|
|
29101
|
-
className: "text-base h-12 px-6 flex-shrink-0 flex-grow-0"
|
|
29102
|
-
},
|
|
29103
|
-
/* @__PURE__ */ React__default.createElement(MdOutlineArrowBack, { className: "w-6 h-auto mr-1.5 opacity-80" }),
|
|
29104
|
-
" Back To Site"
|
|
29105
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
29106
|
-
Button,
|
|
29107
|
-
{
|
|
29108
|
-
onClick: () => logout(),
|
|
29109
|
-
type: "submit",
|
|
29110
|
-
variant: "primary",
|
|
29111
|
-
size: "custom",
|
|
29112
|
-
className: "text-base h-12 px-6 flex-1"
|
|
29113
|
-
},
|
|
29114
|
-
/* @__PURE__ */ React__default.createElement(BiLogOut, { className: "w-6 h-auto mr-1.5 opacity-80" }),
|
|
29115
|
-
" Log Out of Tina"
|
|
29116
|
-
)));
|
|
29117
|
-
};
|
|
29118
|
-
const PageWrapper = ({
|
|
29119
|
-
children
|
|
29120
|
-
}) => {
|
|
28975
|
+
const PageWrapper = ({ children }) => {
|
|
29121
28976
|
var _a, _b;
|
|
29122
28977
|
const cms = useCMS$1();
|
|
29123
28978
|
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
@@ -29139,12 +28994,8 @@ const PageHeader = ({
|
|
|
29139
28994
|
}) => {
|
|
29140
28995
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
29141
28996
|
};
|
|
29142
|
-
const PageBody = ({
|
|
29143
|
-
|
|
29144
|
-
}) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
29145
|
-
const PageBodyNarrow = ({
|
|
29146
|
-
children
|
|
29147
|
-
}) => /* @__PURE__ */ React__default.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
28997
|
+
const PageBody = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
28998
|
+
const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
29148
28999
|
const DashboardPage = () => {
|
|
29149
29000
|
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
29150
29001
|
var _a, _b;
|
|
@@ -30491,7 +30342,7 @@ const RenderForm$1 = ({
|
|
|
30491
30342
|
}) : "text",
|
|
30492
30343
|
disabled: (_b2 = (_a2 = schemaCollection == null ? void 0 : schemaCollection.ui) == null ? void 0 : _a2.filename) == null ? void 0 : _b2.readonly,
|
|
30493
30344
|
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")),
|
|
30494
|
-
placeholder:
|
|
30345
|
+
placeholder: "My_Document",
|
|
30495
30346
|
validate: (value, allValues, meta) => {
|
|
30496
30347
|
var _a3, _b3;
|
|
30497
30348
|
if (!value) {
|
|
@@ -30508,11 +30359,11 @@ const RenderForm$1 = ({
|
|
|
30508
30359
|
const filePath = `${normalizePath(
|
|
30509
30360
|
schemaCollection.path
|
|
30510
30361
|
)}/${value}.${schemaCollection.format || "md"}`;
|
|
30511
|
-
const match = schema.matchFiles({
|
|
30362
|
+
const match = schema == null ? void 0 : schema.matchFiles({
|
|
30512
30363
|
files: [filePath],
|
|
30513
30364
|
collection: schemaCollection
|
|
30514
30365
|
});
|
|
30515
|
-
if (match.length === 0) {
|
|
30366
|
+
if ((match == null ? void 0 : match.length) === 0) {
|
|
30516
30367
|
return `The filename "${value}" is not allowed for this collection.`;
|
|
30517
30368
|
}
|
|
30518
30369
|
}
|
|
@@ -31086,13 +30937,9 @@ const TinaAdmin = ({
|
|
|
31086
30937
|
schemaJson
|
|
31087
30938
|
}) => {
|
|
31088
30939
|
const isSSR2 = typeof window === "undefined";
|
|
31089
|
-
const { edit } = useEditState();
|
|
31090
30940
|
if (isSSR2) {
|
|
31091
30941
|
return null;
|
|
31092
30942
|
}
|
|
31093
|
-
if (!edit) {
|
|
31094
|
-
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(LoginPage, null));
|
|
31095
|
-
}
|
|
31096
30943
|
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
31097
30944
|
var _a, _b, _c;
|
|
31098
30945
|
const isTinaAdminEnabled = cms.flags.get("tina-admin") === false ? false : true;
|
|
@@ -31175,12 +31022,6 @@ const TinaAdmin = ({
|
|
|
31175
31022
|
path: "screens/:screenName",
|
|
31176
31023
|
element: /* @__PURE__ */ React__default.createElement(DefaultWrapper, { cms }, /* @__PURE__ */ React__default.createElement(ScreenPage, null))
|
|
31177
31024
|
}
|
|
31178
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
31179
|
-
Route,
|
|
31180
|
-
{
|
|
31181
|
-
path: "logout",
|
|
31182
|
-
element: /* @__PURE__ */ React__default.createElement(DefaultWrapper, { cms }, /* @__PURE__ */ React__default.createElement(LogoutRedirect, null))
|
|
31183
|
-
}
|
|
31184
31025
|
), /* @__PURE__ */ React__default.createElement(
|
|
31185
31026
|
Route,
|
|
31186
31027
|
{
|
|
@@ -31195,7 +31036,7 @@ const TinaAdmin = ({
|
|
|
31195
31036
|
}
|
|
31196
31037
|
)))));
|
|
31197
31038
|
} else {
|
|
31198
|
-
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(HashRouter, null, /* @__PURE__ */ React__default.createElement(Routes, null, /* @__PURE__ */ React__default.createElement(Route, { path: "
|
|
31039
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(HashRouter, null, /* @__PURE__ */ React__default.createElement(Routes, null, /* @__PURE__ */ React__default.createElement(Route, { path: "/", element: /* @__PURE__ */ React__default.createElement(Redirect, null) }))));
|
|
31199
31040
|
}
|
|
31200
31041
|
});
|
|
31201
31042
|
};
|
|
@@ -31565,7 +31406,6 @@ export {
|
|
|
31565
31406
|
formatBranchName,
|
|
31566
31407
|
getFilteredBranchList,
|
|
31567
31408
|
getStaticPropsForTina,
|
|
31568
|
-
gql,
|
|
31569
31409
|
passwordFieldClasses,
|
|
31570
31410
|
resolveField,
|
|
31571
31411
|
safeAssertShape,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import React from 'react';
|
|
5
5
|
declare type BaseComponents = {
|
|
6
6
|
h1?: {
|
|
7
7
|
children: JSX.Element;
|
|
@@ -135,5 +135,5 @@ export declare const TinaMarkdown: <CustomComponents extends {
|
|
|
135
135
|
} = any>({ content, components, }: {
|
|
136
136
|
content: TinaMarkdownContent | TinaMarkdownContent[];
|
|
137
137
|
components?: Components<{}> | Components<{ [BK in keyof CustomComponents]: (props: CustomComponents[BK]) => JSX.Element; }>;
|
|
138
|
-
}) => JSX.Element;
|
|
138
|
+
}) => React.JSX.Element;
|
|
139
139
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import { themes } from 'prism-react-renderer';
|
|
6
6
|
export declare const Prism: (props: {
|
|
7
7
|
value: string;
|
|
8
8
|
lang?: string;
|
|
9
9
|
theme?: keyof typeof themes;
|
|
10
|
-
}) => JSX.Element;
|
|
10
|
+
}) => React.JSX.Element;
|
package/dist/tina-cms.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useDocumentCreatorPlugin } from './hooks/use-content-creator';
|
|
3
|
-
import { TinaCMSProviderDefaultProps } from './types/cms';
|
|
3
|
+
import type { TinaCMSProviderDefaultProps } from './types/cms';
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated since version 1.0.
|
|
6
6
|
* Tina no longer requires wrapping your site in the TinaProvider
|
|
7
7
|
* See https://tina.io/blog/upgrading-to-iframe/ for full migration details
|
|
8
8
|
*/
|
|
9
|
-
export declare const TinaCMSProvider2: ({ query, documentCreatorCallback, formifyCallback, schema, ...props }: TinaCMSProviderDefaultProps) => JSX.Element;
|
|
9
|
+
export declare const TinaCMSProvider2: ({ query, documentCreatorCallback, formifyCallback, schema, ...props }: TinaCMSProviderDefaultProps) => React.JSX.Element;
|
|
10
10
|
export declare type DocumentCreatorCallback = Parameters<typeof useDocumentCreatorPlugin>[0];
|
|
11
11
|
/**
|
|
12
12
|
* @deprecated v0.62.0: Use `staticRequest` and a "try catch" block instead. see https://tina.io/docs/features/data-fetching/#querying-tina-content-in-nextjs for more details
|
|
@@ -30,9 +30,3 @@ export declare const staticRequest: ({ query, variables, }: {
|
|
|
30
30
|
/** GraphQL variables */
|
|
31
31
|
variables?: object;
|
|
32
32
|
}) => Promise<unknown>;
|
|
33
|
-
/**
|
|
34
|
-
* A passthru function which allows editors
|
|
35
|
-
* to know the temlpate string is a GraphQL
|
|
36
|
-
* query or muation
|
|
37
|
-
*/
|
|
38
|
-
export declare function gql(strings: TemplateStringsArray, ...args: string[]): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function UpdatePassword(props: {}): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function UpdatePassword(props: {}): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ActiveFieldIndicator: () => JSX.Element;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const ActiveFieldIndicator: () => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface BreadcrumbProps {
|
|
3
3
|
directory?: string;
|
|
4
4
|
setDirectory: (_directory: string) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare function Breadcrumb({ directory, setDirectory }: BreadcrumbProps): JSX.Element;
|
|
6
|
+
export declare function Breadcrumb({ directory, setDirectory }: BreadcrumbProps): React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface CopyFieldProps {
|
|
3
3
|
label?: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
value: any;
|
|
6
6
|
}
|
|
7
|
-
export declare const CopyField: ({ label, description, value }: CopyFieldProps) => JSX.Element;
|
|
7
|
+
export declare const CopyField: ({ label, description, value }: CopyFieldProps) => React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Media } from '../../core';
|
|
3
3
|
interface MediaItemProps {
|
|
4
4
|
item: Media & {
|
|
@@ -7,6 +7,6 @@ interface MediaItemProps {
|
|
|
7
7
|
onClick(_item: Media | false): void;
|
|
8
8
|
active: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare function ListMediaItem({ item, onClick, active }: MediaItemProps): JSX.Element;
|
|
11
|
-
export declare function GridMediaItem({ item, active, onClick }: MediaItemProps): JSX.Element;
|
|
10
|
+
export declare function ListMediaItem({ item, onClick, active }: MediaItemProps): React.JSX.Element;
|
|
11
|
+
export declare function GridMediaItem({ item, active, onClick }: MediaItemProps): React.JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Media } from '../../core';
|
|
3
3
|
export interface MediaRequest {
|
|
4
4
|
directory?: string;
|
|
@@ -6,5 +6,5 @@ export interface MediaRequest {
|
|
|
6
6
|
close?(): void;
|
|
7
7
|
allowDelete?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare function MediaManager(): JSX.Element;
|
|
10
|
-
export declare function MediaPicker({ allowDelete, onSelect, close, ...props }: MediaRequest): JSX.Element;
|
|
9
|
+
export declare function MediaManager(): React.JSX.Element;
|
|
10
|
+
export declare function MediaPicker({ allowDelete, onSelect, close, ...props }: MediaRequest): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface DeleteModalProps {
|
|
3
3
|
close(): void;
|
|
4
4
|
deleteFunc(): void;
|
|
@@ -8,6 +8,6 @@ interface NewFolderModalProps {
|
|
|
8
8
|
onSubmit(filename: string): void;
|
|
9
9
|
close(): void;
|
|
10
10
|
}
|
|
11
|
-
export declare const DeleteModal: ({ close, deleteFunc, filename, }: DeleteModalProps) => JSX.Element;
|
|
12
|
-
export declare const NewFolderModal: ({ onSubmit, close }: NewFolderModalProps) => JSX.Element;
|
|
11
|
+
export declare const DeleteModal: ({ close, deleteFunc, filename, }: DeleteModalProps) => React.JSX.Element;
|
|
12
|
+
export declare const NewFolderModal: ({ onSubmit, close }: NewFolderModalProps) => React.JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface MediaPaginatorProps {
|
|
3
3
|
navigateNext: () => void;
|
|
4
4
|
navigatePrev: () => void;
|
|
@@ -6,4 +6,4 @@ export interface MediaPaginatorProps {
|
|
|
6
6
|
hasPrev: boolean;
|
|
7
7
|
variant?: 'primary' | 'secondary' | 'white' | 'ghost';
|
|
8
8
|
}
|
|
9
|
-
export declare function CursorPaginator({ navigateNext, navigatePrev, hasNext, hasPrev, variant, }: MediaPaginatorProps): JSX.Element;
|
|
9
|
+
export declare function CursorPaginator({ navigateNext, navigatePrev, hasNext, hasPrev, variant, }: MediaPaginatorProps): React.JSX.Element;
|
|
@@ -5,7 +5,7 @@ export declare const MutationSignalContext: React.Context<number>;
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const MutationSignalProvider: ({ children }: {
|
|
7
7
|
children: any;
|
|
8
|
-
}) => JSX.Element;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* Returns a value that changes when elements within the parent MutationSignalProvider change
|
|
11
11
|
*/
|
|
@@ -12,12 +12,12 @@ interface ImageUploadProps {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const StyledImage: ({ src }: {
|
|
14
14
|
src: any;
|
|
15
|
-
}) => JSX.Element;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
16
|
export declare const StyledFile: ({ src }: {
|
|
17
17
|
src: any;
|
|
18
|
-
}) => JSX.Element;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
19
|
export declare const ImageUpload: React.ForwardRefExoticComponent<ImageUploadProps & React.RefAttributes<HTMLButtonElement>>;
|
|
20
20
|
export declare const DeleteImageButton: ({ onClick, }: {
|
|
21
21
|
onClick: (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
22
|
-
}) => JSX.Element;
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
export interface InputProps {
|
|
3
3
|
error?: boolean;
|
|
4
4
|
small?: boolean;
|
|
@@ -7,4 +7,4 @@ export interface InputProps {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const Input: ({ ...props }: {
|
|
9
9
|
[x: string]: any;
|
|
10
|
-
}) => JSX.Element;
|
|
10
|
+
}) => React.JSX.Element;
|