sanity 5.22.0 → 5.22.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/version.js +2 -2
- package/lib/index.js +25 -22
- package/lib/index.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "5.22.
|
|
1
|
+
var version = "5.22.1-next.2+1ce6320cbd";
|
|
2
2
|
let buildVersion;
|
|
3
3
|
try {
|
|
4
4
|
buildVersion = process.env.PKG_BUILD_VERSION;
|
|
@@ -7,7 +7,7 @@ try {
|
|
|
7
7
|
try {
|
|
8
8
|
buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
|
|
9
9
|
// and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
|
|
10
|
-
"5.22.
|
|
10
|
+
"5.22.1-next.2+1ce6320cbd";
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
const SANITY_VERSION = buildVersion || `${version}-dev`;
|
package/lib/index.js
CHANGED
|
@@ -3395,7 +3395,7 @@ function useGetI18nText(input) {
|
|
|
3395
3395
|
let t0;
|
|
3396
3396
|
if ($[0] !== input) {
|
|
3397
3397
|
const items = Array.isArray(input) ? input : [input];
|
|
3398
|
-
t0 = JSON.stringify(items.flatMap(_temp2$
|
|
3398
|
+
t0 = JSON.stringify(items.flatMap(_temp2$1M).filter(isNonNullable$2).sort()), $[0] = input, $[1] = t0;
|
|
3399
3399
|
} else
|
|
3400
3400
|
t0 = $[1];
|
|
3401
3401
|
const stableNamespaces = t0;
|
|
@@ -3429,7 +3429,7 @@ function useGetI18nText(input) {
|
|
|
3429
3429
|
}) : node;
|
|
3430
3430
|
}, $[4] = t, $[5] = t2) : t2 = $[5], t2;
|
|
3431
3431
|
}
|
|
3432
|
-
function _temp2$
|
|
3432
|
+
function _temp2$1M(item) {
|
|
3433
3433
|
return item?.i18n ? Object.values(item.i18n).map(_temp$4a) : [];
|
|
3434
3434
|
}
|
|
3435
3435
|
function _temp$4a(t0) {
|
|
@@ -9665,7 +9665,7 @@ function useTimelineStore(t0) {
|
|
|
9665
9665
|
}, $[32] = t10, $[33] = t11, $[34] = t13, $[35] = t9, $[36] = t14) : t14 = $[36], t14;
|
|
9666
9666
|
}
|
|
9667
9667
|
function _temp3$O(innerController_0) {
|
|
9668
|
-
const chunks = innerController_0.timeline.mapChunks(_temp$46), lastNonDeletedChunk = chunks.filter(_temp2$
|
|
9668
|
+
const chunks = innerController_0.timeline.mapChunks(_temp$46), lastNonDeletedChunk = chunks.filter(_temp2$1L), hasMoreChunks = !innerController_0.timeline.reachedEarliestEntry;
|
|
9669
9669
|
hasMoreChunks && chunks.length > 16 && innerController_0.setLoadMore(!1);
|
|
9670
9670
|
const timelineReady = !["invalid", "loading"].includes(innerController_0.selectionState);
|
|
9671
9671
|
return {
|
|
@@ -9685,7 +9685,7 @@ function _temp3$O(innerController_0) {
|
|
|
9685
9685
|
timelineReady
|
|
9686
9686
|
};
|
|
9687
9687
|
}
|
|
9688
|
-
function _temp2$
|
|
9688
|
+
function _temp2$1L(chunk_1) {
|
|
9689
9689
|
return !["delete", "initial"].includes(chunk_1.type);
|
|
9690
9690
|
}
|
|
9691
9691
|
function _temp$46(c2) {
|
|
@@ -11692,7 +11692,7 @@ function useRelativeTime(time, t0) {
|
|
|
11692
11692
|
const $ = c(5);
|
|
11693
11693
|
let t1;
|
|
11694
11694
|
$[0] !== t0 ? (t1 = t0 === void 0 ? {} : t0, $[0] = t0, $[1] = t1) : t1 = $[1];
|
|
11695
|
-
const options = t1, [now, updateNow] = useReducer(_temp$40, null, _temp2$
|
|
11695
|
+
const options = t1, [now, updateNow] = useReducer(_temp$40, null, _temp2$1K), resolved = useFormatRelativeTime(time, options.relativeTo || now, options);
|
|
11696
11696
|
let t2, t3;
|
|
11697
11697
|
return $[2] !== resolved.refreshInterval ? (t2 = () => {
|
|
11698
11698
|
let timerId;
|
|
@@ -11706,7 +11706,7 @@ function useRelativeTime(time, t0) {
|
|
|
11706
11706
|
};
|
|
11707
11707
|
}, t3 = [resolved.refreshInterval], $[2] = resolved.refreshInterval, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), useEffect(t2, t3), resolved.timestamp;
|
|
11708
11708
|
}
|
|
11709
|
-
function _temp2$
|
|
11709
|
+
function _temp2$1K() {
|
|
11710
11710
|
return Date.now();
|
|
11711
11711
|
}
|
|
11712
11712
|
function _temp$40() {
|
|
@@ -13077,7 +13077,7 @@ const SizeDiff = styled.div.withConfig({
|
|
|
13077
13077
|
let t4;
|
|
13078
13078
|
if ($[4] !== changedFields || $[5] !== schemaType.fields) {
|
|
13079
13079
|
let t52;
|
|
13080
|
-
$[7] !== changedFields ? (t52 = (field_0) => field_0.name !== "asset" && changedFields.includes(field_0.name), $[7] = changedFields, $[8] = t52) : t52 = $[8], t4 = schemaType.fields.filter(t52).map(_temp2$
|
|
13080
|
+
$[7] !== changedFields ? (t52 = (field_0) => field_0.name !== "asset" && changedFields.includes(field_0.name), $[7] = changedFields, $[8] = t52) : t52 = $[8], t4 = schemaType.fields.filter(t52).map(_temp2$1J), $[4] = changedFields, $[5] = schemaType.fields, $[6] = t4;
|
|
13081
13081
|
} else
|
|
13082
13082
|
t4 = $[6];
|
|
13083
13083
|
const nestedFields = t4, pctDiff = getSizeDiff(prev?.size, next?.size);
|
|
@@ -13135,7 +13135,7 @@ function _temp$3Z(t0) {
|
|
|
13135
13135
|
const [name_0] = t0;
|
|
13136
13136
|
return name_0;
|
|
13137
13137
|
}
|
|
13138
|
-
function _temp2$
|
|
13138
|
+
function _temp2$1J(field_1) {
|
|
13139
13139
|
return field_1.name;
|
|
13140
13140
|
}
|
|
13141
13141
|
function hexToRgba(hex2, opacity) {
|
|
@@ -15140,7 +15140,7 @@ function GroupChange(props2) {
|
|
|
15140
15140
|
] }), $[20] = changes, $[21] = confirmRevertOpen, $[22] = group2.key, $[23] = group2.path.length, $[24] = handleRevertChanges, $[25] = hidden, $[26] = isComparingCurrent, $[27] = isPermissionsLoading, $[28] = isPortableText2, $[29] = isRevertButtonHovered, $[30] = permissions?.granted, $[31] = readOnly, $[32] = revertButtonElement, $[33] = t8) : t8 = $[33];
|
|
15141
15141
|
const content = t8;
|
|
15142
15142
|
let t9;
|
|
15143
|
-
$[34] !== group2.schemaType ? (t9 = group2.schemaType?.jsonType === "array" && group2.schemaType.of.some(_temp2$
|
|
15143
|
+
$[34] !== group2.schemaType ? (t9 = group2.schemaType?.jsonType === "array" && group2.schemaType.of.some(_temp2$1I), $[34] = group2.schemaType, $[35] = t9) : t9 = $[35];
|
|
15144
15144
|
const isPortableTextGroupArray = t9;
|
|
15145
15145
|
let t10;
|
|
15146
15146
|
return $[36] !== FieldWrapper2 || $[37] !== content || $[38] !== groupPath || $[39] !== hidden || $[40] !== isNestedInDiff || $[41] !== isPortableTextGroupArray || $[42] !== isRevertButtonHovered || $[43] !== restProps || $[44] !== titlePath ? (t10 = hidden ? null : /* @__PURE__ */ jsxs(Stack, { space: 1, ...restProps, children: [
|
|
@@ -15148,7 +15148,7 @@ function GroupChange(props2) {
|
|
|
15148
15148
|
isNestedInDiff || isPortableTextGroupArray ? content : /* @__PURE__ */ jsx(FieldWrapper2, { hasRevertHover: isRevertButtonHovered, path: groupPath, children: content })
|
|
15149
15149
|
] }), $[36] = FieldWrapper2, $[37] = content, $[38] = groupPath, $[39] = hidden, $[40] = isNestedInDiff, $[41] = isPortableTextGroupArray, $[42] = isRevertButtonHovered, $[43] = restProps, $[44] = titlePath, $[45] = t10) : t10 = $[45], t10;
|
|
15150
15150
|
}
|
|
15151
|
-
function _temp2$
|
|
15151
|
+
function _temp2$1I(ofType) {
|
|
15152
15152
|
return ofType.name === "block";
|
|
15153
15153
|
}
|
|
15154
15154
|
function _temp$3V(change) {
|
|
@@ -16051,7 +16051,7 @@ const DefaultAnnotationComponent = (props2) => {
|
|
|
16051
16051
|
textElement,
|
|
16052
16052
|
validation: validation2,
|
|
16053
16053
|
value
|
|
16054
|
-
} = props2, isLink = schemaType.name === "link", hasError = validation2.some(_temp$3R), hasWarning = validation2.some(_temp2$
|
|
16054
|
+
} = props2, isLink = schemaType.name === "link", hasError = validation2.some(_temp$3R), hasWarning = validation2.some(_temp2$1H), hasMarkers = markers.length > 0, {
|
|
16055
16055
|
t
|
|
16056
16056
|
} = useTranslation(), {
|
|
16057
16057
|
register,
|
|
@@ -16097,7 +16097,7 @@ const DefaultAnnotationComponent = (props2) => {
|
|
|
16097
16097
|
function _temp$3R(v) {
|
|
16098
16098
|
return v.level === "error";
|
|
16099
16099
|
}
|
|
16100
|
-
function _temp2$
|
|
16100
|
+
function _temp2$1H(v_0) {
|
|
16101
16101
|
return v_0.level === "warning";
|
|
16102
16102
|
}
|
|
16103
16103
|
function createStore(reportedValues, publish2) {
|
|
@@ -16183,14 +16183,14 @@ const useChangeIndicatorsReporter = (id2, value, isEqual2) => {
|
|
|
16183
16183
|
function useHoveredChange() {
|
|
16184
16184
|
const $ = c(2), reportedValues = useChangeIndicatorsReportedValues();
|
|
16185
16185
|
let t0;
|
|
16186
|
-
$[0] !== reportedValues ? (t0 = reportedValues.filter(_temp$3P).sort(_temp2$
|
|
16186
|
+
$[0] !== reportedValues ? (t0 = reportedValues.filter(_temp$3P).sort(_temp2$1G), $[0] = reportedValues, $[1] = t0) : t0 = $[1];
|
|
16187
16187
|
const hoveredEntry = t0[0];
|
|
16188
16188
|
if (hoveredEntry) {
|
|
16189
16189
|
const [, change_0] = hoveredEntry;
|
|
16190
16190
|
return change_0;
|
|
16191
16191
|
}
|
|
16192
16192
|
}
|
|
16193
|
-
function _temp2$
|
|
16193
|
+
function _temp2$1G(a, b) {
|
|
16194
16194
|
return b[1].path.length - a[1].path.length;
|
|
16195
16195
|
}
|
|
16196
16196
|
function _temp$3P(t0) {
|
|
@@ -16624,7 +16624,7 @@ function useDivergenceNavigator(t0) {
|
|
|
16624
16624
|
$[9] !== divergences ? (t102 = combineLatest({
|
|
16625
16625
|
divergences,
|
|
16626
16626
|
schemaType: schemaTypeContext.pipe(filter$1(_temp$3O)),
|
|
16627
|
-
formState: formStateContext.pipe(filter$1(_temp2$
|
|
16627
|
+
formState: formStateContext.pipe(filter$1(_temp2$1F), distinctUntilChanged$1(_temp3$N), map$1(_temp4$n))
|
|
16628
16628
|
}), $[9] = divergences, $[10] = t102) : t102 = $[10], t9 = t102;
|
|
16629
16629
|
}
|
|
16630
16630
|
const context = t9;
|
|
@@ -16687,7 +16687,7 @@ function _temp4$n(state) {
|
|
|
16687
16687
|
function _temp3$N(previous, current) {
|
|
16688
16688
|
return previous.value?._id === current.value?._id;
|
|
16689
16689
|
}
|
|
16690
|
-
function _temp2$
|
|
16690
|
+
function _temp2$1F(value_0) {
|
|
16691
16691
|
return typeof value_0 < "u";
|
|
16692
16692
|
}
|
|
16693
16693
|
function _temp$3O(value) {
|
|
@@ -17561,7 +17561,7 @@ function useCollateDivergencesContext(t0) {
|
|
|
17561
17561
|
let t14;
|
|
17562
17562
|
$[32] !== context ? (t14 = (nextContext) => context.next(nextContext), $[32] = context, $[33] = t14) : t14 = $[33], t13 = combineLatest({
|
|
17563
17563
|
upstreamHead: listenUpstreamHead.pipe(filter$1(_temp$3N)),
|
|
17564
|
-
subjectHead: listenSubjectHead.pipe(filter$1(_temp2$
|
|
17564
|
+
subjectHead: listenSubjectHead.pipe(filter$1(_temp2$1E)),
|
|
17565
17565
|
resolutions: listenResolutions.pipe(map$1(_temp3$M)),
|
|
17566
17566
|
upstreamAtFork: readUpstreamAtFork.pipe(filter$1(_temp4$m), map$1(_temp5$d), filter$1(_temp6$7))
|
|
17567
17567
|
}).pipe(tap$1(t14)), $[29] = context, $[30] = readUpstreamAtFork, $[31] = t13;
|
|
@@ -17584,7 +17584,7 @@ function _temp4$m(revision) {
|
|
|
17584
17584
|
function _temp3$M(nextResolutions) {
|
|
17585
17585
|
return nextResolutions ?? [];
|
|
17586
17586
|
}
|
|
17587
|
-
function _temp2$
|
|
17587
|
+
function _temp2$1E(document_0) {
|
|
17588
17588
|
return typeof document_0 < "u" && document_0 !== null;
|
|
17589
17589
|
}
|
|
17590
17590
|
function _temp$3N(document2) {
|
|
@@ -17803,7 +17803,7 @@ function useDivergenceController(divergence, allDivergences, contextReadOnly) {
|
|
|
17803
17803
|
let t32;
|
|
17804
17804
|
$[8] !== path ? (t32 = (state) => state?.loading ? of({
|
|
17805
17805
|
isLoading: !0
|
|
17806
|
-
}) : of(state).pipe(filter$1(_temp$3M), map$1(_temp2$
|
|
17806
|
+
}) : of(state).pipe(filter$1(_temp$3M), map$1(_temp2$1D), switchMap$1((document_0) => document_0 ? of(get$1(document_0, path)).pipe(map$1((value) => ({
|
|
17807
17807
|
value,
|
|
17808
17808
|
document: document_0
|
|
17809
17809
|
})), startWith$1(void 0)) : EMPTY$5), map$1(_temp3$L)), $[8] = path, $[9] = t32) : t32 = $[9], t2 = getDocumentAtRevision({
|
|
@@ -17895,7 +17895,7 @@ function _temp3$L(value_0) {
|
|
|
17895
17895
|
value: value_0
|
|
17896
17896
|
};
|
|
17897
17897
|
}
|
|
17898
|
-
function _temp2$
|
|
17898
|
+
function _temp2$1D(t0) {
|
|
17899
17899
|
const {
|
|
17900
17900
|
document: document2
|
|
17901
17901
|
} = t0;
|
|
@@ -18343,14 +18343,14 @@ function RootFieldActionMenuGroup(props2) {
|
|
|
18343
18343
|
open
|
|
18344
18344
|
} = props2, {
|
|
18345
18345
|
title
|
|
18346
|
-
} = useI18nText(node), t0 = open ? void 0 : title;
|
|
18346
|
+
} = useI18nText(node), handlePointerDown = _temp2$1C, t0 = open ? void 0 : title;
|
|
18347
18347
|
let t1;
|
|
18348
18348
|
$[0] !== node.title ? (t1 = {
|
|
18349
18349
|
...STATUS_BUTTON_TOOLTIP_PROPS,
|
|
18350
18350
|
content: node.title
|
|
18351
18351
|
}, $[0] = node.title, $[1] = t1) : t1 = $[1];
|
|
18352
18352
|
let t2;
|
|
18353
|
-
$[2] !== node.icon || $[3] !== t0 || $[4] !== t1 ? (t2 = /* @__PURE__ */ jsx(Button, { "aria-label": t0, "data-testid": "field-actions-trigger", icon: node.icon, mode: "bleed", tabIndex: 0, tooltipProps: t1 }), $[2] = node.icon, $[3] = t0, $[4] = t1, $[5] = t2) : t2 = $[5];
|
|
18353
|
+
$[2] !== node.icon || $[3] !== t0 || $[4] !== t1 ? (t2 = /* @__PURE__ */ jsx(Button, { "aria-label": t0, "data-testid": "field-actions-trigger", icon: node.icon, mode: "bleed", onPointerDown: handlePointerDown, tabIndex: 0, tooltipProps: t1 }), $[2] = node.icon, $[3] = t0, $[4] = t1, $[5] = t2) : t2 = $[5];
|
|
18354
18354
|
const t3 = useId();
|
|
18355
18355
|
let t4;
|
|
18356
18356
|
$[6] !== node.children ? (t4 = node.children.map((action, idx) => /* @__PURE__ */ jsx(FieldActionMenuNode, { action, isFirst: idx === 0, prevIsGroup: node.children[idx - 1]?.type === "group" }, idx)), $[6] = node.children, $[7] = t4) : t4 = $[7];
|
|
@@ -18359,6 +18359,9 @@ function RootFieldActionMenuGroup(props2) {
|
|
|
18359
18359
|
let t6;
|
|
18360
18360
|
return $[10] !== onClose || $[11] !== onOpen || $[12] !== t2 || $[13] !== t3 || $[14] !== t5 ? (t6 = /* @__PURE__ */ jsx(MenuButton, { button: t2, id: t3, menu: t5, onOpen, onClose, popover: ROOT_MENU_BUTTON_POPOVER_PROPS }), $[10] = onClose, $[11] = onOpen, $[12] = t2, $[13] = t3, $[14] = t5, $[15] = t6) : t6 = $[15], t6;
|
|
18361
18361
|
}
|
|
18362
|
+
function _temp2$1C(event) {
|
|
18363
|
+
event.preventDefault();
|
|
18364
|
+
}
|
|
18362
18365
|
function _temp$3L(node) {
|
|
18363
18366
|
return !renderAsButton(node);
|
|
18364
18367
|
}
|