tinacms 0.0.0-97d38ab-20241104224426 → 0.0.0-9931d5a-20250106011423
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 +4 -7
- package/dist/client.mjs +2 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +120 -265
- package/dist/index.mjs +132 -277
- 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 +26 -27
package/dist/client.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports
|
|
3
|
-
})(this, function(exports2
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}));
|
|
3
|
+
})(this, function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { fetch: fetchPonyfillFN, Headers: HeadersPonyfill } = fetchPonyfill();
|
|
6
|
-
const fetchDefined = typeof fetch === "undefined" ? fetchPonyfillFN : fetch;
|
|
7
|
-
const HeadersDefined = typeof Headers === "undefined" ? HeadersPonyfill : Headers;
|
|
8
5
|
const TINA_HOST = "content.tinajs.io";
|
|
9
6
|
class TinaClient {
|
|
10
7
|
constructor({
|
|
@@ -39,7 +36,7 @@
|
|
|
39
36
|
var _a;
|
|
40
37
|
await this.init();
|
|
41
38
|
const errorPolicyDefined = errorPolicy || this.errorPolicy;
|
|
42
|
-
const headers = new
|
|
39
|
+
const headers = new Headers();
|
|
43
40
|
if (this.readonlyToken) {
|
|
44
41
|
headers.append("X-API-KEY", this.readonlyToken);
|
|
45
42
|
}
|
|
@@ -72,7 +69,7 @@
|
|
|
72
69
|
return value;
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
|
-
const res = await
|
|
72
|
+
const res = await fetch(url, optionsObject);
|
|
76
73
|
if (!res.ok) {
|
|
77
74
|
let additionalInfo = "";
|
|
78
75
|
if (res.status === 401) {
|
package/dist/client.mjs
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import fetchPonyfill from "fetch-ponyfill";
|
|
2
|
-
const { fetch: fetchPonyfillFN, Headers: HeadersPonyfill } = fetchPonyfill();
|
|
3
|
-
const fetchDefined = typeof fetch === "undefined" ? fetchPonyfillFN : fetch;
|
|
4
|
-
const HeadersDefined = typeof Headers === "undefined" ? HeadersPonyfill : Headers;
|
|
5
1
|
const TINA_HOST = "content.tinajs.io";
|
|
6
2
|
class TinaClient {
|
|
7
3
|
constructor({
|
|
@@ -36,7 +32,7 @@ class TinaClient {
|
|
|
36
32
|
var _a;
|
|
37
33
|
await this.init();
|
|
38
34
|
const errorPolicyDefined = errorPolicy || this.errorPolicy;
|
|
39
|
-
const headers = new
|
|
35
|
+
const headers = new Headers();
|
|
40
36
|
if (this.readonlyToken) {
|
|
41
37
|
headers.append("X-API-KEY", this.readonlyToken);
|
|
42
38
|
}
|
|
@@ -69,7 +65,7 @@ class TinaClient {
|
|
|
69
65
|
return value;
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
|
-
const res = await
|
|
68
|
+
const res = await fetch(url, optionsObject);
|
|
73
69
|
if (!res.ok) {
|
|
74
70
|
let additionalInfo = "";
|
|
75
71
|
if (res.status === 401) {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export type TinaCollection = Collection;
|
|
|
53
53
|
export type TinaCloudSchema = Schema;
|
|
54
54
|
export declare const defineSchema: (config: Schema) => Schema<false>;
|
|
55
55
|
export declare const defineLegacyConfig: (config: Omit<TinaCMSProviderDefaultProps, "children">) => Omit<TinaCMSProviderDefaultProps, "children">;
|
|
56
|
-
interface MediaStoreClass {
|
|
56
|
+
export interface MediaStoreClass {
|
|
57
57
|
new (...args: any[]): MediaStore;
|
|
58
58
|
}
|
|
59
59
|
export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, DocumentCreatorCallback, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;
|
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
|
}
|
|
@@ -5726,10 +5757,11 @@ flowchart TD
|
|
|
5726
5757
|
return /* @__PURE__ */ React.createElement(
|
|
5727
5758
|
"button",
|
|
5728
5759
|
{
|
|
5729
|
-
|
|
5760
|
+
type: "button",
|
|
5761
|
+
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"}`,
|
|
5730
5762
|
onClick
|
|
5731
5763
|
},
|
|
5732
|
-
/* @__PURE__ */ React.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5764
|
+
/* @__PURE__ */ React.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5733
5765
|
);
|
|
5734
5766
|
};
|
|
5735
5767
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -7177,244 +7209,65 @@ flowchart TD
|
|
|
7177
7209
|
str = "0" + str;
|
|
7178
7210
|
return str;
|
|
7179
7211
|
}
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
}
|
|
7192
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7193
|
-
if (source == null)
|
|
7194
|
-
return {};
|
|
7195
|
-
var target = {};
|
|
7196
|
-
var sourceKeys = Object.keys(source);
|
|
7197
|
-
var key, i;
|
|
7198
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7199
|
-
key = sourceKeys[i];
|
|
7200
|
-
if (excluded.indexOf(key) >= 0)
|
|
7201
|
-
continue;
|
|
7202
|
-
target[key] = source[key];
|
|
7203
|
-
}
|
|
7204
|
-
return target;
|
|
7205
|
-
}
|
|
7206
|
-
function _assertThisInitialized(self2) {
|
|
7207
|
-
if (self2 === void 0) {
|
|
7208
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7209
|
-
}
|
|
7210
|
-
return self2;
|
|
7211
|
-
}
|
|
7212
|
-
function isNodeFound(current, componentNode, ignoreClass) {
|
|
7213
|
-
if (current === componentNode) {
|
|
7214
|
-
return true;
|
|
7215
|
-
}
|
|
7216
|
-
if (current.correspondingElement) {
|
|
7217
|
-
return current.correspondingElement.classList.contains(ignoreClass);
|
|
7218
|
-
}
|
|
7219
|
-
return current.classList.contains(ignoreClass);
|
|
7220
|
-
}
|
|
7221
|
-
function findHighest(current, componentNode, ignoreClass) {
|
|
7222
|
-
if (current === componentNode) {
|
|
7223
|
-
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];
|
|
7224
7223
|
}
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
return true;
|
|
7228
|
-
}
|
|
7229
|
-
current = current.parentNode || current.host;
|
|
7224
|
+
if (obj && obj.addEventListener) {
|
|
7225
|
+
obj.addEventListener.apply(obj, args);
|
|
7230
7226
|
}
|
|
7231
|
-
return current;
|
|
7232
7227
|
}
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
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];
|
|
7239
7233
|
}
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
get: function get2() {
|
|
7243
|
-
passive = true;
|
|
7244
|
-
}
|
|
7245
|
-
});
|
|
7246
|
-
var noop = function noop2() {
|
|
7247
|
-
};
|
|
7248
|
-
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
7249
|
-
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
7250
|
-
return passive;
|
|
7251
|
-
};
|
|
7252
|
-
function autoInc(seed) {
|
|
7253
|
-
if (seed === void 0) {
|
|
7254
|
-
seed = 0;
|
|
7234
|
+
if (obj && obj.removeEventListener) {
|
|
7235
|
+
obj.removeEventListener.apply(obj, args);
|
|
7255
7236
|
}
|
|
7256
|
-
return function() {
|
|
7257
|
-
return ++seed;
|
|
7258
|
-
};
|
|
7259
7237
|
}
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
var
|
|
7265
|
-
var
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
function onClickOutside(props) {
|
|
7280
|
-
var _this;
|
|
7281
|
-
_this = _Component.call(this, props) || this;
|
|
7282
|
-
_this.__outsideClickHandler = function(event) {
|
|
7283
|
-
if (typeof _this.__clickOutsideHandlerProp === "function") {
|
|
7284
|
-
_this.__clickOutsideHandlerProp(event);
|
|
7285
|
-
return;
|
|
7286
|
-
}
|
|
7287
|
-
var instance = _this.getInstance();
|
|
7288
|
-
if (typeof instance.props.handleClickOutside === "function") {
|
|
7289
|
-
instance.props.handleClickOutside(event);
|
|
7290
|
-
return;
|
|
7291
|
-
}
|
|
7292
|
-
if (typeof instance.handleClickOutside === "function") {
|
|
7293
|
-
instance.handleClickOutside(event);
|
|
7294
|
-
return;
|
|
7295
|
-
}
|
|
7296
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
7297
|
-
};
|
|
7298
|
-
_this.__getComponentNode = function() {
|
|
7299
|
-
var instance = _this.getInstance();
|
|
7300
|
-
if (config && typeof config.setClickOutsideRef === "function") {
|
|
7301
|
-
return config.setClickOutsideRef()(instance);
|
|
7302
|
-
}
|
|
7303
|
-
if (typeof instance.setClickOutsideRef === "function") {
|
|
7304
|
-
return instance.setClickOutsideRef();
|
|
7305
|
-
}
|
|
7306
|
-
return reactDom.findDOMNode(instance);
|
|
7307
|
-
};
|
|
7308
|
-
_this.enableOnClickOutside = function() {
|
|
7309
|
-
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
7310
|
-
return;
|
|
7311
|
-
}
|
|
7312
|
-
if (typeof passiveEventSupport === "undefined") {
|
|
7313
|
-
passiveEventSupport = testPassiveEventSupport();
|
|
7314
|
-
}
|
|
7315
|
-
enabledInstances[_this._uid] = true;
|
|
7316
|
-
var events = _this.props.eventTypes;
|
|
7317
|
-
if (!events.forEach) {
|
|
7318
|
-
events = [events];
|
|
7319
|
-
}
|
|
7320
|
-
handlersMap[_this._uid] = function(event) {
|
|
7321
|
-
if (_this.componentNode === null)
|
|
7322
|
-
return;
|
|
7323
|
-
if (_this.initTimeStamp > event.timeStamp)
|
|
7324
|
-
return;
|
|
7325
|
-
if (_this.props.preventDefault) {
|
|
7326
|
-
event.preventDefault();
|
|
7327
|
-
}
|
|
7328
|
-
if (_this.props.stopPropagation) {
|
|
7329
|
-
event.stopPropagation();
|
|
7330
|
-
}
|
|
7331
|
-
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
7332
|
-
return;
|
|
7333
|
-
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
7334
|
-
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
7335
|
-
return;
|
|
7336
|
-
}
|
|
7337
|
-
_this.__outsideClickHandler(event);
|
|
7338
|
-
};
|
|
7339
|
-
events.forEach(function(eventName) {
|
|
7340
|
-
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7341
|
-
});
|
|
7342
|
-
};
|
|
7343
|
-
_this.disableOnClickOutside = function() {
|
|
7344
|
-
delete enabledInstances[_this._uid];
|
|
7345
|
-
var fn = handlersMap[_this._uid];
|
|
7346
|
-
if (fn && typeof document !== "undefined") {
|
|
7347
|
-
var events = _this.props.eventTypes;
|
|
7348
|
-
if (!events.forEach) {
|
|
7349
|
-
events = [events];
|
|
7350
|
-
}
|
|
7351
|
-
events.forEach(function(eventName) {
|
|
7352
|
-
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7353
|
-
});
|
|
7354
|
-
delete handlersMap[_this._uid];
|
|
7355
|
-
}
|
|
7356
|
-
};
|
|
7357
|
-
_this.getRef = function(ref) {
|
|
7358
|
-
return _this.instanceRef = ref;
|
|
7359
|
-
};
|
|
7360
|
-
_this._uid = uid();
|
|
7361
|
-
_this.initTimeStamp = performance.now();
|
|
7362
|
-
return _this;
|
|
7363
|
-
}
|
|
7364
|
-
var _proto = onClickOutside.prototype;
|
|
7365
|
-
_proto.getInstance = function getInstance() {
|
|
7366
|
-
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
7367
|
-
return this;
|
|
7368
|
-
}
|
|
7369
|
-
var ref = this.instanceRef;
|
|
7370
|
-
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);
|
|
7371
7257
|
};
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
7381
|
-
}
|
|
7382
|
-
}
|
|
7383
|
-
this.componentNode = this.__getComponentNode();
|
|
7384
|
-
if (this.props.disableOnClickOutside)
|
|
7385
|
-
return;
|
|
7386
|
-
this.enableOnClickOutside();
|
|
7387
|
-
};
|
|
7388
|
-
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
7389
|
-
this.componentNode = this.__getComponentNode();
|
|
7390
|
-
};
|
|
7391
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
7392
|
-
this.disableOnClickOutside();
|
|
7393
|
-
};
|
|
7394
|
-
_proto.render = function render() {
|
|
7395
|
-
var _this$props = this.props;
|
|
7396
|
-
_this$props.excludeScrollbar;
|
|
7397
|
-
var props = _objectWithoutPropertiesLoose(_this$props, ["excludeScrollbar"]);
|
|
7398
|
-
if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {
|
|
7399
|
-
props.ref = this.getRef;
|
|
7400
|
-
} else {
|
|
7401
|
-
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);
|
|
7402
7266
|
}
|
|
7403
|
-
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
7404
|
-
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
7405
|
-
return React.createElement(WrappedComponent, props);
|
|
7406
7267
|
};
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
7411
|
-
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
7412
|
-
preventDefault: false,
|
|
7413
|
-
stopPropagation: false
|
|
7414
|
-
}, _class.getClass = function() {
|
|
7415
|
-
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
7416
|
-
}, _temp;
|
|
7417
|
-
}
|
|
7268
|
+
}, [events, ref]);
|
|
7269
|
+
};
|
|
7270
|
+
var _default = useClickAway$1.default = useClickAway;
|
|
7418
7271
|
const viewModes = {
|
|
7419
7272
|
YEARS: "years",
|
|
7420
7273
|
MONTHS: "months",
|
|
@@ -7943,22 +7796,13 @@ flowchart TD
|
|
|
7943
7796
|
}
|
|
7944
7797
|
con[method]("***react-datetime:" + message);
|
|
7945
7798
|
}
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
}
|
|
7951
|
-
|
|
7952
|
-
return /* @__PURE__ */ React.createElement("div", { className: this.props.className, ref: this.container }, this.props.children);
|
|
7953
|
-
}
|
|
7954
|
-
handleClickOutside(e) {
|
|
7955
|
-
this.props.onClickOut(e);
|
|
7956
|
-
}
|
|
7957
|
-
setClickOutsideRef() {
|
|
7958
|
-
return this.container.current;
|
|
7959
|
-
}
|
|
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);
|
|
7960
7805
|
}
|
|
7961
|
-
const ClickableWrapper = onClickOutsideHOC(ClickOutBase);
|
|
7962
7806
|
const DEFAULT_DATE_DISPLAY_FORMAT = "MMM DD, YYYY";
|
|
7963
7807
|
const DEFAULT_TIME_DISPLAY_FORMAT = "h:mm A";
|
|
7964
7808
|
const format$1 = (val, _name, field) => {
|
|
@@ -8001,7 +7845,10 @@ flowchart TD
|
|
|
8001
7845
|
ReactDateTimeWithStyles,
|
|
8002
7846
|
{
|
|
8003
7847
|
value: input.value,
|
|
8004
|
-
onChange:
|
|
7848
|
+
onChange: (value) => {
|
|
7849
|
+
const newValue = value === "" ? void 0 : value;
|
|
7850
|
+
input.onChange(newValue);
|
|
7851
|
+
},
|
|
8005
7852
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
8006
7853
|
timeFormat: timeFormat || false,
|
|
8007
7854
|
inputProps: { className: textFieldClasses },
|
|
@@ -10332,7 +10179,7 @@ flowchart TD
|
|
|
10332
10179
|
"Event Log"
|
|
10333
10180
|
));
|
|
10334
10181
|
};
|
|
10335
|
-
const version = "2.
|
|
10182
|
+
const version = "2.5.2";
|
|
10336
10183
|
const Nav = ({
|
|
10337
10184
|
isLocalMode,
|
|
10338
10185
|
className = "",
|
|
@@ -14738,7 +14585,12 @@ flowchart TD
|
|
|
14738
14585
|
const [itemsShown, setItemsShown] = React.useState(11);
|
|
14739
14586
|
const { overrides, templates } = useToolbarContext();
|
|
14740
14587
|
const showEmbedButton = templates.length > 0;
|
|
14741
|
-
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
|
+
}
|
|
14742
14594
|
if (!showEmbedButton) {
|
|
14743
14595
|
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14744
14596
|
}
|
|
@@ -15066,6 +14918,9 @@ flowchart TD
|
|
|
15066
14918
|
if (typeof string !== "string") {
|
|
15067
14919
|
return false;
|
|
15068
14920
|
}
|
|
14921
|
+
if (string.startsWith("#")) {
|
|
14922
|
+
return true;
|
|
14923
|
+
}
|
|
15069
14924
|
const generalMatch = string.match(protocolAndDomainRE);
|
|
15070
14925
|
const emailLinkMatch = string.match(emailLintRE);
|
|
15071
14926
|
const localUrlMatch = string.match(localUrlRE);
|
|
@@ -15087,12 +14942,12 @@ flowchart TD
|
|
|
15087
14942
|
}
|
|
15088
14943
|
return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
|
|
15089
14944
|
};
|
|
15090
|
-
const RichEditor = (
|
|
14945
|
+
const RichEditor = ({ input, tinaForm, field }) => {
|
|
15091
14946
|
var _a;
|
|
15092
14947
|
const initialValue = React.useMemo(
|
|
15093
14948
|
() => {
|
|
15094
14949
|
var _a2, _b;
|
|
15095
|
-
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: "" }] }];
|
|
15096
14951
|
},
|
|
15097
14952
|
[]
|
|
15098
14953
|
);
|
|
@@ -15120,7 +14975,7 @@ flowchart TD
|
|
|
15120
14975
|
),
|
|
15121
14976
|
[]
|
|
15122
14977
|
);
|
|
15123
|
-
const tempId = [
|
|
14978
|
+
const tempId = [tinaForm.id, input.name].join(".");
|
|
15124
14979
|
const id = React.useMemo(() => uuid() + tempId, [tempId]);
|
|
15125
14980
|
const ref = React.useRef(null);
|
|
15126
14981
|
React.useEffect(() => {
|
|
@@ -15130,13 +14985,13 @@ flowchart TD
|
|
|
15130
14985
|
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
15131
14986
|
'[role="textbox"]'
|
|
15132
14987
|
);
|
|
15133
|
-
if (
|
|
14988
|
+
if (field.experimental_focusIntent && plateElement) {
|
|
15134
14989
|
if (plateElement)
|
|
15135
14990
|
plateElement.focus();
|
|
15136
14991
|
}
|
|
15137
14992
|
}, 100);
|
|
15138
14993
|
}
|
|
15139
|
-
}, [
|
|
14994
|
+
}, [field.experimental_focusIntent, ref]);
|
|
15140
14995
|
return /* @__PURE__ */ React.createElement("div", { ref }, /* @__PURE__ */ React.createElement(
|
|
15141
14996
|
plateCommon.Plate,
|
|
15142
14997
|
{
|
|
@@ -15144,7 +14999,7 @@ flowchart TD
|
|
|
15144
14999
|
initialValue,
|
|
15145
15000
|
plugins: plugins$2,
|
|
15146
15001
|
onChange: (value) => {
|
|
15147
|
-
|
|
15002
|
+
input.onChange({
|
|
15148
15003
|
type: "root",
|
|
15149
15004
|
children: value
|
|
15150
15005
|
});
|
|
@@ -15153,12 +15008,12 @@ flowchart TD
|
|
|
15153
15008
|
/* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(
|
|
15154
15009
|
ToolbarProvider,
|
|
15155
15010
|
{
|
|
15156
|
-
tinaForm
|
|
15157
|
-
templates:
|
|
15158
|
-
overrides: (
|
|
15011
|
+
tinaForm,
|
|
15012
|
+
templates: field.templates,
|
|
15013
|
+
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
15159
15014
|
},
|
|
15160
15015
|
/* @__PURE__ */ React.createElement(FixedToolbar, null, /* @__PURE__ */ React.createElement(FixedToolbarButtons, null)),
|
|
15161
|
-
/* @__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
|
|
15162
15017
|
), /* @__PURE__ */ React.createElement(Editor, null))
|
|
15163
15018
|
));
|
|
15164
15019
|
};
|