tinacms 1.6.7 → 2.1.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 +114 -262
- package/dist/index.mjs +114 -263
- 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 +6 -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 +9 -6
- 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
|
}
|
|
@@ -3714,7 +3706,18 @@ const supportedFileTypes = [
|
|
|
3714
3706
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
3715
3707
|
"application/msword",
|
|
3716
3708
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
3717
|
-
"
|
|
3709
|
+
"application/postscript",
|
|
3710
|
+
"model/fbx",
|
|
3711
|
+
"model/gltf+json",
|
|
3712
|
+
"model/ply",
|
|
3713
|
+
"model/u3d+mesh",
|
|
3714
|
+
"model/vnd.usdz+zip",
|
|
3715
|
+
"application/x-indesign",
|
|
3716
|
+
"application/vnd.apple.mpegurl",
|
|
3717
|
+
"application/dash+xml",
|
|
3718
|
+
"application/mxf",
|
|
3719
|
+
"image/*",
|
|
3720
|
+
"video/*"
|
|
3718
3721
|
];
|
|
3719
3722
|
const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
|
|
3720
3723
|
const dropzoneAcceptFromString = (str) => {
|
|
@@ -8263,22 +8266,6 @@ let Alerts$1 = class Alerts {
|
|
|
8263
8266
|
return this.add("error", message, timeout);
|
|
8264
8267
|
}
|
|
8265
8268
|
};
|
|
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
8269
|
const NoFormsPlaceholder = () => /* @__PURE__ */ React.createElement(
|
|
8283
8270
|
"div",
|
|
8284
8271
|
{
|
|
@@ -8531,38 +8518,19 @@ const FormsView = ({
|
|
|
8531
8518
|
}) => {
|
|
8532
8519
|
const cms = useCMS$1();
|
|
8533
8520
|
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
8521
|
const isMultiform = cms.state.forms.length > 1;
|
|
8546
8522
|
const activeForm = cms.state.forms.find(
|
|
8547
8523
|
({ tinaForm }) => tinaForm.id === cms.state.activeFormId
|
|
8548
8524
|
);
|
|
8549
8525
|
const isEditing = !!activeForm;
|
|
8550
8526
|
if (!cms.state.formLists.length) {
|
|
8551
|
-
if (formsRegistering)
|
|
8552
|
-
return /* @__PURE__ */ React.createElement(PendingFormsPlaceholder, null);
|
|
8553
8527
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, " ", children, " ");
|
|
8554
8528
|
}
|
|
8555
8529
|
if (isMultiform && !activeForm) {
|
|
8556
8530
|
return /* @__PURE__ */ React.createElement(FormLists, { isEditing });
|
|
8557
8531
|
}
|
|
8558
8532
|
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
|
-
)));
|
|
8533
|
+
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
8534
|
};
|
|
8567
8535
|
const FormWrapper$1 = ({ isEditing, children }) => {
|
|
8568
8536
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -8591,11 +8559,12 @@ const MultiformFormHeader = ({
|
|
|
8591
8559
|
return /* @__PURE__ */ React.createElement(
|
|
8592
8560
|
"div",
|
|
8593
8561
|
{
|
|
8594
|
-
className:
|
|
8562
|
+
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
8595
8563
|
},
|
|
8596
8564
|
/* @__PURE__ */ React.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React.createElement(
|
|
8597
8565
|
"button",
|
|
8598
8566
|
{
|
|
8567
|
+
type: "button",
|
|
8599
8568
|
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
8600
8569
|
onClick: () => {
|
|
8601
8570
|
const state = activeForm.tinaForm.finalForm.getState();
|
|
@@ -8616,7 +8585,7 @@ const FormHeader = ({ activeForm }) => {
|
|
|
8616
8585
|
return /* @__PURE__ */ React.createElement(
|
|
8617
8586
|
"div",
|
|
8618
8587
|
{
|
|
8619
|
-
className:
|
|
8588
|
+
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
8620
8589
|
},
|
|
8621
8590
|
/* @__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
8591
|
);
|
|
@@ -8880,7 +8849,6 @@ const Nav = ({
|
|
|
8880
8849
|
...props
|
|
8881
8850
|
}) => {
|
|
8882
8851
|
const cms = useCMS$1();
|
|
8883
|
-
const { setEdit } = useEditState();
|
|
8884
8852
|
const [eventsOpen, setEventsOpen] = React.useState(false);
|
|
8885
8853
|
const { contentCollections, authCollection } = collectionsInfo.collections.reduce(
|
|
8886
8854
|
(acc, collection) => {
|
|
@@ -8974,7 +8942,6 @@ const Nav = ({
|
|
|
8974
8942
|
window.location.href
|
|
8975
8943
|
).pathname;
|
|
8976
8944
|
}
|
|
8977
|
-
setEdit(false);
|
|
8978
8945
|
} catch (e) {
|
|
8979
8946
|
cms.alerts.error(`Error logging out: ${e}`);
|
|
8980
8947
|
console.error("Unexpected error calling logout");
|
|
@@ -10791,7 +10758,7 @@ function Alerts2({ alerts }) {
|
|
|
10791
10758
|
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
10759
|
return alert.level !== "error";
|
|
10793
10760
|
}).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(
|
|
10761
|
+
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
10762
|
CloseAlert,
|
|
10796
10763
|
{
|
|
10797
10764
|
onClick: () => {
|
|
@@ -10803,7 +10770,7 @@ function Alerts2({ alerts }) {
|
|
|
10803
10770
|
return alert.level === "error";
|
|
10804
10771
|
}).map((alert) => {
|
|
10805
10772
|
const AlertMessage = typeof alert.message === "string" ? () => {
|
|
10806
|
-
return /* @__PURE__ */ React__default.createElement("p", { className: "text-base mb-3 overflow-y-auto" }, alert.message);
|
|
10773
|
+
return /* @__PURE__ */ React__default.createElement("p", { className: "text-base mb-3 overflow-y-auto" }, alert.message.toString());
|
|
10807
10774
|
} : alert.message;
|
|
10808
10775
|
return /* @__PURE__ */ React__default.createElement(Modal, { key: alert.id }, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(
|
|
10809
10776
|
ModalHeader,
|
|
@@ -10827,7 +10794,10 @@ function Alerts2({ alerts }) {
|
|
|
10827
10794
|
))));
|
|
10828
10795
|
}));
|
|
10829
10796
|
}
|
|
10830
|
-
const Alert = ({
|
|
10797
|
+
const Alert = ({
|
|
10798
|
+
level,
|
|
10799
|
+
...props
|
|
10800
|
+
}) => {
|
|
10831
10801
|
const colorClasses = {
|
|
10832
10802
|
info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
|
|
10833
10803
|
success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
|
|
@@ -11330,7 +11300,7 @@ const FormBuilder = ({
|
|
|
11330
11300
|
header: /* @__PURE__ */ React.createElement(PanelHeader, { ...fieldGroup, id: tinaForm.id }),
|
|
11331
11301
|
id: tinaForm.id
|
|
11332
11302
|
},
|
|
11333
|
-
tinaForm
|
|
11303
|
+
(tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
|
|
11334
11304
|
FieldsBuilder,
|
|
11335
11305
|
{
|
|
11336
11306
|
form: tinaForm,
|
|
@@ -11415,6 +11385,7 @@ const PanelHeader = (props) => {
|
|
|
11415
11385
|
return /* @__PURE__ */ React.createElement(
|
|
11416
11386
|
"button",
|
|
11417
11387
|
{
|
|
11388
|
+
type: "button",
|
|
11418
11389
|
className: `relative z-40 group text-left w-full bg-white hover:bg-gray-50 py-2 border-t border-b shadow-sm
|
|
11419
11390
|
border-gray-100 px-6 -mt-px`,
|
|
11420
11391
|
onClick: () => {
|
|
@@ -12817,6 +12788,7 @@ const ICON_WIDTH = 40;
|
|
|
12817
12788
|
const EMBED_ICON_WIDTH = 85;
|
|
12818
12789
|
function Toolbar({
|
|
12819
12790
|
templates,
|
|
12791
|
+
toolbarOverride,
|
|
12820
12792
|
tinaForm
|
|
12821
12793
|
}) {
|
|
12822
12794
|
const { setRawMode } = useEditorContext();
|
|
@@ -12832,8 +12804,8 @@ function Toolbar({
|
|
|
12832
12804
|
const codeBlockActive = helpers.isNodeActive(editor, ELEMENT_CODE_BLOCK);
|
|
12833
12805
|
const blockQuoteActive = helpers.isNodeActive(editor, ELEMENT_BLOCKQUOTE);
|
|
12834
12806
|
const isImgActive = helpers.isNodeActive(editor, ELEMENT_IMG);
|
|
12835
|
-
const
|
|
12836
|
-
{
|
|
12807
|
+
const toolbarItemLookup = {
|
|
12808
|
+
heading: {
|
|
12837
12809
|
tinaForm,
|
|
12838
12810
|
name: "heading",
|
|
12839
12811
|
label: "Heading",
|
|
@@ -12854,19 +12826,19 @@ function Toolbar({
|
|
|
12854
12826
|
item.render
|
|
12855
12827
|
))
|
|
12856
12828
|
},
|
|
12857
|
-
{
|
|
12829
|
+
link: {
|
|
12858
12830
|
tinaForm,
|
|
12859
12831
|
name: "link",
|
|
12860
12832
|
label: "Link",
|
|
12861
12833
|
active: isLinkActive2
|
|
12862
12834
|
},
|
|
12863
|
-
{
|
|
12835
|
+
image: {
|
|
12864
12836
|
tinaForm,
|
|
12865
12837
|
name: "image",
|
|
12866
12838
|
label: "Image",
|
|
12867
12839
|
active: isImgActive
|
|
12868
12840
|
},
|
|
12869
|
-
{
|
|
12841
|
+
quote: {
|
|
12870
12842
|
tinaForm,
|
|
12871
12843
|
name: "quote",
|
|
12872
12844
|
label: "Quote",
|
|
@@ -12877,7 +12849,7 @@ function Toolbar({
|
|
|
12877
12849
|
toggleNodeType(editor, { activeType: ELEMENT_BLOCKQUOTE });
|
|
12878
12850
|
}
|
|
12879
12851
|
},
|
|
12880
|
-
{
|
|
12852
|
+
ul: {
|
|
12881
12853
|
tinaForm,
|
|
12882
12854
|
name: "ul",
|
|
12883
12855
|
label: "Bullet List",
|
|
@@ -12888,7 +12860,7 @@ function Toolbar({
|
|
|
12888
12860
|
toggleList(editor, { type: ELEMENT_UL });
|
|
12889
12861
|
}
|
|
12890
12862
|
},
|
|
12891
|
-
{
|
|
12863
|
+
ol: {
|
|
12892
12864
|
tinaForm,
|
|
12893
12865
|
name: "ol",
|
|
12894
12866
|
label: "List",
|
|
@@ -12899,7 +12871,7 @@ function Toolbar({
|
|
|
12899
12871
|
toggleList(editor, { type: ELEMENT_OL });
|
|
12900
12872
|
}
|
|
12901
12873
|
},
|
|
12902
|
-
{
|
|
12874
|
+
code: {
|
|
12903
12875
|
tinaForm,
|
|
12904
12876
|
name: "code",
|
|
12905
12877
|
label: "Code",
|
|
@@ -12910,7 +12882,7 @@ function Toolbar({
|
|
|
12910
12882
|
toggleMark(editor, { key: MARK_CODE });
|
|
12911
12883
|
}
|
|
12912
12884
|
},
|
|
12913
|
-
{
|
|
12885
|
+
codeBlock: {
|
|
12914
12886
|
tinaForm,
|
|
12915
12887
|
name: "codeBlock",
|
|
12916
12888
|
label: "Code Block",
|
|
@@ -12921,7 +12893,7 @@ function Toolbar({
|
|
|
12921
12893
|
insertEmptyCodeBlock(editor);
|
|
12922
12894
|
}
|
|
12923
12895
|
},
|
|
12924
|
-
{
|
|
12896
|
+
bold: {
|
|
12925
12897
|
tinaForm,
|
|
12926
12898
|
name: "bold",
|
|
12927
12899
|
label: "Bold",
|
|
@@ -12932,7 +12904,7 @@ function Toolbar({
|
|
|
12932
12904
|
toggleMark(editor, { key: MARK_BOLD });
|
|
12933
12905
|
}
|
|
12934
12906
|
},
|
|
12935
|
-
{
|
|
12907
|
+
italic: {
|
|
12936
12908
|
tinaForm,
|
|
12937
12909
|
name: "italic",
|
|
12938
12910
|
label: "Italic",
|
|
@@ -12943,14 +12915,15 @@ function Toolbar({
|
|
|
12943
12915
|
toggleMark(editor, { key: MARK_ITALIC });
|
|
12944
12916
|
}
|
|
12945
12917
|
},
|
|
12946
|
-
{
|
|
12918
|
+
raw: {
|
|
12947
12919
|
tinaForm,
|
|
12948
12920
|
name: "raw",
|
|
12949
12921
|
label: "Raw",
|
|
12950
12922
|
active: false,
|
|
12951
12923
|
onMouseDown: () => setRawMode(true)
|
|
12952
12924
|
}
|
|
12953
|
-
|
|
12925
|
+
};
|
|
12926
|
+
const toolbarItems = toolbarOverride === void 0 ? Object.values(toolbarItemLookup) : toolbarOverride.map((item) => toolbarItemLookup[item]).filter((item) => item !== void 0);
|
|
12954
12927
|
const [itemsShown, setItemsShown] = React.useState(toolbarItems.length);
|
|
12955
12928
|
useResize(toolbarRef, (entry) => {
|
|
12956
12929
|
const width = entry.target.getBoundingClientRect().width;
|
|
@@ -13095,10 +13068,11 @@ function ErrorMessage({ error }) {
|
|
|
13095
13068
|
))));
|
|
13096
13069
|
}
|
|
13097
13070
|
const RichEditor = (props) => {
|
|
13071
|
+
var _a;
|
|
13098
13072
|
const initialValue = React__default.useMemo(
|
|
13099
13073
|
() => {
|
|
13100
|
-
var
|
|
13101
|
-
return ((_b = (
|
|
13074
|
+
var _a2, _b;
|
|
13075
|
+
return ((_b = (_a2 = props.input.value) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) ? props.input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
|
|
13102
13076
|
},
|
|
13103
13077
|
[]
|
|
13104
13078
|
);
|
|
@@ -13126,8 +13100,8 @@ const RichEditor = (props) => {
|
|
|
13126
13100
|
React__default.useEffect(() => {
|
|
13127
13101
|
if (ref.current) {
|
|
13128
13102
|
setTimeout(() => {
|
|
13129
|
-
var
|
|
13130
|
-
const plateElement = (
|
|
13103
|
+
var _a2;
|
|
13104
|
+
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
13131
13105
|
'[role="textbox"]'
|
|
13132
13106
|
);
|
|
13133
13107
|
if (props.field.experimental_focusIntent && plateElement) {
|
|
@@ -13153,6 +13127,7 @@ const RichEditor = (props) => {
|
|
|
13153
13127
|
Toolbar,
|
|
13154
13128
|
{
|
|
13155
13129
|
tinaForm: props.tinaForm,
|
|
13130
|
+
toolbarOverride: (_a = props.field) == null ? void 0 : _a.toolbarOverride,
|
|
13156
13131
|
templates: props.field.templates,
|
|
13157
13132
|
inlineOnly: false
|
|
13158
13133
|
}
|
|
@@ -13162,38 +13137,36 @@ const RichEditor = (props) => {
|
|
|
13162
13137
|
};
|
|
13163
13138
|
const MdxFieldPlugin = {
|
|
13164
13139
|
name: "rich-text",
|
|
13165
|
-
Component: wrapFieldsWithMeta(
|
|
13166
|
-
(
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13140
|
+
Component: wrapFieldsWithMeta((props) => {
|
|
13141
|
+
const [rawMode, setRawMode] = React__default.useState(false);
|
|
13142
|
+
const [key, setKey] = React__default.useState(0);
|
|
13143
|
+
React__default.useMemo(() => {
|
|
13144
|
+
const { reset } = props.form;
|
|
13145
|
+
props.form.reset = (initialValues) => {
|
|
13146
|
+
setKey((key2) => key2 + 1);
|
|
13147
|
+
return reset(initialValues);
|
|
13148
|
+
};
|
|
13149
|
+
}, []);
|
|
13150
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
13151
|
+
EditorContext.Provider,
|
|
13152
|
+
{
|
|
13153
|
+
key,
|
|
13154
|
+
value: {
|
|
13155
|
+
fieldName: props.field.name,
|
|
13156
|
+
templates: props.field.templates,
|
|
13157
|
+
rawMode,
|
|
13158
|
+
setRawMode
|
|
13159
|
+
}
|
|
13160
|
+
},
|
|
13161
|
+
/* @__PURE__ */ React__default.createElement(
|
|
13162
|
+
"div",
|
|
13178
13163
|
{
|
|
13179
|
-
|
|
13180
|
-
value: {
|
|
13181
|
-
fieldName: props.field.name,
|
|
13182
|
-
templates: props.field.templates,
|
|
13183
|
-
rawMode,
|
|
13184
|
-
setRawMode
|
|
13185
|
-
}
|
|
13164
|
+
className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
|
|
13186
13165
|
},
|
|
13187
|
-
/* @__PURE__ */ React__default.createElement(
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
},
|
|
13192
|
-
/* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
|
|
13193
|
-
)
|
|
13194
|
-
);
|
|
13195
|
-
}
|
|
13196
|
-
)
|
|
13166
|
+
/* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
|
|
13167
|
+
)
|
|
13168
|
+
);
|
|
13169
|
+
})
|
|
13197
13170
|
};
|
|
13198
13171
|
const MdxFieldPluginExtendible = {
|
|
13199
13172
|
name: "rich-text",
|
|
@@ -13204,37 +13177,35 @@ const MdxFieldPluginExtendible = {
|
|
|
13204
13177
|
return void 0;
|
|
13205
13178
|
}
|
|
13206
13179
|
},
|
|
13207
|
-
Component: wrapFieldsWithMeta(
|
|
13208
|
-
(
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13180
|
+
Component: wrapFieldsWithMeta((props) => {
|
|
13181
|
+
const [key, setKey] = React__default.useState(0);
|
|
13182
|
+
React__default.useMemo(() => {
|
|
13183
|
+
const { reset } = props.form;
|
|
13184
|
+
props.form.reset = (initialValues) => {
|
|
13185
|
+
setKey((key2) => key2 + 1);
|
|
13186
|
+
return reset(initialValues);
|
|
13187
|
+
};
|
|
13188
|
+
}, []);
|
|
13189
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
13190
|
+
EditorContext.Provider,
|
|
13191
|
+
{
|
|
13192
|
+
key,
|
|
13193
|
+
value: {
|
|
13194
|
+
fieldName: props.field.name,
|
|
13195
|
+
templates: props.field.templates,
|
|
13196
|
+
rawMode: props.rawMode,
|
|
13197
|
+
setRawMode: props.setRawMode
|
|
13198
|
+
}
|
|
13199
|
+
},
|
|
13200
|
+
/* @__PURE__ */ React__default.createElement(
|
|
13201
|
+
"div",
|
|
13219
13202
|
{
|
|
13220
|
-
|
|
13221
|
-
value: {
|
|
13222
|
-
fieldName: props.field.name,
|
|
13223
|
-
templates: props.field.templates,
|
|
13224
|
-
rawMode: props.rawMode,
|
|
13225
|
-
setRawMode: props.setRawMode
|
|
13226
|
-
}
|
|
13203
|
+
className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
|
|
13227
13204
|
},
|
|
13228
|
-
/* @__PURE__ */ React__default.createElement(
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
},
|
|
13233
|
-
props.rawMode ? props.rawEditor : /* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
|
|
13234
|
-
)
|
|
13235
|
-
);
|
|
13236
|
-
}
|
|
13237
|
-
)
|
|
13205
|
+
props.rawMode ? props.rawEditor : /* @__PURE__ */ React__default.createElement(RichEditor, { ...props })
|
|
13206
|
+
)
|
|
13207
|
+
);
|
|
13208
|
+
})
|
|
13238
13209
|
};
|
|
13239
13210
|
class FormMetaPlugin {
|
|
13240
13211
|
constructor(options) {
|
|
@@ -27206,7 +27177,7 @@ mutation addPendingDocumentMutation(
|
|
|
27206
27177
|
method: "POST",
|
|
27207
27178
|
headers: headers2,
|
|
27208
27179
|
body: JSON.stringify({
|
|
27209
|
-
query: typeof query === "function" ? print(query(gql
|
|
27180
|
+
query: typeof query === "function" ? print(query(gql)) : query,
|
|
27210
27181
|
variables
|
|
27211
27182
|
})
|
|
27212
27183
|
});
|
|
@@ -28567,6 +28538,7 @@ class ErrorBoundary extends React__default.Component {
|
|
|
28567
28538
|
/* @__PURE__ */ React__default.createElement(
|
|
28568
28539
|
"button",
|
|
28569
28540
|
{
|
|
28541
|
+
type: "button",
|
|
28570
28542
|
style: errorButtonStyles,
|
|
28571
28543
|
onClick: () => {
|
|
28572
28544
|
this.setState({ pageRefresh: true });
|
|
@@ -28790,13 +28762,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28790
28762
|
}
|
|
28791
28763
|
return client.request(query, { variables });
|
|
28792
28764
|
};
|
|
28793
|
-
function gql(strings, ...args) {
|
|
28794
|
-
let str = "";
|
|
28795
|
-
strings.forEach((string, i) => {
|
|
28796
|
-
str += string + (args[i] || "");
|
|
28797
|
-
});
|
|
28798
|
-
return str;
|
|
28799
|
-
}
|
|
28800
28765
|
const Layout = ({ children }) => {
|
|
28801
28766
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
28802
28767
|
"div",
|
|
@@ -29018,106 +28983,7 @@ const GetCMS = ({ children }) => {
|
|
|
29018
28983
|
return null;
|
|
29019
28984
|
}
|
|
29020
28985
|
};
|
|
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
|
-
}) => {
|
|
28986
|
+
const PageWrapper = ({ children }) => {
|
|
29121
28987
|
var _a, _b;
|
|
29122
28988
|
const cms = useCMS$1();
|
|
29123
28989
|
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
@@ -29139,12 +29005,8 @@ const PageHeader = ({
|
|
|
29139
29005
|
}) => {
|
|
29140
29006
|
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
29007
|
};
|
|
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));
|
|
29008
|
+
const PageBody = ({ children }) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
29009
|
+
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
29010
|
const DashboardPage = () => {
|
|
29149
29011
|
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
29150
29012
|
var _a, _b;
|
|
@@ -30491,7 +30353,7 @@ const RenderForm$1 = ({
|
|
|
30491
30353
|
}) : "text",
|
|
30492
30354
|
disabled: (_b2 = (_a2 = schemaCollection == null ? void 0 : schemaCollection.ui) == null ? void 0 : _a2.filename) == null ? void 0 : _b2.readonly,
|
|
30493
30355
|
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:
|
|
30356
|
+
placeholder: "My_Document",
|
|
30495
30357
|
validate: (value, allValues, meta) => {
|
|
30496
30358
|
var _a3, _b3;
|
|
30497
30359
|
if (!value) {
|
|
@@ -30508,11 +30370,11 @@ const RenderForm$1 = ({
|
|
|
30508
30370
|
const filePath = `${normalizePath(
|
|
30509
30371
|
schemaCollection.path
|
|
30510
30372
|
)}/${value}.${schemaCollection.format || "md"}`;
|
|
30511
|
-
const match = schema.matchFiles({
|
|
30373
|
+
const match = schema == null ? void 0 : schema.matchFiles({
|
|
30512
30374
|
files: [filePath],
|
|
30513
30375
|
collection: schemaCollection
|
|
30514
30376
|
});
|
|
30515
|
-
if (match.length === 0) {
|
|
30377
|
+
if ((match == null ? void 0 : match.length) === 0) {
|
|
30516
30378
|
return `The filename "${value}" is not allowed for this collection.`;
|
|
30517
30379
|
}
|
|
30518
30380
|
}
|
|
@@ -31086,13 +30948,9 @@ const TinaAdmin = ({
|
|
|
31086
30948
|
schemaJson
|
|
31087
30949
|
}) => {
|
|
31088
30950
|
const isSSR2 = typeof window === "undefined";
|
|
31089
|
-
const { edit } = useEditState();
|
|
31090
30951
|
if (isSSR2) {
|
|
31091
30952
|
return null;
|
|
31092
30953
|
}
|
|
31093
|
-
if (!edit) {
|
|
31094
|
-
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement(LoginPage, null));
|
|
31095
|
-
}
|
|
31096
30954
|
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
31097
30955
|
var _a, _b, _c;
|
|
31098
30956
|
const isTinaAdminEnabled = cms.flags.get("tina-admin") === false ? false : true;
|
|
@@ -31175,12 +31033,6 @@ const TinaAdmin = ({
|
|
|
31175
31033
|
path: "screens/:screenName",
|
|
31176
31034
|
element: /* @__PURE__ */ React__default.createElement(DefaultWrapper, { cms }, /* @__PURE__ */ React__default.createElement(ScreenPage, null))
|
|
31177
31035
|
}
|
|
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
31036
|
), /* @__PURE__ */ React__default.createElement(
|
|
31185
31037
|
Route,
|
|
31186
31038
|
{
|
|
@@ -31195,7 +31047,7 @@ const TinaAdmin = ({
|
|
|
31195
31047
|
}
|
|
31196
31048
|
)))));
|
|
31197
31049
|
} 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: "
|
|
31050
|
+
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
31051
|
}
|
|
31200
31052
|
});
|
|
31201
31053
|
};
|
|
@@ -31565,7 +31417,6 @@ export {
|
|
|
31565
31417
|
formatBranchName,
|
|
31566
31418
|
getFilteredBranchList,
|
|
31567
31419
|
getStaticPropsForTina,
|
|
31568
|
-
gql,
|
|
31569
31420
|
passwordFieldClasses,
|
|
31570
31421
|
resolveField,
|
|
31571
31422
|
safeAssertShape,
|