tinacms 2.5.2 → 2.6.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/index.js +78 -258
- package/dist/index.mjs +90 -270
- 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/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3830,7 +3830,7 @@ flowchart TD
|
|
|
3830
3830
|
function _objectWithoutProperties(source, excluded) {
|
|
3831
3831
|
if (source == null)
|
|
3832
3832
|
return {};
|
|
3833
|
-
var target = _objectWithoutPropertiesLoose
|
|
3833
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
3834
3834
|
var key, i;
|
|
3835
3835
|
if (Object.getOwnPropertySymbols) {
|
|
3836
3836
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3845,7 +3845,7 @@ flowchart TD
|
|
|
3845
3845
|
}
|
|
3846
3846
|
return target;
|
|
3847
3847
|
}
|
|
3848
|
-
function _objectWithoutPropertiesLoose
|
|
3848
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3849
3849
|
if (source == null)
|
|
3850
3850
|
return {};
|
|
3851
3851
|
var target = {};
|
|
@@ -7209,244 +7209,65 @@ flowchart TD
|
|
|
7209
7209
|
str = "0" + str;
|
|
7210
7210
|
return str;
|
|
7211
7211
|
}
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
}
|
|
7224
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7225
|
-
if (source == null)
|
|
7226
|
-
return {};
|
|
7227
|
-
var target = {};
|
|
7228
|
-
var sourceKeys = Object.keys(source);
|
|
7229
|
-
var key, i;
|
|
7230
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7231
|
-
key = sourceKeys[i];
|
|
7232
|
-
if (excluded.indexOf(key) >= 0)
|
|
7233
|
-
continue;
|
|
7234
|
-
target[key] = source[key];
|
|
7235
|
-
}
|
|
7236
|
-
return target;
|
|
7237
|
-
}
|
|
7238
|
-
function _assertThisInitialized(self2) {
|
|
7239
|
-
if (self2 === void 0) {
|
|
7240
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7241
|
-
}
|
|
7242
|
-
return self2;
|
|
7243
|
-
}
|
|
7244
|
-
function isNodeFound(current, componentNode, ignoreClass) {
|
|
7245
|
-
if (current === componentNode) {
|
|
7246
|
-
return true;
|
|
7247
|
-
}
|
|
7248
|
-
if (current.correspondingElement) {
|
|
7249
|
-
return current.correspondingElement.classList.contains(ignoreClass);
|
|
7250
|
-
}
|
|
7251
|
-
return current.classList.contains(ignoreClass);
|
|
7252
|
-
}
|
|
7253
|
-
function findHighest(current, componentNode, ignoreClass) {
|
|
7254
|
-
if (current === componentNode) {
|
|
7255
|
-
return true;
|
|
7212
|
+
var useClickAway$1 = {};
|
|
7213
|
+
var util = {};
|
|
7214
|
+
Object.defineProperty(util, "__esModule", { value: true });
|
|
7215
|
+
util.isNavigator = util.isBrowser = util.off = util.on = util.noop = void 0;
|
|
7216
|
+
var noop = function() {
|
|
7217
|
+
};
|
|
7218
|
+
util.noop = noop;
|
|
7219
|
+
function on(obj) {
|
|
7220
|
+
var args = [];
|
|
7221
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7222
|
+
args[_i - 1] = arguments[_i];
|
|
7256
7223
|
}
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
return true;
|
|
7260
|
-
}
|
|
7261
|
-
current = current.parentNode || current.host;
|
|
7224
|
+
if (obj && obj.addEventListener) {
|
|
7225
|
+
obj.addEventListener.apply(obj, args);
|
|
7262
7226
|
}
|
|
7263
|
-
return current;
|
|
7264
7227
|
}
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
return;
|
|
7228
|
+
util.on = on;
|
|
7229
|
+
function off(obj) {
|
|
7230
|
+
var args = [];
|
|
7231
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7232
|
+
args[_i - 1] = arguments[_i];
|
|
7271
7233
|
}
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
get: function get2() {
|
|
7275
|
-
passive = true;
|
|
7276
|
-
}
|
|
7277
|
-
});
|
|
7278
|
-
var noop = function noop2() {
|
|
7279
|
-
};
|
|
7280
|
-
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
7281
|
-
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
7282
|
-
return passive;
|
|
7283
|
-
};
|
|
7284
|
-
function autoInc(seed) {
|
|
7285
|
-
if (seed === void 0) {
|
|
7286
|
-
seed = 0;
|
|
7234
|
+
if (obj && obj.removeEventListener) {
|
|
7235
|
+
obj.removeEventListener.apply(obj, args);
|
|
7287
7236
|
}
|
|
7288
|
-
return function() {
|
|
7289
|
-
return ++seed;
|
|
7290
|
-
};
|
|
7291
|
-
}
|
|
7292
|
-
var uid = autoInc();
|
|
7293
|
-
var passiveEventSupport;
|
|
7294
|
-
var handlersMap = {};
|
|
7295
|
-
var enabledInstances = {};
|
|
7296
|
-
var touchEvents = ["touchstart", "touchmove"];
|
|
7297
|
-
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
7298
|
-
function getEventHandlerOptions(instance, eventName) {
|
|
7299
|
-
var handlerOptions = {};
|
|
7300
|
-
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
7301
|
-
if (isTouchEvent && passiveEventSupport) {
|
|
7302
|
-
handlerOptions.passive = !instance.props.preventDefault;
|
|
7303
|
-
}
|
|
7304
|
-
return handlerOptions;
|
|
7305
7237
|
}
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
instance.handleClickOutside(event);
|
|
7326
|
-
return;
|
|
7327
|
-
}
|
|
7328
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
7329
|
-
};
|
|
7330
|
-
_this.__getComponentNode = function() {
|
|
7331
|
-
var instance = _this.getInstance();
|
|
7332
|
-
if (config && typeof config.setClickOutsideRef === "function") {
|
|
7333
|
-
return config.setClickOutsideRef()(instance);
|
|
7334
|
-
}
|
|
7335
|
-
if (typeof instance.setClickOutsideRef === "function") {
|
|
7336
|
-
return instance.setClickOutsideRef();
|
|
7337
|
-
}
|
|
7338
|
-
return reactDom.findDOMNode(instance);
|
|
7339
|
-
};
|
|
7340
|
-
_this.enableOnClickOutside = function() {
|
|
7341
|
-
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
7342
|
-
return;
|
|
7343
|
-
}
|
|
7344
|
-
if (typeof passiveEventSupport === "undefined") {
|
|
7345
|
-
passiveEventSupport = testPassiveEventSupport();
|
|
7346
|
-
}
|
|
7347
|
-
enabledInstances[_this._uid] = true;
|
|
7348
|
-
var events = _this.props.eventTypes;
|
|
7349
|
-
if (!events.forEach) {
|
|
7350
|
-
events = [events];
|
|
7351
|
-
}
|
|
7352
|
-
handlersMap[_this._uid] = function(event) {
|
|
7353
|
-
if (_this.componentNode === null)
|
|
7354
|
-
return;
|
|
7355
|
-
if (_this.initTimeStamp > event.timeStamp)
|
|
7356
|
-
return;
|
|
7357
|
-
if (_this.props.preventDefault) {
|
|
7358
|
-
event.preventDefault();
|
|
7359
|
-
}
|
|
7360
|
-
if (_this.props.stopPropagation) {
|
|
7361
|
-
event.stopPropagation();
|
|
7362
|
-
}
|
|
7363
|
-
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
7364
|
-
return;
|
|
7365
|
-
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
7366
|
-
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
7367
|
-
return;
|
|
7368
|
-
}
|
|
7369
|
-
_this.__outsideClickHandler(event);
|
|
7370
|
-
};
|
|
7371
|
-
events.forEach(function(eventName) {
|
|
7372
|
-
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7373
|
-
});
|
|
7374
|
-
};
|
|
7375
|
-
_this.disableOnClickOutside = function() {
|
|
7376
|
-
delete enabledInstances[_this._uid];
|
|
7377
|
-
var fn = handlersMap[_this._uid];
|
|
7378
|
-
if (fn && typeof document !== "undefined") {
|
|
7379
|
-
var events = _this.props.eventTypes;
|
|
7380
|
-
if (!events.forEach) {
|
|
7381
|
-
events = [events];
|
|
7382
|
-
}
|
|
7383
|
-
events.forEach(function(eventName) {
|
|
7384
|
-
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7385
|
-
});
|
|
7386
|
-
delete handlersMap[_this._uid];
|
|
7387
|
-
}
|
|
7388
|
-
};
|
|
7389
|
-
_this.getRef = function(ref) {
|
|
7390
|
-
return _this.instanceRef = ref;
|
|
7391
|
-
};
|
|
7392
|
-
_this._uid = uid();
|
|
7393
|
-
_this.initTimeStamp = performance.now();
|
|
7394
|
-
return _this;
|
|
7395
|
-
}
|
|
7396
|
-
var _proto = onClickOutside.prototype;
|
|
7397
|
-
_proto.getInstance = function getInstance() {
|
|
7398
|
-
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
7399
|
-
return this;
|
|
7400
|
-
}
|
|
7401
|
-
var ref = this.instanceRef;
|
|
7402
|
-
return ref.getInstance ? ref.getInstance() : ref;
|
|
7238
|
+
util.off = off;
|
|
7239
|
+
util.isBrowser = typeof window !== "undefined";
|
|
7240
|
+
util.isNavigator = typeof navigator !== "undefined";
|
|
7241
|
+
Object.defineProperty(useClickAway$1, "__esModule", { value: true });
|
|
7242
|
+
var react_1 = React;
|
|
7243
|
+
var util_1 = util;
|
|
7244
|
+
var defaultEvents = ["mousedown", "touchstart"];
|
|
7245
|
+
var useClickAway = function(ref, onClickAway, events) {
|
|
7246
|
+
if (events === void 0) {
|
|
7247
|
+
events = defaultEvents;
|
|
7248
|
+
}
|
|
7249
|
+
var savedCallback = react_1.useRef(onClickAway);
|
|
7250
|
+
react_1.useEffect(function() {
|
|
7251
|
+
savedCallback.current = onClickAway;
|
|
7252
|
+
}, [onClickAway]);
|
|
7253
|
+
react_1.useEffect(function() {
|
|
7254
|
+
var handler = function(event) {
|
|
7255
|
+
var el = ref.current;
|
|
7256
|
+
el && !el.contains(event.target) && savedCallback.current(event);
|
|
7403
7257
|
};
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
7413
|
-
}
|
|
7414
|
-
}
|
|
7415
|
-
this.componentNode = this.__getComponentNode();
|
|
7416
|
-
if (this.props.disableOnClickOutside)
|
|
7417
|
-
return;
|
|
7418
|
-
this.enableOnClickOutside();
|
|
7419
|
-
};
|
|
7420
|
-
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
7421
|
-
this.componentNode = this.__getComponentNode();
|
|
7422
|
-
};
|
|
7423
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
7424
|
-
this.disableOnClickOutside();
|
|
7425
|
-
};
|
|
7426
|
-
_proto.render = function render() {
|
|
7427
|
-
var _this$props = this.props;
|
|
7428
|
-
_this$props.excludeScrollbar;
|
|
7429
|
-
var props = _objectWithoutPropertiesLoose(_this$props, ["excludeScrollbar"]);
|
|
7430
|
-
if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {
|
|
7431
|
-
props.ref = this.getRef;
|
|
7432
|
-
} else {
|
|
7433
|
-
props.wrappedRef = this.getRef;
|
|
7258
|
+
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
|
|
7259
|
+
var eventName = events_1[_i];
|
|
7260
|
+
util_1.on(document, eventName, handler);
|
|
7261
|
+
}
|
|
7262
|
+
return function() {
|
|
7263
|
+
for (var _i2 = 0, events_2 = events; _i2 < events_2.length; _i2++) {
|
|
7264
|
+
var eventName2 = events_2[_i2];
|
|
7265
|
+
util_1.off(document, eventName2, handler);
|
|
7434
7266
|
}
|
|
7435
|
-
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
7436
|
-
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
7437
|
-
return React.createElement(WrappedComponent, props);
|
|
7438
7267
|
};
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
7443
|
-
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
7444
|
-
preventDefault: false,
|
|
7445
|
-
stopPropagation: false
|
|
7446
|
-
}, _class.getClass = function() {
|
|
7447
|
-
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
7448
|
-
}, _temp;
|
|
7449
|
-
}
|
|
7268
|
+
}, [events, ref]);
|
|
7269
|
+
};
|
|
7270
|
+
var _default = useClickAway$1.default = useClickAway;
|
|
7450
7271
|
const viewModes = {
|
|
7451
7272
|
YEARS: "years",
|
|
7452
7273
|
MONTHS: "months",
|
|
@@ -7975,22 +7796,13 @@ flowchart TD
|
|
|
7975
7796
|
}
|
|
7976
7797
|
con[method]("***react-datetime:" + message);
|
|
7977
7798
|
}
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
}
|
|
7983
|
-
|
|
7984
|
-
return /* @__PURE__ */ React.createElement("div", { className: this.props.className, ref: this.container }, this.props.children);
|
|
7985
|
-
}
|
|
7986
|
-
handleClickOutside(e) {
|
|
7987
|
-
this.props.onClickOut(e);
|
|
7988
|
-
}
|
|
7989
|
-
setClickOutsideRef() {
|
|
7990
|
-
return this.container.current;
|
|
7991
|
-
}
|
|
7799
|
+
function ClickableWrapper({ className, onClickOut, children }) {
|
|
7800
|
+
const containerRef = React.useRef(null);
|
|
7801
|
+
_default(containerRef, (event) => {
|
|
7802
|
+
onClickOut(event);
|
|
7803
|
+
});
|
|
7804
|
+
return /* @__PURE__ */ React.createElement("div", { className, ref: containerRef }, children);
|
|
7992
7805
|
}
|
|
7993
|
-
const ClickableWrapper = onClickOutsideHOC(ClickOutBase);
|
|
7994
7806
|
const DEFAULT_DATE_DISPLAY_FORMAT = "MMM DD, YYYY";
|
|
7995
7807
|
const DEFAULT_TIME_DISPLAY_FORMAT = "h:mm A";
|
|
7996
7808
|
const format$1 = (val, _name, field) => {
|
|
@@ -10367,7 +10179,7 @@ flowchart TD
|
|
|
10367
10179
|
"Event Log"
|
|
10368
10180
|
));
|
|
10369
10181
|
};
|
|
10370
|
-
const version = "2.
|
|
10182
|
+
const version = "2.6.0";
|
|
10371
10183
|
const Nav = ({
|
|
10372
10184
|
isLocalMode,
|
|
10373
10185
|
className = "",
|
|
@@ -14773,7 +14585,12 @@ flowchart TD
|
|
|
14773
14585
|
const [itemsShown, setItemsShown] = React.useState(11);
|
|
14774
14586
|
const { overrides, templates } = useToolbarContext();
|
|
14775
14587
|
const showEmbedButton = templates.length > 0;
|
|
14776
|
-
let items2 =
|
|
14588
|
+
let items2 = [];
|
|
14589
|
+
if (Array.isArray(overrides)) {
|
|
14590
|
+
items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14591
|
+
} else {
|
|
14592
|
+
items2 = (overrides == null ? void 0 : overrides.toolbar) === void 0 ? Object.values(toolbarItems) : overrides.toolbar.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14593
|
+
}
|
|
14777
14594
|
if (!showEmbedButton) {
|
|
14778
14595
|
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14779
14596
|
}
|
|
@@ -15101,6 +14918,9 @@ flowchart TD
|
|
|
15101
14918
|
if (typeof string !== "string") {
|
|
15102
14919
|
return false;
|
|
15103
14920
|
}
|
|
14921
|
+
if (string.startsWith("#")) {
|
|
14922
|
+
return true;
|
|
14923
|
+
}
|
|
15104
14924
|
const generalMatch = string.match(protocolAndDomainRE);
|
|
15105
14925
|
const emailLinkMatch = string.match(emailLintRE);
|
|
15106
14926
|
const localUrlMatch = string.match(localUrlRE);
|
|
@@ -15122,12 +14942,12 @@ flowchart TD
|
|
|
15122
14942
|
}
|
|
15123
14943
|
return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
|
|
15124
14944
|
};
|
|
15125
|
-
const RichEditor = (
|
|
14945
|
+
const RichEditor = ({ input, tinaForm, field }) => {
|
|
15126
14946
|
var _a;
|
|
15127
14947
|
const initialValue = React.useMemo(
|
|
15128
14948
|
() => {
|
|
15129
14949
|
var _a2, _b;
|
|
15130
|
-
return ((_b = (_a2 =
|
|
14950
|
+
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: "" }] }];
|
|
15131
14951
|
},
|
|
15132
14952
|
[]
|
|
15133
14953
|
);
|
|
@@ -15155,7 +14975,7 @@ flowchart TD
|
|
|
15155
14975
|
),
|
|
15156
14976
|
[]
|
|
15157
14977
|
);
|
|
15158
|
-
const tempId = [
|
|
14978
|
+
const tempId = [tinaForm.id, input.name].join(".");
|
|
15159
14979
|
const id = React.useMemo(() => uuid() + tempId, [tempId]);
|
|
15160
14980
|
const ref = React.useRef(null);
|
|
15161
14981
|
React.useEffect(() => {
|
|
@@ -15165,13 +14985,13 @@ flowchart TD
|
|
|
15165
14985
|
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
15166
14986
|
'[role="textbox"]'
|
|
15167
14987
|
);
|
|
15168
|
-
if (
|
|
14988
|
+
if (field.experimental_focusIntent && plateElement) {
|
|
15169
14989
|
if (plateElement)
|
|
15170
14990
|
plateElement.focus();
|
|
15171
14991
|
}
|
|
15172
14992
|
}, 100);
|
|
15173
14993
|
}
|
|
15174
|
-
}, [
|
|
14994
|
+
}, [field.experimental_focusIntent, ref]);
|
|
15175
14995
|
return /* @__PURE__ */ React.createElement("div", { ref }, /* @__PURE__ */ React.createElement(
|
|
15176
14996
|
plateCommon.Plate,
|
|
15177
14997
|
{
|
|
@@ -15179,7 +14999,7 @@ flowchart TD
|
|
|
15179
14999
|
initialValue,
|
|
15180
15000
|
plugins: plugins$2,
|
|
15181
15001
|
onChange: (value) => {
|
|
15182
|
-
|
|
15002
|
+
input.onChange({
|
|
15183
15003
|
type: "root",
|
|
15184
15004
|
children: value
|
|
15185
15005
|
});
|
|
@@ -15188,12 +15008,12 @@ flowchart TD
|
|
|
15188
15008
|
/* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(
|
|
15189
15009
|
ToolbarProvider,
|
|
15190
15010
|
{
|
|
15191
|
-
tinaForm
|
|
15192
|
-
templates:
|
|
15193
|
-
overrides: (
|
|
15011
|
+
tinaForm,
|
|
15012
|
+
templates: field.templates,
|
|
15013
|
+
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
15194
15014
|
},
|
|
15195
15015
|
/* @__PURE__ */ React.createElement(FixedToolbar, null, /* @__PURE__ */ React.createElement(FixedToolbarButtons, null)),
|
|
15196
|
-
/* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null))
|
|
15016
|
+
((_a = field == null ? void 0 : field.overrides) == null ? void 0 : _a.showFloatingToolbar) !== false ? /* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null)) : null
|
|
15197
15017
|
), /* @__PURE__ */ React.createElement(Editor, null))
|
|
15198
15018
|
));
|
|
15199
15019
|
};
|
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";
|
|
@@ -1358,8 +1358,8 @@ const ListElementVariants = withVariants(PlateElement, listVariants, [
|
|
|
1358
1358
|
]);
|
|
1359
1359
|
const ListElement = withRef(
|
|
1360
1360
|
({ children, variant = "ul", ...props }, ref) => {
|
|
1361
|
-
const
|
|
1362
|
-
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));
|
|
1363
1363
|
}
|
|
1364
1364
|
);
|
|
1365
1365
|
const ELEMENT_MERMAID = "mermaid";
|
|
@@ -3679,7 +3679,7 @@ function TinaForm({ form, children }) {
|
|
|
3679
3679
|
}));
|
|
3680
3680
|
}
|
|
3681
3681
|
function TinaField({
|
|
3682
|
-
Component
|
|
3682
|
+
Component,
|
|
3683
3683
|
children,
|
|
3684
3684
|
...fieldProps
|
|
3685
3685
|
}) {
|
|
@@ -3687,7 +3687,7 @@ function TinaField({
|
|
|
3687
3687
|
if (!isEditing)
|
|
3688
3688
|
return children || null;
|
|
3689
3689
|
return /* @__PURE__ */ React.createElement(Field, { ...fieldProps }, ({ input, meta }) => {
|
|
3690
|
-
return /* @__PURE__ */ React.createElement(
|
|
3690
|
+
return /* @__PURE__ */ React.createElement(Component, { input, meta, ...fieldProps });
|
|
3691
3691
|
});
|
|
3692
3692
|
}
|
|
3693
3693
|
TinaField.propTypes = {
|
|
@@ -3857,7 +3857,7 @@ var _excluded = ["attr", "size", "title"];
|
|
|
3857
3857
|
function _objectWithoutProperties(source, excluded) {
|
|
3858
3858
|
if (source == null)
|
|
3859
3859
|
return {};
|
|
3860
|
-
var target = _objectWithoutPropertiesLoose
|
|
3860
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
3861
3861
|
var key, i;
|
|
3862
3862
|
if (Object.getOwnPropertySymbols) {
|
|
3863
3863
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3872,7 +3872,7 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
3872
3872
|
}
|
|
3873
3873
|
return target;
|
|
3874
3874
|
}
|
|
3875
|
-
function _objectWithoutPropertiesLoose
|
|
3875
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3876
3876
|
if (source == null)
|
|
3877
3877
|
return {};
|
|
3878
3878
|
var target = {};
|
|
@@ -7236,244 +7236,65 @@ function pad(type, value) {
|
|
|
7236
7236
|
str = "0" + str;
|
|
7237
7237
|
return str;
|
|
7238
7238
|
}
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
}
|
|
7251
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7252
|
-
if (source == null)
|
|
7253
|
-
return {};
|
|
7254
|
-
var target = {};
|
|
7255
|
-
var sourceKeys = Object.keys(source);
|
|
7256
|
-
var key, i;
|
|
7257
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7258
|
-
key = sourceKeys[i];
|
|
7259
|
-
if (excluded.indexOf(key) >= 0)
|
|
7260
|
-
continue;
|
|
7261
|
-
target[key] = source[key];
|
|
7262
|
-
}
|
|
7263
|
-
return target;
|
|
7264
|
-
}
|
|
7265
|
-
function _assertThisInitialized(self) {
|
|
7266
|
-
if (self === void 0) {
|
|
7267
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7268
|
-
}
|
|
7269
|
-
return self;
|
|
7270
|
-
}
|
|
7271
|
-
function isNodeFound(current, componentNode, ignoreClass) {
|
|
7272
|
-
if (current === componentNode) {
|
|
7273
|
-
return true;
|
|
7274
|
-
}
|
|
7275
|
-
if (current.correspondingElement) {
|
|
7276
|
-
return current.correspondingElement.classList.contains(ignoreClass);
|
|
7277
|
-
}
|
|
7278
|
-
return current.classList.contains(ignoreClass);
|
|
7279
|
-
}
|
|
7280
|
-
function findHighest(current, componentNode, ignoreClass) {
|
|
7281
|
-
if (current === componentNode) {
|
|
7282
|
-
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];
|
|
7283
7250
|
}
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
return true;
|
|
7287
|
-
}
|
|
7288
|
-
current = current.parentNode || current.host;
|
|
7251
|
+
if (obj && obj.addEventListener) {
|
|
7252
|
+
obj.addEventListener.apply(obj, args);
|
|
7289
7253
|
}
|
|
7290
|
-
return current;
|
|
7291
7254
|
}
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
var
|
|
7296
|
-
|
|
7297
|
-
return;
|
|
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];
|
|
7298
7260
|
}
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
get: function get2() {
|
|
7302
|
-
passive = true;
|
|
7303
|
-
}
|
|
7304
|
-
});
|
|
7305
|
-
var noop = function noop2() {
|
|
7306
|
-
};
|
|
7307
|
-
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
7308
|
-
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
7309
|
-
return passive;
|
|
7310
|
-
};
|
|
7311
|
-
function autoInc(seed) {
|
|
7312
|
-
if (seed === void 0) {
|
|
7313
|
-
seed = 0;
|
|
7261
|
+
if (obj && obj.removeEventListener) {
|
|
7262
|
+
obj.removeEventListener.apply(obj, args);
|
|
7314
7263
|
}
|
|
7315
|
-
return function() {
|
|
7316
|
-
return ++seed;
|
|
7317
|
-
};
|
|
7318
|
-
}
|
|
7319
|
-
var uid = autoInc();
|
|
7320
|
-
var passiveEventSupport;
|
|
7321
|
-
var handlersMap = {};
|
|
7322
|
-
var enabledInstances = {};
|
|
7323
|
-
var touchEvents = ["touchstart", "touchmove"];
|
|
7324
|
-
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
7325
|
-
function getEventHandlerOptions(instance, eventName) {
|
|
7326
|
-
var handlerOptions = {};
|
|
7327
|
-
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
7328
|
-
if (isTouchEvent && passiveEventSupport) {
|
|
7329
|
-
handlerOptions.passive = !instance.props.preventDefault;
|
|
7330
|
-
}
|
|
7331
|
-
return handlerOptions;
|
|
7332
7264
|
}
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
instance.handleClickOutside(event);
|
|
7353
|
-
return;
|
|
7354
|
-
}
|
|
7355
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
7356
|
-
};
|
|
7357
|
-
_this.__getComponentNode = function() {
|
|
7358
|
-
var instance = _this.getInstance();
|
|
7359
|
-
if (config && typeof config.setClickOutsideRef === "function") {
|
|
7360
|
-
return config.setClickOutsideRef()(instance);
|
|
7361
|
-
}
|
|
7362
|
-
if (typeof instance.setClickOutsideRef === "function") {
|
|
7363
|
-
return instance.setClickOutsideRef();
|
|
7364
|
-
}
|
|
7365
|
-
return findDOMNode(instance);
|
|
7366
|
-
};
|
|
7367
|
-
_this.enableOnClickOutside = function() {
|
|
7368
|
-
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
7369
|
-
return;
|
|
7370
|
-
}
|
|
7371
|
-
if (typeof passiveEventSupport === "undefined") {
|
|
7372
|
-
passiveEventSupport = testPassiveEventSupport();
|
|
7373
|
-
}
|
|
7374
|
-
enabledInstances[_this._uid] = true;
|
|
7375
|
-
var events = _this.props.eventTypes;
|
|
7376
|
-
if (!events.forEach) {
|
|
7377
|
-
events = [events];
|
|
7378
|
-
}
|
|
7379
|
-
handlersMap[_this._uid] = function(event) {
|
|
7380
|
-
if (_this.componentNode === null)
|
|
7381
|
-
return;
|
|
7382
|
-
if (_this.initTimeStamp > event.timeStamp)
|
|
7383
|
-
return;
|
|
7384
|
-
if (_this.props.preventDefault) {
|
|
7385
|
-
event.preventDefault();
|
|
7386
|
-
}
|
|
7387
|
-
if (_this.props.stopPropagation) {
|
|
7388
|
-
event.stopPropagation();
|
|
7389
|
-
}
|
|
7390
|
-
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
7391
|
-
return;
|
|
7392
|
-
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
7393
|
-
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
7394
|
-
return;
|
|
7395
|
-
}
|
|
7396
|
-
_this.__outsideClickHandler(event);
|
|
7397
|
-
};
|
|
7398
|
-
events.forEach(function(eventName) {
|
|
7399
|
-
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7400
|
-
});
|
|
7401
|
-
};
|
|
7402
|
-
_this.disableOnClickOutside = function() {
|
|
7403
|
-
delete enabledInstances[_this._uid];
|
|
7404
|
-
var fn = handlersMap[_this._uid];
|
|
7405
|
-
if (fn && typeof document !== "undefined") {
|
|
7406
|
-
var events = _this.props.eventTypes;
|
|
7407
|
-
if (!events.forEach) {
|
|
7408
|
-
events = [events];
|
|
7409
|
-
}
|
|
7410
|
-
events.forEach(function(eventName) {
|
|
7411
|
-
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7412
|
-
});
|
|
7413
|
-
delete handlersMap[_this._uid];
|
|
7414
|
-
}
|
|
7415
|
-
};
|
|
7416
|
-
_this.getRef = function(ref) {
|
|
7417
|
-
return _this.instanceRef = ref;
|
|
7418
|
-
};
|
|
7419
|
-
_this._uid = uid();
|
|
7420
|
-
_this.initTimeStamp = performance.now();
|
|
7421
|
-
return _this;
|
|
7422
|
-
}
|
|
7423
|
-
var _proto = onClickOutside.prototype;
|
|
7424
|
-
_proto.getInstance = function getInstance() {
|
|
7425
|
-
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
7426
|
-
return this;
|
|
7427
|
-
}
|
|
7428
|
-
var ref = this.instanceRef;
|
|
7429
|
-
return ref.getInstance ? ref.getInstance() : ref;
|
|
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);
|
|
7430
7284
|
};
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
7440
|
-
}
|
|
7441
|
-
}
|
|
7442
|
-
this.componentNode = this.__getComponentNode();
|
|
7443
|
-
if (this.props.disableOnClickOutside)
|
|
7444
|
-
return;
|
|
7445
|
-
this.enableOnClickOutside();
|
|
7446
|
-
};
|
|
7447
|
-
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
7448
|
-
this.componentNode = this.__getComponentNode();
|
|
7449
|
-
};
|
|
7450
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
7451
|
-
this.disableOnClickOutside();
|
|
7452
|
-
};
|
|
7453
|
-
_proto.render = function render() {
|
|
7454
|
-
var _this$props = this.props;
|
|
7455
|
-
_this$props.excludeScrollbar;
|
|
7456
|
-
var props = _objectWithoutPropertiesLoose(_this$props, ["excludeScrollbar"]);
|
|
7457
|
-
if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {
|
|
7458
|
-
props.ref = this.getRef;
|
|
7459
|
-
} else {
|
|
7460
|
-
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);
|
|
7461
7293
|
}
|
|
7462
|
-
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
7463
|
-
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
7464
|
-
return createElement(WrappedComponent, props);
|
|
7465
7294
|
};
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
7470
|
-
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
7471
|
-
preventDefault: false,
|
|
7472
|
-
stopPropagation: false
|
|
7473
|
-
}, _class.getClass = function() {
|
|
7474
|
-
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
7475
|
-
}, _temp;
|
|
7476
|
-
}
|
|
7295
|
+
}, [events, ref]);
|
|
7296
|
+
};
|
|
7297
|
+
var _default = useClickAway$1.default = useClickAway;
|
|
7477
7298
|
const viewModes = {
|
|
7478
7299
|
YEARS: "years",
|
|
7479
7300
|
MONTHS: "months",
|
|
@@ -8002,22 +7823,13 @@ function log(message, method) {
|
|
|
8002
7823
|
}
|
|
8003
7824
|
con[method]("***react-datetime:" + message);
|
|
8004
7825
|
}
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
}
|
|
8010
|
-
|
|
8011
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: this.props.className, ref: this.container }, this.props.children);
|
|
8012
|
-
}
|
|
8013
|
-
handleClickOutside(e) {
|
|
8014
|
-
this.props.onClickOut(e);
|
|
8015
|
-
}
|
|
8016
|
-
setClickOutsideRef() {
|
|
8017
|
-
return this.container.current;
|
|
8018
|
-
}
|
|
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);
|
|
8019
7832
|
}
|
|
8020
|
-
const ClickableWrapper = onClickOutsideHOC(ClickOutBase);
|
|
8021
7833
|
const DEFAULT_DATE_DISPLAY_FORMAT = "MMM DD, YYYY";
|
|
8022
7834
|
const DEFAULT_TIME_DISPLAY_FORMAT = "h:mm A";
|
|
8023
7835
|
const format$1 = (val, _name, field) => {
|
|
@@ -9874,7 +9686,7 @@ class SidebarState {
|
|
|
9874
9686
|
}
|
|
9875
9687
|
}
|
|
9876
9688
|
function createScreen({
|
|
9877
|
-
Component
|
|
9689
|
+
Component,
|
|
9878
9690
|
props,
|
|
9879
9691
|
...options
|
|
9880
9692
|
}) {
|
|
@@ -9883,7 +9695,7 @@ function createScreen({
|
|
|
9883
9695
|
layout: "popup",
|
|
9884
9696
|
...options,
|
|
9885
9697
|
Component(screenProps) {
|
|
9886
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
9698
|
+
return /* @__PURE__ */ React__default.createElement(Component, { ...screenProps, ...props });
|
|
9887
9699
|
}
|
|
9888
9700
|
};
|
|
9889
9701
|
}
|
|
@@ -10394,7 +10206,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10394
10206
|
"Event Log"
|
|
10395
10207
|
));
|
|
10396
10208
|
};
|
|
10397
|
-
const version = "2.
|
|
10209
|
+
const version = "2.6.0";
|
|
10398
10210
|
const Nav = ({
|
|
10399
10211
|
isLocalMode,
|
|
10400
10212
|
className = "",
|
|
@@ -13323,9 +13135,9 @@ const EllipsisIcon = ({ title }) => {
|
|
|
13323
13135
|
));
|
|
13324
13136
|
};
|
|
13325
13137
|
const Wrapper$1 = ({ inline, children }) => {
|
|
13326
|
-
const
|
|
13138
|
+
const Component = inline ? "span" : "div";
|
|
13327
13139
|
return /* @__PURE__ */ React__default.createElement(
|
|
13328
|
-
|
|
13140
|
+
Component,
|
|
13329
13141
|
{
|
|
13330
13142
|
contentEditable: false,
|
|
13331
13143
|
style: { userSelect: "none" },
|
|
@@ -14113,13 +13925,13 @@ const TooltipContent = withCn(
|
|
|
14113
13925
|
}),
|
|
14114
13926
|
"z-[9999] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md"
|
|
14115
13927
|
);
|
|
14116
|
-
function withTooltip(
|
|
13928
|
+
function withTooltip(Component) {
|
|
14117
13929
|
return React__default.forwardRef(function ExtendComponent({ tooltip, tooltipContentProps, tooltipProps, ...props }, ref) {
|
|
14118
13930
|
const [mounted, setMounted] = React__default.useState(false);
|
|
14119
13931
|
React__default.useEffect(() => {
|
|
14120
13932
|
setMounted(true);
|
|
14121
13933
|
}, []);
|
|
14122
|
-
const component = /* @__PURE__ */ React__default.createElement(
|
|
13934
|
+
const component = /* @__PURE__ */ React__default.createElement(Component, { ref, ...props });
|
|
14123
13935
|
if (tooltip && mounted) {
|
|
14124
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)));
|
|
14125
13937
|
}
|
|
@@ -14800,7 +14612,12 @@ function FixedToolbarButtons() {
|
|
|
14800
14612
|
const [itemsShown, setItemsShown] = React__default.useState(11);
|
|
14801
14613
|
const { overrides, templates } = useToolbarContext();
|
|
14802
14614
|
const showEmbedButton = templates.length > 0;
|
|
14803
|
-
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
|
+
}
|
|
14804
14621
|
if (!showEmbedButton) {
|
|
14805
14622
|
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14806
14623
|
}
|
|
@@ -15128,6 +14945,9 @@ const isUrl = (string) => {
|
|
|
15128
14945
|
if (typeof string !== "string") {
|
|
15129
14946
|
return false;
|
|
15130
14947
|
}
|
|
14948
|
+
if (string.startsWith("#")) {
|
|
14949
|
+
return true;
|
|
14950
|
+
}
|
|
15131
14951
|
const generalMatch = string.match(protocolAndDomainRE);
|
|
15132
14952
|
const emailLinkMatch = string.match(emailLintRE);
|
|
15133
14953
|
const localUrlMatch = string.match(localUrlRE);
|
|
@@ -15149,12 +14969,12 @@ const isUrl = (string) => {
|
|
|
15149
14969
|
}
|
|
15150
14970
|
return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
|
|
15151
14971
|
};
|
|
15152
|
-
const RichEditor = (
|
|
14972
|
+
const RichEditor = ({ input, tinaForm, field }) => {
|
|
15153
14973
|
var _a;
|
|
15154
14974
|
const initialValue = React__default.useMemo(
|
|
15155
14975
|
() => {
|
|
15156
14976
|
var _a2, _b;
|
|
15157
|
-
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: "" }] }];
|
|
15158
14978
|
},
|
|
15159
14979
|
[]
|
|
15160
14980
|
);
|
|
@@ -15182,7 +15002,7 @@ const RichEditor = (props) => {
|
|
|
15182
15002
|
),
|
|
15183
15003
|
[]
|
|
15184
15004
|
);
|
|
15185
|
-
const tempId = [
|
|
15005
|
+
const tempId = [tinaForm.id, input.name].join(".");
|
|
15186
15006
|
const id = React__default.useMemo(() => uuid() + tempId, [tempId]);
|
|
15187
15007
|
const ref = React__default.useRef(null);
|
|
15188
15008
|
React__default.useEffect(() => {
|
|
@@ -15192,13 +15012,13 @@ const RichEditor = (props) => {
|
|
|
15192
15012
|
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
15193
15013
|
'[role="textbox"]'
|
|
15194
15014
|
);
|
|
15195
|
-
if (
|
|
15015
|
+
if (field.experimental_focusIntent && plateElement) {
|
|
15196
15016
|
if (plateElement)
|
|
15197
15017
|
plateElement.focus();
|
|
15198
15018
|
}
|
|
15199
15019
|
}, 100);
|
|
15200
15020
|
}
|
|
15201
|
-
}, [
|
|
15021
|
+
}, [field.experimental_focusIntent, ref]);
|
|
15202
15022
|
return /* @__PURE__ */ React__default.createElement("div", { ref }, /* @__PURE__ */ React__default.createElement(
|
|
15203
15023
|
Plate,
|
|
15204
15024
|
{
|
|
@@ -15206,7 +15026,7 @@ const RichEditor = (props) => {
|
|
|
15206
15026
|
initialValue,
|
|
15207
15027
|
plugins: plugins$2,
|
|
15208
15028
|
onChange: (value) => {
|
|
15209
|
-
|
|
15029
|
+
input.onChange({
|
|
15210
15030
|
type: "root",
|
|
15211
15031
|
children: value
|
|
15212
15032
|
});
|
|
@@ -15215,12 +15035,12 @@ const RichEditor = (props) => {
|
|
|
15215
15035
|
/* @__PURE__ */ React__default.createElement(TooltipProvider, null, /* @__PURE__ */ React__default.createElement(
|
|
15216
15036
|
ToolbarProvider,
|
|
15217
15037
|
{
|
|
15218
|
-
tinaForm
|
|
15219
|
-
templates:
|
|
15220
|
-
overrides: (
|
|
15038
|
+
tinaForm,
|
|
15039
|
+
templates: field.templates,
|
|
15040
|
+
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
15221
15041
|
},
|
|
15222
15042
|
/* @__PURE__ */ React__default.createElement(FixedToolbar, null, /* @__PURE__ */ React__default.createElement(FixedToolbarButtons, null)),
|
|
15223
|
-
/* @__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
|
|
15224
15044
|
), /* @__PURE__ */ React__default.createElement(Editor, null))
|
|
15225
15045
|
));
|
|
15226
15046
|
};
|
|
@@ -2,16 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { type InputFieldType } from '../wrap-field-with-meta';
|
|
3
3
|
import type { MdxTemplate } from './plate/types';
|
|
4
4
|
import type { InputProps } from '../../../fields/components';
|
|
5
|
-
import type { ToolbarOverrideType } from './plate/toolbar/toolbar-overrides';
|
|
5
|
+
import type { ToolbarOverrides, ToolbarOverrideType } from './plate/toolbar/toolbar-overrides';
|
|
6
6
|
export type RichTextType = React.PropsWithChildren<InputFieldType<InputProps, {
|
|
7
7
|
templates: MdxTemplate[];
|
|
8
8
|
toolbarOverride?: ToolbarOverrideType[];
|
|
9
|
+
overrides?: ToolbarOverrides;
|
|
9
10
|
}>>;
|
|
10
11
|
export declare const MdxFieldPlugin: {
|
|
11
12
|
name: string;
|
|
12
13
|
Component: (props: InputFieldType<InputProps, {
|
|
13
14
|
templates: MdxTemplate[];
|
|
14
15
|
toolbarOverride?: ToolbarOverrideType[];
|
|
16
|
+
overrides?: ToolbarOverrides;
|
|
15
17
|
}>) => React.JSX.Element;
|
|
16
18
|
};
|
|
17
19
|
export declare const MdxFieldPluginExtendible: {
|
|
@@ -20,5 +22,6 @@ export declare const MdxFieldPluginExtendible: {
|
|
|
20
22
|
Component: (props: InputFieldType<InputProps, {
|
|
21
23
|
templates: MdxTemplate[];
|
|
22
24
|
toolbarOverride?: ToolbarOverrideType[];
|
|
25
|
+
overrides?: ToolbarOverrides;
|
|
23
26
|
}>) => React.JSX.Element;
|
|
24
27
|
};
|
|
@@ -6,3 +6,7 @@ export declare const EMBED_ICON_WIDTH = 78;
|
|
|
6
6
|
export declare const CONTAINER_MD_BREAKPOINT = 448;
|
|
7
7
|
export declare const FLOAT_BUTTON_WIDTH = 25;
|
|
8
8
|
export declare const HEADING_LABEL = "Headings";
|
|
9
|
+
export type ToolbarOverrides = {
|
|
10
|
+
toolbar?: ToolbarOverrideType[];
|
|
11
|
+
showFloatingToolbar?: boolean;
|
|
12
|
+
};
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import type { Form } from '../../../../../forms';
|
|
4
4
|
import type { MdxTemplate } from '../types';
|
|
5
|
-
import type { ToolbarOverrideType } from './toolbar-overrides';
|
|
5
|
+
import type { ToolbarOverrides, ToolbarOverrideType } from './toolbar-overrides';
|
|
6
6
|
interface ToolbarContextProps {
|
|
7
7
|
tinaForm: Form;
|
|
8
8
|
templates: MdxTemplate[];
|
|
9
|
-
overrides: ToolbarOverrideType[];
|
|
9
|
+
overrides: ToolbarOverrideType[] | ToolbarOverrides;
|
|
10
10
|
}
|
|
11
11
|
interface ToolbarProviderProps extends ToolbarContextProps {
|
|
12
12
|
children: ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"react-dropzone": "14.2.3",
|
|
119
119
|
"react-final-form": "^6.5.9",
|
|
120
120
|
"react-icons": "^5.3.0",
|
|
121
|
-
"react-onclickoutside": "^6.13.1",
|
|
122
121
|
"react-router-dom": "6.3.0",
|
|
122
|
+
"react-use": "^17.6.0",
|
|
123
123
|
"slate": "^0.103.0",
|
|
124
124
|
"slate-history": "^0.100.0",
|
|
125
125
|
"slate-hyperscript": "^0.100.0",
|
|
@@ -128,9 +128,9 @@
|
|
|
128
128
|
"webfontloader": "1.6.28",
|
|
129
129
|
"yup": "^1.4.0",
|
|
130
130
|
"zod": "^3.23.8",
|
|
131
|
-
"@tinacms/mdx": "1.5.
|
|
132
|
-
"@tinacms/
|
|
133
|
-
"@tinacms/
|
|
131
|
+
"@tinacms/mdx": "1.5.4",
|
|
132
|
+
"@tinacms/schema-tools": "1.7.0",
|
|
133
|
+
"@tinacms/search": "1.0.37"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@graphql-tools/utils": "^10.5.6",
|