sanity 6.1.0 → 6.2.0-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-dts/ActiveWorkspaceMatcherContext.d.ts +53 -50
- package/lib/_chunks-es/version.js +2 -2
- package/lib/_singletons.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +262 -185
- package/lib/index.js.map +1 -1
- package/package.json +11 -11
package/lib/index.js
CHANGED
|
@@ -147,6 +147,7 @@ import last$1 from "lodash-es/last.js";
|
|
|
147
147
|
import getSlug from "speakingurl";
|
|
148
148
|
import { PortableText as PortableText$1, toPlainText as toPlainText$1 } from "@portabletext/react";
|
|
149
149
|
import { BehaviorPlugin, EventListenerPlugin } from "@portabletext/editor/plugins";
|
|
150
|
+
import { getValue as getValue$1 } from "@portabletext/editor/selectors";
|
|
150
151
|
import { OneLinePlugin } from "@portabletext/plugin-one-line";
|
|
151
152
|
import { defineBehavior, raise, forward } from "@portabletext/editor/behaviors";
|
|
152
153
|
import { isPortableTextBlock, toPlainText } from "@portabletext/toolkit";
|
|
@@ -45514,7 +45515,7 @@ const MAX_DOCUMENT_ID_CHUNK_SIZE = 11164, INCLUDE_FIELDS_QUERY = ["_id", "_rev",
|
|
|
45514
45515
|
title: "Invalid preview config",
|
|
45515
45516
|
subtitle: "Check the error log in the console",
|
|
45516
45517
|
media: /* @__PURE__ */ jsx(WarningOutlineIcon, {})
|
|
45517
|
-
};
|
|
45518
|
+
}, DOCUMENT_SYSTEM_FIELD = "_system";
|
|
45518
45519
|
function debounceCollect(fn, wait) {
|
|
45519
45520
|
let timer2, queue = {}, idx = 0;
|
|
45520
45521
|
return function(...args) {
|
|
@@ -46283,6 +46284,12 @@ function createDocumentPreviewStore({
|
|
|
46283
46284
|
_ref: id2
|
|
46284
46285
|
}, ["_type"], apiConfig, perspective).pipe(map((res) => isRecord$4(res) && typeof res._type == "string" ? res._type : void 0), distinctUntilChanged());
|
|
46285
46286
|
}
|
|
46287
|
+
function observeDocumentSystemFromId(id2, apiConfig, perspective) {
|
|
46288
|
+
return observePaths2({
|
|
46289
|
+
_type: "reference",
|
|
46290
|
+
_ref: id2
|
|
46291
|
+
}, [DOCUMENT_SYSTEM_FIELD], apiConfig, perspective).pipe(map((res) => isRecord$4(res) && isRecord$4(res[DOCUMENT_SYSTEM_FIELD]) ? res[DOCUMENT_SYSTEM_FIELD] : void 0), distinctUntilChanged());
|
|
46292
|
+
}
|
|
46286
46293
|
const observeDocumentIdSet = createDocumentIdSetObserver(versionedClient2), observeForPreview = createPreviewObserver({
|
|
46287
46294
|
observeDocumentTypeFromId,
|
|
46288
46295
|
observePaths: observePaths2
|
|
@@ -46294,6 +46301,7 @@ function createDocumentPreviewStore({
|
|
|
46294
46301
|
observePaths: observePaths2,
|
|
46295
46302
|
observeForPreview,
|
|
46296
46303
|
observeDocumentTypeFromId,
|
|
46304
|
+
observeDocumentSystemFromId,
|
|
46297
46305
|
unstable_observeDocumentIdSet: observeDocumentIdSet,
|
|
46298
46306
|
unstable_observeDocument: observeDocument,
|
|
46299
46307
|
unstable_observeDocuments: (ids) => combineLatest(ids.map((id2) => observeDocument(id2))),
|
|
@@ -46371,7 +46379,7 @@ function _temp$2q(release) {
|
|
|
46371
46379
|
function exists(value) {
|
|
46372
46380
|
return value?._rev;
|
|
46373
46381
|
}
|
|
46374
|
-
const DOCUMENT_STUB_PATHS = ["_id", "_type", "_rev", "_createdAt", "_updatedAt"], NO_VERSIONS = {};
|
|
46382
|
+
const DOCUMENT_STUB_PATHS$1 = ["_id", "_type", "_rev", "_createdAt", "_updatedAt", "_system"], NO_VERSIONS = {};
|
|
46375
46383
|
function useDocumentVersionInfo(documentId) {
|
|
46376
46384
|
const $ = c(13), documentPreviewStore = useDocumentPreviewStore(), releaseIds = useReleasesIds(useActiveReleases().data).releasesIds;
|
|
46377
46385
|
let t0;
|
|
@@ -46385,15 +46393,15 @@ function useDocumentVersionInfo(documentId) {
|
|
|
46385
46393
|
if ($[7] !== documentPreviewStore || $[8] !== draftId || $[9] !== publishedId || $[10] !== releaseIds) {
|
|
46386
46394
|
const releaseVersions = releaseIds.length > 0 ? combineLatest(Object.fromEntries(releaseIds.map((releaseId) => [releaseId, documentPreviewStore.observePaths({
|
|
46387
46395
|
_id: getVersionId(publishedId, releaseId)
|
|
46388
|
-
}, DOCUMENT_STUB_PATHS).pipe(map(_temp$2p))]))) : of(NO_VERSIONS);
|
|
46396
|
+
}, DOCUMENT_STUB_PATHS$1).pipe(map(_temp$2p))]))) : of(NO_VERSIONS);
|
|
46389
46397
|
t3 = combineLatest({
|
|
46390
46398
|
isLoading: of(!1),
|
|
46391
46399
|
draft: documentPreviewStore.observePaths({
|
|
46392
46400
|
_id: draftId
|
|
46393
|
-
}, DOCUMENT_STUB_PATHS).pipe(map(_temp2$Y)),
|
|
46401
|
+
}, DOCUMENT_STUB_PATHS$1).pipe(map(_temp2$Y)),
|
|
46394
46402
|
published: documentPreviewStore.observePaths({
|
|
46395
46403
|
_id: publishedId
|
|
46396
|
-
}, DOCUMENT_STUB_PATHS).pipe(map(_temp3$v)),
|
|
46404
|
+
}, DOCUMENT_STUB_PATHS$1).pipe(map(_temp3$v)),
|
|
46397
46405
|
versions: releaseVersions
|
|
46398
46406
|
}), $[7] = documentPreviewStore, $[8] = draftId, $[9] = publishedId, $[10] = releaseIds, $[11] = t3;
|
|
46399
46407
|
} else
|
|
@@ -46471,6 +46479,7 @@ function useProjectId() {
|
|
|
46471
46479
|
}
|
|
46472
46480
|
const INITIAL_VALUE$3 = {
|
|
46473
46481
|
data: [],
|
|
46482
|
+
versions: [],
|
|
46474
46483
|
error: null,
|
|
46475
46484
|
loading: !0
|
|
46476
46485
|
}, observableCache = /* @__PURE__ */ new Map(), swr = createSWR({
|
|
@@ -46482,23 +46491,60 @@ function useDocumentVersions(props2) {
|
|
|
46482
46491
|
} = props2;
|
|
46483
46492
|
let t0;
|
|
46484
46493
|
$[0] !== documentId ? (t0 = getPublishedId(documentId), $[0] = documentId, $[1] = t0) : t0 = $[1];
|
|
46485
|
-
const publishedId = t0, dataset = useDataset(), projectId = useProjectId(), documentPreviewStore = useDocumentPreviewStore(),
|
|
46494
|
+
const publishedId = t0, dataset = useDataset(), projectId = useProjectId(), documentPreviewStore = useDocumentPreviewStore(), {
|
|
46495
|
+
data: releases2
|
|
46496
|
+
} = useActiveReleases();
|
|
46486
46497
|
let t1;
|
|
46487
|
-
$[2] !== dataset || $[3] !== documentPreviewStore || $[4] !== projectId || $[5] !== publishedId
|
|
46488
|
-
|
|
46489
|
-
|
|
46490
|
-
|
|
46491
|
-
|
|
46492
|
-
|
|
46493
|
-
|
|
46494
|
-
|
|
46495
|
-
|
|
46496
|
-
|
|
46497
|
-
|
|
46498
|
-
})
|
|
46499
|
-
|
|
46500
|
-
|
|
46498
|
+
if ($[2] !== dataset || $[3] !== documentPreviewStore || $[4] !== projectId || $[5] !== publishedId || $[6] !== releases2) {
|
|
46499
|
+
let t2;
|
|
46500
|
+
$[8] !== releases2 ? (t2 = (result) => ({
|
|
46501
|
+
...result,
|
|
46502
|
+
versions: result.versions.map((version2) => ({
|
|
46503
|
+
...version2,
|
|
46504
|
+
[DOCUMENT_SYSTEM_FIELD]: version2._system?.group ? version2._system : {
|
|
46505
|
+
...version2._system,
|
|
46506
|
+
...temporarilyBuildDocumentSystem(version2._id, releases2)
|
|
46507
|
+
}
|
|
46508
|
+
}))
|
|
46509
|
+
}), $[8] = releases2, $[9] = t2) : t2 = $[9], t1 = getOrCreateDocumentVersionsObservable({
|
|
46510
|
+
documentPreviewStore,
|
|
46511
|
+
publishedId,
|
|
46512
|
+
projectId,
|
|
46513
|
+
dataset
|
|
46514
|
+
}).pipe(map$1(t2)), $[2] = dataset, $[3] = documentPreviewStore, $[4] = projectId, $[5] = publishedId, $[6] = releases2, $[7] = t1;
|
|
46515
|
+
} else
|
|
46516
|
+
t1 = $[7];
|
|
46517
|
+
return useObservable(t1, INITIAL_VALUE$3);
|
|
46501
46518
|
}
|
|
46519
|
+
const temporarilyBuildDocumentSystem = (id2, releases2) => {
|
|
46520
|
+
const versionId = getVersionFromId(id2);
|
|
46521
|
+
if (versionId) {
|
|
46522
|
+
const releaseDocument = releases2.find((release) => getReleaseIdFromReleaseDocumentId(release._id) === versionId);
|
|
46523
|
+
return {
|
|
46524
|
+
bundleId: versionId,
|
|
46525
|
+
release: releaseDocument ? {
|
|
46526
|
+
_ref: releaseDocument._id,
|
|
46527
|
+
_weak: !0
|
|
46528
|
+
} : null,
|
|
46529
|
+
variant: null,
|
|
46530
|
+
group: {
|
|
46531
|
+
_ref: getPublishedId(id2),
|
|
46532
|
+
_weak: !0
|
|
46533
|
+
},
|
|
46534
|
+
scopeId: versionId
|
|
46535
|
+
};
|
|
46536
|
+
}
|
|
46537
|
+
return {
|
|
46538
|
+
bundleId: isDraftId(id2) ? "drafts" : null,
|
|
46539
|
+
release: null,
|
|
46540
|
+
variant: null,
|
|
46541
|
+
group: {
|
|
46542
|
+
_ref: getPublishedId(id2),
|
|
46543
|
+
_weak: !0
|
|
46544
|
+
},
|
|
46545
|
+
scopeId: versionId || null
|
|
46546
|
+
};
|
|
46547
|
+
}, DOCUMENT_STUB_PATHS = ["_id", "_type", "_rev", "_createdAt", "_updatedAt", "_system"];
|
|
46502
46548
|
function getOrCreateDocumentVersionsObservable(options) {
|
|
46503
46549
|
const {
|
|
46504
46550
|
documentPreviewStore,
|
|
@@ -46513,13 +46559,38 @@ function getOrCreateDocumentVersionsObservable(options) {
|
|
|
46513
46559
|
apiVersion: RELEASES_STUDIO_CLIENT_OPTIONS.apiVersion
|
|
46514
46560
|
}).pipe(swr(cacheKey2), map$1(({
|
|
46515
46561
|
value
|
|
46516
|
-
}) => ({
|
|
46517
|
-
|
|
46518
|
-
|
|
46519
|
-
|
|
46520
|
-
|
|
46562
|
+
}) => value.documentIds), switchMap$1((documentIds) => {
|
|
46563
|
+
if (documentIds.length === 0)
|
|
46564
|
+
return of({
|
|
46565
|
+
data: [],
|
|
46566
|
+
versions: [],
|
|
46567
|
+
error: null,
|
|
46568
|
+
loading: !1
|
|
46569
|
+
});
|
|
46570
|
+
const loadingState = {
|
|
46571
|
+
data: documentIds,
|
|
46572
|
+
versions: [],
|
|
46573
|
+
error: null,
|
|
46574
|
+
loading: !0
|
|
46575
|
+
};
|
|
46576
|
+
return combineLatest(documentIds.map((id2) => documentPreviewStore.observePaths({
|
|
46577
|
+
_id: id2
|
|
46578
|
+
}, DOCUMENT_STUB_PATHS).pipe(map$1((versionInfo) => isRecord$4(versionInfo) ? versionInfo : void 0), map$1((versionInfo) => ({
|
|
46579
|
+
_id: id2,
|
|
46580
|
+
_rev: versionInfo?._rev ?? "",
|
|
46581
|
+
_createdAt: versionInfo?._createdAt ?? "",
|
|
46582
|
+
_updatedAt: versionInfo?._updatedAt ?? "",
|
|
46583
|
+
[DOCUMENT_SYSTEM_FIELD]: versionInfo?.[DOCUMENT_SYSTEM_FIELD]
|
|
46584
|
+
}))))).pipe(map$1((versions) => ({
|
|
46585
|
+
data: documentIds,
|
|
46586
|
+
versions,
|
|
46587
|
+
error: null,
|
|
46588
|
+
loading: !1
|
|
46589
|
+
})), startWith$1(loadingState));
|
|
46590
|
+
}), catchError$1((error) => of({
|
|
46521
46591
|
error,
|
|
46522
46592
|
data: [],
|
|
46593
|
+
versions: [],
|
|
46523
46594
|
loading: !1
|
|
46524
46595
|
})), finalize(() => {
|
|
46525
46596
|
observableCache.delete(cacheKey2);
|
|
@@ -62255,7 +62326,8 @@ function useDocumentForm(options) {
|
|
|
62255
62326
|
documentId
|
|
62256
62327
|
}, $[0] = documentId, $[1] = t1) : t1 = $[1];
|
|
62257
62328
|
const {
|
|
62258
|
-
data: documentVersions
|
|
62329
|
+
data: documentVersions,
|
|
62330
|
+
loading: documentVersionsLoading
|
|
62259
62331
|
} = useDocumentVersions(t1);
|
|
62260
62332
|
useWorkspace();
|
|
62261
62333
|
let t2;
|
|
@@ -62395,7 +62467,7 @@ function useDocumentForm(options) {
|
|
|
62395
62467
|
document: docPermissionsInput,
|
|
62396
62468
|
permission: requiredPermission
|
|
62397
62469
|
}, $[48] = docPermissionsInput, $[49] = requiredPermission, $[50] = t19) : t19 = $[50];
|
|
62398
|
-
const [permissions, isPermissionsLoading] = useDocumentValuePermissions(t19), isNonExistent = !value?._id, ready = connectionState === "connected" && editState2.ready && !initialValue?.loading;
|
|
62470
|
+
const [permissions, isPermissionsLoading] = useDocumentValuePermissions(t19), isNonExistent = !value?._id, ready = connectionState === "connected" && editState2.ready && !initialValue?.loading && !documentVersionsLoading;
|
|
62399
62471
|
let t20;
|
|
62400
62472
|
$[51] !== releases2 || $[52] !== selectedPerspectiveName ? (t20 = getSelectedPerspective(selectedPerspectiveName, releases2), $[51] = releases2, $[52] = selectedPerspectiveName, $[53] = t20) : t20 = $[53];
|
|
62401
62473
|
const selectedPerspective = t20;
|
|
@@ -69913,9 +69985,9 @@ function _temp$1f(t) {
|
|
|
69913
69985
|
return t.name === "mention";
|
|
69914
69986
|
}
|
|
69915
69987
|
const EditorRefPlugin = forwardRef(function(_, ref) {
|
|
69916
|
-
const $ = c(
|
|
69988
|
+
const $ = c(3), editor2 = useEditor();
|
|
69917
69989
|
let t0, t1;
|
|
69918
|
-
return $[0]
|
|
69990
|
+
return $[0] !== editor2 ? (t0 = () => editor2, t1 = [editor2], $[0] = editor2, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useImperativeHandle(ref, t0, t1), null;
|
|
69919
69991
|
});
|
|
69920
69992
|
EditorRefPlugin.displayName = "EditorRefPlugin";
|
|
69921
69993
|
const EMPTY_ARRAY$d = [], SCROLL_INTO_VIEW_OPTIONS = {
|
|
@@ -69950,7 +70022,9 @@ const EMPTY_ARRAY$d = [], SCROLL_INTO_VIEW_OPTIONS = {
|
|
|
69950
70022
|
let t5;
|
|
69951
70023
|
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
|
|
69952
70024
|
requestAnimationFrame(() => {
|
|
69953
|
-
editorRef.current
|
|
70025
|
+
editorRef.current?.send({
|
|
70026
|
+
type: "focus"
|
|
70027
|
+
});
|
|
69954
70028
|
});
|
|
69955
70029
|
}, $[1] = t5) : t5 = $[1];
|
|
69956
70030
|
const requestFocus = t5;
|
|
@@ -69971,7 +70045,8 @@ const EMPTY_ARRAY$d = [], SCROLL_INTO_VIEW_OPTIONS = {
|
|
|
69971
70045
|
const scrollToEditor = t8;
|
|
69972
70046
|
let t9;
|
|
69973
70047
|
$[7] !== onSubmit ? (t9 = () => {
|
|
69974
|
-
|
|
70048
|
+
const currentValue = editorRef.current ? getValue$1(editorRef.current.getSnapshot()) : EMPTY_ARRAY$d;
|
|
70049
|
+
onSubmit?.(currentValue), resetEditorInstance(), requestFocus(), scrollToEditor();
|
|
69975
70050
|
}, $[7] = onSubmit, $[8] = t9) : t9 = $[8];
|
|
69976
70051
|
const handleSubmit = t9;
|
|
69977
70052
|
let t10;
|
|
@@ -69993,7 +70068,9 @@ const EMPTY_ARRAY$d = [], SCROLL_INTO_VIEW_OPTIONS = {
|
|
|
69993
70068
|
$[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t12 = () => ({
|
|
69994
70069
|
focus: requestFocus,
|
|
69995
70070
|
blur() {
|
|
69996
|
-
editorRef.current
|
|
70071
|
+
editorRef.current?.send({
|
|
70072
|
+
type: "blur"
|
|
70073
|
+
});
|
|
69997
70074
|
},
|
|
69998
70075
|
scrollTo: scrollToEditor,
|
|
69999
70076
|
reset: resetEditorInstance,
|
|
@@ -70790,7 +70867,7 @@ const stopPropagation = (e) => e.stopPropagation(), ContextMenuBox = styled(Box)
|
|
|
70790
70867
|
useTemporalPhrase: !0
|
|
70791
70868
|
};
|
|
70792
70869
|
function CommentsListItemLayout(props2) {
|
|
70793
|
-
const $ = c(
|
|
70870
|
+
const $ = c(151), {
|
|
70794
70871
|
avatarSize: t0,
|
|
70795
70872
|
canDelete,
|
|
70796
70873
|
canEdit,
|
|
@@ -70895,41 +70972,41 @@ function CommentsListItemLayout(props2) {
|
|
|
70895
70972
|
}, $[34] = _id, $[35] = onReactionSelect, $[36] = t19) : t19 = $[36];
|
|
70896
70973
|
const handleReactionSelect = t19;
|
|
70897
70974
|
let t20;
|
|
70898
|
-
$[37] !== _id || $[38] !== onEdit
|
|
70975
|
+
$[37] !== _id || $[38] !== onEdit ? (t20 = (nextValue) => {
|
|
70899
70976
|
onEdit(_id, {
|
|
70900
|
-
message:
|
|
70977
|
+
message: nextValue
|
|
70901
70978
|
}), setIsEditing(!1);
|
|
70902
|
-
}, $[37] = _id, $[38] = onEdit, $[39] =
|
|
70979
|
+
}, $[37] = _id, $[38] = onEdit, $[39] = t20) : t20 = $[39];
|
|
70903
70980
|
const handleEditSubmit = t20;
|
|
70904
70981
|
let t21;
|
|
70905
|
-
$[
|
|
70982
|
+
$[40] !== _id || $[41] !== comment.status || $[42] !== onStatusChange ? (t21 = () => {
|
|
70906
70983
|
onStatusChange?.(_id, comment.status === "open" ? "resolved" : "open");
|
|
70907
|
-
}, $[
|
|
70984
|
+
}, $[40] = _id, $[41] = comment.status, $[42] = onStatusChange, $[43] = t21) : t21 = $[43];
|
|
70908
70985
|
const handleOpenStatusChange = t21;
|
|
70909
70986
|
let t22;
|
|
70910
|
-
$[
|
|
70987
|
+
$[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t22 = () => {
|
|
70911
70988
|
setIsEditing(_temp3$g);
|
|
70912
|
-
}, $[
|
|
70989
|
+
}, $[44] = t22) : t22 = $[44];
|
|
70913
70990
|
const toggleEdit = t22;
|
|
70914
70991
|
let t23;
|
|
70915
|
-
$[
|
|
70992
|
+
$[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t23 = () => setMenuOpen(!1), $[45] = t23) : t23 = $[45];
|
|
70916
70993
|
const handleCloseMenu = t23;
|
|
70917
70994
|
let t24;
|
|
70918
|
-
$[
|
|
70995
|
+
$[46] !== hasChanges ? (t24 = (event_0) => {
|
|
70919
70996
|
event_0.key === "Escape" && !hasChanges && cancelEdit();
|
|
70920
|
-
}, $[
|
|
70997
|
+
}, $[46] = hasChanges, $[47] = t24) : t24 = $[47];
|
|
70921
70998
|
const handleRootKeyDown = t24;
|
|
70922
70999
|
useDidUpdate(isEditing, handleCloseMenu);
|
|
70923
71000
|
let t25;
|
|
70924
|
-
$[
|
|
71001
|
+
$[48] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t25 = () => [rootElementRef.current], $[48] = t25) : t25 = $[48], useClickOutsideEvent(!hasChanges && cancelEdit, t25);
|
|
70925
71002
|
let t26;
|
|
70926
|
-
$[
|
|
71003
|
+
$[49] !== user ? (t26 = user?.displayName ? /* @__PURE__ */ jsx(Text$1, { size: 1, weight: "medium", textOverflow: "ellipsis", title: user.displayName, children: user.displayName }) : /* @__PURE__ */ jsx(TextSkeleton, { size: 1, style: SKELETON_INLINE_STYLE }), $[49] = user, $[50] = t26) : t26 = $[50];
|
|
70927
71004
|
const name = t26, T0 = RootStack$1, t27 = menuOpen ? "true" : "false", t28 = "comments-list-item-layout", t29 = 4, T1 = InnerStack, t30 = 1, T2 = HeaderFlex$4, t31 = "center", t32 = FLEX_GAP, t33 = 1;
|
|
70928
71005
|
let t34;
|
|
70929
|
-
$[
|
|
71006
|
+
$[51] !== avatarSize || $[52] !== user || $[53] !== withAvatar ? (t34 = withAvatar && /* @__PURE__ */ jsx(CommentsAvatar, { user, size: avatarSize }), $[51] = avatarSize, $[52] = user, $[53] = withAvatar, $[54] = t34) : t34 = $[54];
|
|
70930
71007
|
const T3 = Flex, t35 = "column", t36 = 2, t37 = intent ? 2 : 0, T4 = Flex, t38 = "center", t39 = comment.context?.intent ? 0 : 1, t40 = "border", t41 = 1, T5 = Flex, t42 = "flex-end", t43 = 2;
|
|
70931
71008
|
let t44;
|
|
70932
|
-
$[
|
|
71009
|
+
$[55] !== name ? (t44 = /* @__PURE__ */ jsx(Box, { flex: 1, children: name }), $[55] = name, $[56] = t44) : t44 = $[56];
|
|
70933
71010
|
const t45 = !displayError && /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 1, children: [
|
|
70934
71011
|
/* @__PURE__ */ jsx(TimeText, { muted: !0, size: 0, children: /* @__PURE__ */ jsx("time", { dateTime: createdDate.toISOString(), title: formattedCreatedAt, children: createdTimeAgo }) }),
|
|
70935
71012
|
formattedLastEditAt && editedDate && /* @__PURE__ */ jsx(TimeText, { muted: !0, size: 0, title: formattedLastEditAt, children: /* @__PURE__ */ jsxs("time", { dateTime: editedDate.toISOString(), title: formattedLastEditAt, children: [
|
|
@@ -70939,14 +71016,14 @@ function CommentsListItemLayout(props2) {
|
|
|
70939
71016
|
] }) })
|
|
70940
71017
|
] });
|
|
70941
71018
|
let t46;
|
|
70942
|
-
$[
|
|
71019
|
+
$[57] !== T5 || $[58] !== t44 || $[59] !== t45 ? (t46 = /* @__PURE__ */ jsxs(T5, { align: t42, gap: t43, children: [
|
|
70943
71020
|
t44,
|
|
70944
71021
|
t45
|
|
70945
|
-
] }), $[
|
|
71022
|
+
] }), $[57] = T5, $[58] = t44, $[59] = t45, $[60] = t46) : t46 = $[60];
|
|
70946
71023
|
let t47;
|
|
70947
|
-
$[
|
|
71024
|
+
$[61] !== T4 || $[62] !== t39 || $[63] !== t46 ? (t47 = /* @__PURE__ */ jsx(T4, { align: t38, paddingBottom: t39, sizing: t40, flex: t41, children: t46 }), $[61] = T4, $[62] = t39, $[63] = t46, $[64] = t47) : t47 = $[64];
|
|
70948
71025
|
let t48;
|
|
70949
|
-
$[
|
|
71026
|
+
$[65] !== intent || $[66] !== t ? (t48 = intent && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(IntentText, { muted: !0, size: 0, textOverflow: "ellipsis", children: /* @__PURE__ */ jsx(Translate, { t, i18nKey: "list-item.layout-context", values: {
|
|
70950
71027
|
title: intent.title,
|
|
70951
71028
|
intent: "edit"
|
|
70952
71029
|
}, components: {
|
|
@@ -70956,50 +71033,50 @@ function CommentsListItemLayout(props2) {
|
|
|
70956
71033
|
} = t492;
|
|
70957
71034
|
return intent ? /* @__PURE__ */ jsx(IntentLink, { params: intent.params, intent: intent.name, children }) : void 0;
|
|
70958
71035
|
}
|
|
70959
|
-
} }) }) }), $[
|
|
71036
|
+
} }) }) }), $[65] = intent, $[66] = t, $[67] = t48) : t48 = $[67];
|
|
70960
71037
|
let t49;
|
|
70961
|
-
$[
|
|
71038
|
+
$[68] !== T3 || $[69] !== t37 || $[70] !== t47 || $[71] !== t48 ? (t49 = /* @__PURE__ */ jsxs(T3, { direction: t35, gap: t36, paddingY: t37, children: [
|
|
70962
71039
|
t47,
|
|
70963
71040
|
t48
|
|
70964
|
-
] }), $[
|
|
71041
|
+
] }), $[68] = T3, $[69] = t37, $[70] = t47, $[71] = t48, $[72] = t49) : t49 = $[72];
|
|
70965
71042
|
let t50;
|
|
70966
|
-
$[
|
|
71043
|
+
$[73] !== canDelete || $[74] !== canEdit || $[75] !== comment.status || $[76] !== displayError || $[77] !== handleCopyLink || $[78] !== handleDelete || $[79] !== handleMenuClose || $[80] !== handleMenuOpen || $[81] !== handleOpenStatusChange || $[82] !== handleReactionSelect || $[83] !== isEditing || $[84] !== isParent || $[85] !== mode || $[86] !== onCopyLink || $[87] !== onStatusChange || $[88] !== readOnly || $[89] !== toggleEdit ? (t50 = !isEditing && !displayError && /* @__PURE__ */ jsx(ContextMenuBox, { "data-root-menu": isParent ? "true" : "false", onClick: stopPropagation, children: /* @__PURE__ */ jsx(CommentsListItemContextMenu, { canDelete, canEdit, isParent, mode, onCopyLink: onCopyLink ? handleCopyLink : void 0, onDeleteStart: handleDelete, onEditStart: toggleEdit, onMenuClose: handleMenuClose, onMenuOpen: handleMenuOpen, onReactionSelect: handleReactionSelect, onStatusChange: onStatusChange ? handleOpenStatusChange : void 0, readOnly, status: comment.status }) }), $[73] = canDelete, $[74] = canEdit, $[75] = comment.status, $[76] = displayError, $[77] = handleCopyLink, $[78] = handleDelete, $[79] = handleMenuClose, $[80] = handleMenuOpen, $[81] = handleOpenStatusChange, $[82] = handleReactionSelect, $[83] = isEditing, $[84] = isParent, $[85] = mode, $[86] = onCopyLink, $[87] = onStatusChange, $[88] = readOnly, $[89] = toggleEdit, $[90] = t50) : t50 = $[90];
|
|
70967
71044
|
let t51;
|
|
70968
|
-
$[
|
|
71045
|
+
$[91] !== T2 || $[92] !== avatarSize || $[93] !== t32 || $[94] !== t34 || $[95] !== t49 || $[96] !== t50 ? (t51 = /* @__PURE__ */ jsxs(T2, { align: t31, gap: t32, flex: t33, $size: avatarSize, children: [
|
|
70969
71046
|
t34,
|
|
70970
71047
|
t49,
|
|
70971
71048
|
t50
|
|
70972
|
-
] }), $[
|
|
71049
|
+
] }), $[91] = T2, $[92] = avatarSize, $[93] = t32, $[94] = t34, $[95] = t49, $[96] = t50, $[97] = t51) : t51 = $[97];
|
|
70973
71050
|
let t52;
|
|
70974
|
-
$[
|
|
71051
|
+
$[98] !== avatarSize || $[99] !== comment || $[100] !== hasReferencedValue || $[101] !== withAvatar ? (t52 = isTextSelectionComment(comment) && !!comment?.contentSnapshot && /* @__PURE__ */ jsxs(Flex, { gap: FLEX_GAP, marginBottom: 3, children: [
|
|
70975
71052
|
withAvatar && /* @__PURE__ */ jsx(SpacerAvatar, { $size: avatarSize }),
|
|
70976
71053
|
/* @__PURE__ */ jsx(CommentsListItemReferencedValue, { hasReferencedValue, value: comment?.contentSnapshot })
|
|
70977
|
-
] }), $[
|
|
71054
|
+
] }), $[98] = avatarSize, $[99] = comment, $[100] = hasReferencedValue, $[101] = withAvatar, $[102] = t52) : t52 = $[102];
|
|
70978
71055
|
let t53;
|
|
70979
|
-
$[
|
|
71056
|
+
$[103] !== avatarSize || $[104] !== cancelDiscard || $[105] !== confirmDiscard || $[106] !== currentUser || $[107] !== handleEditSubmit || $[108] !== handleInputKeyDown || $[109] !== isEditing || $[110] !== mentionOptions || $[111] !== readOnly || $[112] !== value || $[113] !== withAvatar ? (t53 = isEditing && /* @__PURE__ */ jsxs(Flex, { align: "flex-start", gap: 2, children: [
|
|
70980
71057
|
withAvatar && /* @__PURE__ */ jsx(SpacerAvatar, { $size: avatarSize }),
|
|
70981
71058
|
/* @__PURE__ */ jsx(Stack, { flex: 1, children: /* @__PURE__ */ jsx(CommentInput, { currentUser, focusOnMount: !0, mentionOptions, onChange: setValue, onDiscardCancel: cancelDiscard, onDiscardConfirm: confirmDiscard, onKeyDown: handleInputKeyDown, onSubmit: handleEditSubmit, readOnly, ref: commentInputRef, value, withAvatar: !1 }) })
|
|
70982
|
-
] }), $[
|
|
71059
|
+
] }), $[103] = avatarSize, $[104] = cancelDiscard, $[105] = confirmDiscard, $[106] = currentUser, $[107] = handleEditSubmit, $[108] = handleInputKeyDown, $[109] = isEditing, $[110] = mentionOptions, $[111] = readOnly, $[112] = value, $[113] = withAvatar, $[114] = t53) : t53 = $[114];
|
|
70983
71060
|
let t54;
|
|
70984
|
-
$[
|
|
71061
|
+
$[115] !== avatarSize || $[116] !== isEditing || $[117] !== message || $[118] !== withAvatar ? (t54 = !isEditing && /* @__PURE__ */ jsxs(Flex, { gap: FLEX_GAP, children: [
|
|
70985
71062
|
withAvatar && /* @__PURE__ */ jsx(SpacerAvatar, { $size: avatarSize }),
|
|
70986
71063
|
/* @__PURE__ */ jsx(CommentMessageSerializer, { blocks: message })
|
|
70987
|
-
] }), $[
|
|
71064
|
+
] }), $[115] = avatarSize, $[116] = isEditing, $[117] = message, $[118] = withAvatar, $[119] = t54) : t54 = $[119];
|
|
70988
71065
|
let t55;
|
|
70989
|
-
$[
|
|
71066
|
+
$[120] !== avatarSize || $[121] !== currentUser || $[122] !== handleReactionSelect || $[123] !== hasReactions || $[124] !== mode || $[125] !== reactions || $[126] !== readOnly || $[127] !== withAvatar ? (t55 = hasReactions && /* @__PURE__ */ jsxs(Flex, { gap: FLEX_GAP, marginTop: 2, children: [
|
|
70990
71067
|
withAvatar && /* @__PURE__ */ jsx(SpacerAvatar, { $size: avatarSize }),
|
|
70991
71068
|
/* @__PURE__ */ jsx(Box, { onClick: stopPropagation, children: /* @__PURE__ */ jsx(CommentReactionsBar, { currentUser, mode, onSelect: handleReactionSelect, reactions, readOnly }) })
|
|
70992
|
-
] }), $[
|
|
71069
|
+
] }), $[120] = avatarSize, $[121] = currentUser, $[122] = handleReactionSelect, $[123] = hasReactions, $[124] = mode, $[125] = reactions, $[126] = readOnly, $[127] = withAvatar, $[128] = t55) : t55 = $[128];
|
|
70993
71070
|
let t56;
|
|
70994
|
-
$[
|
|
71071
|
+
$[129] !== T1 || $[130] !== displayError || $[131] !== t51 || $[132] !== t52 || $[133] !== t53 || $[134] !== t54 || $[135] !== t55 ? (t56 = /* @__PURE__ */ jsxs(T1, { space: t30, "data-muted": displayError, children: [
|
|
70995
71072
|
t51,
|
|
70996
71073
|
t52,
|
|
70997
71074
|
t53,
|
|
70998
71075
|
t54,
|
|
70999
71076
|
t55
|
|
71000
|
-
] }), $[
|
|
71077
|
+
] }), $[129] = T1, $[130] = displayError, $[131] = t51, $[132] = t52, $[133] = t53, $[134] = t54, $[135] = t55, $[136] = t56) : t56 = $[136];
|
|
71001
71078
|
let t57;
|
|
71002
|
-
$[
|
|
71079
|
+
$[137] !== avatarSize || $[138] !== displayError || $[139] !== handleCreateRetry || $[140] !== hasError || $[141] !== isRetrying || $[142] !== t || $[143] !== withAvatar ? (t57 = displayError && /* @__PURE__ */ jsxs(ErrorFlex, { gap: FLEX_GAP, $size: avatarSize, children: [
|
|
71003
71080
|
withAvatar && /* @__PURE__ */ jsx(SpacerAvatar, { $size: avatarSize }),
|
|
71004
71081
|
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: 1, flex: 1, children: [
|
|
71005
71082
|
/* @__PURE__ */ jsxs(Text$1, { muted: !0, size: 1, children: [
|
|
@@ -71008,12 +71085,12 @@ function CommentsListItemLayout(props2) {
|
|
|
71008
71085
|
] }),
|
|
71009
71086
|
/* @__PURE__ */ jsx(Flex, { hidden: isRetrying, children: /* @__PURE__ */ jsx(RetryCardButton, { __unstable_focusRing: !0, display: "flex", forwardedAs: "button", onClick: handleCreateRetry, padding: 1, radius: 2, tone: "primary", children: /* @__PURE__ */ jsx(Text$1, { size: 1, muted: !0, children: t("list-item.layout-retry") }) }) })
|
|
71010
71087
|
] })
|
|
71011
|
-
] }), $[
|
|
71088
|
+
] }), $[137] = avatarSize, $[138] = displayError, $[139] = handleCreateRetry, $[140] = hasError, $[141] = isRetrying, $[142] = t, $[143] = withAvatar, $[144] = t57) : t57 = $[144];
|
|
71012
71089
|
let t58;
|
|
71013
|
-
return $[
|
|
71090
|
+
return $[145] !== T0 || $[146] !== handleRootKeyDown || $[147] !== t27 || $[148] !== t56 || $[149] !== t57 ? (t58 = /* @__PURE__ */ jsxs(T0, { "data-menu-open": t27, "data-testid": t28, onKeyDown: handleRootKeyDown, ref: rootElementRef, space: t29, children: [
|
|
71014
71091
|
t56,
|
|
71015
71092
|
t57
|
|
71016
|
-
] }), $[
|
|
71093
|
+
] }), $[145] = T0, $[146] = handleRootKeyDown, $[147] = t27, $[148] = t56, $[149] = t57, $[150] = t58) : t58 = $[150], t58;
|
|
71017
71094
|
}
|
|
71018
71095
|
function _temp3$g(v) {
|
|
71019
71096
|
return !v;
|
|
@@ -71089,7 +71166,7 @@ const ThreadCard = /* @__PURE__ */ styled(Card).attrs({
|
|
|
71089
71166
|
displayName: "GhostButton",
|
|
71090
71167
|
componentId: "sc-niunrr-2"
|
|
71091
71168
|
})`opacity:0;position:absolute;right:0;top:0;bottom:0;left:0;`, CommentsListItem = memo(function(props2) {
|
|
71092
|
-
const $ = c(
|
|
71169
|
+
const $ = c(112), {
|
|
71093
71170
|
avatarConfig: t0,
|
|
71094
71171
|
canReply,
|
|
71095
71172
|
currentUser,
|
|
@@ -71125,9 +71202,9 @@ const ThreadCard = /* @__PURE__ */ styled(Card).attrs({
|
|
|
71125
71202
|
$[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = () => setMouseOver(!1), $[3] = t4) : t4 = $[3];
|
|
71126
71203
|
const handleMouseLeave = t4;
|
|
71127
71204
|
let t5;
|
|
71128
|
-
$[4] !== onReply || $[5] !== parentComment._id || $[6] !== parentComment.status || $[7] !== parentComment.target.path?.field || $[8] !== parentComment.threadId
|
|
71205
|
+
$[4] !== onReply || $[5] !== parentComment._id || $[6] !== parentComment.status || $[7] !== parentComment.target.path?.field || $[8] !== parentComment.threadId ? (t5 = (nextValue) => {
|
|
71129
71206
|
const nextComment = {
|
|
71130
|
-
message:
|
|
71207
|
+
message: nextValue,
|
|
71131
71208
|
parentCommentId: parentComment._id,
|
|
71132
71209
|
status: parentComment?.status || "open",
|
|
71133
71210
|
threadId: parentComment.threadId,
|
|
@@ -71137,51 +71214,51 @@ const ThreadCard = /* @__PURE__ */ styled(Card).attrs({
|
|
|
71137
71214
|
}
|
|
71138
71215
|
};
|
|
71139
71216
|
onReply?.(nextComment), setValue(EMPTY_ARRAY$a);
|
|
71140
|
-
}, $[4] = onReply, $[5] = parentComment._id, $[6] = parentComment.status, $[7] = parentComment.target.path?.field, $[8] = parentComment.threadId, $[9] =
|
|
71217
|
+
}, $[4] = onReply, $[5] = parentComment._id, $[6] = parentComment.status, $[7] = parentComment.target.path?.field, $[8] = parentComment.threadId, $[9] = t5) : t5 = $[9];
|
|
71141
71218
|
const handleReplySubmit = t5;
|
|
71142
71219
|
let t6;
|
|
71143
|
-
$[
|
|
71220
|
+
$[10] !== hasValue2 ? (t6 = () => {
|
|
71144
71221
|
if (!hasValue2) {
|
|
71145
71222
|
setValue(EMPTY_ARRAY$a);
|
|
71146
71223
|
return;
|
|
71147
71224
|
}
|
|
71148
71225
|
replyInputRef.current?.discardDialogController.open();
|
|
71149
|
-
}, $[
|
|
71226
|
+
}, $[10] = hasValue2, $[11] = t6) : t6 = $[11];
|
|
71150
71227
|
const startDiscard = t6;
|
|
71151
71228
|
let t7;
|
|
71152
|
-
$[
|
|
71229
|
+
$[12] !== startDiscard ? (t7 = (event) => {
|
|
71153
71230
|
event.isDefaultPrevented() || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), startDiscard());
|
|
71154
|
-
}, $[
|
|
71231
|
+
}, $[12] = startDiscard, $[13] = t7) : t7 = $[13];
|
|
71155
71232
|
const handleInputKeyDown = t7;
|
|
71156
71233
|
let t8;
|
|
71157
|
-
$[
|
|
71234
|
+
$[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t8 = () => {
|
|
71158
71235
|
replyInputRef.current?.discardDialogController.close();
|
|
71159
|
-
}, $[
|
|
71236
|
+
}, $[14] = t8) : t8 = $[14];
|
|
71160
71237
|
const cancelDiscard = t8;
|
|
71161
71238
|
let t9;
|
|
71162
|
-
$[
|
|
71239
|
+
$[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
71163
71240
|
setValue(EMPTY_ARRAY$a), replyInputRef.current?.discardDialogController.close(), replyInputRef.current?.focus();
|
|
71164
|
-
}, $[
|
|
71241
|
+
}, $[15] = t9) : t9 = $[15];
|
|
71165
71242
|
const confirmDiscard = t9;
|
|
71166
71243
|
let t10;
|
|
71167
|
-
$[
|
|
71244
|
+
$[16] !== isTopLayer || $[17] !== onPathSelect || $[18] !== parentComment.target.path?.field || $[19] !== parentComment.threadId ? (t10 = (e) => {
|
|
71168
71245
|
e.stopPropagation(), isTopLayer && onPathSelect?.({
|
|
71169
71246
|
fieldPath: parentComment.target.path?.field || "",
|
|
71170
71247
|
origin: "inspector",
|
|
71171
71248
|
threadId: parentComment.threadId
|
|
71172
71249
|
});
|
|
71173
|
-
}, $[
|
|
71250
|
+
}, $[16] = isTopLayer, $[17] = onPathSelect, $[18] = parentComment.target.path?.field, $[19] = parentComment.threadId, $[20] = t10) : t10 = $[20];
|
|
71174
71251
|
const handleThreadRootClick = t10;
|
|
71175
71252
|
let t11;
|
|
71176
|
-
$[
|
|
71253
|
+
$[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t11 = (e_0) => {
|
|
71177
71254
|
e_0.stopPropagation(), setCollapsed(!1);
|
|
71178
|
-
}, $[
|
|
71255
|
+
}, $[21] = t11) : t11 = $[21];
|
|
71179
71256
|
const handleExpand = t11;
|
|
71180
71257
|
let t12;
|
|
71181
71258
|
bb0: {
|
|
71182
71259
|
if (collapsed) {
|
|
71183
71260
|
let t132;
|
|
71184
|
-
$[
|
|
71261
|
+
$[22] !== replies ? (t132 = replies?.slice(-MAX_COLLAPSED_REPLIES), $[22] = replies, $[23] = t132) : t132 = $[23], t12 = t132;
|
|
71185
71262
|
break bb0;
|
|
71186
71263
|
}
|
|
71187
71264
|
t12 = replies;
|
|
@@ -71197,42 +71274,42 @@ const ThreadCard = /* @__PURE__ */ styled(Card).attrs({
|
|
|
71197
71274
|
}
|
|
71198
71275
|
const showCollapseButton = t13, expandButtonText = `${replies?.length - MAX_COLLAPSED_REPLIES} more ${replies?.length - MAX_COLLAPSED_REPLIES === 1 ? "comment" : "comments"}`, t14 = isSelected ? "true" : "false", t15 = mouseOver ? "true" : "false";
|
|
71199
71276
|
let t16;
|
|
71200
|
-
$[
|
|
71277
|
+
$[24] !== t ? (t16 = t("list-item.go-to-field-button.aria-label"), $[24] = t, $[25] = t16) : t16 = $[25];
|
|
71201
71278
|
let t17;
|
|
71202
|
-
$[
|
|
71279
|
+
$[26] !== t16 ? (t17 = /* @__PURE__ */ jsx(GhostButton, { "data-ui": "GhostButton", "aria-label": t16 }), $[26] = t16, $[27] = t17) : t17 = $[27];
|
|
71203
71280
|
const t18 = canReply ? void 0 : 1;
|
|
71204
71281
|
let t19;
|
|
71205
|
-
$[
|
|
71282
|
+
$[28] !== parentComment._id ? (t19 = applyCommentIdAttr(parentComment._id), $[28] = parentComment._id, $[29] = t19) : t19 = $[29];
|
|
71206
71283
|
const t20 = parentComment.authorId === currentUser.id, t21 = parentComment.authorId === currentUser.id, t22 = parentComment._state?.type === "createError", t23 = parentComment.context?.intent, t24 = parentComment._state?.type === "createRetrying";
|
|
71207
71284
|
let t25;
|
|
71208
|
-
$[
|
|
71285
|
+
$[30] !== avatarConfig.avatarSize || $[31] !== avatarConfig.parentCommentAvatar || $[32] !== currentUser || $[33] !== hasReferencedValue || $[34] !== mentionOptions || $[35] !== mode || $[36] !== onCopyLink || $[37] !== onCreateRetry || $[38] !== onDelete || $[39] !== onEdit || $[40] !== onKeyDown || $[41] !== onReactionSelect || $[42] !== onStatusChange || $[43] !== parentComment || $[44] !== readOnly || $[45] !== t20 || $[46] !== t21 || $[47] !== t22 || $[48] !== t23 || $[49] !== t24 ? (t25 = /* @__PURE__ */ jsx(CommentsListItemLayout, { avatarSize: avatarConfig.avatarSize, canDelete: t20, canEdit: t21, comment: parentComment, currentUser, hasError: t22, hasReferencedValue, intent: t23, isParent: !0, isRetrying: t24, mentionOptions, mode, onCopyLink, onCreateRetry, onDelete, onEdit, onInputKeyDown: onKeyDown, onReactionSelect, onStatusChange, readOnly, withAvatar: avatarConfig.parentCommentAvatar }), $[30] = avatarConfig.avatarSize, $[31] = avatarConfig.parentCommentAvatar, $[32] = currentUser, $[33] = hasReferencedValue, $[34] = mentionOptions, $[35] = mode, $[36] = onCopyLink, $[37] = onCreateRetry, $[38] = onDelete, $[39] = onEdit, $[40] = onKeyDown, $[41] = onReactionSelect, $[42] = onStatusChange, $[43] = parentComment, $[44] = readOnly, $[45] = t20, $[46] = t21, $[47] = t22, $[48] = t23, $[49] = t24, $[50] = t25) : t25 = $[50];
|
|
71209
71286
|
let t26;
|
|
71210
|
-
$[
|
|
71287
|
+
$[51] !== t19 || $[52] !== t25 ? (t26 = /* @__PURE__ */ jsx(Stack, { as: "li", ...t19, children: t25 }), $[51] = t19, $[52] = t25, $[53] = t26) : t26 = $[53];
|
|
71211
71288
|
let t27;
|
|
71212
|
-
$[
|
|
71289
|
+
$[54] !== collapsed || $[55] !== expandButtonText || $[56] !== showCollapseButton ? (t27 = showCollapseButton && collapsed && /* @__PURE__ */ jsxs(Flex, { gap: 1, paddingY: 1, sizing: "border", children: [
|
|
71213
71290
|
/* @__PURE__ */ jsx(SpacerAvatar, {}),
|
|
71214
71291
|
/* @__PURE__ */ jsx(ExpandButton, { iconRight: ChevronDownIcon, mode: "bleed", onClick: handleExpand, text: expandButtonText })
|
|
71215
|
-
] }), $[
|
|
71292
|
+
] }), $[54] = collapsed, $[55] = expandButtonText, $[56] = showCollapseButton, $[57] = t27) : t27 = $[57];
|
|
71216
71293
|
let t28;
|
|
71217
|
-
if ($[
|
|
71294
|
+
if ($[58] !== avatarConfig.avatarSize || $[59] !== avatarConfig.threadCommentsAvatar || $[60] !== currentUser || $[61] !== handleInputKeyDown || $[62] !== mentionOptions || $[63] !== mode || $[64] !== onCopyLink || $[65] !== onCreateRetry || $[66] !== onDelete || $[67] !== onEdit || $[68] !== onReactionSelect || $[69] !== parentComment || $[70] !== readOnly || $[71] !== splicedReplies) {
|
|
71218
71295
|
let t292;
|
|
71219
|
-
$[
|
|
71296
|
+
$[73] !== avatarConfig.avatarSize || $[74] !== avatarConfig.threadCommentsAvatar || $[75] !== currentUser || $[76] !== handleInputKeyDown || $[77] !== mentionOptions || $[78] !== mode || $[79] !== onCopyLink || $[80] !== onCreateRetry || $[81] !== onDelete || $[82] !== onEdit || $[83] !== onReactionSelect || $[84] !== parentComment || $[85] !== readOnly ? (t292 = (reply) => /* @__PURE__ */ jsx(Stack, { as: "li", ...applyCommentIdAttr(reply._id), children: /* @__PURE__ */ jsx(CommentsListItemLayout, { avatarSize: avatarConfig.avatarSize, canDelete: reply.authorId === currentUser.id, canEdit: reply.authorId === currentUser.id, comment: reply, currentUser, hasError: reply._state?.type === "createError", isRetrying: reply._state?.type === "createRetrying", intent: commentIntentIfDiffers(parentComment, reply), mentionOptions, mode, onCopyLink, onCreateRetry, onDelete, onEdit, onInputKeyDown: handleInputKeyDown, onReactionSelect, readOnly, withAvatar: avatarConfig.threadCommentsAvatar }) }, reply._id), $[73] = avatarConfig.avatarSize, $[74] = avatarConfig.threadCommentsAvatar, $[75] = currentUser, $[76] = handleInputKeyDown, $[77] = mentionOptions, $[78] = mode, $[79] = onCopyLink, $[80] = onCreateRetry, $[81] = onDelete, $[82] = onEdit, $[83] = onReactionSelect, $[84] = parentComment, $[85] = readOnly, $[86] = t292) : t292 = $[86], t28 = splicedReplies.map(t292), $[58] = avatarConfig.avatarSize, $[59] = avatarConfig.threadCommentsAvatar, $[60] = currentUser, $[61] = handleInputKeyDown, $[62] = mentionOptions, $[63] = mode, $[64] = onCopyLink, $[65] = onCreateRetry, $[66] = onDelete, $[67] = onEdit, $[68] = onReactionSelect, $[69] = parentComment, $[70] = readOnly, $[71] = splicedReplies, $[72] = t28;
|
|
71220
71297
|
} else
|
|
71221
|
-
t28 = $[
|
|
71298
|
+
t28 = $[72];
|
|
71222
71299
|
let t29;
|
|
71223
|
-
$[
|
|
71300
|
+
$[87] !== avatarConfig.avatarSize || $[88] !== avatarConfig.replyAvatar || $[89] !== canReply || $[90] !== currentUser || $[91] !== handleInputKeyDown || $[92] !== handleReplySubmit || $[93] !== mentionOptions || $[94] !== mode || $[95] !== readOnly || $[96] !== t || $[97] !== value ? (t29 = canReply && /* @__PURE__ */ jsx(CommentInput, { avatarSize: avatarConfig.avatarSize, currentUser, expandOnFocus: !0, mentionOptions, onChange: setValue, onDiscardCancel: cancelDiscard, onDiscardConfirm: confirmDiscard, onKeyDown: handleInputKeyDown, onSubmit: handleReplySubmit, placeholder: t(mode === "upsell" ? "compose.reply-placeholder-upsell" : "compose.reply-placeholder"), readOnly: readOnly || mode === "upsell", ref: replyInputRef, value, withAvatar: avatarConfig.replyAvatar }), $[87] = avatarConfig.avatarSize, $[88] = avatarConfig.replyAvatar, $[89] = canReply, $[90] = currentUser, $[91] = handleInputKeyDown, $[92] = handleReplySubmit, $[93] = mentionOptions, $[94] = mode, $[95] = readOnly, $[96] = t, $[97] = value, $[98] = t29) : t29 = $[98];
|
|
71224
71301
|
let t30;
|
|
71225
|
-
$[
|
|
71302
|
+
$[99] !== innerPadding || $[100] !== t18 || $[101] !== t26 || $[102] !== t27 || $[103] !== t28 || $[104] !== t29 ? (t30 = /* @__PURE__ */ jsxs(Stack, { as: "ul", padding: innerPadding, paddingBottom: t18, space: 4, children: [
|
|
71226
71303
|
t26,
|
|
71227
71304
|
t27,
|
|
71228
71305
|
t28,
|
|
71229
71306
|
t29
|
|
71230
|
-
] }), $[
|
|
71307
|
+
] }), $[99] = innerPadding, $[100] = t18, $[101] = t26, $[102] = t27, $[103] = t28, $[104] = t29, $[105] = t30) : t30 = $[105];
|
|
71231
71308
|
let t31;
|
|
71232
|
-
return $[
|
|
71309
|
+
return $[106] !== handleThreadRootClick || $[107] !== t14 || $[108] !== t15 || $[109] !== t17 || $[110] !== t30 ? (t31 = /* @__PURE__ */ jsxs(StyledThreadCard, { "data-active": t14, "data-hovered": t15, "data-testid": "comments-list-item", "data-ui": "CommentsListItem", onClick: handleThreadRootClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [
|
|
71233
71310
|
t17,
|
|
71234
71311
|
t30
|
|
71235
|
-
] }), $[
|
|
71312
|
+
] }), $[106] = handleThreadRootClick, $[107] = t14, $[108] = t15, $[109] = t17, $[110] = t30, $[111] = t31) : t31 = $[111], t31;
|
|
71236
71313
|
});
|
|
71237
71314
|
CommentsListItem.displayName = "Memo(CommentsListItem)";
|
|
71238
71315
|
function getEmptyStateMessages(t) {
|
|
@@ -71288,7 +71365,7 @@ function CommentsListStatus(props2) {
|
|
|
71288
71365
|
}
|
|
71289
71366
|
const EMPTY_PT_ARRAY = [];
|
|
71290
71367
|
function CreateNewThreadInput(props2) {
|
|
71291
|
-
const $ = c(
|
|
71368
|
+
const $ = c(25), {
|
|
71292
71369
|
currentUser,
|
|
71293
71370
|
fieldTitle,
|
|
71294
71371
|
mentionOptions,
|
|
@@ -71302,40 +71379,40 @@ function CreateNewThreadInput(props2) {
|
|
|
71302
71379
|
t
|
|
71303
71380
|
} = useTranslation(commentsLocaleNamespace), [value, setValue] = useState(EMPTY_PT_ARRAY), commentInputHandle = useRef(null);
|
|
71304
71381
|
let t0;
|
|
71305
|
-
$[0] !== onNewThreadCreate
|
|
71306
|
-
onNewThreadCreate?.(
|
|
71307
|
-
}, $[0] = onNewThreadCreate, $[1] =
|
|
71382
|
+
$[0] !== onNewThreadCreate ? (t0 = (nextValue) => {
|
|
71383
|
+
onNewThreadCreate?.(nextValue), setValue(EMPTY_PT_ARRAY);
|
|
71384
|
+
}, $[0] = onNewThreadCreate, $[1] = t0) : t0 = $[1];
|
|
71308
71385
|
const handleSubmit = t0;
|
|
71309
71386
|
let t1;
|
|
71310
|
-
$[
|
|
71387
|
+
$[2] !== value ? (t1 = hasCommentMessageValue(value), $[2] = value, $[3] = t1) : t1 = $[3];
|
|
71311
71388
|
const hasValue2 = t1;
|
|
71312
71389
|
let t2;
|
|
71313
|
-
$[
|
|
71390
|
+
$[4] !== hasValue2 ? (t2 = () => {
|
|
71314
71391
|
hasValue2 && commentInputHandle.current?.discardDialogController.open();
|
|
71315
|
-
}, $[
|
|
71392
|
+
}, $[4] = hasValue2, $[5] = t2) : t2 = $[5];
|
|
71316
71393
|
const startDiscard = t2;
|
|
71317
71394
|
let t3;
|
|
71318
|
-
$[
|
|
71395
|
+
$[6] !== onKeyDown || $[7] !== startDiscard ? (t3 = (event) => {
|
|
71319
71396
|
event.isDefaultPrevented() || (event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), startDiscard()), onKeyDown && onKeyDown(event));
|
|
71320
|
-
}, $[
|
|
71397
|
+
}, $[6] = onKeyDown, $[7] = startDiscard, $[8] = t3) : t3 = $[8];
|
|
71321
71398
|
const handleInputKeyDown = t3;
|
|
71322
71399
|
let t4;
|
|
71323
|
-
$[
|
|
71400
|
+
$[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = () => {
|
|
71324
71401
|
setValue(EMPTY_PT_ARRAY), commentInputHandle.current?.discardDialogController.close(), commentInputHandle.current?.focus();
|
|
71325
|
-
}, $[
|
|
71402
|
+
}, $[9] = t4) : t4 = $[9];
|
|
71326
71403
|
const confirmDiscard = t4;
|
|
71327
71404
|
let t5;
|
|
71328
|
-
$[
|
|
71405
|
+
$[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
|
|
71329
71406
|
commentInputHandle.current?.discardDialogController.close();
|
|
71330
|
-
}, $[
|
|
71407
|
+
}, $[10] = t5) : t5 = $[10];
|
|
71331
71408
|
const cancelDiscard = t5;
|
|
71332
71409
|
let t6;
|
|
71333
|
-
$[
|
|
71410
|
+
$[11] !== fieldTitle || $[12] !== mode || $[13] !== t ? (t6 = mode === "upsell" ? t("compose.add-comment-input-placeholder-upsell") : /* @__PURE__ */ jsx(Translate, { t, i18nKey: "compose.add-comment-input-placeholder", values: {
|
|
71334
71411
|
field: fieldTitle
|
|
71335
|
-
} }), $[
|
|
71412
|
+
} }), $[11] = fieldTitle, $[12] = mode, $[13] = t, $[14] = t6) : t6 = $[14];
|
|
71336
71413
|
const placeholder = t6, t7 = readOnly || mode === "upsell";
|
|
71337
71414
|
let t8;
|
|
71338
|
-
return $[
|
|
71415
|
+
return $[15] !== currentUser || $[16] !== handleInputKeyDown || $[17] !== handleSubmit || $[18] !== mentionOptions || $[19] !== onBlur || $[20] !== onFocus || $[21] !== placeholder || $[22] !== t7 || $[23] !== value ? (t8 = /* @__PURE__ */ jsx(CommentInput, { currentUser, expandOnFocus: !0, mentionOptions, onBlur, onChange: setValue, onDiscardCancel: cancelDiscard, onDiscardConfirm: confirmDiscard, onKeyDown: handleInputKeyDown, onFocus, onSubmit: handleSubmit, placeholder, readOnly: t7, ref: commentInputHandle, value }), $[15] = currentUser, $[16] = handleInputKeyDown, $[17] = handleSubmit, $[18] = mentionOptions, $[19] = onBlur, $[20] = onFocus, $[21] = placeholder, $[22] = t7, $[23] = value, $[24] = t8) : t8 = $[24], t8;
|
|
71339
71416
|
}
|
|
71340
71417
|
const HeaderFlex$3 = styled(Flex).withConfig({
|
|
71341
71418
|
displayName: "HeaderFlex",
|
|
@@ -72951,8 +73028,8 @@ function CommentsFieldButton(props2) {
|
|
|
72951
73028
|
}, $[0] = addCommentButtonElement, $[1] = onClose, $[2] = open, $[3] = t0) : t0 = $[3];
|
|
72952
73029
|
const closePopover = t0;
|
|
72953
73030
|
let t1;
|
|
72954
|
-
$[4] !== closePopover || $[5] !== onCommentAdd ? (t1 = () => {
|
|
72955
|
-
onCommentAdd(), closePopover();
|
|
73031
|
+
$[4] !== closePopover || $[5] !== onCommentAdd ? (t1 = (nextValue) => {
|
|
73032
|
+
onCommentAdd(nextValue), closePopover();
|
|
72956
73033
|
}, $[4] = closePopover, $[5] = onCommentAdd, $[6] = t1) : t1 = $[6];
|
|
72957
73034
|
const handleSubmit = t1;
|
|
72958
73035
|
let t2;
|
|
@@ -73088,7 +73165,7 @@ const HighlightDiv = /* @__PURE__ */ styled(motion.div).withConfig({
|
|
|
73088
73165
|
componentId: "sc-xeguza-1"
|
|
73089
73166
|
})`position:relative;&:empty:not([hidden]){display:none;}`;
|
|
73090
73167
|
function CommentFieldInner(props2) {
|
|
73091
|
-
const $ = c(
|
|
73168
|
+
const $ = c(84), {
|
|
73092
73169
|
mode
|
|
73093
73170
|
} = props2, currentUser = useCurrentUser(), {
|
|
73094
73171
|
element: boundaryElement
|
|
@@ -73169,12 +73246,12 @@ function CommentFieldInner(props2) {
|
|
|
73169
73246
|
}, $[25] = comments2.data.open, $[26] = handleOpenDialog, $[27] = hasComments, $[28] = isOpen, $[29] = mode, $[30] = onCommentsOpen, $[31] = props2.path, $[32] = scrollToGroup, $[33] = setAuthoringPath, $[34] = setSelectedPath, $[35] = setStatus, $[36] = status, $[37] = stringPath, $[38] = upsellData, $[39] = t8) : t8 = $[39];
|
|
73170
73247
|
const handleClick = t8;
|
|
73171
73248
|
let t9;
|
|
73172
|
-
$[40] !== onCommentsOpen || $[41] !== operation || $[42] !== props2.path || $[43] !== resetMessageValue || $[44] !== scrollToGroup || $[45] !== setSelectedPath || $[46] !== setStatus || $[47] !== status
|
|
73173
|
-
if (
|
|
73249
|
+
$[40] !== onCommentsOpen || $[41] !== operation || $[42] !== props2.path || $[43] !== resetMessageValue || $[44] !== scrollToGroup || $[45] !== setSelectedPath || $[46] !== setStatus || $[47] !== status ? (t9 = (nextValue) => {
|
|
73250
|
+
if (nextValue) {
|
|
73174
73251
|
const newThreadId = uuid(), nextComment = {
|
|
73175
73252
|
type: "field",
|
|
73176
73253
|
fieldPath: PathUtils.toString(props2.path),
|
|
73177
|
-
message:
|
|
73254
|
+
message: nextValue,
|
|
73178
73255
|
parentCommentId: void 0,
|
|
73179
73256
|
status: "open",
|
|
73180
73257
|
threadId: newThreadId,
|
|
@@ -73186,41 +73263,41 @@ function CommentFieldInner(props2) {
|
|
|
73186
73263
|
fieldPath: PathUtils.toString(props2.path)
|
|
73187
73264
|
}), scrollToGroup(newThreadId);
|
|
73188
73265
|
}
|
|
73189
|
-
}, $[40] = onCommentsOpen, $[41] = operation, $[42] = props2.path, $[43] = resetMessageValue, $[44] = scrollToGroup, $[45] = setSelectedPath, $[46] = setStatus, $[47] = status, $[48] =
|
|
73266
|
+
}, $[40] = onCommentsOpen, $[41] = operation, $[42] = props2.path, $[43] = resetMessageValue, $[44] = scrollToGroup, $[45] = setSelectedPath, $[46] = setStatus, $[47] = status, $[48] = t9) : t9 = $[48];
|
|
73190
73267
|
const handleCommentAdd = t9;
|
|
73191
73268
|
let t10;
|
|
73192
|
-
$[
|
|
73269
|
+
$[49] !== setAuthoringPath ? (t10 = () => setAuthoringPath(null), $[49] = setAuthoringPath, $[50] = t10) : t10 = $[50];
|
|
73193
73270
|
const handleClose = t10;
|
|
73194
73271
|
let t11;
|
|
73195
|
-
$[
|
|
73196
|
-
setValue(
|
|
73197
|
-
}, $[
|
|
73272
|
+
$[51] !== stringPath ? (t11 = (nextValue_0) => {
|
|
73273
|
+
setValue(nextValue_0), messageCache.set(stringPath, nextValue_0);
|
|
73274
|
+
}, $[51] = stringPath, $[52] = t11) : t11 = $[52];
|
|
73198
73275
|
const handleOnChange = t11;
|
|
73199
73276
|
let t12;
|
|
73200
|
-
$[
|
|
73277
|
+
$[53] !== count2 || $[54] !== currentUser || $[55] !== fieldTitle || $[56] !== handleClick || $[57] !== handleClose || $[58] !== handleCommentAdd || $[59] !== handleOnChange || $[60] !== isCreatingDataset || $[61] !== isOpen || $[62] !== mentionOptions || $[63] !== resetMessageValue || $[64] !== value ? (t12 = currentUser && /* @__PURE__ */ jsx(CommentsFieldButton, { count: Number(count2), currentUser, fieldTitle, isCreatingDataset, mentionOptions, onChange: handleOnChange, onClick: handleClick, onClose: handleClose, onCommentAdd: handleCommentAdd, onDiscard: resetMessageValue, open: isOpen, value }), $[53] = count2, $[54] = currentUser, $[55] = fieldTitle, $[56] = handleClick, $[57] = handleClose, $[58] = handleCommentAdd, $[59] = handleOnChange, $[60] = isCreatingDataset, $[61] = isOpen, $[62] = mentionOptions, $[63] = resetMessageValue, $[64] = value, $[65] = t12) : t12 = $[65];
|
|
73201
73278
|
let t13;
|
|
73202
|
-
$[
|
|
73279
|
+
$[66] !== hasComments || $[67] !== isOpen || $[68] !== t12 ? (t13 = {
|
|
73203
73280
|
button: t12,
|
|
73204
73281
|
hasComments,
|
|
73205
73282
|
isAddingComment: isOpen
|
|
73206
|
-
}, $[
|
|
73283
|
+
}, $[66] = hasComments, $[67] = isOpen, $[68] = t12, $[69] = t13) : t13 = $[69];
|
|
73207
73284
|
const internalComments = t13;
|
|
73208
73285
|
let t14;
|
|
73209
|
-
$[
|
|
73286
|
+
$[70] !== props2.path ? (t14 = applyCommentsFieldAttr(PathUtils.toString(props2.path)), $[70] = props2.path, $[71] = t14) : t14 = $[71];
|
|
73210
73287
|
let t15;
|
|
73211
|
-
$[
|
|
73288
|
+
$[72] !== internalComments || $[73] !== props2 ? (t15 = props2.renderDefault({
|
|
73212
73289
|
...props2,
|
|
73213
73290
|
__internal_comments: internalComments
|
|
73214
|
-
}), $[
|
|
73291
|
+
}), $[72] = internalComments, $[73] = props2, $[74] = t15) : t15 = $[74];
|
|
73215
73292
|
let t16;
|
|
73216
|
-
$[
|
|
73293
|
+
$[75] !== isInlineCommentThread || $[76] !== isSelected ? (t16 = isSelected && !isInlineCommentThread && /* @__PURE__ */ jsx(HighlightDiv, { animate: "animate", exit: "exit", initial: "initial", variants: HIGHLIGHT_BLOCK_VARIANTS }), $[75] = isInlineCommentThread, $[76] = isSelected, $[77] = t16) : t16 = $[77];
|
|
73217
73294
|
let t17;
|
|
73218
|
-
$[
|
|
73295
|
+
$[78] !== t16 ? (t17 = /* @__PURE__ */ jsx(AnimatePresence, { children: t16 }), $[78] = t16, $[79] = t17) : t17 = $[79];
|
|
73219
73296
|
let t18;
|
|
73220
|
-
return $[
|
|
73297
|
+
return $[80] !== t14 || $[81] !== t15 || $[82] !== t17 ? (t18 = /* @__PURE__ */ jsxs(FieldStack, { ...t14, ref: rootRef, children: [
|
|
73221
73298
|
t15,
|
|
73222
73299
|
t17
|
|
73223
|
-
] }), $[
|
|
73300
|
+
] }), $[80] = t14, $[81] = t15, $[82] = t17, $[83] = t18) : t18 = $[83], t18;
|
|
73224
73301
|
}
|
|
73225
73302
|
function _temp2$o(acc, val) {
|
|
73226
73303
|
return acc + val;
|
|
@@ -73387,7 +73464,7 @@ function CommentsPortableTextInput(props2) {
|
|
|
73387
73464
|
return $[2] !== mode || $[3] !== props2 ? (t0 = /* @__PURE__ */ jsx(CommentsPortableTextInputInner, { ...props2, mode }), $[2] = mode, $[3] = props2, $[4] = t0) : t0 = $[4], t0;
|
|
73388
73465
|
}
|
|
73389
73466
|
const CommentsPortableTextInputInner = memo(function(props2) {
|
|
73390
|
-
const $ = c(
|
|
73467
|
+
const $ = c(97), {
|
|
73391
73468
|
mode
|
|
73392
73469
|
} = props2, currentUser = useCurrentUser(), portal = usePortal(), {
|
|
73393
73470
|
comments: comments2,
|
|
@@ -73448,7 +73525,7 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73448
73525
|
t6 = $[12];
|
|
73449
73526
|
const textComments = t6;
|
|
73450
73527
|
let t7;
|
|
73451
|
-
$[15] !== fragment || $[16] !== nextCommentSelection || $[17] !==
|
|
73528
|
+
$[15] !== fragment || $[16] !== nextCommentSelection || $[17] !== onCommentsOpen || $[18] !== operation || $[19] !== scrollToGroup || $[20] !== setSelectedPath || $[21] !== setStatus || $[22] !== status || $[23] !== stringFieldPath ? (t7 = (nextValue) => {
|
|
73452
73529
|
if (!nextCommentSelection || !editorRef.current)
|
|
73453
73530
|
return;
|
|
73454
73531
|
const editorValue = PortableTextEditor.getValue(editorRef.current);
|
|
@@ -73463,7 +73540,7 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73463
73540
|
type: "field",
|
|
73464
73541
|
contentSnapshot: fragment,
|
|
73465
73542
|
fieldPath: stringFieldPath,
|
|
73466
|
-
message:
|
|
73543
|
+
message: nextValue,
|
|
73467
73544
|
parentCommentId: void 0,
|
|
73468
73545
|
reactions: EMPTY_ARRAY$6,
|
|
73469
73546
|
selection: textSelection,
|
|
@@ -73474,20 +73551,20 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73474
73551
|
threadId,
|
|
73475
73552
|
origin: "form"
|
|
73476
73553
|
}), scrollToGroup(threadId), resetStates();
|
|
73477
|
-
}, $[15] = fragment, $[16] = nextCommentSelection, $[17] =
|
|
73554
|
+
}, $[15] = fragment, $[16] = nextCommentSelection, $[17] = onCommentsOpen, $[18] = operation, $[19] = scrollToGroup, $[20] = setSelectedPath, $[21] = setStatus, $[22] = status, $[23] = stringFieldPath, $[24] = t7) : t7 = $[24];
|
|
73478
73555
|
const handleSubmit = t7;
|
|
73479
73556
|
let t8;
|
|
73480
|
-
$[
|
|
73557
|
+
$[25] !== getComment || $[26] !== onCommentsOpen || $[27] !== scrollToComment || $[28] !== setSelectedPath ? (t8 = (commentId) => {
|
|
73481
73558
|
const comment_0 = getComment(commentId);
|
|
73482
73559
|
comment_0 && (setSelectedPath({
|
|
73483
73560
|
fieldPath: comment_0.target.path?.field || "",
|
|
73484
73561
|
threadId: comment_0.threadId,
|
|
73485
73562
|
origin: "form"
|
|
73486
73563
|
}), onCommentsOpen?.(), scrollToComment(comment_0._id));
|
|
73487
|
-
}, $[
|
|
73564
|
+
}, $[25] = getComment, $[26] = onCommentsOpen, $[27] = scrollToComment, $[28] = setSelectedPath, $[29] = t8) : t8 = $[29];
|
|
73488
73565
|
const handleDecoratorClick = t8, blurred = useRef(!1);
|
|
73489
73566
|
let t9;
|
|
73490
|
-
$[
|
|
73567
|
+
$[30] !== mousePressed ? (t9 = (selection) => {
|
|
73491
73568
|
const isRangeSelected = selection?.anchor.offset !== selection?.focus.offset;
|
|
73492
73569
|
if (!getFragment()?.every(isPortableTextTextBlock) || !isRangeSelected) {
|
|
73493
73570
|
setCanSubmit(!1);
|
|
@@ -73498,20 +73575,20 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73498
73575
|
return;
|
|
73499
73576
|
}
|
|
73500
73577
|
mousePressed || handleSetCurrentSelectionRect(), setCurrentSelection(selection), setCanSubmit(!0);
|
|
73501
|
-
}, $[
|
|
73578
|
+
}, $[30] = mousePressed, $[31] = t9) : t9 = $[31];
|
|
73502
73579
|
const debounceSelectionChange = useDebounceSelectionChange(t9);
|
|
73503
73580
|
let t10;
|
|
73504
|
-
$[
|
|
73581
|
+
$[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t10 = () => {
|
|
73505
73582
|
startTransition(() => setMousePressed(!0));
|
|
73506
|
-
}, $[
|
|
73583
|
+
}, $[32] = t10) : t10 = $[32];
|
|
73507
73584
|
const handleMouseDown = t10;
|
|
73508
73585
|
let t11;
|
|
73509
|
-
$[
|
|
73586
|
+
$[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t11 = () => {
|
|
73510
73587
|
startTransition(() => setMousePressed(!1)), handleSetCurrentSelectionRect();
|
|
73511
|
-
}, $[
|
|
73588
|
+
}, $[33] = t11) : t11 = $[33];
|
|
73512
73589
|
const handleMouseUp = t11;
|
|
73513
73590
|
let t12;
|
|
73514
|
-
$[
|
|
73591
|
+
$[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t12 = (details) => {
|
|
73515
73592
|
const {
|
|
73516
73593
|
rangeDecoration,
|
|
73517
73594
|
newSelection
|
|
@@ -73524,10 +73601,10 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73524
73601
|
dirty: !0
|
|
73525
73602
|
}
|
|
73526
73603
|
} : p));
|
|
73527
|
-
}, $[
|
|
73604
|
+
}, $[34] = t12) : t12 = $[34];
|
|
73528
73605
|
const handleRangeDecorationMoved = t12;
|
|
73529
73606
|
let t13;
|
|
73530
|
-
$[
|
|
73607
|
+
$[35] !== addedCommentsDecorations || $[36] !== getComment || $[37] !== operation ? (t13 = () => {
|
|
73531
73608
|
const decoratorsToUpdate = addedCommentsDecorations.filter(_temp3$d);
|
|
73532
73609
|
decoratorsToUpdate.length !== 0 && (decoratorsToUpdate.forEach((decorator_0) => {
|
|
73533
73610
|
const commentId_1 = decorator_0.payload?.commentId, comment_1 = getComment(commentId_1 || "");
|
|
@@ -73536,7 +73613,7 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73536
73613
|
const editorValue_0 = PortableTextEditor.getValue(editorRef.current) || EMPTY_ARRAY$6, [updatedDecoration] = buildRangeDecorationSelectionsFromComments({
|
|
73537
73614
|
comments: [comment_1],
|
|
73538
73615
|
value: editorValue_0
|
|
73539
|
-
}), nextRange = updatedDecoration?.range ? [updatedDecoration.range] : EMPTY_ARRAY$6,
|
|
73616
|
+
}), nextRange = updatedDecoration?.range ? [updatedDecoration.range] : EMPTY_ARRAY$6, nextValue_0 = updatedDecoration ? [...comment_1.target.path?.selection?.value.filter((r) => r._key !== nextRange[0]?._key).concat(nextRange).flat().sort(_temp4$5) || EMPTY_ARRAY$6] : EMPTY_ARRAY$6, nextComment = {
|
|
73540
73617
|
target: {
|
|
73541
73618
|
...comment_1.target,
|
|
73542
73619
|
path: {
|
|
@@ -73544,7 +73621,7 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73544
73621
|
field: comment_1.target.path?.field || "",
|
|
73545
73622
|
selection: {
|
|
73546
73623
|
type: "text",
|
|
73547
|
-
value:
|
|
73624
|
+
value: nextValue_0
|
|
73548
73625
|
}
|
|
73549
73626
|
}
|
|
73550
73627
|
}
|
|
@@ -73557,10 +73634,10 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73557
73634
|
dirty: !1
|
|
73558
73635
|
}
|
|
73559
73636
|
} : p_0).filter(_temp5$3)));
|
|
73560
|
-
}, $[
|
|
73637
|
+
}, $[35] = addedCommentsDecorations, $[36] = getComment, $[37] = operation, $[38] = t13) : t13 = $[38];
|
|
73561
73638
|
const updateCommentRange = t13;
|
|
73562
73639
|
let t14;
|
|
73563
|
-
$[
|
|
73640
|
+
$[39] !== currentHoveredCommentId || $[40] !== handleDecoratorClick || $[41] !== selectedPath?.threadId ? (t14 = (commentsToDecorate) => {
|
|
73564
73641
|
if (!editorRef.current)
|
|
73565
73642
|
return EMPTY_ARRAY$6;
|
|
73566
73643
|
const editorValue_1 = PortableTextEditor.getValue(editorRef.current) || EMPTY_ARRAY$6;
|
|
@@ -73574,12 +73651,12 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73574
73651
|
selectedThreadId: selectedPath?.threadId || null,
|
|
73575
73652
|
value: editorValue_1
|
|
73576
73653
|
});
|
|
73577
|
-
}, $[
|
|
73654
|
+
}, $[39] = currentHoveredCommentId, $[40] = handleDecoratorClick, $[41] = selectedPath?.threadId, $[42] = t14) : t14 = $[42];
|
|
73578
73655
|
const handleBuildRangeDecorations = t14;
|
|
73579
73656
|
let t15;
|
|
73580
|
-
$[
|
|
73657
|
+
$[43] !== debounceSelectionChange || $[44] !== updateCommentRange ? (t15 = (change) => {
|
|
73581
73658
|
change.type === "mutation" && updateCommentRange(), change.type === "blur" && (blurred.current = !0), change.type === "selection" && debounceSelectionChange(change.selection);
|
|
73582
|
-
}, $[
|
|
73659
|
+
}, $[43] = debounceSelectionChange, $[44] = updateCommentRange, $[45] = t15) : t15 = $[45];
|
|
73583
73660
|
const onEditorChange = t15;
|
|
73584
73661
|
let t16;
|
|
73585
73662
|
bb0: {
|
|
@@ -73588,38 +73665,38 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73588
73665
|
break bb0;
|
|
73589
73666
|
}
|
|
73590
73667
|
let t172;
|
|
73591
|
-
$[
|
|
73668
|
+
$[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t172 = (t183) => {
|
|
73592
73669
|
const {
|
|
73593
73670
|
children
|
|
73594
73671
|
} = t183;
|
|
73595
73672
|
return /* @__PURE__ */ jsx(CommentInlineHighlightSpan, { isAuthoring: !0, ref: setAuthoringDecorationElement, children });
|
|
73596
|
-
}, $[
|
|
73673
|
+
}, $[46] = t172) : t172 = $[46];
|
|
73597
73674
|
let t182;
|
|
73598
|
-
$[
|
|
73675
|
+
$[47] !== nextCommentSelection ? (t182 = {
|
|
73599
73676
|
component: t172,
|
|
73600
73677
|
selection: nextCommentSelection
|
|
73601
|
-
}, $[
|
|
73678
|
+
}, $[47] = nextCommentSelection, $[48] = t182) : t182 = $[48], t16 = t182;
|
|
73602
73679
|
}
|
|
73603
73680
|
const authoringDecoration = t16, t17 = props2?.rangeDecorations || EMPTY_ARRAY$6;
|
|
73604
73681
|
let t18;
|
|
73605
|
-
$[
|
|
73682
|
+
$[49] !== addedCommentsDecorations || $[50] !== authoringDecoration || $[51] !== t17 ? (t18 = [...t17, ...authoringDecoration ? [authoringDecoration] : EMPTY_ARRAY$6, ...addedCommentsDecorations], $[49] = addedCommentsDecorations, $[50] = authoringDecoration, $[51] = t17, $[52] = t18) : t18 = $[52];
|
|
73606
73683
|
const rangeDecorations = t18, [currentSelectionIsOverlapping, setCurrentSelectionIsOverlapping] = useState(!1);
|
|
73607
73684
|
let t19, t20;
|
|
73608
|
-
$[
|
|
73685
|
+
$[53] !== addedCommentsDecorations || $[54] !== currentSelection ? (t19 = () => {
|
|
73609
73686
|
startTransition(() => setCurrentSelectionIsOverlapping(() => !currentSelection || addedCommentsDecorations.length === 0 ? !1 : addedCommentsDecorations.some((d_0) => {
|
|
73610
73687
|
if (!editorRef.current)
|
|
73611
73688
|
return !1;
|
|
73612
73689
|
const testA = PortableTextEditor.isSelectionsOverlapping(editorRef.current, currentSelection, d_0.selection), testB = PortableTextEditor.isSelectionsOverlapping(editorRef.current, d_0.selection, currentSelection);
|
|
73613
73690
|
return testA || testB;
|
|
73614
73691
|
})));
|
|
73615
|
-
}, t20 = [addedCommentsDecorations, currentSelection], $[
|
|
73692
|
+
}, t20 = [addedCommentsDecorations, currentSelection], $[53] = addedCommentsDecorations, $[54] = currentSelection, $[55] = t19, $[56] = t20) : (t19 = $[55], t20 = $[56]), useEffect(t19, t20);
|
|
73616
73693
|
const scrollElement = isFullScreen ? document.body : portal.elements?.documentScrollElement || document.body, boundaryElement = isFullScreen ? portal.elements?.documentScrollElement || document.body : rootElement, t21 = !nextCommentSelection || !authoringDecorationElement;
|
|
73617
73694
|
let t22;
|
|
73618
|
-
$[
|
|
73695
|
+
$[57] !== scrollElement || $[58] !== t21 ? (t22 = {
|
|
73619
73696
|
scrollElement,
|
|
73620
73697
|
disabled: t21,
|
|
73621
73698
|
selector: '[data-inline-comment-state="authoring"]'
|
|
73622
|
-
}, $[
|
|
73699
|
+
}, $[57] = scrollElement, $[58] = t21, $[59] = t22) : t22 = $[59];
|
|
73623
73700
|
const popoverAuthoringReferenceElement = useAuthoringReferenceElement(t22);
|
|
73624
73701
|
let t23;
|
|
73625
73702
|
bb1: {
|
|
@@ -73628,20 +73705,20 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73628
73705
|
break bb1;
|
|
73629
73706
|
}
|
|
73630
73707
|
let t242;
|
|
73631
|
-
$[
|
|
73708
|
+
$[60] !== currentSelectionRect ? (t242 = {
|
|
73632
73709
|
getBoundingClientRect: () => currentSelectionRect
|
|
73633
|
-
}, $[
|
|
73710
|
+
}, $[60] = currentSelectionRect, $[61] = t242) : t242 = $[61], t23 = t242;
|
|
73634
73711
|
}
|
|
73635
73712
|
const selectionReferenceElement = t23;
|
|
73636
73713
|
let t24, t25;
|
|
73637
|
-
$[
|
|
73714
|
+
$[62] !== currentSelection || $[63] !== scrollElement ? (t24 = () => {
|
|
73638
73715
|
if (currentSelection)
|
|
73639
73716
|
return scrollElement?.addEventListener("wheel", handleSetCurrentSelectionRect), () => {
|
|
73640
73717
|
scrollElement?.removeEventListener("wheel", handleSetCurrentSelectionRect);
|
|
73641
73718
|
};
|
|
73642
|
-
}, t25 = [currentSelection, scrollElement, handleSetCurrentSelectionRect], $[
|
|
73719
|
+
}, t25 = [currentSelection, scrollElement, handleSetCurrentSelectionRect], $[62] = currentSelection, $[63] = scrollElement, $[64] = t24, $[65] = t25) : (t24 = $[64], t25 = $[65]), useEffect(t24, t25);
|
|
73643
73720
|
let t26, t27;
|
|
73644
|
-
$[
|
|
73721
|
+
$[66] !== handleBuildRangeDecorations || $[67] !== textComments ? (t26 = () => {
|
|
73645
73722
|
const nextDecorations = handleBuildRangeDecorations(textComments);
|
|
73646
73723
|
startTransition(() => setAddedCommentsDecorations((current) => nextDecorations.map((nextDecoration_1) => {
|
|
73647
73724
|
const prevDecoration = current.find((p_2) => p_2.payload?.commentId === nextDecoration_1.payload?.commentId);
|
|
@@ -73653,26 +73730,26 @@ const CommentsPortableTextInputInner = memo(function(props2) {
|
|
|
73653
73730
|
}
|
|
73654
73731
|
} : nextDecoration_1;
|
|
73655
73732
|
})));
|
|
73656
|
-
}, t27 = [handleBuildRangeDecorations, textComments], $[
|
|
73733
|
+
}, t27 = [handleBuildRangeDecorations, textComments], $[66] = handleBuildRangeDecorations, $[67] = textComments, $[68] = t26, $[69] = t27) : (t26 = $[68], t27 = $[69]), useEffect(t26, t27);
|
|
73657
73734
|
const showFloatingButton = !!(currentSelection && canSubmit && selectionReferenceElement && !mousePressed), showFloatingInput = !!(nextCommentSelection && popoverAuthoringReferenceElement);
|
|
73658
73735
|
let t28;
|
|
73659
|
-
$[
|
|
73736
|
+
$[70] !== currentUser || $[71] !== handleSubmit || $[72] !== mentionOptions || $[73] !== nextCommentValue || $[74] !== popoverAuthoringReferenceElement || $[75] !== showFloatingInput ? (t28 = showFloatingInput && currentUser && /* @__PURE__ */ jsx(InlineCommentInputPopover, { currentUser, mentionOptions, onChange: setNextCommentValue, onClickOutside: resetStates, onDiscardConfirm: handleCommentDiscardConfirm, onSubmit: handleSubmit, referenceElement: popoverAuthoringReferenceElement, value: nextCommentValue }), $[70] = currentUser, $[71] = handleSubmit, $[72] = mentionOptions, $[73] = nextCommentValue, $[74] = popoverAuthoringReferenceElement, $[75] = showFloatingInput, $[76] = t28) : t28 = $[76];
|
|
73660
73737
|
let t29;
|
|
73661
|
-
$[
|
|
73738
|
+
$[77] !== addonDatasetError || $[78] !== currentSelectionIsOverlapping || $[79] !== handleSelectCurrentSelection || $[80] !== selectionReferenceElement || $[81] !== showFloatingButton || $[82] !== showFloatingInput ? (t29 = showFloatingButton && !showFloatingInput && /* @__PURE__ */ jsx(FloatingButtonPopover, { disabled: currentSelectionIsOverlapping || !!addonDatasetError, onClick: handleSelectCurrentSelection, onClickOutside: resetStates, referenceElement: selectionReferenceElement }), $[77] = addonDatasetError, $[78] = currentSelectionIsOverlapping, $[79] = handleSelectCurrentSelection, $[80] = selectionReferenceElement, $[81] = showFloatingButton, $[82] = showFloatingInput, $[83] = t29) : t29 = $[83];
|
|
73662
73739
|
let t30;
|
|
73663
|
-
$[
|
|
73740
|
+
$[84] !== t29 ? (t30 = /* @__PURE__ */ jsx(AnimatePresence, { children: t29 }), $[84] = t29, $[85] = t30) : t30 = $[85];
|
|
73664
73741
|
let t31;
|
|
73665
|
-
$[
|
|
73742
|
+
$[86] !== boundaryElement || $[87] !== t28 || $[88] !== t30 ? (t31 = /* @__PURE__ */ jsxs(BoundaryElementProvider, { element: boundaryElement, children: [
|
|
73666
73743
|
t28,
|
|
73667
73744
|
t30
|
|
73668
|
-
] }), $[
|
|
73745
|
+
] }), $[86] = boundaryElement, $[87] = t28, $[88] = t30, $[89] = t31) : t31 = $[89];
|
|
73669
73746
|
let t32;
|
|
73670
|
-
$[
|
|
73747
|
+
$[90] !== onEditorChange || $[91] !== props2 || $[92] !== rangeDecorations ? (t32 = /* @__PURE__ */ jsx(Stack, { ref: setRootElement, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, children: /* @__PURE__ */ jsx(RenderDefaultCommentsPortableTextInputInner, { ...props2, onEditorChange, editorRef, rangeDecorations, onFullScreenChange: setIsFullScreen }) }), $[90] = onEditorChange, $[91] = props2, $[92] = rangeDecorations, $[93] = t32) : t32 = $[93];
|
|
73671
73748
|
let t33;
|
|
73672
|
-
return $[
|
|
73749
|
+
return $[94] !== t31 || $[95] !== t32 ? (t33 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
73673
73750
|
t31,
|
|
73674
73751
|
t32
|
|
73675
|
-
] }), $[
|
|
73752
|
+
] }), $[94] = t31, $[95] = t32, $[96] = t33) : t33 = $[96], t33;
|
|
73676
73753
|
});
|
|
73677
73754
|
function useDebounceSelectionChange(handleSelectionChange) {
|
|
73678
73755
|
const $ = c(2);
|