tinacms 0.0.0-bc59a81-20241030011355 → 0.0.0-bdd3bb8-20250121101941
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/types.d.ts +3 -0
- package/dist/client.js +72 -45
- package/dist/client.mjs +49 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.js +166 -267
- package/dist/index.mjs +178 -279
- package/dist/{node-cache-4c336858.mjs → node-cache-5e8db9f0.mjs} +23 -10
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +4 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +4 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +2 -2
- package/dist/unifiedClient/index.d.ts +8 -1
- package/package.json +27 -27
package/dist/index.mjs
CHANGED
|
@@ -6,8 +6,8 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import React__default, { useState, useCallback, useEffect, useRef, createContext, forwardRef, useContext, useMemo, startTransition
|
|
10
|
-
import { createPortal
|
|
9
|
+
import React__default, { useState, useCallback, useEffect, useRef, createContext, forwardRef, useContext, useMemo, startTransition } from "react";
|
|
10
|
+
import { createPortal } from "react-dom";
|
|
11
11
|
import { withRef, cn as cn$1, withVariants, withProps, withCn, createPrimitiveElement } from "@udecode/cn";
|
|
12
12
|
import { toggleList, ELEMENT_UL, ELEMENT_OL, ELEMENT_H1 as ELEMENT_H1$1, ELEMENT_H2 as ELEMENT_H2$1, ELEMENT_H3 as ELEMENT_H3$1, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_PARAGRAPH, ELEMENT_BLOCKQUOTE, ELEMENT_CODE_BLOCK, ELEMENT_CODE_LINE, ELEMENT_CODE_SYNTAX, ELEMENT_LI, ELEMENT_LINK, MARK_CODE, MARK_UNDERLINE, MARK_STRIKETHROUGH, MARK_ITALIC, MARK_BOLD, ELEMENT_HR, ELEMENT_TABLE, ELEMENT_TR, ELEMENT_TD, ELEMENT_TH, unwrapList, ELEMENT_TODO_LI, createTrailingBlockPlugin, createAutoformatPlugin, createExitBreakPlugin, KEYS_HEADING, createResetNodePlugin, createHeadingPlugin, createParagraphPlugin, createBlockquotePlugin, createBoldPlugin, createItalicPlugin, createUnderlinePlugin, createCodePlugin, createListPlugin, createIndentListPlugin, createHorizontalRulePlugin, createNodeIdPlugin, createTablePlugin, getListItemEntry, useListToolbarButtonState, useListToolbarButton } from "@udecode/plate";
|
|
13
13
|
import { PlateElement, isCollapsed, findNodePath, getPointAfter, insertNodes, ELEMENT_DEFAULT, focusEditor, getPointBefore, setNodes, isElement, PlateLeaf, createPluginFactory, useComposedRef, useEditorRef, createPointRef, insertText, moveSelection, toggleNodeType, useElement, useRemoveNodeButton, useEditorSelector, isSelectionExpanded, withHOC, normalizeEditor, getBlockAbove, queryNode, getParentNode, isType, someNode, isSelectionAtBlockStart, setElements, insertNode, getPluginType, isBlock, isBlockAboveEmpty, findNode, PlateContent, getNodeEntries, useEditorState, collapseSelection, useMarkToolbarButtonState, useMarkToolbarButton, insertEmptyElement, usePlateSelectors, useEventEditorSelectors, PortalBody, useFormInputProps, createPlugins, Plate } from "@udecode/plate-common";
|
|
@@ -889,13 +889,23 @@ const FieldDescription = ({
|
|
|
889
889
|
className,
|
|
890
890
|
...props
|
|
891
891
|
}) => {
|
|
892
|
+
if (typeof children === "string") {
|
|
893
|
+
return /* @__PURE__ */ React.createElement(
|
|
894
|
+
"span",
|
|
895
|
+
{
|
|
896
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
897
|
+
...props,
|
|
898
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
}
|
|
892
902
|
return /* @__PURE__ */ React.createElement(
|
|
893
903
|
"span",
|
|
894
904
|
{
|
|
895
905
|
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
896
|
-
...props
|
|
897
|
-
|
|
898
|
-
|
|
906
|
+
...props
|
|
907
|
+
},
|
|
908
|
+
children
|
|
899
909
|
);
|
|
900
910
|
};
|
|
901
911
|
const FieldError = ({
|
|
@@ -1348,8 +1358,8 @@ const ListElementVariants = withVariants(PlateElement, listVariants, [
|
|
|
1348
1358
|
]);
|
|
1349
1359
|
const ListElement = withRef(
|
|
1350
1360
|
({ children, variant = "ul", ...props }, ref) => {
|
|
1351
|
-
const
|
|
1352
|
-
return /* @__PURE__ */ React__default.createElement(ListElementVariants, { asChild: true, ref, variant, ...props }, /* @__PURE__ */ React__default.createElement(
|
|
1361
|
+
const Component = variant;
|
|
1362
|
+
return /* @__PURE__ */ React__default.createElement(ListElementVariants, { asChild: true, ref, variant, ...props }, /* @__PURE__ */ React__default.createElement(Component, null, children));
|
|
1353
1363
|
}
|
|
1354
1364
|
);
|
|
1355
1365
|
const ELEMENT_MERMAID = "mermaid";
|
|
@@ -3669,7 +3679,7 @@ function TinaForm({ form, children }) {
|
|
|
3669
3679
|
}));
|
|
3670
3680
|
}
|
|
3671
3681
|
function TinaField({
|
|
3672
|
-
Component
|
|
3682
|
+
Component,
|
|
3673
3683
|
children,
|
|
3674
3684
|
...fieldProps
|
|
3675
3685
|
}) {
|
|
@@ -3677,7 +3687,7 @@ function TinaField({
|
|
|
3677
3687
|
if (!isEditing)
|
|
3678
3688
|
return children || null;
|
|
3679
3689
|
return /* @__PURE__ */ React.createElement(Field, { ...fieldProps }, ({ input, meta }) => {
|
|
3680
|
-
return /* @__PURE__ */ React.createElement(
|
|
3690
|
+
return /* @__PURE__ */ React.createElement(Component, { input, meta, ...fieldProps });
|
|
3681
3691
|
});
|
|
3682
3692
|
}
|
|
3683
3693
|
TinaField.propTypes = {
|
|
@@ -3847,7 +3857,7 @@ var _excluded = ["attr", "size", "title"];
|
|
|
3847
3857
|
function _objectWithoutProperties(source, excluded) {
|
|
3848
3858
|
if (source == null)
|
|
3849
3859
|
return {};
|
|
3850
|
-
var target = _objectWithoutPropertiesLoose
|
|
3860
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
3851
3861
|
var key, i;
|
|
3852
3862
|
if (Object.getOwnPropertySymbols) {
|
|
3853
3863
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3862,7 +3872,7 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
3862
3872
|
}
|
|
3863
3873
|
return target;
|
|
3864
3874
|
}
|
|
3865
|
-
function _objectWithoutPropertiesLoose
|
|
3875
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3866
3876
|
if (source == null)
|
|
3867
3877
|
return {};
|
|
3868
3878
|
var target = {};
|
|
@@ -4952,7 +4962,28 @@ const NumberInput = ({
|
|
|
4952
4962
|
onChange,
|
|
4953
4963
|
value,
|
|
4954
4964
|
step
|
|
4955
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
4965
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
4966
|
+
Input,
|
|
4967
|
+
{
|
|
4968
|
+
type: "number",
|
|
4969
|
+
step,
|
|
4970
|
+
value,
|
|
4971
|
+
onChange: (event) => {
|
|
4972
|
+
const inputValue = event.target.value;
|
|
4973
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4974
|
+
if (onChange) {
|
|
4975
|
+
const syntheticEvent = {
|
|
4976
|
+
...event,
|
|
4977
|
+
target: {
|
|
4978
|
+
...event.target,
|
|
4979
|
+
value: newValue
|
|
4980
|
+
}
|
|
4981
|
+
};
|
|
4982
|
+
onChange(syntheticEvent);
|
|
4983
|
+
}
|
|
4984
|
+
}
|
|
4985
|
+
}
|
|
4986
|
+
);
|
|
4956
4987
|
function useCMS() {
|
|
4957
4988
|
return useCMS$1();
|
|
4958
4989
|
}
|
|
@@ -5753,10 +5784,11 @@ const ItemDeleteButton = ({ onClick, disabled = false }) => {
|
|
|
5753
5784
|
return /* @__PURE__ */ React__default.createElement(
|
|
5754
5785
|
"button",
|
|
5755
5786
|
{
|
|
5756
|
-
|
|
5787
|
+
type: "button",
|
|
5788
|
+
className: `w-8 px-1 py-2.5 flex items-center justify-center text-gray-200 hover:opacity-100 opacity-30 hover:bg-gray-50 ${disabled && "pointer-events-none opacity-30 cursor-not-allowed"}`,
|
|
5757
5789
|
onClick
|
|
5758
5790
|
},
|
|
5759
|
-
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5791
|
+
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5760
5792
|
);
|
|
5761
5793
|
};
|
|
5762
5794
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -7204,244 +7236,65 @@ function pad(type, value) {
|
|
|
7204
7236
|
str = "0" + str;
|
|
7205
7237
|
return str;
|
|
7206
7238
|
}
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
}
|
|
7219
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7220
|
-
if (source == null)
|
|
7221
|
-
return {};
|
|
7222
|
-
var target = {};
|
|
7223
|
-
var sourceKeys = Object.keys(source);
|
|
7224
|
-
var key, i;
|
|
7225
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7226
|
-
key = sourceKeys[i];
|
|
7227
|
-
if (excluded.indexOf(key) >= 0)
|
|
7228
|
-
continue;
|
|
7229
|
-
target[key] = source[key];
|
|
7230
|
-
}
|
|
7231
|
-
return target;
|
|
7232
|
-
}
|
|
7233
|
-
function _assertThisInitialized(self) {
|
|
7234
|
-
if (self === void 0) {
|
|
7235
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7236
|
-
}
|
|
7237
|
-
return self;
|
|
7238
|
-
}
|
|
7239
|
-
function isNodeFound(current, componentNode, ignoreClass) {
|
|
7240
|
-
if (current === componentNode) {
|
|
7241
|
-
return true;
|
|
7242
|
-
}
|
|
7243
|
-
if (current.correspondingElement) {
|
|
7244
|
-
return current.correspondingElement.classList.contains(ignoreClass);
|
|
7245
|
-
}
|
|
7246
|
-
return current.classList.contains(ignoreClass);
|
|
7247
|
-
}
|
|
7248
|
-
function findHighest(current, componentNode, ignoreClass) {
|
|
7249
|
-
if (current === componentNode) {
|
|
7250
|
-
return true;
|
|
7239
|
+
var useClickAway$1 = {};
|
|
7240
|
+
var util = {};
|
|
7241
|
+
Object.defineProperty(util, "__esModule", { value: true });
|
|
7242
|
+
util.isNavigator = util.isBrowser = util.off = util.on = util.noop = void 0;
|
|
7243
|
+
var noop = function() {
|
|
7244
|
+
};
|
|
7245
|
+
util.noop = noop;
|
|
7246
|
+
function on(obj) {
|
|
7247
|
+
var args = [];
|
|
7248
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7249
|
+
args[_i - 1] = arguments[_i];
|
|
7251
7250
|
}
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
return true;
|
|
7255
|
-
}
|
|
7256
|
-
current = current.parentNode || current.host;
|
|
7251
|
+
if (obj && obj.addEventListener) {
|
|
7252
|
+
obj.addEventListener.apply(obj, args);
|
|
7257
7253
|
}
|
|
7258
|
-
return current;
|
|
7259
|
-
}
|
|
7260
|
-
function clickedScrollbar(evt) {
|
|
7261
|
-
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
|
|
7262
7254
|
}
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7255
|
+
util.on = on;
|
|
7256
|
+
function off(obj) {
|
|
7257
|
+
var args = [];
|
|
7258
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7259
|
+
args[_i - 1] = arguments[_i];
|
|
7266
7260
|
}
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
get: function get2() {
|
|
7270
|
-
passive = true;
|
|
7271
|
-
}
|
|
7272
|
-
});
|
|
7273
|
-
var noop = function noop2() {
|
|
7274
|
-
};
|
|
7275
|
-
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
7276
|
-
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
7277
|
-
return passive;
|
|
7278
|
-
};
|
|
7279
|
-
function autoInc(seed) {
|
|
7280
|
-
if (seed === void 0) {
|
|
7281
|
-
seed = 0;
|
|
7261
|
+
if (obj && obj.removeEventListener) {
|
|
7262
|
+
obj.removeEventListener.apply(obj, args);
|
|
7282
7263
|
}
|
|
7283
|
-
return function() {
|
|
7284
|
-
return ++seed;
|
|
7285
|
-
};
|
|
7286
|
-
}
|
|
7287
|
-
var uid = autoInc();
|
|
7288
|
-
var passiveEventSupport;
|
|
7289
|
-
var handlersMap = {};
|
|
7290
|
-
var enabledInstances = {};
|
|
7291
|
-
var touchEvents = ["touchstart", "touchmove"];
|
|
7292
|
-
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
7293
|
-
function getEventHandlerOptions(instance, eventName) {
|
|
7294
|
-
var handlerOptions = {};
|
|
7295
|
-
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
7296
|
-
if (isTouchEvent && passiveEventSupport) {
|
|
7297
|
-
handlerOptions.passive = !instance.props.preventDefault;
|
|
7298
|
-
}
|
|
7299
|
-
return handlerOptions;
|
|
7300
7264
|
}
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
instance.handleClickOutside(event);
|
|
7321
|
-
return;
|
|
7322
|
-
}
|
|
7323
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
7324
|
-
};
|
|
7325
|
-
_this.__getComponentNode = function() {
|
|
7326
|
-
var instance = _this.getInstance();
|
|
7327
|
-
if (config && typeof config.setClickOutsideRef === "function") {
|
|
7328
|
-
return config.setClickOutsideRef()(instance);
|
|
7329
|
-
}
|
|
7330
|
-
if (typeof instance.setClickOutsideRef === "function") {
|
|
7331
|
-
return instance.setClickOutsideRef();
|
|
7332
|
-
}
|
|
7333
|
-
return findDOMNode(instance);
|
|
7334
|
-
};
|
|
7335
|
-
_this.enableOnClickOutside = function() {
|
|
7336
|
-
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
7337
|
-
return;
|
|
7338
|
-
}
|
|
7339
|
-
if (typeof passiveEventSupport === "undefined") {
|
|
7340
|
-
passiveEventSupport = testPassiveEventSupport();
|
|
7341
|
-
}
|
|
7342
|
-
enabledInstances[_this._uid] = true;
|
|
7343
|
-
var events = _this.props.eventTypes;
|
|
7344
|
-
if (!events.forEach) {
|
|
7345
|
-
events = [events];
|
|
7346
|
-
}
|
|
7347
|
-
handlersMap[_this._uid] = function(event) {
|
|
7348
|
-
if (_this.componentNode === null)
|
|
7349
|
-
return;
|
|
7350
|
-
if (_this.initTimeStamp > event.timeStamp)
|
|
7351
|
-
return;
|
|
7352
|
-
if (_this.props.preventDefault) {
|
|
7353
|
-
event.preventDefault();
|
|
7354
|
-
}
|
|
7355
|
-
if (_this.props.stopPropagation) {
|
|
7356
|
-
event.stopPropagation();
|
|
7357
|
-
}
|
|
7358
|
-
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
7359
|
-
return;
|
|
7360
|
-
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
7361
|
-
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
7362
|
-
return;
|
|
7363
|
-
}
|
|
7364
|
-
_this.__outsideClickHandler(event);
|
|
7365
|
-
};
|
|
7366
|
-
events.forEach(function(eventName) {
|
|
7367
|
-
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7368
|
-
});
|
|
7369
|
-
};
|
|
7370
|
-
_this.disableOnClickOutside = function() {
|
|
7371
|
-
delete enabledInstances[_this._uid];
|
|
7372
|
-
var fn = handlersMap[_this._uid];
|
|
7373
|
-
if (fn && typeof document !== "undefined") {
|
|
7374
|
-
var events = _this.props.eventTypes;
|
|
7375
|
-
if (!events.forEach) {
|
|
7376
|
-
events = [events];
|
|
7377
|
-
}
|
|
7378
|
-
events.forEach(function(eventName) {
|
|
7379
|
-
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7380
|
-
});
|
|
7381
|
-
delete handlersMap[_this._uid];
|
|
7382
|
-
}
|
|
7383
|
-
};
|
|
7384
|
-
_this.getRef = function(ref) {
|
|
7385
|
-
return _this.instanceRef = ref;
|
|
7386
|
-
};
|
|
7387
|
-
_this._uid = uid();
|
|
7388
|
-
_this.initTimeStamp = performance.now();
|
|
7389
|
-
return _this;
|
|
7390
|
-
}
|
|
7391
|
-
var _proto = onClickOutside.prototype;
|
|
7392
|
-
_proto.getInstance = function getInstance() {
|
|
7393
|
-
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
7394
|
-
return this;
|
|
7395
|
-
}
|
|
7396
|
-
var ref = this.instanceRef;
|
|
7397
|
-
return ref.getInstance ? ref.getInstance() : ref;
|
|
7398
|
-
};
|
|
7399
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
7400
|
-
if (typeof document === "undefined" || !document.createElement) {
|
|
7401
|
-
return;
|
|
7402
|
-
}
|
|
7403
|
-
var instance = this.getInstance();
|
|
7404
|
-
if (config && typeof config.handleClickOutside === "function") {
|
|
7405
|
-
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
|
|
7406
|
-
if (typeof this.__clickOutsideHandlerProp !== "function") {
|
|
7407
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
7408
|
-
}
|
|
7409
|
-
}
|
|
7410
|
-
this.componentNode = this.__getComponentNode();
|
|
7411
|
-
if (this.props.disableOnClickOutside)
|
|
7412
|
-
return;
|
|
7413
|
-
this.enableOnClickOutside();
|
|
7414
|
-
};
|
|
7415
|
-
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
7416
|
-
this.componentNode = this.__getComponentNode();
|
|
7265
|
+
util.off = off;
|
|
7266
|
+
util.isBrowser = typeof window !== "undefined";
|
|
7267
|
+
util.isNavigator = typeof navigator !== "undefined";
|
|
7268
|
+
Object.defineProperty(useClickAway$1, "__esModule", { value: true });
|
|
7269
|
+
var react_1 = React__default;
|
|
7270
|
+
var util_1 = util;
|
|
7271
|
+
var defaultEvents = ["mousedown", "touchstart"];
|
|
7272
|
+
var useClickAway = function(ref, onClickAway, events) {
|
|
7273
|
+
if (events === void 0) {
|
|
7274
|
+
events = defaultEvents;
|
|
7275
|
+
}
|
|
7276
|
+
var savedCallback = react_1.useRef(onClickAway);
|
|
7277
|
+
react_1.useEffect(function() {
|
|
7278
|
+
savedCallback.current = onClickAway;
|
|
7279
|
+
}, [onClickAway]);
|
|
7280
|
+
react_1.useEffect(function() {
|
|
7281
|
+
var handler = function(event) {
|
|
7282
|
+
var el = ref.current;
|
|
7283
|
+
el && !el.contains(event.target) && savedCallback.current(event);
|
|
7417
7284
|
};
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
props.ref = this.getRef;
|
|
7427
|
-
} else {
|
|
7428
|
-
props.wrappedRef = this.getRef;
|
|
7285
|
+
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
|
|
7286
|
+
var eventName = events_1[_i];
|
|
7287
|
+
util_1.on(document, eventName, handler);
|
|
7288
|
+
}
|
|
7289
|
+
return function() {
|
|
7290
|
+
for (var _i2 = 0, events_2 = events; _i2 < events_2.length; _i2++) {
|
|
7291
|
+
var eventName2 = events_2[_i2];
|
|
7292
|
+
util_1.off(document, eventName2, handler);
|
|
7429
7293
|
}
|
|
7430
|
-
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
7431
|
-
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
7432
|
-
return createElement(WrappedComponent, props);
|
|
7433
7294
|
};
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
7438
|
-
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
7439
|
-
preventDefault: false,
|
|
7440
|
-
stopPropagation: false
|
|
7441
|
-
}, _class.getClass = function() {
|
|
7442
|
-
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
7443
|
-
}, _temp;
|
|
7444
|
-
}
|
|
7295
|
+
}, [events, ref]);
|
|
7296
|
+
};
|
|
7297
|
+
var _default = useClickAway$1.default = useClickAway;
|
|
7445
7298
|
const viewModes = {
|
|
7446
7299
|
YEARS: "years",
|
|
7447
7300
|
MONTHS: "months",
|
|
@@ -7970,22 +7823,13 @@ function log(message, method) {
|
|
|
7970
7823
|
}
|
|
7971
7824
|
con[method]("***react-datetime:" + message);
|
|
7972
7825
|
}
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
}
|
|
7978
|
-
|
|
7979
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: this.props.className, ref: this.container }, this.props.children);
|
|
7980
|
-
}
|
|
7981
|
-
handleClickOutside(e) {
|
|
7982
|
-
this.props.onClickOut(e);
|
|
7983
|
-
}
|
|
7984
|
-
setClickOutsideRef() {
|
|
7985
|
-
return this.container.current;
|
|
7986
|
-
}
|
|
7826
|
+
function ClickableWrapper({ className, onClickOut, children }) {
|
|
7827
|
+
const containerRef = useRef(null);
|
|
7828
|
+
_default(containerRef, (event) => {
|
|
7829
|
+
onClickOut(event);
|
|
7830
|
+
});
|
|
7831
|
+
return /* @__PURE__ */ React__default.createElement("div", { className, ref: containerRef }, children);
|
|
7987
7832
|
}
|
|
7988
|
-
const ClickableWrapper = onClickOutsideHOC(ClickOutBase);
|
|
7989
7833
|
const DEFAULT_DATE_DISPLAY_FORMAT = "MMM DD, YYYY";
|
|
7990
7834
|
const DEFAULT_TIME_DISPLAY_FORMAT = "h:mm A";
|
|
7991
7835
|
const format$1 = (val, _name, field) => {
|
|
@@ -8028,7 +7872,10 @@ const DateField = wrapFieldsWithMeta(
|
|
|
8028
7872
|
ReactDateTimeWithStyles,
|
|
8029
7873
|
{
|
|
8030
7874
|
value: input.value,
|
|
8031
|
-
onChange:
|
|
7875
|
+
onChange: (value) => {
|
|
7876
|
+
const newValue = value === "" ? void 0 : value;
|
|
7877
|
+
input.onChange(newValue);
|
|
7878
|
+
},
|
|
8032
7879
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
8033
7880
|
timeFormat: timeFormat || false,
|
|
8034
7881
|
inputProps: { className: textFieldClasses },
|
|
@@ -9839,7 +9686,7 @@ class SidebarState {
|
|
|
9839
9686
|
}
|
|
9840
9687
|
}
|
|
9841
9688
|
function createScreen({
|
|
9842
|
-
Component
|
|
9689
|
+
Component,
|
|
9843
9690
|
props,
|
|
9844
9691
|
...options
|
|
9845
9692
|
}) {
|
|
@@ -9848,7 +9695,7 @@ function createScreen({
|
|
|
9848
9695
|
layout: "popup",
|
|
9849
9696
|
...options,
|
|
9850
9697
|
Component(screenProps) {
|
|
9851
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
9698
|
+
return /* @__PURE__ */ React__default.createElement(Component, { ...screenProps, ...props });
|
|
9852
9699
|
}
|
|
9853
9700
|
};
|
|
9854
9701
|
}
|
|
@@ -10359,7 +10206,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10359
10206
|
"Event Log"
|
|
10360
10207
|
));
|
|
10361
10208
|
};
|
|
10362
|
-
const version = "2.
|
|
10209
|
+
const version = "2.6.0";
|
|
10363
10210
|
const Nav = ({
|
|
10364
10211
|
isLocalMode,
|
|
10365
10212
|
className = "",
|
|
@@ -13288,9 +13135,9 @@ const EllipsisIcon = ({ title }) => {
|
|
|
13288
13135
|
));
|
|
13289
13136
|
};
|
|
13290
13137
|
const Wrapper$1 = ({ inline, children }) => {
|
|
13291
|
-
const
|
|
13138
|
+
const Component = inline ? "span" : "div";
|
|
13292
13139
|
return /* @__PURE__ */ React__default.createElement(
|
|
13293
|
-
|
|
13140
|
+
Component,
|
|
13294
13141
|
{
|
|
13295
13142
|
contentEditable: false,
|
|
13296
13143
|
style: { userSelect: "none" },
|
|
@@ -14078,13 +13925,13 @@ const TooltipContent = withCn(
|
|
|
14078
13925
|
}),
|
|
14079
13926
|
"z-[9999] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md"
|
|
14080
13927
|
);
|
|
14081
|
-
function withTooltip(
|
|
13928
|
+
function withTooltip(Component) {
|
|
14082
13929
|
return React__default.forwardRef(function ExtendComponent({ tooltip, tooltipContentProps, tooltipProps, ...props }, ref) {
|
|
14083
13930
|
const [mounted, setMounted] = React__default.useState(false);
|
|
14084
13931
|
React__default.useEffect(() => {
|
|
14085
13932
|
setMounted(true);
|
|
14086
13933
|
}, []);
|
|
14087
|
-
const component = /* @__PURE__ */ React__default.createElement(
|
|
13934
|
+
const component = /* @__PURE__ */ React__default.createElement(Component, { ref, ...props });
|
|
14088
13935
|
if (tooltip && mounted) {
|
|
14089
13936
|
return /* @__PURE__ */ React__default.createElement(Tooltip, { ...tooltipProps }, /* @__PURE__ */ React__default.createElement(TooltipTrigger, { asChild: true }, component), /* @__PURE__ */ React__default.createElement(TooltipPortal, null, /* @__PURE__ */ React__default.createElement(TooltipContent, { ...tooltipContentProps }, tooltip)));
|
|
14090
13937
|
}
|
|
@@ -14765,7 +14612,12 @@ function FixedToolbarButtons() {
|
|
|
14765
14612
|
const [itemsShown, setItemsShown] = React__default.useState(11);
|
|
14766
14613
|
const { overrides, templates } = useToolbarContext();
|
|
14767
14614
|
const showEmbedButton = templates.length > 0;
|
|
14768
|
-
let items2 =
|
|
14615
|
+
let items2 = [];
|
|
14616
|
+
if (Array.isArray(overrides)) {
|
|
14617
|
+
items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14618
|
+
} else {
|
|
14619
|
+
items2 = (overrides == null ? void 0 : overrides.toolbar) === void 0 ? Object.values(toolbarItems) : overrides.toolbar.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14620
|
+
}
|
|
14769
14621
|
if (!showEmbedButton) {
|
|
14770
14622
|
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14771
14623
|
}
|
|
@@ -15093,6 +14945,9 @@ const isUrl = (string) => {
|
|
|
15093
14945
|
if (typeof string !== "string") {
|
|
15094
14946
|
return false;
|
|
15095
14947
|
}
|
|
14948
|
+
if (string.startsWith("#")) {
|
|
14949
|
+
return true;
|
|
14950
|
+
}
|
|
15096
14951
|
const generalMatch = string.match(protocolAndDomainRE);
|
|
15097
14952
|
const emailLinkMatch = string.match(emailLintRE);
|
|
15098
14953
|
const localUrlMatch = string.match(localUrlRE);
|
|
@@ -15114,12 +14969,12 @@ const isUrl = (string) => {
|
|
|
15114
14969
|
}
|
|
15115
14970
|
return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
|
|
15116
14971
|
};
|
|
15117
|
-
const RichEditor = (
|
|
14972
|
+
const RichEditor = ({ input, tinaForm, field }) => {
|
|
15118
14973
|
var _a;
|
|
15119
14974
|
const initialValue = React__default.useMemo(
|
|
15120
14975
|
() => {
|
|
15121
14976
|
var _a2, _b;
|
|
15122
|
-
return ((_b = (_a2 =
|
|
14977
|
+
return ((_b = (_a2 = input.value) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) ? input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
|
|
15123
14978
|
},
|
|
15124
14979
|
[]
|
|
15125
14980
|
);
|
|
@@ -15147,7 +15002,7 @@ const RichEditor = (props) => {
|
|
|
15147
15002
|
),
|
|
15148
15003
|
[]
|
|
15149
15004
|
);
|
|
15150
|
-
const tempId = [
|
|
15005
|
+
const tempId = [tinaForm.id, input.name].join(".");
|
|
15151
15006
|
const id = React__default.useMemo(() => uuid() + tempId, [tempId]);
|
|
15152
15007
|
const ref = React__default.useRef(null);
|
|
15153
15008
|
React__default.useEffect(() => {
|
|
@@ -15157,13 +15012,13 @@ const RichEditor = (props) => {
|
|
|
15157
15012
|
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
15158
15013
|
'[role="textbox"]'
|
|
15159
15014
|
);
|
|
15160
|
-
if (
|
|
15015
|
+
if (field.experimental_focusIntent && plateElement) {
|
|
15161
15016
|
if (plateElement)
|
|
15162
15017
|
plateElement.focus();
|
|
15163
15018
|
}
|
|
15164
15019
|
}, 100);
|
|
15165
15020
|
}
|
|
15166
|
-
}, [
|
|
15021
|
+
}, [field.experimental_focusIntent, ref]);
|
|
15167
15022
|
return /* @__PURE__ */ React__default.createElement("div", { ref }, /* @__PURE__ */ React__default.createElement(
|
|
15168
15023
|
Plate,
|
|
15169
15024
|
{
|
|
@@ -15171,7 +15026,7 @@ const RichEditor = (props) => {
|
|
|
15171
15026
|
initialValue,
|
|
15172
15027
|
plugins: plugins$2,
|
|
15173
15028
|
onChange: (value) => {
|
|
15174
|
-
|
|
15029
|
+
input.onChange({
|
|
15175
15030
|
type: "root",
|
|
15176
15031
|
children: value
|
|
15177
15032
|
});
|
|
@@ -15180,12 +15035,12 @@ const RichEditor = (props) => {
|
|
|
15180
15035
|
/* @__PURE__ */ React__default.createElement(TooltipProvider, null, /* @__PURE__ */ React__default.createElement(
|
|
15181
15036
|
ToolbarProvider,
|
|
15182
15037
|
{
|
|
15183
|
-
tinaForm
|
|
15184
|
-
templates:
|
|
15185
|
-
overrides: (
|
|
15038
|
+
tinaForm,
|
|
15039
|
+
templates: field.templates,
|
|
15040
|
+
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
15186
15041
|
},
|
|
15187
15042
|
/* @__PURE__ */ React__default.createElement(FixedToolbar, null, /* @__PURE__ */ React__default.createElement(FixedToolbarButtons, null)),
|
|
15188
|
-
/* @__PURE__ */ React__default.createElement(FloatingToolbar, null, /* @__PURE__ */ React__default.createElement(FloatingToolbarButtons, null))
|
|
15043
|
+
((_a = field == null ? void 0 : field.overrides) == null ? void 0 : _a.showFloatingToolbar) !== false ? /* @__PURE__ */ React__default.createElement(FloatingToolbar, null, /* @__PURE__ */ React__default.createElement(FloatingToolbarButtons, null)) : null
|
|
15189
15044
|
), /* @__PURE__ */ React__default.createElement(Editor, null))
|
|
15190
15045
|
));
|
|
15191
15046
|
};
|
|
@@ -30139,6 +29994,7 @@ class TinaAdminApi {
|
|
|
30139
29994
|
relativePath
|
|
30140
29995
|
filename
|
|
30141
29996
|
extension
|
|
29997
|
+
hasReferences
|
|
30142
29998
|
}
|
|
30143
29999
|
}
|
|
30144
30000
|
}
|
|
@@ -30230,6 +30086,9 @@ class TinaAdminApi {
|
|
|
30230
30086
|
document(collection:$collection, relativePath:$relativePath) {
|
|
30231
30087
|
... on Document {
|
|
30232
30088
|
_values
|
|
30089
|
+
_sys {
|
|
30090
|
+
hasReferences
|
|
30091
|
+
}
|
|
30233
30092
|
}
|
|
30234
30093
|
}
|
|
30235
30094
|
}`;
|
|
@@ -31956,6 +31815,23 @@ const CollectionListPage = () => {
|
|
|
31956
31815
|
DeleteModal,
|
|
31957
31816
|
{
|
|
31958
31817
|
filename: vars.relativePath,
|
|
31818
|
+
checkRefsFunc: async () => {
|
|
31819
|
+
var _a2, _b2;
|
|
31820
|
+
try {
|
|
31821
|
+
const doc = await admin.fetchDocument(
|
|
31822
|
+
collection.name,
|
|
31823
|
+
vars.relativePath,
|
|
31824
|
+
true
|
|
31825
|
+
);
|
|
31826
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
31827
|
+
} catch (error) {
|
|
31828
|
+
cms.alerts.error(
|
|
31829
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
31830
|
+
);
|
|
31831
|
+
console.error(error);
|
|
31832
|
+
throw error;
|
|
31833
|
+
}
|
|
31834
|
+
},
|
|
31959
31835
|
deleteFunc: async () => {
|
|
31960
31836
|
try {
|
|
31961
31837
|
await admin.deleteDocument(vars);
|
|
@@ -31964,6 +31840,12 @@ const CollectionListPage = () => {
|
|
|
31964
31840
|
);
|
|
31965
31841
|
reFetchCollection();
|
|
31966
31842
|
} catch (error) {
|
|
31843
|
+
if (error.message.indexOf("has references")) {
|
|
31844
|
+
cms.alerts.error(
|
|
31845
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31846
|
+
);
|
|
31847
|
+
return;
|
|
31848
|
+
}
|
|
31967
31849
|
cms.alerts.warn(
|
|
31968
31850
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31969
31851
|
);
|
|
@@ -32015,6 +31897,12 @@ const CollectionListPage = () => {
|
|
|
32015
31897
|
cms.alerts.info("Document was successfully renamed");
|
|
32016
31898
|
reFetchCollection();
|
|
32017
31899
|
} catch (error) {
|
|
31900
|
+
if (error.message.indexOf("has references")) {
|
|
31901
|
+
cms.alerts.error(
|
|
31902
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31903
|
+
);
|
|
31904
|
+
return;
|
|
31905
|
+
}
|
|
32018
31906
|
cms.alerts.warn(
|
|
32019
31907
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
32020
31908
|
);
|
|
@@ -32488,8 +32376,19 @@ const Breadcrumb = ({ folder, navigate, collectionName }) => {
|
|
|
32488
32376
|
const NoDocumentsPlaceholder = () => {
|
|
32489
32377
|
return /* @__PURE__ */ React__default.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
32490
32378
|
};
|
|
32491
|
-
const DeleteModal = ({
|
|
32492
|
-
|
|
32379
|
+
const DeleteModal = ({
|
|
32380
|
+
close: close2,
|
|
32381
|
+
deleteFunc,
|
|
32382
|
+
checkRefsFunc,
|
|
32383
|
+
filename
|
|
32384
|
+
}) => {
|
|
32385
|
+
const [hasRefs, setHasRefs] = React__default.useState();
|
|
32386
|
+
useEffect(() => {
|
|
32387
|
+
checkRefsFunc().then((result) => {
|
|
32388
|
+
setHasRefs(result);
|
|
32389
|
+
});
|
|
32390
|
+
}, [filename, checkRefsFunc]);
|
|
32391
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__default.createElement(
|
|
32493
32392
|
Button$1,
|
|
32494
32393
|
{
|
|
32495
32394
|
style: { flexGrow: 3 },
|