tinacms 0.0.0-eb519f2-20241015053224 → 0.0.0-ebe1b69-20250211022853
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/types.d.ts +3 -0
- package/dist/cache/node-cache.d.ts +1 -0
- package/dist/client.js +90 -61
- package/dist/client.mjs +49 -35
- package/dist/index.d.ts +1 -1
- package/dist/index.js +297 -339
- package/dist/index.mjs +313 -355
- package/dist/node-cache-5e8db9f0.mjs +63 -0
- package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
- 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/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
- package/dist/unifiedClient/index.d.ts +8 -1
- package/package.json +28 -28
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
- package/dist/node-cache-7fa2452c.mjs +0 -43
package/dist/index.js
CHANGED
|
@@ -774,6 +774,22 @@ var __publicField = (obj, key, value) => {
|
|
|
774
774
|
);
|
|
775
775
|
};
|
|
776
776
|
}
|
|
777
|
+
function wrapFieldWithNoHeader(Field) {
|
|
778
|
+
return (props) => {
|
|
779
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
780
|
+
FieldMeta,
|
|
781
|
+
{
|
|
782
|
+
name: props.input.name,
|
|
783
|
+
label: false,
|
|
784
|
+
description: "",
|
|
785
|
+
error: props.meta.error,
|
|
786
|
+
index: props.index,
|
|
787
|
+
tinaForm: props.tinaForm
|
|
788
|
+
},
|
|
789
|
+
/* @__PURE__ */ React__namespace.createElement(Field, { ...props })
|
|
790
|
+
);
|
|
791
|
+
};
|
|
792
|
+
}
|
|
777
793
|
function wrapFieldWithError(Field) {
|
|
778
794
|
return (props) => {
|
|
779
795
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -846,6 +862,16 @@ var __publicField = (obj, key, value) => {
|
|
|
846
862
|
className,
|
|
847
863
|
...props
|
|
848
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
|
+
}
|
|
849
875
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
850
876
|
"span",
|
|
851
877
|
{
|
|
@@ -1321,7 +1347,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1321
1347
|
React.useEffect(() => {
|
|
1322
1348
|
if (mermaidRef.current) {
|
|
1323
1349
|
mermaid.initialize({ startOnLoad: true });
|
|
1324
|
-
mermaid.
|
|
1350
|
+
mermaid.init();
|
|
1325
1351
|
}
|
|
1326
1352
|
}, [config]);
|
|
1327
1353
|
return /* @__PURE__ */ React.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
@@ -1348,7 +1374,7 @@ flowchart TD
|
|
|
1348
1374
|
--> id2(modify me to see changes!)
|
|
1349
1375
|
id2
|
|
1350
1376
|
--> id3(Click the top button to preview the changes)
|
|
1351
|
-
--> id4(Learn about mermaid diagrams
|
|
1377
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1352
1378
|
const MermaidElement = cn$1.withRef(
|
|
1353
1379
|
({ children, nodeProps, element, ...props }, ref) => {
|
|
1354
1380
|
const [mermaidConfig, setMermaidConfig] = React.useState(
|
|
@@ -1364,7 +1390,7 @@ flowchart TD
|
|
|
1364
1390
|
children: [{ type: "text", text: "" }]
|
|
1365
1391
|
};
|
|
1366
1392
|
React.useEffect(() => {
|
|
1367
|
-
if (mermaid.parse(mermaidConfig
|
|
1393
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1368
1394
|
setMermaidError(null);
|
|
1369
1395
|
}
|
|
1370
1396
|
}, [mermaidConfig]);
|
|
@@ -3676,7 +3702,7 @@ flowchart TD
|
|
|
3676
3702
|
};
|
|
3677
3703
|
const sizeClasses = {
|
|
3678
3704
|
small: `text-xs h-8 px-3`,
|
|
3679
|
-
medium: `text-sm h-10 px-
|
|
3705
|
+
medium: `text-sm h-10 px-8`,
|
|
3680
3706
|
custom: ``
|
|
3681
3707
|
};
|
|
3682
3708
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -3804,7 +3830,7 @@ flowchart TD
|
|
|
3804
3830
|
function _objectWithoutProperties(source, excluded) {
|
|
3805
3831
|
if (source == null)
|
|
3806
3832
|
return {};
|
|
3807
|
-
var target = _objectWithoutPropertiesLoose
|
|
3833
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
3808
3834
|
var key, i;
|
|
3809
3835
|
if (Object.getOwnPropertySymbols) {
|
|
3810
3836
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3819,7 +3845,7 @@ flowchart TD
|
|
|
3819
3845
|
}
|
|
3820
3846
|
return target;
|
|
3821
3847
|
}
|
|
3822
|
-
function _objectWithoutPropertiesLoose
|
|
3848
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3823
3849
|
if (source == null)
|
|
3824
3850
|
return {};
|
|
3825
3851
|
var target = {};
|
|
@@ -4909,7 +4935,28 @@ flowchart TD
|
|
|
4909
4935
|
onChange,
|
|
4910
4936
|
value,
|
|
4911
4937
|
step
|
|
4912
|
-
}) => /* @__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
|
+
);
|
|
4913
4960
|
function useCMS() {
|
|
4914
4961
|
return useCMS$1();
|
|
4915
4962
|
}
|
|
@@ -5150,7 +5197,7 @@ flowchart TD
|
|
|
5150
5197
|
side: "bottom",
|
|
5151
5198
|
className: cn(
|
|
5152
5199
|
"rounded-md border bg-white p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
5153
|
-
"max-h-[30vh] max-w-[
|
|
5200
|
+
"max-h-[30vh] max-w-[30vw] overflow-y-auto",
|
|
5154
5201
|
className
|
|
5155
5202
|
),
|
|
5156
5203
|
...props
|
|
@@ -5242,11 +5289,7 @@ flowchart TD
|
|
|
5242
5289
|
const node = nodes.find((node2) => node2.id === value);
|
|
5243
5290
|
return node ? node._internalSys.filename : null;
|
|
5244
5291
|
};
|
|
5245
|
-
const
|
|
5246
|
-
cms,
|
|
5247
|
-
input,
|
|
5248
|
-
field
|
|
5249
|
-
}) => {
|
|
5292
|
+
const Combobox = ({ cms, input, field }) => {
|
|
5250
5293
|
const [open2, setOpen] = React__namespace.useState(false);
|
|
5251
5294
|
const [value, setValue] = React__namespace.useState(input.value);
|
|
5252
5295
|
const [displayText, setDisplayText] = React__namespace.useState(null);
|
|
@@ -5270,17 +5313,17 @@ flowchart TD
|
|
|
5270
5313
|
if (loading === true) {
|
|
5271
5314
|
return /* @__PURE__ */ React__namespace.createElement(LoadingDots, { color: "var(--tina-color-primary)" });
|
|
5272
5315
|
}
|
|
5273
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
5316
|
+
return /* @__PURE__ */ React__namespace.createElement(Popover, { open: open2, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
|
|
5274
5317
|
Button,
|
|
5275
5318
|
{
|
|
5276
5319
|
variant: "outline",
|
|
5277
5320
|
role: "combobox",
|
|
5278
5321
|
"aria-expanded": open2,
|
|
5279
|
-
className: "w-
|
|
5322
|
+
className: "w-full justify-between"
|
|
5280
5323
|
},
|
|
5281
5324
|
/* @__PURE__ */ React__namespace.createElement("p", { className: "truncate" }, displayText ?? "Choose an option..."),
|
|
5282
5325
|
open2 ? /* @__PURE__ */ React__namespace.createElement(IoMdArrowDropup, { size: 20 }) : /* @__PURE__ */ React__namespace.createElement(IoMdArrowDropdown, { size: 20 })
|
|
5283
|
-
)), /* @__PURE__ */ React__namespace.createElement(PopoverContent, { className: "p-0 relative" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5326
|
+
)), /* @__PURE__ */ React__namespace.createElement(PopoverContent, { className: "p-0 relative min-w-[var(--radix-popover-trigger-width)]" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5284
5327
|
Command,
|
|
5285
5328
|
{
|
|
5286
5329
|
shouldFilter: !field.experimental___filter,
|
|
@@ -5304,32 +5347,25 @@ flowchart TD
|
|
|
5304
5347
|
}
|
|
5305
5348
|
),
|
|
5306
5349
|
/* @__PURE__ */ React__namespace.createElement(CommandEmpty, null, "No reference found"),
|
|
5307
|
-
/* @__PURE__ */ React__namespace.createElement(CommandList, null, filteredOptionsList.length > 0 && (filteredOptionsList == null ? void 0 : filteredOptionsList.map(({ collection, edges }) => /* @__PURE__ */ React__namespace.createElement(
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
field,
|
|
5322
|
-
_values,
|
|
5323
|
-
node,
|
|
5324
|
-
onSelect: (currentValue) => {
|
|
5325
|
-
setValue(currentValue);
|
|
5326
|
-
setOpen(false);
|
|
5327
|
-
}
|
|
5350
|
+
/* @__PURE__ */ React__namespace.createElement(CommandList, null, filteredOptionsList.length > 0 && (filteredOptionsList == null ? void 0 : filteredOptionsList.map(({ collection, edges }) => /* @__PURE__ */ React__namespace.createElement(CommandGroup, { key: `${collection}-group`, heading: collection }, /* @__PURE__ */ React__namespace.createElement(CommandList, null, edges == null ? void 0 : edges.map(({ node }) => {
|
|
5351
|
+
const { id, _values } = node;
|
|
5352
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
5353
|
+
OptionComponent,
|
|
5354
|
+
{
|
|
5355
|
+
id,
|
|
5356
|
+
key: id,
|
|
5357
|
+
value,
|
|
5358
|
+
field,
|
|
5359
|
+
_values,
|
|
5360
|
+
node,
|
|
5361
|
+
onSelect: (currentValue) => {
|
|
5362
|
+
setValue(currentValue);
|
|
5363
|
+
setOpen(false);
|
|
5328
5364
|
}
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
))))
|
|
5332
|
-
)))
|
|
5365
|
+
}
|
|
5366
|
+
);
|
|
5367
|
+
}))))))
|
|
5368
|
+
)));
|
|
5333
5369
|
};
|
|
5334
5370
|
const useGetNode = (cms, id) => {
|
|
5335
5371
|
const [document2, setDocument] = React__namespace.useState(
|
|
@@ -5402,7 +5438,7 @@ flowchart TD
|
|
|
5402
5438
|
};
|
|
5403
5439
|
const Reference = ({ input, field }) => {
|
|
5404
5440
|
const cms = useCMS();
|
|
5405
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
5441
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__namespace.createElement(Combobox, { cms, input, field })), /* @__PURE__ */ React__namespace.createElement(ReferenceLink, { cms, input }));
|
|
5406
5442
|
};
|
|
5407
5443
|
const ButtonToggle = ({
|
|
5408
5444
|
input,
|
|
@@ -5710,10 +5746,11 @@ flowchart TD
|
|
|
5710
5746
|
return /* @__PURE__ */ React.createElement(
|
|
5711
5747
|
"button",
|
|
5712
5748
|
{
|
|
5713
|
-
|
|
5749
|
+
type: "button",
|
|
5750
|
+
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"}`,
|
|
5714
5751
|
onClick
|
|
5715
5752
|
},
|
|
5716
|
-
/* @__PURE__ */ React.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5753
|
+
/* @__PURE__ */ React.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5717
5754
|
);
|
|
5718
5755
|
};
|
|
5719
5756
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -5791,27 +5828,35 @@ flowchart TD
|
|
|
5791
5828
|
))))
|
|
5792
5829
|
))));
|
|
5793
5830
|
};
|
|
5794
|
-
const Group =
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5831
|
+
const Group = wrapFieldWithNoHeader(
|
|
5832
|
+
({ tinaForm, field }) => {
|
|
5833
|
+
const cms = useCMS$1();
|
|
5834
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
5835
|
+
Header,
|
|
5836
|
+
{
|
|
5837
|
+
onClick: () => {
|
|
5838
|
+
const state = tinaForm.finalForm.getState();
|
|
5839
|
+
if (state.invalid === true) {
|
|
5840
|
+
cms.alerts.error("Cannot navigate away from an invalid form.");
|
|
5841
|
+
return;
|
|
5842
|
+
}
|
|
5843
|
+
cms.dispatch({
|
|
5844
|
+
type: "forms:set-active-field-name",
|
|
5845
|
+
value: { formId: tinaForm.id, fieldName: field.name }
|
|
5846
|
+
});
|
|
5805
5847
|
}
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5848
|
+
},
|
|
5849
|
+
field.label || field.name,
|
|
5850
|
+
field.description && /* @__PURE__ */ React__namespace.createElement(
|
|
5851
|
+
"span",
|
|
5852
|
+
{
|
|
5853
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0`,
|
|
5854
|
+
dangerouslySetInnerHTML: { __html: field.description }
|
|
5855
|
+
}
|
|
5856
|
+
)
|
|
5857
|
+
));
|
|
5858
|
+
}
|
|
5859
|
+
);
|
|
5815
5860
|
const Header = ({ onClick, children }) => {
|
|
5816
5861
|
return /* @__PURE__ */ React__namespace.createElement("div", { className: "pt-1 mb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5817
5862
|
"button",
|
|
@@ -7153,244 +7198,65 @@ flowchart TD
|
|
|
7153
7198
|
str = "0" + str;
|
|
7154
7199
|
return str;
|
|
7155
7200
|
}
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
}
|
|
7168
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7169
|
-
if (source == null)
|
|
7170
|
-
return {};
|
|
7171
|
-
var target = {};
|
|
7172
|
-
var sourceKeys = Object.keys(source);
|
|
7173
|
-
var key, i;
|
|
7174
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7175
|
-
key = sourceKeys[i];
|
|
7176
|
-
if (excluded.indexOf(key) >= 0)
|
|
7177
|
-
continue;
|
|
7178
|
-
target[key] = source[key];
|
|
7179
|
-
}
|
|
7180
|
-
return target;
|
|
7181
|
-
}
|
|
7182
|
-
function _assertThisInitialized(self2) {
|
|
7183
|
-
if (self2 === void 0) {
|
|
7184
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7185
|
-
}
|
|
7186
|
-
return self2;
|
|
7187
|
-
}
|
|
7188
|
-
function isNodeFound(current, componentNode, ignoreClass) {
|
|
7189
|
-
if (current === componentNode) {
|
|
7190
|
-
return true;
|
|
7191
|
-
}
|
|
7192
|
-
if (current.correspondingElement) {
|
|
7193
|
-
return current.correspondingElement.classList.contains(ignoreClass);
|
|
7194
|
-
}
|
|
7195
|
-
return current.classList.contains(ignoreClass);
|
|
7196
|
-
}
|
|
7197
|
-
function findHighest(current, componentNode, ignoreClass) {
|
|
7198
|
-
if (current === componentNode) {
|
|
7199
|
-
return true;
|
|
7201
|
+
var useClickAway$1 = {};
|
|
7202
|
+
var util = {};
|
|
7203
|
+
Object.defineProperty(util, "__esModule", { value: true });
|
|
7204
|
+
util.isNavigator = util.isBrowser = util.off = util.on = util.noop = void 0;
|
|
7205
|
+
var noop = function() {
|
|
7206
|
+
};
|
|
7207
|
+
util.noop = noop;
|
|
7208
|
+
function on(obj) {
|
|
7209
|
+
var args = [];
|
|
7210
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7211
|
+
args[_i - 1] = arguments[_i];
|
|
7200
7212
|
}
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
return true;
|
|
7204
|
-
}
|
|
7205
|
-
current = current.parentNode || current.host;
|
|
7213
|
+
if (obj && obj.addEventListener) {
|
|
7214
|
+
obj.addEventListener.apply(obj, args);
|
|
7206
7215
|
}
|
|
7207
|
-
return current;
|
|
7208
|
-
}
|
|
7209
|
-
function clickedScrollbar(evt) {
|
|
7210
|
-
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
|
|
7211
7216
|
}
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7217
|
+
util.on = on;
|
|
7218
|
+
function off(obj) {
|
|
7219
|
+
var args = [];
|
|
7220
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7221
|
+
args[_i - 1] = arguments[_i];
|
|
7215
7222
|
}
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
get: function get2() {
|
|
7219
|
-
passive = true;
|
|
7220
|
-
}
|
|
7221
|
-
});
|
|
7222
|
-
var noop = function noop2() {
|
|
7223
|
-
};
|
|
7224
|
-
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
7225
|
-
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
7226
|
-
return passive;
|
|
7227
|
-
};
|
|
7228
|
-
function autoInc(seed) {
|
|
7229
|
-
if (seed === void 0) {
|
|
7230
|
-
seed = 0;
|
|
7223
|
+
if (obj && obj.removeEventListener) {
|
|
7224
|
+
obj.removeEventListener.apply(obj, args);
|
|
7231
7225
|
}
|
|
7232
|
-
return function() {
|
|
7233
|
-
return ++seed;
|
|
7234
|
-
};
|
|
7235
|
-
}
|
|
7236
|
-
var uid = autoInc();
|
|
7237
|
-
var passiveEventSupport;
|
|
7238
|
-
var handlersMap = {};
|
|
7239
|
-
var enabledInstances = {};
|
|
7240
|
-
var touchEvents = ["touchstart", "touchmove"];
|
|
7241
|
-
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
7242
|
-
function getEventHandlerOptions(instance, eventName) {
|
|
7243
|
-
var handlerOptions = {};
|
|
7244
|
-
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
7245
|
-
if (isTouchEvent && passiveEventSupport) {
|
|
7246
|
-
handlerOptions.passive = !instance.props.preventDefault;
|
|
7247
|
-
}
|
|
7248
|
-
return handlerOptions;
|
|
7249
7226
|
}
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
instance.handleClickOutside(event);
|
|
7270
|
-
return;
|
|
7271
|
-
}
|
|
7272
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
7273
|
-
};
|
|
7274
|
-
_this.__getComponentNode = function() {
|
|
7275
|
-
var instance = _this.getInstance();
|
|
7276
|
-
if (config && typeof config.setClickOutsideRef === "function") {
|
|
7277
|
-
return config.setClickOutsideRef()(instance);
|
|
7278
|
-
}
|
|
7279
|
-
if (typeof instance.setClickOutsideRef === "function") {
|
|
7280
|
-
return instance.setClickOutsideRef();
|
|
7281
|
-
}
|
|
7282
|
-
return reactDom.findDOMNode(instance);
|
|
7283
|
-
};
|
|
7284
|
-
_this.enableOnClickOutside = function() {
|
|
7285
|
-
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
7286
|
-
return;
|
|
7287
|
-
}
|
|
7288
|
-
if (typeof passiveEventSupport === "undefined") {
|
|
7289
|
-
passiveEventSupport = testPassiveEventSupport();
|
|
7290
|
-
}
|
|
7291
|
-
enabledInstances[_this._uid] = true;
|
|
7292
|
-
var events = _this.props.eventTypes;
|
|
7293
|
-
if (!events.forEach) {
|
|
7294
|
-
events = [events];
|
|
7295
|
-
}
|
|
7296
|
-
handlersMap[_this._uid] = function(event) {
|
|
7297
|
-
if (_this.componentNode === null)
|
|
7298
|
-
return;
|
|
7299
|
-
if (_this.initTimeStamp > event.timeStamp)
|
|
7300
|
-
return;
|
|
7301
|
-
if (_this.props.preventDefault) {
|
|
7302
|
-
event.preventDefault();
|
|
7303
|
-
}
|
|
7304
|
-
if (_this.props.stopPropagation) {
|
|
7305
|
-
event.stopPropagation();
|
|
7306
|
-
}
|
|
7307
|
-
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
7308
|
-
return;
|
|
7309
|
-
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
7310
|
-
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
7311
|
-
return;
|
|
7312
|
-
}
|
|
7313
|
-
_this.__outsideClickHandler(event);
|
|
7314
|
-
};
|
|
7315
|
-
events.forEach(function(eventName) {
|
|
7316
|
-
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7317
|
-
});
|
|
7318
|
-
};
|
|
7319
|
-
_this.disableOnClickOutside = function() {
|
|
7320
|
-
delete enabledInstances[_this._uid];
|
|
7321
|
-
var fn = handlersMap[_this._uid];
|
|
7322
|
-
if (fn && typeof document !== "undefined") {
|
|
7323
|
-
var events = _this.props.eventTypes;
|
|
7324
|
-
if (!events.forEach) {
|
|
7325
|
-
events = [events];
|
|
7326
|
-
}
|
|
7327
|
-
events.forEach(function(eventName) {
|
|
7328
|
-
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
7329
|
-
});
|
|
7330
|
-
delete handlersMap[_this._uid];
|
|
7331
|
-
}
|
|
7332
|
-
};
|
|
7333
|
-
_this.getRef = function(ref) {
|
|
7334
|
-
return _this.instanceRef = ref;
|
|
7335
|
-
};
|
|
7336
|
-
_this._uid = uid();
|
|
7337
|
-
_this.initTimeStamp = performance.now();
|
|
7338
|
-
return _this;
|
|
7339
|
-
}
|
|
7340
|
-
var _proto = onClickOutside.prototype;
|
|
7341
|
-
_proto.getInstance = function getInstance() {
|
|
7342
|
-
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
7343
|
-
return this;
|
|
7344
|
-
}
|
|
7345
|
-
var ref = this.instanceRef;
|
|
7346
|
-
return ref.getInstance ? ref.getInstance() : ref;
|
|
7347
|
-
};
|
|
7348
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
7349
|
-
if (typeof document === "undefined" || !document.createElement) {
|
|
7350
|
-
return;
|
|
7351
|
-
}
|
|
7352
|
-
var instance = this.getInstance();
|
|
7353
|
-
if (config && typeof config.handleClickOutside === "function") {
|
|
7354
|
-
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
|
|
7355
|
-
if (typeof this.__clickOutsideHandlerProp !== "function") {
|
|
7356
|
-
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
7357
|
-
}
|
|
7358
|
-
}
|
|
7359
|
-
this.componentNode = this.__getComponentNode();
|
|
7360
|
-
if (this.props.disableOnClickOutside)
|
|
7361
|
-
return;
|
|
7362
|
-
this.enableOnClickOutside();
|
|
7363
|
-
};
|
|
7364
|
-
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
7365
|
-
this.componentNode = this.__getComponentNode();
|
|
7366
|
-
};
|
|
7367
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
7368
|
-
this.disableOnClickOutside();
|
|
7227
|
+
util.off = off;
|
|
7228
|
+
util.isBrowser = typeof window !== "undefined";
|
|
7229
|
+
util.isNavigator = typeof navigator !== "undefined";
|
|
7230
|
+
Object.defineProperty(useClickAway$1, "__esModule", { value: true });
|
|
7231
|
+
var react_1 = React;
|
|
7232
|
+
var util_1 = util;
|
|
7233
|
+
var defaultEvents = ["mousedown", "touchstart"];
|
|
7234
|
+
var useClickAway = function(ref, onClickAway, events) {
|
|
7235
|
+
if (events === void 0) {
|
|
7236
|
+
events = defaultEvents;
|
|
7237
|
+
}
|
|
7238
|
+
var savedCallback = react_1.useRef(onClickAway);
|
|
7239
|
+
react_1.useEffect(function() {
|
|
7240
|
+
savedCallback.current = onClickAway;
|
|
7241
|
+
}, [onClickAway]);
|
|
7242
|
+
react_1.useEffect(function() {
|
|
7243
|
+
var handler = function(event) {
|
|
7244
|
+
var el = ref.current;
|
|
7245
|
+
el && !el.contains(event.target) && savedCallback.current(event);
|
|
7369
7246
|
};
|
|
7370
|
-
|
|
7371
|
-
var
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7247
|
+
for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
|
|
7248
|
+
var eventName = events_1[_i];
|
|
7249
|
+
util_1.on(document, eventName, handler);
|
|
7250
|
+
}
|
|
7251
|
+
return function() {
|
|
7252
|
+
for (var _i2 = 0, events_2 = events; _i2 < events_2.length; _i2++) {
|
|
7253
|
+
var eventName2 = events_2[_i2];
|
|
7254
|
+
util_1.off(document, eventName2, handler);
|
|
7378
7255
|
}
|
|
7379
|
-
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
7380
|
-
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
7381
|
-
return React.createElement(WrappedComponent, props);
|
|
7382
7256
|
};
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
7387
|
-
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
7388
|
-
preventDefault: false,
|
|
7389
|
-
stopPropagation: false
|
|
7390
|
-
}, _class.getClass = function() {
|
|
7391
|
-
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
7392
|
-
}, _temp;
|
|
7393
|
-
}
|
|
7257
|
+
}, [events, ref]);
|
|
7258
|
+
};
|
|
7259
|
+
var _default = useClickAway$1.default = useClickAway;
|
|
7394
7260
|
const viewModes = {
|
|
7395
7261
|
YEARS: "years",
|
|
7396
7262
|
MONTHS: "months",
|
|
@@ -7919,22 +7785,13 @@ flowchart TD
|
|
|
7919
7785
|
}
|
|
7920
7786
|
con[method]("***react-datetime:" + message);
|
|
7921
7787
|
}
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
}
|
|
7927
|
-
|
|
7928
|
-
return /* @__PURE__ */ React.createElement("div", { className: this.props.className, ref: this.container }, this.props.children);
|
|
7929
|
-
}
|
|
7930
|
-
handleClickOutside(e) {
|
|
7931
|
-
this.props.onClickOut(e);
|
|
7932
|
-
}
|
|
7933
|
-
setClickOutsideRef() {
|
|
7934
|
-
return this.container.current;
|
|
7935
|
-
}
|
|
7788
|
+
function ClickableWrapper({ className, onClickOut, children }) {
|
|
7789
|
+
const containerRef = React.useRef(null);
|
|
7790
|
+
_default(containerRef, (event) => {
|
|
7791
|
+
onClickOut(event);
|
|
7792
|
+
});
|
|
7793
|
+
return /* @__PURE__ */ React.createElement("div", { className, ref: containerRef }, children);
|
|
7936
7794
|
}
|
|
7937
|
-
const ClickableWrapper = onClickOutsideHOC(ClickOutBase);
|
|
7938
7795
|
const DEFAULT_DATE_DISPLAY_FORMAT = "MMM DD, YYYY";
|
|
7939
7796
|
const DEFAULT_TIME_DISPLAY_FORMAT = "h:mm A";
|
|
7940
7797
|
const format$1 = (val, _name, field) => {
|
|
@@ -7977,7 +7834,10 @@ flowchart TD
|
|
|
7977
7834
|
ReactDateTimeWithStyles,
|
|
7978
7835
|
{
|
|
7979
7836
|
value: input.value,
|
|
7980
|
-
onChange:
|
|
7837
|
+
onChange: (value) => {
|
|
7838
|
+
const newValue = value === "" ? void 0 : value;
|
|
7839
|
+
input.onChange(newValue);
|
|
7840
|
+
},
|
|
7981
7841
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
7982
7842
|
timeFormat: timeFormat || false,
|
|
7983
7843
|
inputProps: { className: textFieldClasses },
|
|
@@ -9429,6 +9289,19 @@ flowchart TD
|
|
|
9429
9289
|
}
|
|
9430
9290
|
}
|
|
9431
9291
|
}
|
|
9292
|
+
const encodeUrlIfNeeded = (url) => {
|
|
9293
|
+
if (url) {
|
|
9294
|
+
try {
|
|
9295
|
+
const parsed = new URL(url);
|
|
9296
|
+
parsed.pathname = parsed.pathname.split("/").filter((part) => part !== "").map(encodeURIComponent).join("/");
|
|
9297
|
+
return parsed.toString();
|
|
9298
|
+
} catch (e) {
|
|
9299
|
+
return url;
|
|
9300
|
+
}
|
|
9301
|
+
} else {
|
|
9302
|
+
return url;
|
|
9303
|
+
}
|
|
9304
|
+
};
|
|
9432
9305
|
let MediaManager$1 = class MediaManager {
|
|
9433
9306
|
constructor(store, events) {
|
|
9434
9307
|
this.store = store;
|
|
@@ -9501,6 +9374,20 @@ flowchart TD
|
|
|
9501
9374
|
try {
|
|
9502
9375
|
this.events.dispatch({ type: "media:list:start", ...options });
|
|
9503
9376
|
const media = await this.store.list(options);
|
|
9377
|
+
media.items = media.items.map((item) => {
|
|
9378
|
+
if (item.type === "dir") {
|
|
9379
|
+
return item;
|
|
9380
|
+
}
|
|
9381
|
+
if (item.thumbnails) {
|
|
9382
|
+
for (const [size, src] of Object.entries(item.thumbnails)) {
|
|
9383
|
+
item.thumbnails[size] = encodeUrlIfNeeded(src);
|
|
9384
|
+
}
|
|
9385
|
+
}
|
|
9386
|
+
return {
|
|
9387
|
+
...item,
|
|
9388
|
+
src: encodeUrlIfNeeded(item.src)
|
|
9389
|
+
};
|
|
9390
|
+
});
|
|
9504
9391
|
this.events.dispatch({ type: "media:list:success", ...options, media });
|
|
9505
9392
|
return media;
|
|
9506
9393
|
} catch (error) {
|
|
@@ -10308,7 +10195,7 @@ flowchart TD
|
|
|
10308
10195
|
"Event Log"
|
|
10309
10196
|
));
|
|
10310
10197
|
};
|
|
10311
|
-
const version = "2.
|
|
10198
|
+
const version = "2.6.3";
|
|
10312
10199
|
const Nav = ({
|
|
10313
10200
|
isLocalMode,
|
|
10314
10201
|
className = "",
|
|
@@ -12839,15 +12726,14 @@ flowchart TD
|
|
|
12839
12726
|
fields: fieldGroup.fields
|
|
12840
12727
|
}
|
|
12841
12728
|
) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null)
|
|
12842
|
-
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12729
|
+
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-12 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
|
|
12843
12730
|
ResetForm,
|
|
12844
12731
|
{
|
|
12845
12732
|
pristine,
|
|
12846
12733
|
reset: async () => {
|
|
12847
12734
|
finalForm2.reset();
|
|
12848
12735
|
await tinaForm.reset();
|
|
12849
|
-
}
|
|
12850
|
-
style: { flexGrow: 1 }
|
|
12736
|
+
}
|
|
12851
12737
|
},
|
|
12852
12738
|
tinaForm.buttons.reset
|
|
12853
12739
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -12856,8 +12742,7 @@ flowchart TD
|
|
|
12856
12742
|
onClick: safeHandleSubmit,
|
|
12857
12743
|
disabled: !canSubmit,
|
|
12858
12744
|
busy: submitting,
|
|
12859
|
-
variant: "primary"
|
|
12860
|
-
style: { flexGrow: 3 }
|
|
12745
|
+
variant: "primary"
|
|
12861
12746
|
},
|
|
12862
12747
|
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
12863
12748
|
!submitting && tinaForm.buttons.save
|
|
@@ -14427,6 +14312,7 @@ flowchart TD
|
|
|
14427
14312
|
ToolbarButton,
|
|
14428
14313
|
{
|
|
14429
14314
|
showArrow: false,
|
|
14315
|
+
"data-testid": "rich-text-editor-overflow-menu-button",
|
|
14430
14316
|
className: "lg:min-w-[130px]",
|
|
14431
14317
|
isDropdown: true,
|
|
14432
14318
|
pressed: openState.open,
|
|
@@ -14480,7 +14366,17 @@ flowchart TD
|
|
|
14480
14366
|
};
|
|
14481
14367
|
const RawMarkdownToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14482
14368
|
const { props } = useRawMarkdownToolbarButton();
|
|
14483
|
-
return /* @__PURE__ */ React.createElement(
|
|
14369
|
+
return /* @__PURE__ */ React.createElement(
|
|
14370
|
+
ToolbarButton,
|
|
14371
|
+
{
|
|
14372
|
+
ref,
|
|
14373
|
+
tooltip: "Link",
|
|
14374
|
+
...rest,
|
|
14375
|
+
...props,
|
|
14376
|
+
"data-testid": "markdown-button"
|
|
14377
|
+
},
|
|
14378
|
+
/* @__PURE__ */ React.createElement(Icons.raw, null)
|
|
14379
|
+
);
|
|
14484
14380
|
});
|
|
14485
14381
|
function TableDropdownMenu(props) {
|
|
14486
14382
|
const tableSelected = plateCommon.useEditorSelector(
|
|
@@ -14619,7 +14515,7 @@ flowchart TD
|
|
|
14619
14515
|
key: template.name,
|
|
14620
14516
|
onMouseDown: (e) => {
|
|
14621
14517
|
e.preventDefault();
|
|
14622
|
-
|
|
14518
|
+
setOpen(false);
|
|
14623
14519
|
insertMDX(editor, template);
|
|
14624
14520
|
},
|
|
14625
14521
|
className: ""
|
|
@@ -14705,7 +14601,12 @@ flowchart TD
|
|
|
14705
14601
|
const [itemsShown, setItemsShown] = React.useState(11);
|
|
14706
14602
|
const { overrides, templates } = useToolbarContext();
|
|
14707
14603
|
const showEmbedButton = templates.length > 0;
|
|
14708
|
-
let items2 =
|
|
14604
|
+
let items2 = [];
|
|
14605
|
+
if (Array.isArray(overrides)) {
|
|
14606
|
+
items2 = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14607
|
+
} else {
|
|
14608
|
+
items2 = (overrides == null ? void 0 : overrides.toolbar) === void 0 ? Object.values(toolbarItems) : overrides.toolbar.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
|
|
14609
|
+
}
|
|
14709
14610
|
if (!showEmbedButton) {
|
|
14710
14611
|
items2 = items2.filter((item) => item.label !== toolbarItems.embed.label);
|
|
14711
14612
|
}
|
|
@@ -15033,6 +14934,9 @@ flowchart TD
|
|
|
15033
14934
|
if (typeof string !== "string") {
|
|
15034
14935
|
return false;
|
|
15035
14936
|
}
|
|
14937
|
+
if (string.startsWith("#")) {
|
|
14938
|
+
return true;
|
|
14939
|
+
}
|
|
15036
14940
|
const generalMatch = string.match(protocolAndDomainRE);
|
|
15037
14941
|
const emailLinkMatch = string.match(emailLintRE);
|
|
15038
14942
|
const localUrlMatch = string.match(localUrlRE);
|
|
@@ -15054,12 +14958,12 @@ flowchart TD
|
|
|
15054
14958
|
}
|
|
15055
14959
|
return localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol);
|
|
15056
14960
|
};
|
|
15057
|
-
const RichEditor = (
|
|
14961
|
+
const RichEditor = ({ input, tinaForm, field }) => {
|
|
15058
14962
|
var _a;
|
|
15059
14963
|
const initialValue = React.useMemo(
|
|
15060
14964
|
() => {
|
|
15061
14965
|
var _a2, _b;
|
|
15062
|
-
return ((_b = (_a2 =
|
|
14966
|
+
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: "" }] }];
|
|
15063
14967
|
},
|
|
15064
14968
|
[]
|
|
15065
14969
|
);
|
|
@@ -15087,7 +14991,7 @@ flowchart TD
|
|
|
15087
14991
|
),
|
|
15088
14992
|
[]
|
|
15089
14993
|
);
|
|
15090
|
-
const tempId = [
|
|
14994
|
+
const tempId = [tinaForm.id, input.name].join(".");
|
|
15091
14995
|
const id = React.useMemo(() => uuid() + tempId, [tempId]);
|
|
15092
14996
|
const ref = React.useRef(null);
|
|
15093
14997
|
React.useEffect(() => {
|
|
@@ -15097,13 +15001,13 @@ flowchart TD
|
|
|
15097
15001
|
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
15098
15002
|
'[role="textbox"]'
|
|
15099
15003
|
);
|
|
15100
|
-
if (
|
|
15004
|
+
if (field.experimental_focusIntent && plateElement) {
|
|
15101
15005
|
if (plateElement)
|
|
15102
15006
|
plateElement.focus();
|
|
15103
15007
|
}
|
|
15104
15008
|
}, 100);
|
|
15105
15009
|
}
|
|
15106
|
-
}, [
|
|
15010
|
+
}, [field.experimental_focusIntent, ref]);
|
|
15107
15011
|
return /* @__PURE__ */ React.createElement("div", { ref }, /* @__PURE__ */ React.createElement(
|
|
15108
15012
|
plateCommon.Plate,
|
|
15109
15013
|
{
|
|
@@ -15111,7 +15015,7 @@ flowchart TD
|
|
|
15111
15015
|
initialValue,
|
|
15112
15016
|
plugins: plugins$2,
|
|
15113
15017
|
onChange: (value) => {
|
|
15114
|
-
|
|
15018
|
+
input.onChange({
|
|
15115
15019
|
type: "root",
|
|
15116
15020
|
children: value
|
|
15117
15021
|
});
|
|
@@ -15120,12 +15024,12 @@ flowchart TD
|
|
|
15120
15024
|
/* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(
|
|
15121
15025
|
ToolbarProvider,
|
|
15122
15026
|
{
|
|
15123
|
-
tinaForm
|
|
15124
|
-
templates:
|
|
15125
|
-
overrides: (
|
|
15027
|
+
tinaForm,
|
|
15028
|
+
templates: field.templates,
|
|
15029
|
+
overrides: (field == null ? void 0 : field.toolbarOverride) ? field.toolbarOverride : field.overrides
|
|
15126
15030
|
},
|
|
15127
15031
|
/* @__PURE__ */ React.createElement(FixedToolbar, null, /* @__PURE__ */ React.createElement(FixedToolbarButtons, null)),
|
|
15128
|
-
/* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null))
|
|
15032
|
+
((_a = field == null ? void 0 : field.overrides) == null ? void 0 : _a.showFloatingToolbar) !== false ? /* @__PURE__ */ React.createElement(FloatingToolbar, null, /* @__PURE__ */ React.createElement(FloatingToolbarButtons, null)) : null
|
|
15129
15033
|
), /* @__PURE__ */ React.createElement(Editor, null))
|
|
15130
15034
|
));
|
|
15131
15035
|
};
|
|
@@ -30079,6 +29983,7 @@ mutation addPendingDocumentMutation(
|
|
|
30079
29983
|
relativePath
|
|
30080
29984
|
filename
|
|
30081
29985
|
extension
|
|
29986
|
+
hasReferences
|
|
30082
29987
|
}
|
|
30083
29988
|
}
|
|
30084
29989
|
}
|
|
@@ -30170,6 +30075,9 @@ mutation addPendingDocumentMutation(
|
|
|
30170
30075
|
document(collection:$collection, relativePath:$relativePath) {
|
|
30171
30076
|
... on Document {
|
|
30172
30077
|
_values
|
|
30078
|
+
_sys {
|
|
30079
|
+
hasReferences
|
|
30080
|
+
}
|
|
30173
30081
|
}
|
|
30174
30082
|
}
|
|
30175
30083
|
}`;
|
|
@@ -31896,6 +31804,23 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31896
31804
|
DeleteModal,
|
|
31897
31805
|
{
|
|
31898
31806
|
filename: vars.relativePath,
|
|
31807
|
+
checkRefsFunc: async () => {
|
|
31808
|
+
var _a2, _b2;
|
|
31809
|
+
try {
|
|
31810
|
+
const doc = await admin.fetchDocument(
|
|
31811
|
+
collection.name,
|
|
31812
|
+
vars.relativePath,
|
|
31813
|
+
true
|
|
31814
|
+
);
|
|
31815
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
31816
|
+
} catch (error) {
|
|
31817
|
+
cms.alerts.error(
|
|
31818
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
31819
|
+
);
|
|
31820
|
+
console.error(error);
|
|
31821
|
+
throw error;
|
|
31822
|
+
}
|
|
31823
|
+
},
|
|
31899
31824
|
deleteFunc: async () => {
|
|
31900
31825
|
try {
|
|
31901
31826
|
await admin.deleteDocument(vars);
|
|
@@ -31904,6 +31829,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31904
31829
|
);
|
|
31905
31830
|
reFetchCollection();
|
|
31906
31831
|
} catch (error) {
|
|
31832
|
+
if (error.message.indexOf("has references")) {
|
|
31833
|
+
cms.alerts.error(
|
|
31834
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31835
|
+
);
|
|
31836
|
+
return;
|
|
31837
|
+
}
|
|
31907
31838
|
cms.alerts.warn(
|
|
31908
31839
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31909
31840
|
);
|
|
@@ -31955,6 +31886,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31955
31886
|
cms.alerts.info("Document was successfully renamed");
|
|
31956
31887
|
reFetchCollection();
|
|
31957
31888
|
} catch (error) {
|
|
31889
|
+
if (error.message.indexOf("has references")) {
|
|
31890
|
+
cms.alerts.error(
|
|
31891
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31892
|
+
);
|
|
31893
|
+
return;
|
|
31894
|
+
}
|
|
31958
31895
|
cms.alerts.warn(
|
|
31959
31896
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
31960
31897
|
);
|
|
@@ -32428,8 +32365,19 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32428
32365
|
const NoDocumentsPlaceholder = () => {
|
|
32429
32366
|
return /* @__PURE__ */ React.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
32430
32367
|
};
|
|
32431
|
-
const DeleteModal = ({
|
|
32432
|
-
|
|
32368
|
+
const DeleteModal = ({
|
|
32369
|
+
close: close2,
|
|
32370
|
+
deleteFunc,
|
|
32371
|
+
checkRefsFunc,
|
|
32372
|
+
filename
|
|
32373
|
+
}) => {
|
|
32374
|
+
const [hasRefs, setHasRefs] = React.useState();
|
|
32375
|
+
React.useEffect(() => {
|
|
32376
|
+
checkRefsFunc().then((result) => {
|
|
32377
|
+
setHasRefs(result);
|
|
32378
|
+
});
|
|
32379
|
+
}, [filename, checkRefsFunc]);
|
|
32380
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
32433
32381
|
Button$1,
|
|
32434
32382
|
{
|
|
32435
32383
|
style: { flexGrow: 3 },
|
|
@@ -33161,15 +33109,24 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
33161
33109
|
}
|
|
33162
33110
|
}
|
|
33163
33111
|
if (state === "creatingPR") {
|
|
33164
|
-
|
|
33165
|
-
|
|
33166
|
-
|
|
33167
|
-
|
|
33168
|
-
|
|
33169
|
-
|
|
33170
|
-
|
|
33171
|
-
|
|
33172
|
-
|
|
33112
|
+
try {
|
|
33113
|
+
const foo = await tinaApi.createPullRequest({
|
|
33114
|
+
baseBranch,
|
|
33115
|
+
branch,
|
|
33116
|
+
title: `${branch.replace("tina/", "").replace("-", " ")} (PR from TinaCMS)`
|
|
33117
|
+
});
|
|
33118
|
+
console.log("PR created", foo);
|
|
33119
|
+
cms.alerts.success("Pull request created.");
|
|
33120
|
+
localStorage.setItem("tina.createBranchState", "done");
|
|
33121
|
+
setState("done");
|
|
33122
|
+
} catch (e) {
|
|
33123
|
+
console.error(e);
|
|
33124
|
+
cms.alerts.error("Failed to create PR");
|
|
33125
|
+
setErrorMessage(
|
|
33126
|
+
"Failed to create PR, please try again. If the problem persists please contact support."
|
|
33127
|
+
);
|
|
33128
|
+
setState("error");
|
|
33129
|
+
}
|
|
33173
33130
|
}
|
|
33174
33131
|
if (state === "done") {
|
|
33175
33132
|
window.location.href = back;
|
|
@@ -33796,6 +33753,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
33796
33753
|
exports2.useScreenPlugin = useScreenPlugin;
|
|
33797
33754
|
exports2.useTinaAuthRedirect = useTinaAuthRedirect;
|
|
33798
33755
|
exports2.wrapFieldWithError = wrapFieldWithError;
|
|
33756
|
+
exports2.wrapFieldWithNoHeader = wrapFieldWithNoHeader;
|
|
33799
33757
|
exports2.wrapFieldsWithMeta = wrapFieldsWithMeta;
|
|
33800
33758
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
33801
33759
|
});
|