sanity 6.2.1-next.1 → 6.2.1-next.2
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/lib/_chunks-es/index2.js +70 -69
- package/lib/_chunks-es/index2.js.map +1 -1
- package/lib/_chunks-es/version.js +2 -2
- package/package.json +10 -10
package/lib/_chunks-es/index2.js
CHANGED
|
@@ -46,7 +46,7 @@ import { isHotkey } from "is-hotkey-esm";
|
|
|
46
46
|
import FocusLock from "react-focus-lock";
|
|
47
47
|
import { defineEvent, createSessionId, createBatchedStore } from "@sanity/telemetry";
|
|
48
48
|
import { isDraftId as isDraftId$1, isVersionId as isVersionId$1, getVersionNameFromId } from "@sanity/id-utils";
|
|
49
|
-
import { usePortableTextEditor, PortableTextEditor, usePortableTextEditorSelection, PortableTextEditable, EditorProvider,
|
|
49
|
+
import { usePortableTextEditor, PortableTextEditor, usePortableTextEditorSelection, useEditor, useEditorSelector, PortableTextEditable, EditorProvider, defineSchema, keyGenerator as keyGenerator$1 } from "@portabletext/editor";
|
|
50
50
|
import { nanoid, customAlphabet } from "nanoid";
|
|
51
51
|
import { useTelemetry, TelemetryProvider, DeferredTelemetryProvider } from "@sanity/telemetry/react";
|
|
52
52
|
import { cleanupEfficiency, makeDiff, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL, applyPatches, parsePatch, makePatches } from "@sanity/diff-match-patch";
|
|
@@ -142,7 +142,7 @@ import last$1 from "lodash-es/last.js";
|
|
|
142
142
|
import getSlug from "speakingurl";
|
|
143
143
|
import { PortableText as PortableText$1, toPlainText as toPlainText$1 } from "@portabletext/react";
|
|
144
144
|
import { BehaviorPlugin, EventListenerPlugin } from "@portabletext/editor/plugins";
|
|
145
|
-
import { getValue as getValue$1 } from "@portabletext/editor/selectors";
|
|
145
|
+
import { getSelectionStartBlock, getSelectionEndBlock, getValue as getValue$1 } from "@portabletext/editor/selectors";
|
|
146
146
|
import { OneLinePlugin } from "@portabletext/plugin-one-line";
|
|
147
147
|
import { defineBehavior, raise, forward } from "@portabletext/editor/behaviors";
|
|
148
148
|
import { isPortableTextBlock, toPlainText } from "@portabletext/toolkit";
|
|
@@ -9869,7 +9869,7 @@ function useTimelineStore(t0) {
|
|
|
9869
9869
|
$[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t10 = () => timelineStateRef.current, $[23] = t10) : t10 = $[23];
|
|
9870
9870
|
let t11;
|
|
9871
9871
|
$[24] !== onError || $[25] !== timelineController$ ? (t11 = (callback) => {
|
|
9872
|
-
const subscription = timelineController$.pipe(map$1(_temp3$
|
|
9872
|
+
const subscription = timelineController$.pipe(map$1(_temp3$O), distinctUntilChanged$1(deepEquals), catchError$1((err_0) => (onError?.(err_0), of(INITIAL_TIMELINE_STATE))), tap$1((timelineState) => {
|
|
9873
9873
|
timelineStateRef.current = timelineState;
|
|
9874
9874
|
}), tap$1(callback)).subscribe();
|
|
9875
9875
|
return () => subscription.unsubscribe();
|
|
@@ -9883,7 +9883,7 @@ function useTimelineStore(t0) {
|
|
|
9883
9883
|
subscribe: t11
|
|
9884
9884
|
}, $[27] = t11, $[28] = t7, $[29] = t8, $[30] = t9, $[31] = t12) : t12 = $[31], t12;
|
|
9885
9885
|
}
|
|
9886
|
-
function _temp3$
|
|
9886
|
+
function _temp3$O(innerController_0) {
|
|
9887
9887
|
const chunks = innerController_0.timeline.mapChunks(_temp$3L), lastNonDeletedChunk = chunks.filter(_temp2$1D), hasMoreChunks = !innerController_0.timeline.reachedEarliestEntry;
|
|
9888
9888
|
hasMoreChunks && chunks.length > 16 && innerController_0.setLoadMore(!1);
|
|
9889
9889
|
const timelineReady = !["invalid", "loading"].includes(innerController_0.selectionState);
|
|
@@ -16974,7 +16974,7 @@ function useDivergenceNavigator(t0) {
|
|
|
16974
16974
|
$[9] !== divergences ? (t102 = combineLatest({
|
|
16975
16975
|
divergences,
|
|
16976
16976
|
schemaType: schemaTypeContext.pipe(filter$1(_temp$3s)),
|
|
16977
|
-
formState: formStateContext.pipe(filter$1(_temp2$1x), distinctUntilChanged$1(_temp3$
|
|
16977
|
+
formState: formStateContext.pipe(filter$1(_temp2$1x), distinctUntilChanged$1(_temp3$N), map$1(_temp4$k))
|
|
16978
16978
|
}), $[9] = divergences, $[10] = t102) : t102 = $[10], t9 = t102;
|
|
16979
16979
|
}
|
|
16980
16980
|
const context = t9;
|
|
@@ -17034,7 +17034,7 @@ function useDivergenceNavigator(t0) {
|
|
|
17034
17034
|
function _temp4$k(state) {
|
|
17035
17035
|
return state && pick(state, ["groups", "_allMembers"]);
|
|
17036
17036
|
}
|
|
17037
|
-
function _temp3$
|
|
17037
|
+
function _temp3$N(previous, current) {
|
|
17038
17038
|
return previous.value?._id === current.value?._id;
|
|
17039
17039
|
}
|
|
17040
17040
|
function _temp2$1x(value_0) {
|
|
@@ -17907,7 +17907,7 @@ function useCollateDivergencesContext(t0) {
|
|
|
17907
17907
|
let t14;
|
|
17908
17908
|
$[32] !== context ? (t14 = (nextContext) => context.next(nextContext), $[32] = context, $[33] = t14) : t14 = $[33], t13 = combineLatest({
|
|
17909
17909
|
upstreamHead: listenUpstreamHead.pipe(filter$1(_temp2$1w)),
|
|
17910
|
-
subjectHead: listenSubjectHead.pipe(filter$1(_temp3$
|
|
17910
|
+
subjectHead: listenSubjectHead.pipe(filter$1(_temp3$M)),
|
|
17911
17911
|
resolutions: listenResolutions.pipe(map$1(_temp4$j)),
|
|
17912
17912
|
upstreamAtFork: readUpstreamAtFork.pipe(filter$1(_temp5$b), map$1(_temp6$7), filter$1(_temp7$4))
|
|
17913
17913
|
}).pipe(tap$1(t14)), $[29] = context, $[30] = readUpstreamAtFork, $[31] = t13;
|
|
@@ -17930,7 +17930,7 @@ function _temp5$b(revision) {
|
|
|
17930
17930
|
function _temp4$j(nextResolutions) {
|
|
17931
17931
|
return nextResolutions ?? [];
|
|
17932
17932
|
}
|
|
17933
|
-
function _temp3$
|
|
17933
|
+
function _temp3$M(document_0) {
|
|
17934
17934
|
return typeof document_0 < "u" && document_0 !== null;
|
|
17935
17935
|
}
|
|
17936
17936
|
function _temp2$1w(document2) {
|
|
@@ -18158,7 +18158,7 @@ function useDivergenceController(divergence, allDivergences, contextReadOnly) {
|
|
|
18158
18158
|
}) : of(state).pipe(filter$1(_temp$3q), map$1(_temp2$1v), switchMap$1((document_0) => document_0 ? of(get$1(document_0, path)).pipe(map$1((value) => ({
|
|
18159
18159
|
value,
|
|
18160
18160
|
document: document_0
|
|
18161
|
-
})), startWith$1(void 0)) : EMPTY$5), map$1(_temp3$
|
|
18161
|
+
})), startWith$1(void 0)) : EMPTY$5), map$1(_temp3$L)), $[10] = path, $[11] = t32) : t32 = $[11], t2 = getDocumentAtRevision({
|
|
18162
18162
|
client,
|
|
18163
18163
|
documentId: upstreamId,
|
|
18164
18164
|
revisionId: upstreamRevisionId
|
|
@@ -18245,7 +18245,7 @@ function _temp5$a(value_2) {
|
|
|
18245
18245
|
function _temp4$i(document_1) {
|
|
18246
18246
|
return document_1 !== null;
|
|
18247
18247
|
}
|
|
18248
|
-
function _temp3$
|
|
18248
|
+
function _temp3$L(value_0) {
|
|
18249
18249
|
return {
|
|
18250
18250
|
isLoading: !1,
|
|
18251
18251
|
value: value_0
|
|
@@ -20590,13 +20590,13 @@ function HumanizedList(props2) {
|
|
|
20590
20590
|
let T0, t1;
|
|
20591
20591
|
if ($[1] !== listFormat || $[2] !== props2.values) {
|
|
20592
20592
|
const parts = listFormat.formatToParts(props2.values);
|
|
20593
|
-
T0 = Fragment, t1 = parts.map(_temp3$
|
|
20593
|
+
T0 = Fragment, t1 = parts.map(_temp3$K), $[1] = listFormat, $[2] = props2.values, $[3] = T0, $[4] = t1;
|
|
20594
20594
|
} else
|
|
20595
20595
|
T0 = $[3], t1 = $[4];
|
|
20596
20596
|
let t2;
|
|
20597
20597
|
return $[5] !== T0 || $[6] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { children: t1 }), $[5] = T0, $[6] = t1, $[7] = t2) : t2 = $[7], t2;
|
|
20598
20598
|
}
|
|
20599
|
-
function _temp3$
|
|
20599
|
+
function _temp3$K(segment) {
|
|
20600
20600
|
return segment.type === "element" ? /* @__PURE__ */ jsx("code", { children: segment.value }, segment.value) : segment.value;
|
|
20601
20601
|
}
|
|
20602
20602
|
const HeaderButton = styled.button.withConfig({
|
|
@@ -21270,7 +21270,7 @@ function ReferenceInput(props2) {
|
|
|
21270
21270
|
!hadFocusAtRef && hasFocusAtRef && elementProps.ref.current?.focus();
|
|
21271
21271
|
}, $[47] = elementProps, $[48] = t13) : t13 = $[48], useDidUpdate(focusPath?.[0] === "_ref", t13);
|
|
21272
21272
|
let t14;
|
|
21273
|
-
$[49] !== searchState.hits ? (t14 = searchState.hits.map(_temp3$
|
|
21273
|
+
$[49] !== searchState.hits ? (t14 = searchState.hits.map(_temp3$J), $[49] = searchState.hits, $[50] = t14) : t14 = $[50];
|
|
21274
21274
|
const hits_0 = t14, isEditing = focusPath.length === 1 && focusPath[0] === "_ref", {
|
|
21275
21275
|
menuRef,
|
|
21276
21276
|
menuButtonRef,
|
|
@@ -21315,7 +21315,7 @@ function ReferenceInput(props2) {
|
|
|
21315
21315
|
let t30;
|
|
21316
21316
|
return $[103] !== props2.elementProps.style || $[104] !== t29 ? (t30 = /* @__PURE__ */ jsx("div", { style: t17, children: t29 }), $[103] = props2.elementProps.style, $[104] = t29, $[105] = t30) : t30 = $[105], t30;
|
|
21317
21317
|
}
|
|
21318
|
-
function _temp3$
|
|
21318
|
+
function _temp3$J(hit_0) {
|
|
21319
21319
|
return {
|
|
21320
21320
|
value: hit_0.id,
|
|
21321
21321
|
hit: hit_0
|
|
@@ -21487,7 +21487,7 @@ function StudioReferenceInput(props2) {
|
|
|
21487
21487
|
schemaType,
|
|
21488
21488
|
document: documentValue,
|
|
21489
21489
|
valuePath: path
|
|
21490
|
-
}).map(_temp3$
|
|
21490
|
+
}).map(_temp3$I);
|
|
21491
21491
|
t92 = (initialValueTemplateItems || []).filter((i) => allowedTypes.includes(i.template?.schemaType ?? "")).map(_temp4$h).filter(isNonNullable$2), $[35] = documentValue, $[36] = initialValueTemplateItems, $[37] = path, $[38] = schemaType, $[39] = t92;
|
|
21492
21492
|
} else
|
|
21493
21493
|
t92 = $[39];
|
|
@@ -21517,7 +21517,7 @@ function _temp4$h(item) {
|
|
|
21517
21517
|
}
|
|
21518
21518
|
} : void 0;
|
|
21519
21519
|
}
|
|
21520
|
-
function _temp3$
|
|
21520
|
+
function _temp3$I(opt) {
|
|
21521
21521
|
return opt.type;
|
|
21522
21522
|
}
|
|
21523
21523
|
function _temp2$1o(t0) {
|
|
@@ -23137,7 +23137,7 @@ function ArrayOfObjectsField(props2) {
|
|
|
23137
23137
|
break bb183;
|
|
23138
23138
|
}
|
|
23139
23139
|
case "error": {
|
|
23140
|
-
event_4.files.forEach(_temp3$
|
|
23140
|
+
event_4.files.forEach(_temp3$H), toast.push({
|
|
23141
23141
|
status: "error",
|
|
23142
23142
|
description: t("asset-sources.common.uploader.upload-failed.description"),
|
|
23143
23143
|
title: t("asset-sources.common.uploader.upload-failed.title")
|
|
@@ -23227,7 +23227,7 @@ function ArrayOfObjectsField(props2) {
|
|
|
23227
23227
|
assetSourceUploadComponents
|
|
23228
23228
|
] }), $[141] = assetSourceUploadComponents, $[142] = handleChange, $[143] = onFieldGroupSelect, $[144] = onPathBlur, $[145] = onPathFocus, $[146] = onPathOpen, $[147] = onSetFieldSetCollapsed, $[148] = onSetPathCollapsed, $[149] = t33, $[150] = t34) : t34 = $[150], t34;
|
|
23229
23229
|
}
|
|
23230
|
-
function _temp3$
|
|
23230
|
+
function _temp3$H(_file) {
|
|
23231
23231
|
console.error(_file.error);
|
|
23232
23232
|
}
|
|
23233
23233
|
function _temp2$1n(item) {
|
|
@@ -23765,7 +23765,7 @@ function PrimitiveField(props2) {
|
|
|
23765
23765
|
}
|
|
23766
23766
|
const validation2 = t14;
|
|
23767
23767
|
let t15;
|
|
23768
|
-
$[44] !== validation2 ? (t15 = validation2.filter(_temp2$1l).map(_temp3$
|
|
23768
|
+
$[44] !== validation2 ? (t15 = validation2.filter(_temp2$1l).map(_temp3$G).join(`
|
|
23769
23769
|
`) || void 0, $[44] = validation2, $[45] = t15) : t15 = $[45];
|
|
23770
23770
|
const validationError = t15, t16 = member.field.value, t17 = member.field.schemaType, t18 = member.field.displayInlineChanges ?? !1;
|
|
23771
23771
|
let t19;
|
|
@@ -23794,7 +23794,7 @@ function PrimitiveField(props2) {
|
|
|
23794
23794
|
let t24;
|
|
23795
23795
|
return $[67] !== fieldActions || $[68] !== member.field.changed || $[69] !== member.field.id || $[70] !== member.field.level || $[71] !== member.field.path || $[72] !== member.field.presence || $[73] !== member.field.schemaType.description || $[74] !== member.field.schemaType.title || $[75] !== member.index || $[76] !== member.name || $[77] !== renderField || $[78] !== t20 || $[79] !== t21 || $[80] !== t22 || $[81] !== t23 || $[82] !== validation2 ? (t24 = /* @__PURE__ */ jsx(RenderField, { actions: fieldActions, changed: member.field.changed, description: member.field.schemaType.description, index: member.index, inputId: member.field.id, inputProps: t20, level: member.field.level, name: member.name, path: member.field.path, presence: member.field.presence, schemaType: t21, title: member.field.schemaType.title, validation: validation2, value: t22, render: renderField, children: t23 }), $[67] = fieldActions, $[68] = member.field.changed, $[69] = member.field.id, $[70] = member.field.level, $[71] = member.field.path, $[72] = member.field.presence, $[73] = member.field.schemaType.description, $[74] = member.field.schemaType.title, $[75] = member.index, $[76] = member.name, $[77] = renderField, $[78] = t20, $[79] = t21, $[80] = t22, $[81] = t23, $[82] = validation2, $[83] = t24) : t24 = $[83], t24;
|
|
23796
23796
|
}
|
|
23797
|
-
function _temp3$
|
|
23797
|
+
function _temp3$G(item_1) {
|
|
23798
23798
|
return item_1.message;
|
|
23799
23799
|
}
|
|
23800
23800
|
function _temp2$1l(item_0) {
|
|
@@ -24079,7 +24079,7 @@ const InvalidValueInput = forwardRef((props2, ref) => {
|
|
|
24079
24079
|
let t11;
|
|
24080
24080
|
$[32] !== t || $[33] !== validTypes.length ? (t11 = validTypes.length !== 1 && /* @__PURE__ */ jsx(Text$1, { as: "p", muted: !0, size: 1, children: t("inputs.invalid-value.details.multi-type-description") }), $[32] = t, $[33] = validTypes.length, $[34] = t11) : t11 = $[34];
|
|
24081
24081
|
let t12;
|
|
24082
|
-
$[35] !== validTypes ? (t12 = validTypes.length !== 1 && /* @__PURE__ */ jsx(Stack, { as: "ul", space: 2, children: validTypes.map(_temp3$
|
|
24082
|
+
$[35] !== validTypes ? (t12 = validTypes.length !== 1 && /* @__PURE__ */ jsx(Stack, { as: "ul", space: 2, children: validTypes.map(_temp3$F) }), $[35] = validTypes, $[36] = t12) : t12 = $[36];
|
|
24083
24083
|
let t13;
|
|
24084
24084
|
$[37] !== actualType ? (t13 = {
|
|
24085
24085
|
actualType
|
|
@@ -24140,7 +24140,7 @@ function _temp2$1k() {
|
|
|
24140
24140
|
focus: _temp$34
|
|
24141
24141
|
};
|
|
24142
24142
|
}
|
|
24143
|
-
function _temp3$
|
|
24143
|
+
function _temp3$F(validType) {
|
|
24144
24144
|
return /* @__PURE__ */ jsx(Text$1, { as: "li", children: /* @__PURE__ */ jsx("code", { children: validType }) }, validType);
|
|
24145
24145
|
}
|
|
24146
24146
|
const FormCell = styled.div.withConfig({
|
|
@@ -24393,7 +24393,7 @@ function FormFieldValidationStatus(props2) {
|
|
|
24393
24393
|
let t1;
|
|
24394
24394
|
$[0] !== showSummary || $[1] !== validation2 ? (t1 = showSummary && /* @__PURE__ */ jsx(FormFieldValidationSummary, { validation: validation2 }), $[0] = showSummary, $[1] = validation2, $[2] = t1) : t1 = $[2];
|
|
24395
24395
|
let t2;
|
|
24396
|
-
$[3] !== showSummary || $[4] !== validation2 ? (t2 = !showSummary && /* @__PURE__ */ jsx(Fragment$1, { children: validation2.map(_temp3$
|
|
24396
|
+
$[3] !== showSummary || $[4] !== validation2 ? (t2 = !showSummary && /* @__PURE__ */ jsx(Fragment$1, { children: validation2.map(_temp3$E) }), $[3] = showSummary, $[4] = validation2, $[5] = t2) : t2 = $[5];
|
|
24397
24397
|
let t3;
|
|
24398
24398
|
$[6] !== t1 || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsxs(StyledStack, { space: 3, children: [
|
|
24399
24399
|
t1,
|
|
@@ -24408,7 +24408,7 @@ function FormFieldValidationStatus(props2) {
|
|
|
24408
24408
|
let t7;
|
|
24409
24409
|
return $[15] !== placement || $[16] !== t3 || $[17] !== t6 ? (t7 = /* @__PURE__ */ jsx(Tooltip, { content: t3, portal: !0, placement, fallbackPlacements: t4, children: t6 }), $[15] = placement, $[16] = t3, $[17] = t6, $[18] = t7) : t7 = $[18], t7;
|
|
24410
24410
|
}
|
|
24411
|
-
function _temp3$
|
|
24411
|
+
function _temp3$E(item, itemIndex) {
|
|
24412
24412
|
return /* @__PURE__ */ jsx(FormFieldValidationStatusItem, { validation: item }, itemIndex);
|
|
24413
24413
|
}
|
|
24414
24414
|
function _temp2$1j(v_0) {
|
|
@@ -26530,7 +26530,7 @@ function fileTarget(Component2) {
|
|
|
26530
26530
|
}, t6 = [pasteTarget, handlePaste], $[16] = handlePaste, $[17] = pasteTarget, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), useEffect(t5, t6);
|
|
26531
26531
|
let t7;
|
|
26532
26532
|
$[20] !== emitFiles || $[21] !== onFiles || $[22] !== onFilesOut ? (t7 = (event_2) => {
|
|
26533
|
-
if (enteredElements.current = [], Array.from(event_2.dataTransfer.items).map(_temp2$1g).some(_temp3$
|
|
26533
|
+
if (enteredElements.current = [], Array.from(event_2.dataTransfer.items).map(_temp2$1g).some(_temp3$D))
|
|
26534
26534
|
return;
|
|
26535
26535
|
event_2.preventDefault(), event_2.stopPropagation();
|
|
26536
26536
|
const dataTransfer = event_2.nativeEvent.dataTransfer;
|
|
@@ -26602,7 +26602,7 @@ function _temp2$1g(item) {
|
|
|
26602
26602
|
kind: item.kind
|
|
26603
26603
|
};
|
|
26604
26604
|
}
|
|
26605
|
-
function _temp3$
|
|
26605
|
+
function _temp3$D(item_0) {
|
|
26606
26606
|
return isPortableTextItem(item_0);
|
|
26607
26607
|
}
|
|
26608
26608
|
function _temp4$f(item_1) {
|
|
@@ -26733,7 +26733,7 @@ function uploadTarget$1(Component2) {
|
|
|
26733
26733
|
title: t("inputs.array.error.cannot-upload-unable-to-convert", {
|
|
26734
26734
|
count: rejected.length
|
|
26735
26735
|
}),
|
|
26736
|
-
description: rejected.map(_temp3$
|
|
26736
|
+
description: rejected.map(_temp3$C)
|
|
26737
26737
|
});
|
|
26738
26738
|
}, $[20] = pushToast, $[21] = t, $[22] = t6) : t6 = $[22];
|
|
26739
26739
|
const alertRejectedFiles = t6;
|
|
@@ -26916,7 +26916,7 @@ function _temp$2U(type) {
|
|
|
26916
26916
|
function _temp2$1f(type_0) {
|
|
26917
26917
|
return type_0.options?.disableNew === !0;
|
|
26918
26918
|
}
|
|
26919
|
-
function _temp3$
|
|
26919
|
+
function _temp3$C(task, i) {
|
|
26920
26920
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, padding: 2, children: [
|
|
26921
26921
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { weight: "medium", children: task.file.name }) }),
|
|
26922
26922
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text$1, { size: 1, children: [
|
|
@@ -27951,7 +27951,7 @@ function GridItem(props2) {
|
|
|
27951
27951
|
readOnly,
|
|
27952
27952
|
hasErrors,
|
|
27953
27953
|
hasWarnings
|
|
27954
|
-
}), handleMouseDown = _temp3$
|
|
27954
|
+
}), handleMouseDown = _temp3$B;
|
|
27955
27955
|
let t18;
|
|
27956
27956
|
$[53] !== onOpen ? (t18 = (event_0) => {
|
|
27957
27957
|
event_0.stopPropagation(), onOpen();
|
|
@@ -27997,7 +27997,7 @@ function GridItem(props2) {
|
|
|
27997
27997
|
t23 = $[92];
|
|
27998
27998
|
return t23;
|
|
27999
27999
|
}
|
|
28000
|
-
function _temp3$
|
|
28000
|
+
function _temp3$B(event) {
|
|
28001
28001
|
event.preventDefault();
|
|
28002
28002
|
}
|
|
28003
28003
|
function _temp2$1d(v_0) {
|
|
@@ -28032,7 +28032,7 @@ function GridArrayInput(props2) {
|
|
|
28032
28032
|
t
|
|
28033
28033
|
} = useTranslation(), errorTone = validation2?.some(_temp$2P) ? "critical" : void 0, sortable = schemaType.options?.sortable !== !1, renderItem2 = _temp2$1c;
|
|
28034
28034
|
let t2;
|
|
28035
|
-
$[0] !== members ? (t2 = members.map(_temp3$
|
|
28035
|
+
$[0] !== members ? (t2 = members.map(_temp3$A), $[0] = members, $[1] = t2) : t2 = $[1];
|
|
28036
28036
|
const memberKeys = t2;
|
|
28037
28037
|
let t3;
|
|
28038
28038
|
$[2] !== errorTone || $[3] !== members.length || $[4] !== schemaType.placeholder || $[5] !== t ? (t3 = members?.length === 0 && /* @__PURE__ */ jsx(Card, { padding: 3, border: !0, radius: 2, tone: errorTone, children: /* @__PURE__ */ jsx(Text$1, { align: "center", muted: !0, size: 1, children: schemaType.placeholder || /* @__PURE__ */ jsx(Fragment$1, { children: t("inputs.array.no-items-label") }) }) }), $[2] = errorTone, $[3] = members.length, $[4] = schemaType.placeholder, $[5] = t, $[6] = t3) : t3 = $[6];
|
|
@@ -28058,7 +28058,7 @@ function GridArrayInput(props2) {
|
|
|
28058
28058
|
let t9;
|
|
28059
28059
|
return $[42] !== members.length || $[43] !== schemaType || $[44] !== t8 ? (t9 = /* @__PURE__ */ jsx(ArrayValidationProvider, { schemaType, itemCount: members.length, children: t8 }), $[42] = members.length, $[43] = schemaType, $[44] = t8, $[45] = t9) : t9 = $[45], t9;
|
|
28060
28060
|
}
|
|
28061
|
-
function _temp3$
|
|
28061
|
+
function _temp3$A(member) {
|
|
28062
28062
|
return member.key;
|
|
28063
28063
|
}
|
|
28064
28064
|
function _temp2$1c(itemProps) {
|
|
@@ -28739,7 +28739,7 @@ function uploadTarget(Component2) {
|
|
|
28739
28739
|
title: t("inputs.array.error.cannot-upload-unable-to-convert", {
|
|
28740
28740
|
count: rejected.length
|
|
28741
28741
|
}),
|
|
28742
|
-
description: rejected.map(_temp3$
|
|
28742
|
+
description: rejected.map(_temp3$z)
|
|
28743
28743
|
}), ready.forEach((task_2) => {
|
|
28744
28744
|
uploadFile2(task_2.file, sortBy(task_2.uploaderCandidates, _temp4$d)[0]);
|
|
28745
28745
|
});
|
|
@@ -28806,7 +28806,7 @@ function _temp$2J(task) {
|
|
|
28806
28806
|
function _temp2$1a(task_0) {
|
|
28807
28807
|
return task_0.uploaderCandidates.length === 0;
|
|
28808
28808
|
}
|
|
28809
|
-
function _temp3$
|
|
28809
|
+
function _temp3$z(task_1, i) {
|
|
28810
28810
|
return /* @__PURE__ */ jsxs(Flex, { gap: 2, padding: 2, children: [
|
|
28811
28811
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { weight: "medium", children: task_1.file.name }) }),
|
|
28812
28812
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text$1, { size: 1, children: [
|
|
@@ -32932,34 +32932,31 @@ const CollapseMenuMemo$1 = memo(CollapseMenu), MENU_POPOVER_PROPS$3 = {
|
|
|
32932
32932
|
constrainSize: !0,
|
|
32933
32933
|
portal: !0
|
|
32934
32934
|
}, ActionMenu = memo(function(props2) {
|
|
32935
|
-
const $ = c(
|
|
32935
|
+
const $ = c(31), {
|
|
32936
32936
|
disabled: disabledProp,
|
|
32937
32937
|
groups,
|
|
32938
32938
|
isFullscreen,
|
|
32939
32939
|
collapsed
|
|
32940
|
-
} = props2, focusBlock = useFocusBlock(),
|
|
32940
|
+
} = props2, focusBlock = useFocusBlock(), legacyEditor = usePortableTextEditor(), editor2 = useEditor(), schemaTypes = usePortableTextMemberSchemaTypes(), {
|
|
32941
32941
|
t
|
|
32942
|
-
} = useTranslation();
|
|
32942
|
+
} = useTranslation(), isSelectingMultipleBlocks = useEditorSelector(editor2, _temp$2t), isVoidBlock = focusBlock?._type !== schemaTypes.block.name, isEmptyTextBlock = !isVoidBlock && Array.isArray(focusBlock.children) && focusBlock.children.length === 1 && focusBlock?.children[0].text === "", disabled = disabledProp || isVoidBlock;
|
|
32943
32943
|
let t0;
|
|
32944
|
-
$[0] !==
|
|
32945
|
-
const
|
|
32944
|
+
$[0] !== groups ? (t0 = groups.reduce(_temp3$y, []), $[0] = groups, $[1] = t0) : t0 = $[1];
|
|
32945
|
+
const actions = t0;
|
|
32946
32946
|
let t1;
|
|
32947
|
-
$[2] !==
|
|
32948
|
-
const actions = t1;
|
|
32949
|
-
let t2;
|
|
32950
|
-
$[4] !== actions ? (t2 = {
|
|
32947
|
+
$[2] !== actions ? (t1 = {
|
|
32951
32948
|
actions
|
|
32952
|
-
}, $[
|
|
32953
|
-
const activeKeys = useActiveActionKeys(
|
|
32949
|
+
}, $[2] = actions, $[3] = t1) : t1 = $[3];
|
|
32950
|
+
const activeKeys = useActiveActionKeys(t1);
|
|
32951
|
+
let t2;
|
|
32952
|
+
$[4] !== legacyEditor ? (t2 = () => {
|
|
32953
|
+
PortableTextEditor.focus(legacyEditor);
|
|
32954
|
+
}, $[4] = legacyEditor, $[5] = t2) : t2 = $[5];
|
|
32955
|
+
const handleMenuClose = t2, tooltipPlacement = isFullscreen ? "bottom" : "top";
|
|
32954
32956
|
let t3;
|
|
32955
|
-
$[6] !==
|
|
32956
|
-
|
|
32957
|
-
|
|
32958
|
-
const handleMenuClose = t3, tooltipPlacement = isFullscreen ? "bottom" : "top";
|
|
32959
|
-
let t4;
|
|
32960
|
-
if ($[8] !== actions || $[9] !== activeKeys || $[10] !== disabled || $[11] !== isEmptyTextBlock || $[12] !== isSelectingMultipleBlocks || $[13] !== t || $[14] !== tooltipPlacement) {
|
|
32961
|
-
let t52;
|
|
32962
|
-
$[16] !== activeKeys || $[17] !== disabled || $[18] !== isEmptyTextBlock || $[19] !== isSelectingMultipleBlocks || $[20] !== t || $[21] !== tooltipPlacement ? (t52 = (action_0) => {
|
|
32957
|
+
if ($[6] !== actions || $[7] !== activeKeys || $[8] !== disabled || $[9] !== isEmptyTextBlock || $[10] !== isSelectingMultipleBlocks || $[11] !== t || $[12] !== tooltipPlacement) {
|
|
32958
|
+
let t42;
|
|
32959
|
+
$[14] !== activeKeys || $[15] !== disabled || $[16] !== isEmptyTextBlock || $[17] !== isSelectingMultipleBlocks || $[18] !== t || $[19] !== tooltipPlacement ? (t42 = (action_0) => {
|
|
32963
32960
|
const annotationDisabled = action_0.type === "annotation" && (isEmptyTextBlock || isSelectingMultipleBlocks), annotationDisabledText = isEmptyTextBlock ? t("user-menu.action.portable-text.annotation-disabled_empty-block", {
|
|
32964
32961
|
name: action_0.title || action_0.key
|
|
32965
32962
|
}) : t("user-menu.action.portable-text.annotation-disabled_multiple-blocks", {
|
|
@@ -32972,31 +32969,35 @@ const CollapseMenuMemo$1 = memo(CollapseMenu), MENU_POPOVER_PROPS$3 = {
|
|
|
32972
32969
|
placement: tooltipPlacement,
|
|
32973
32970
|
portal: "default"
|
|
32974
32971
|
} }, action_0.key);
|
|
32975
|
-
}, $[
|
|
32972
|
+
}, $[14] = activeKeys, $[15] = disabled, $[16] = isEmptyTextBlock, $[17] = isSelectingMultipleBlocks, $[18] = t, $[19] = tooltipPlacement, $[20] = t42) : t42 = $[20], t3 = actions.map(t42), $[6] = actions, $[7] = activeKeys, $[8] = disabled, $[9] = isEmptyTextBlock, $[10] = isSelectingMultipleBlocks, $[11] = t, $[12] = tooltipPlacement, $[13] = t3;
|
|
32976
32973
|
} else
|
|
32977
|
-
|
|
32978
|
-
const children =
|
|
32979
|
-
let
|
|
32980
|
-
$[
|
|
32974
|
+
t3 = $[13];
|
|
32975
|
+
const children = t3;
|
|
32976
|
+
let t4;
|
|
32977
|
+
$[21] !== tooltipPlacement ? (t4 = {
|
|
32981
32978
|
placement: tooltipPlacement
|
|
32982
|
-
}, $[
|
|
32983
|
-
let
|
|
32984
|
-
$[
|
|
32985
|
-
button: /* @__PURE__ */ jsx(ContextMenuButton, { "data-testid": "action-menu-button", disabled, tooltipProps:
|
|
32979
|
+
}, $[21] = tooltipPlacement, $[22] = t4) : t4 = $[22];
|
|
32980
|
+
let t5;
|
|
32981
|
+
$[23] !== disabled || $[24] !== t4 ? (t5 = {
|
|
32982
|
+
button: /* @__PURE__ */ jsx(ContextMenuButton, { "data-testid": "action-menu-button", disabled, tooltipProps: t4 }),
|
|
32986
32983
|
popover: MENU_POPOVER_PROPS$3
|
|
32987
|
-
}, $[
|
|
32988
|
-
const menuButtonProps =
|
|
32989
|
-
let
|
|
32990
|
-
return $[
|
|
32984
|
+
}, $[23] = disabled, $[24] = t4, $[25] = t5) : t5 = $[25];
|
|
32985
|
+
const menuButtonProps = t5;
|
|
32986
|
+
let t6;
|
|
32987
|
+
return $[26] !== children || $[27] !== collapsed || $[28] !== handleMenuClose || $[29] !== menuButtonProps ? (t6 = /* @__PURE__ */ jsx(CollapseMenuMemo$1, { "data-testid": "action-menu-auto-collapse-menu", collapsed, disableRestoreFocusOnClose: !0, gap: 1, menuButtonProps, onMenuClose: handleMenuClose, children }), $[26] = children, $[27] = collapsed, $[28] = handleMenuClose, $[29] = menuButtonProps, $[30] = t6) : t6 = $[30], t6;
|
|
32991
32988
|
});
|
|
32992
|
-
function _temp$2t(
|
|
32989
|
+
function _temp$2t(snapshot2) {
|
|
32990
|
+
const startBlock = getSelectionStartBlock(snapshot2), endBlock = getSelectionEndBlock(snapshot2);
|
|
32991
|
+
return !!startBlock && !!endBlock && !isEqual$2(startBlock.path, endBlock.path);
|
|
32992
|
+
}
|
|
32993
|
+
function _temp2$15(action, actionIndex) {
|
|
32993
32994
|
return actionIndex === 0 ? {
|
|
32994
32995
|
...action,
|
|
32995
32996
|
firstInGroup: !0
|
|
32996
32997
|
} : action;
|
|
32997
32998
|
}
|
|
32998
|
-
function
|
|
32999
|
-
return acc.concat(group2.actions.map(
|
|
32999
|
+
function _temp3$y(acc, group2) {
|
|
33000
|
+
return acc.concat(group2.actions.map(_temp2$15));
|
|
33000
33001
|
}
|
|
33001
33002
|
const MenuButtonMemo = memo(MenuButton), StyledMenuItem = styled(MenuItem$1).withConfig({
|
|
33002
33003
|
displayName: "StyledMenuItem",
|