tinacms 0.0.0-c72bb45-20241118014046 → 0.0.0-c852462-20250131014229
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/client.js +72 -45
- package/dist/client.mjs +49 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.js +148 -265
- package/dist/index.mjs +160 -277
- 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 +7 -10
package/dist/index.js
CHANGED
|
@@ -862,13 +862,23 @@ var __publicField = (obj, key, value) => {
|
|
|
862
862
|
className,
|
|
863
863
|
...props
|
|
864
864
|
}) => {
|
|
865
|
+
if (typeof children === "string") {
|
|
866
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
867
|
+
"span",
|
|
868
|
+
{
|
|
869
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
870
|
+
...props,
|
|
871
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
865
875
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
866
876
|
"span",
|
|
867
877
|
{
|
|
868
878
|
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
869
|
-
...props
|
|
870
|
-
|
|
871
|
-
|
|
879
|
+
...props
|
|
880
|
+
},
|
|
881
|
+
children
|
|
872
882
|
);
|
|
873
883
|
};
|
|
874
884
|
const FieldError = ({
|
|
@@ -3820,7 +3830,7 @@ flowchart TD
|
|
|
3820
3830
|
function _objectWithoutProperties(source, excluded) {
|
|
3821
3831
|
if (source == null)
|
|
3822
3832
|
return {};
|
|
3823
|
-
var target = _objectWithoutPropertiesLoose
|
|
3833
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
3824
3834
|
var key, i;
|
|
3825
3835
|
if (Object.getOwnPropertySymbols) {
|
|
3826
3836
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3835,7 +3845,7 @@ flowchart TD
|
|
|
3835
3845
|
}
|
|
3836
3846
|
return target;
|
|
3837
3847
|
}
|
|
3838
|
-
function _objectWithoutPropertiesLoose
|
|
3848
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3839
3849
|
if (source == null)
|
|
3840
3850
|
return {};
|
|
3841
3851
|
var target = {};
|
|
@@ -4925,7 +4935,28 @@ flowchart TD
|
|
|
4925
4935
|
onChange,
|
|
4926
4936
|
value,
|
|
4927
4937
|
step
|
|
4928
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4938
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4939
|
+
Input,
|
|
4940
|
+
{
|
|
4941
|
+
type: "number",
|
|
4942
|
+
step,
|
|
4943
|
+
value,
|
|
4944
|
+
onChange: (event) => {
|
|
4945
|
+
const inputValue = event.target.value;
|
|
4946
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4947
|
+
if (onChange) {
|
|
4948
|
+
const syntheticEvent = {
|
|
4949
|
+
...event,
|
|
4950
|
+
target: {
|
|
4951
|
+
...event.target,
|
|
4952
|
+
value: newValue
|
|
4953
|
+
}
|
|
4954
|
+
};
|
|
4955
|
+
onChange(syntheticEvent);
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
}
|
|
4959
|
+
);
|
|
4929
4960
|
function useCMS() {
|
|
4930
4961
|
return useCMS$1();
|
|
4931
4962
|
}
|
|
@@ -7178,244 +7209,65 @@ flowchart TD
|
|
|
7178
7209
|
str = "0" + str;
|
|
7179
7210
|
return str;
|
|
7180
7211
|
}
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
}
|
|
7193
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7194
|
-
if (source == null)
|
|
7195
|
-
return {};
|
|
7196
|
-
var target = {};
|
|
7197
|
-
var sourceKeys = Object.keys(source);
|
|
7198
|
-
var key, i;
|
|
7199
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7200
|
-
key = sourceKeys[i];
|
|
7201
|
-
if (excluded.indexOf(key) >= 0)
|
|
7202
|
-
continue;
|
|
7203
|
-
target[key] = source[key];
|
|
7204
|
-
}
|
|
7205
|
-
return target;
|
|
7206
|
-
}
|
|
7207
|
-
function _assertThisInitialized(self2) {
|
|
7208
|
-
if (self2 === void 0) {
|
|
7209
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7210
|
-
}
|
|
7211
|
-
return self2;
|
|
7212
|
-
}
|
|
7213
|
-
function isNodeFound(current, componentNode, ignoreClass) {
|
|
7214
|
-
if (current === componentNode) {
|
|
7215
|
-
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];
|
|
7216
7223
|
}
|
|
7217
|
-
if (
|
|
7218
|
-
|
|
7224
|
+
if (obj && obj.addEventListener) {
|
|
7225
|
+
obj.addEventListener.apply(obj, args);
|
|
7219
7226
|
}
|
|
7220
|
-
return current.classList.contains(ignoreClass);
|
|
7221
7227
|
}
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
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];
|
|
7225
7233
|
}
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
return true;
|
|
7229
|
-
}
|
|
7230
|
-
current = current.parentNode || current.host;
|
|
7234
|
+
if (obj && obj.removeEventListener) {
|
|
7235
|
+
obj.removeEventListener.apply(obj, args);
|
|
7231
7236
|
}
|
|
7232
|
-
return current;
|
|
7233
|
-
}
|
|
7234
|
-
function clickedScrollbar(evt) {
|
|
7235
|
-
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
|
|
7236
7237
|
}
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
}
|
|
7257
|
-
return function() {
|
|
7258
|
-
return ++seed;
|
|
7259
|
-
};
|
|
7260
|
-
}
|
|
7261
|
-
var uid = autoInc();
|
|
7262
|
-
var passiveEventSupport;
|
|
7263
|
-
var handlersMap = {};
|
|
7264
|
-
var enabledInstances = {};
|
|
7265
|
-
var touchEvents = ["touchstart", "touchmove"];
|
|
7266
|
-
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
7267
|
-
function getEventHandlerOptions(instance, eventName) {
|
|
7268
|
-
var handlerOptions = {};
|
|
7269
|
-
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
7270
|
-
if (isTouchEvent && passiveEventSupport) {
|
|
7271
|
-
handlerOptions.passive = !instance.props.preventDefault;
|
|
7272
|
-
}
|
|
7273
|
-
return handlerOptions;
|
|
7274
|
-
}
|
|
7275
|
-
function onClickOutsideHOC(WrappedComponent, config) {
|
|
7276
|
-
var _class, _temp;
|
|
7277
|
-
var componentName = WrappedComponent.displayName || WrappedComponent.name || "Component";
|
|
7278
|
-
return _temp = _class = /* @__PURE__ */ function(_Component) {
|
|
7279
|
-
_inheritsLoose(onClickOutside, _Component);
|
|
7280
|
-
function onClickOutside(props) {
|
|
7281
|
-
var _this;
|
|
7282
|
-
_this = _Component.call(this, props) || this;
|
|
7283
|
-
_this.__outsideClickHandler = function(event) {
|
|
7284
|
-
if (typeof _this.__clickOutsideHandlerProp === "function") {
|
|
7285
|
-
_this.__clickOutsideHandlerProp(event);
|
|
7286
|
-
return;
|
|
7287
|
-
}
|
|
7288
|
-
var instance = _this.getInstance();
|
|
7289
|
-
if (typeof instance.props.handleClickOutside === "function") {
|
|
7290
|
-
instance.props.handleClickOutside(event);
|
|
7291
|
-
return;
|
|
7292
|
-
}
|
|
7293
|
-
if (typeof instance.handleClickOutside === "function") {
|
|
7294
|
-
instance.handleClickOutside(event);
|
|
7295
|
-
return;
|
|
7296
|
-
}
|
|
7297
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
7298
|
-
};
|
|
7299
|
-
_this.__getComponentNode = function() {
|
|
7300
|
-
var instance = _this.getInstance();
|
|
7301
|
-
if (config && typeof config.setClickOutsideRef === "function") {
|
|
7302
|
-
return config.setClickOutsideRef()(instance);
|
|
7303
|
-
}
|
|
7304
|
-
if (typeof instance.setClickOutsideRef === "function") {
|
|
7305
|
-
return instance.setClickOutsideRef();
|
|
7306
|
-
}
|
|
7307
|
-
return reactDom.findDOMNode(instance);
|
|
7308
|
-
};
|
|
7309
|
-
_this.enableOnClickOutside = function() {
|
|
7310
|
-
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
7311
|
-
return;
|
|
7312
|
-
}
|
|
7313
|
-
if (typeof passiveEventSupport === "undefined") {
|
|
7314
|
-
passiveEventSupport = testPassiveEventSupport();
|
|
7315
|
-
}
|
|
7316
|
-
enabledInstances[_this._uid] = true;
|
|
7317
|
-
var events = _this.props.eventTypes;
|
|
7318
|
-
if (!events.forEach) {
|
|
7319
|
-
events = [events];
|
|
7320
|
-
}
|
|
7321
|
-
handlersMap[_this._uid] = function(event) {
|
|
7322
|
-
if (_this.componentNode === null)
|
|
7323
|
-
return;
|
|
7324
|
-
if (_this.initTimeStamp > event.timeStamp)
|
|
7325
|
-
return;
|
|
7326
|
-
if (_this.props.preventDefault) {
|
|
7327
|
-
event.preventDefault();
|
|
7328
|
-
}
|
|
7329
|
-
if (_this.props.stopPropagation) {
|
|
7330
|
-
event.stopPropagation();
|
|
7331
|
-
}
|
|
7332
|
-
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
7333
|
-
return;
|
|
7334
|
-
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
7335
|
-
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
7336
|
-
return;
|
|
7337
|
-
}
|
|
7338
|
-
_this.__outsideClickHandler(event);
|
|
7339
|
-
};
|
|
7340
|
-
events.forEach(function(eventName) {
|
|
7341
|
-
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7342
|
-
});
|
|
7343
|
-
};
|
|
7344
|
-
_this.disableOnClickOutside = function() {
|
|
7345
|
-
delete enabledInstances[_this._uid];
|
|
7346
|
-
var fn = handlersMap[_this._uid];
|
|
7347
|
-
if (fn && typeof document !== "undefined") {
|
|
7348
|
-
var events = _this.props.eventTypes;
|
|
7349
|
-
if (!events.forEach) {
|
|
7350
|
-
events = [events];
|
|
7351
|
-
}
|
|
7352
|
-
events.forEach(function(eventName) {
|
|
7353
|
-
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7354
|
-
});
|
|
7355
|
-
delete handlersMap[_this._uid];
|
|
7356
|
-
}
|
|
7357
|
-
};
|
|
7358
|
-
_this.getRef = function(ref) {
|
|
7359
|
-
return _this.instanceRef = ref;
|
|
7360
|
-
};
|
|
7361
|
-
_this._uid = uid();
|
|
7362
|
-
_this.initTimeStamp = performance.now();
|
|
7363
|
-
return _this;
|
|
7364
|
-
}
|
|
7365
|
-
var _proto = onClickOutside.prototype;
|
|
7366
|
-
_proto.getInstance = function getInstance() {
|
|
7367
|
-
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
7368
|
-
return this;
|
|
7369
|
-
}
|
|
7370
|
-
var ref = this.instanceRef;
|
|
7371
|
-
return ref.getInstance ? ref.getInstance() : ref;
|
|
7372
|
-
};
|
|
7373
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
7374
|
-
if (typeof document === "undefined" || !document.createElement) {
|
|
7375
|
-
return;
|
|
7376
|
-
}
|
|
7377
|
-
var instance = this.getInstance();
|
|
7378
|
-
if (config && typeof config.handleClickOutside === "function") {
|
|
7379
|
-
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
|
|
7380
|
-
if (typeof this.__clickOutsideHandlerProp !== "function") {
|
|
7381
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
7382
|
-
}
|
|
7383
|
-
}
|
|
7384
|
-
this.componentNode = this.__getComponentNode();
|
|
7385
|
-
if (this.props.disableOnClickOutside)
|
|
7386
|
-
return;
|
|
7387
|
-
this.enableOnClickOutside();
|
|
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);
|
|
7388
7257
|
};
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
_this$props.excludeScrollbar;
|
|
7398
|
-
var props = _objectWithoutPropertiesLoose(_this$props, ["excludeScrollbar"]);
|
|
7399
|
-
if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {
|
|
7400
|
-
props.ref = this.getRef;
|
|
7401
|
-
} else {
|
|
7402
|
-
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);
|
|
7403
7266
|
}
|
|
7404
|
-
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
7405
|
-
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
7406
|
-
return React.createElement(WrappedComponent, props);
|
|
7407
7267
|
};
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
7412
|
-
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
7413
|
-
preventDefault: false,
|
|
7414
|
-
stopPropagation: false
|
|
7415
|
-
}, _class.getClass = function() {
|
|
7416
|
-
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
7417
|
-
}, _temp;
|
|
7418
|
-
}
|
|
7268
|
+
}, [events, ref]);
|
|
7269
|
+
};
|
|
7270
|
+
var _default = useClickAway$1.default = useClickAway;
|
|
7419
7271
|
const viewModes = {
|
|
7420
7272
|
YEARS: "years",
|
|
7421
7273
|
MONTHS: "months",
|
|
@@ -7944,22 +7796,13 @@ flowchart TD
|
|
|
7944
7796
|
}
|
|
7945
7797
|
con[method]("***react-datetime:" + message);
|
|
7946
7798
|
}
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
}
|
|
7952
|
-
|
|
7953
|
-
return /* @__PURE__ */ React.createElement("div", { className: this.props.className, ref: this.container }, this.props.children);
|
|
7954
|
-
}
|
|
7955
|
-
handleClickOutside(e) {
|
|
7956
|
-
this.props.onClickOut(e);
|
|
7957
|
-
}
|
|
7958
|
-
setClickOutsideRef() {
|
|
7959
|
-
return this.container.current;
|
|
7960
|
-
}
|
|
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);
|
|
7961
7805
|
}
|
|
7962
|
-
const ClickableWrapper = onClickOutsideHOC(ClickOutBase);
|
|
7963
7806
|
const DEFAULT_DATE_DISPLAY_FORMAT = "MMM DD, YYYY";
|
|
7964
7807
|
const DEFAULT_TIME_DISPLAY_FORMAT = "h:mm A";
|
|
7965
7808
|
const format$1 = (val, _name, field) => {
|
|
@@ -8002,7 +7845,10 @@ flowchart TD
|
|
|
8002
7845
|
ReactDateTimeWithStyles,
|
|
8003
7846
|
{
|
|
8004
7847
|
value: input.value,
|
|
8005
|
-
onChange:
|
|
7848
|
+
onChange: (value) => {
|
|
7849
|
+
const newValue = value === "" ? void 0 : value;
|
|
7850
|
+
input.onChange(newValue);
|
|
7851
|
+
},
|
|
8006
7852
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
8007
7853
|
timeFormat: timeFormat || false,
|
|
8008
7854
|
inputProps: { className: textFieldClasses },
|
|
@@ -9454,6 +9300,20 @@ flowchart TD
|
|
|
9454
9300
|
}
|
|
9455
9301
|
}
|
|
9456
9302
|
}
|
|
9303
|
+
const encodeUrlIfNeeded = (url) => {
|
|
9304
|
+
if (url) {
|
|
9305
|
+
try {
|
|
9306
|
+
const parsed = new URL(url);
|
|
9307
|
+
parsed.pathname = parsed.pathname.split("/").filter((part) => part !== "").map(encodeURIComponent).join("/");
|
|
9308
|
+
return parsed.toString();
|
|
9309
|
+
} catch (e) {
|
|
9310
|
+
console.error("Failed to parse URL:", e);
|
|
9311
|
+
return url;
|
|
9312
|
+
}
|
|
9313
|
+
} else {
|
|
9314
|
+
return url;
|
|
9315
|
+
}
|
|
9316
|
+
};
|
|
9457
9317
|
let MediaManager$1 = class MediaManager {
|
|
9458
9318
|
constructor(store, events) {
|
|
9459
9319
|
this.store = store;
|
|
@@ -9526,6 +9386,20 @@ flowchart TD
|
|
|
9526
9386
|
try {
|
|
9527
9387
|
this.events.dispatch({ type: "media:list:start", ...options });
|
|
9528
9388
|
const media = await this.store.list(options);
|
|
9389
|
+
media.items = media.items.map((item) => {
|
|
9390
|
+
if (item.type === "dir") {
|
|
9391
|
+
return item;
|
|
9392
|
+
}
|
|
9393
|
+
if (item.thumbnails) {
|
|
9394
|
+
for (const [size, src] of Object.entries(item.thumbnails)) {
|
|
9395
|
+
item.thumbnails[size] = encodeUrlIfNeeded(src);
|
|
9396
|
+
}
|
|
9397
|
+
}
|
|
9398
|
+
return {
|
|
9399
|
+
...item,
|
|
9400
|
+
src: encodeUrlIfNeeded(item.src)
|
|
9401
|
+
};
|
|
9402
|
+
});
|
|
9529
9403
|
this.events.dispatch({ type: "media:list:success", ...options, media });
|
|
9530
9404
|
return media;
|
|
9531
9405
|
} catch (error) {
|
|
@@ -10333,7 +10207,7 @@ flowchart TD
|
|
|
10333
10207
|
"Event Log"
|
|
10334
10208
|
));
|
|
10335
10209
|
};
|
|
10336
|
-
const version = "2.
|
|
10210
|
+
const version = "2.6.2";
|
|
10337
10211
|
const Nav = ({
|
|
10338
10212
|
isLocalMode,
|
|
10339
10213
|
className = "",
|
|
@@ -14653,7 +14527,7 @@ flowchart TD
|
|
|
14653
14527
|
key: template.name,
|
|
14654
14528
|
onMouseDown: (e) => {
|
|
14655
14529
|
e.preventDefault();
|
|
14656
|
-
|
|
14530
|
+
setOpen(false);
|
|
14657
14531
|
insertMDX(editor, template);
|
|
14658
14532
|
},
|
|
14659
14533
|
className: ""
|
|
@@ -14739,7 +14613,12 @@ flowchart TD
|
|
|
14739
14613
|
const [itemsShown, setItemsShown] = React.useState(11);
|
|
14740
14614
|
const { overrides, templates } = useToolbarContext();
|
|
14741
14615
|
const showEmbedButton = templates.length > 0;
|
|
14742
|
-
let items2 =
|
|
14616
|
+
let items2 = [];
|
|
14617
|
+
if (Array.isArray(overrides)) {
|
|
14618
|
+
items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14619
|
+
} else {
|
|
14620
|
+
items2 = (overrides == null ? void 0 : overrides.toolbar) === void 0 ? Object.values(toolbarItems) : overrides.toolbar.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14621
|
+
}
|
|
14743
14622
|
if (!showEmbedButton) {
|
|
14744
14623
|
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14745
14624
|
}
|
|
@@ -15067,6 +14946,9 @@ flowchart TD
|
|
|
15067
14946
|
if (typeof string !== "string") {
|
|
15068
14947
|
return false;
|
|
15069
14948
|
}
|
|
14949
|
+
if (string.startsWith("#")) {
|
|
14950
|
+
return true;
|
|
14951
|
+
}
|
|
15070
14952
|
const generalMatch = string.match(protocolAndDomainRE);
|
|
15071
14953
|
const emailLinkMatch = string.match(emailLintRE);
|
|
15072
14954
|
const localUrlMatch = string.match(localUrlRE);
|
|
@@ -15088,12 +14970,12 @@ flowchart TD
|
|
|
15088
14970
|
}
|
|
15089
14971
|
return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
|
|
15090
14972
|
};
|
|
15091
|
-
const RichEditor = (
|
|
14973
|
+
const RichEditor = ({ input, tinaForm, field }) => {
|
|
15092
14974
|
var _a;
|
|
15093
14975
|
const initialValue = React.useMemo(
|
|
15094
14976
|
() => {
|
|
15095
14977
|
var _a2, _b;
|
|
15096
|
-
return ((_b = (_a2 =
|
|
14978
|
+
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: "" }] }];
|
|
15097
14979
|
},
|
|
15098
14980
|
[]
|
|
15099
14981
|
);
|
|
@@ -15121,7 +15003,7 @@ flowchart TD
|
|
|
15121
15003
|
),
|
|
15122
15004
|
[]
|
|
15123
15005
|
);
|
|
15124
|
-
const tempId = [
|
|
15006
|
+
const tempId = [tinaForm.id, input.name].join(".");
|
|
15125
15007
|
const id = React.useMemo(() => uuid() + tempId, [tempId]);
|
|
15126
15008
|
const ref = React.useRef(null);
|
|
15127
15009
|
React.useEffect(() => {
|
|
@@ -15131,13 +15013,13 @@ flowchart TD
|
|
|
15131
15013
|
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
15132
15014
|
'[role="textbox"]'
|
|
15133
15015
|
);
|
|
15134
|
-
if (
|
|
15016
|
+
if (field.experimental_focusIntent && plateElement) {
|
|
15135
15017
|
if (plateElement)
|
|
15136
15018
|
plateElement.focus();
|
|
15137
15019
|
}
|
|
15138
15020
|
}, 100);
|
|
15139
15021
|
}
|
|
15140
|
-
}, [
|
|
15022
|
+
}, [field.experimental_focusIntent, ref]);
|
|
15141
15023
|
return /* @__PURE__ */ React.createElement("div", { ref }, /* @__PURE__ */ React.createElement(
|
|
15142
15024
|
plateCommon.Plate,
|
|
15143
15025
|
{
|
|
@@ -15145,21 +15027,22 @@ flowchart TD
|
|
|
15145
15027
|
initialValue,
|
|
15146
15028
|
plugins: plugins$2,
|
|
15147
15029
|
onChange: (value) => {
|
|
15148
|
-
|
|
15030
|
+
input.onChange({
|
|
15149
15031
|
type: "root",
|
|
15150
|
-
children: value
|
|
15032
|
+
children: value,
|
|
15033
|
+
embedCode: input.value.embedCode
|
|
15151
15034
|
});
|
|
15152
15035
|
}
|
|
15153
15036
|
},
|
|
15154
15037
|
/* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(
|
|
15155
15038
|
ToolbarProvider,
|
|
15156
15039
|
{
|
|
15157
|
-
tinaForm
|
|
15158
|
-
templates:
|
|
15159
|
-
overrides: (
|
|
15040
|
+
tinaForm,
|
|
15041
|
+
templates: field.templates,
|
|
15042
|
+
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
15160
15043
|
},
|
|
15161
15044
|
/* @__PURE__ */ React.createElement(FixedToolbar, null, /* @__PURE__ */ React.createElement(FixedToolbarButtons, null)),
|
|
15162
|
-
/* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null))
|
|
15045
|
+
((_a = field == null ? void 0 : field.overrides) == null ? void 0 : _a.showFloatingToolbar) !== false ? /* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null)) : null
|
|
15163
15046
|
), /* @__PURE__ */ React.createElement(Editor, null))
|
|
15164
15047
|
));
|
|
15165
15048
|
};
|