@ynput/ayon-frontend-shared 0.3.34 → 0.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index.cjs12.js +1 -1
- package/dist/_virtual/index.cjs13.js +1 -1
- package/dist/_virtual/index.cjs15.js +1 -1
- package/dist/_virtual/index.cjs18.js +1 -1
- package/dist/_virtual/index.cjs19.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs6.js +1 -1
- package/dist/_virtual/index.cjs9.js +1 -1
- package/dist/_virtual/index.es12.js +5 -2
- package/dist/_virtual/index.es12.js.map +1 -1
- package/dist/_virtual/index.es13.js +5 -2
- package/dist/_virtual/index.es13.js.map +1 -1
- package/dist/_virtual/index.es14.js +2 -2
- package/dist/_virtual/index.es15.js +2 -2
- package/dist/_virtual/index.es16.js +2 -2
- package/dist/_virtual/index.es17.js +2 -2
- package/dist/_virtual/index.es18.js +2 -2
- package/dist/_virtual/index.es19.js +2 -2
- package/dist/_virtual/index.es4.js +2 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es6.js +2 -2
- package/dist/_virtual/index.es7.js +2 -2
- package/dist/_virtual/index.es9.js +2 -5
- package/dist/_virtual/index.es9.js.map +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js.map +1 -1
- package/dist/node_modules/match-sorter/dist/match-sorter.esm.es.js +1 -1
- package/dist/node_modules/parse-numeric-range/index.cjs.js +1 -1
- package/dist/node_modules/parse-numeric-range/index.es.js +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js.map +1 -1
- package/dist/node_modules/remove-accents/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/error-codes/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/error-codes/dist/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime/dist/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js.map +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js.map +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js.map +1 -1
- package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.es.js +1 -1
- package/dist/shared/node_modules/@module-federation/sdk/dist/index.cjs.js +1 -1
- package/dist/shared/node_modules/@module-federation/sdk/dist/index.es.js +1 -1
- package/dist/shared/node_modules/prop-types/index.cjs.js +1 -1
- package/dist/shared/node_modules/prop-types/index.es.js +1 -1
- package/dist/shared/node_modules/react-is/index.cjs.js +1 -1
- package/dist/shared/node_modules/react-is/index.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
- package/dist/shared/src/containers/Feed/Feed.cjs.js +1 -1
- package/dist/shared/src/containers/Feed/Feed.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/Feed.es.js +7 -10
- package/dist/shared/src/containers/Feed/Feed.es.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/ActivityComment/ActivityComment.cjs.js +1 -1
- package/dist/shared/src/containers/Feed/components/ActivityComment/ActivityComment.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.cjs.js +1 -1
- package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.es.js +9 -5
- package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.es.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.cjs.js +2 -2
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.es.js +207 -233
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.es.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.cjs.js +5 -10
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.es.js +12 -17
- package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.es.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.cjs.js +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.es.js +16 -22
- package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.es.js.map +1 -1
- package/dist/shared/src/containers/Feed/components/CommentInput/types.cjs.js +2 -0
- package/dist/shared/src/containers/Feed/components/CommentInput/types.cjs.js.map +1 -0
- package/dist/shared/src/containers/Feed/components/CommentInput/types.es.js +18 -0
- package/dist/shared/src/containers/Feed/components/CommentInput/types.es.js.map +1 -0
- package/dist/shared/src/containers/Feed/hooks/useCommentMutations.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/hooks/useCommentMutations.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +67 -64
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
- package/dist/shared/src/containers/RepresentationsList/RepresentationsList.cjs.js +1 -1
- package/dist/shared/src/containers/RepresentationsList/RepresentationsList.cjs.js.map +1 -1
- package/dist/shared/src/containers/RepresentationsList/RepresentationsList.es.js +13 -11
- package/dist/shared/src/containers/RepresentationsList/RepresentationsList.es.js.map +1 -1
- package/dist/types/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.d.ts +1 -1
- package/dist/types/containers/Feed/components/CommentInput/CommentInput.d.ts +1 -16
- package/dist/types/containers/Feed/components/CommentInput/VersionReviewPill.d.ts +1 -2
- package/dist/types/containers/Feed/components/CommentInput/index.d.ts +2 -0
- package/dist/types/containers/Feed/components/CommentInput/types.d.ts +16 -0
- package/dist/types/containers/Feed/hooks/useCommentMutations.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { j as e } from "../../../../../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import { useState as f, useRef as
|
|
3
|
-
import
|
|
4
|
-
import { toast as
|
|
2
|
+
import { useState as f, useRef as O, useEffect as It, useMemo as bt } from "react";
|
|
3
|
+
import N from "clsx";
|
|
4
|
+
import { toast as At } from "react-toastify";
|
|
5
5
|
import uo, { Quill as fo } from "react-quill-ayon";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as U, SaveButton as ho, Icon as go } from "@ynput/ayon-react-components";
|
|
7
7
|
import xo from "../CommentMentionSelect/CommentMentionSelect.es.js";
|
|
8
8
|
import yo from "./InputMarkdownConvert.es.js";
|
|
9
9
|
import Co from "../FilesGrid/FilesGrid.es.js";
|
|
10
|
-
import { VersionReviewButtons as vo, VersionReviewButton as
|
|
10
|
+
import { VersionReviewButtons as vo, VersionReviewButton as Rt, AutoHeight as wo, Comment as ko, Markdown as jo, Placeholder as So, Footer as Mo, Buttons as To, SubmitButtons as Do, Dropzone as Fo, VersionReviewButtonsSpacer as Po } from "./CommentInput.styled.es.js";
|
|
11
11
|
import { QuillListStyles as Io } from "../../../../components/QuillListStyles/QuillListStyles.es.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import bo from "../../mentionHelpers/getMentionOptions.es.js";
|
|
13
|
+
import Ao from "../../mentionHelpers/getMentionUsers.es.js";
|
|
14
|
+
import Ro from "../../mentionHelpers/getMentionTasks.es.js";
|
|
15
|
+
import Eo from "../../mentionHelpers/getMentionVersions.es.js";
|
|
16
16
|
import { convertToMarkdown as Bo } from "./quillToMarkdown.es.js";
|
|
17
|
-
import {
|
|
18
|
-
import { getModules as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
17
|
+
import { handleFileDrop as No, parseImages as Uo, typeWithDelay as Vo } from "./helpers.es.js";
|
|
18
|
+
import { getModules as qo, quillFormats as Lo } from "./modules/index.es.js";
|
|
19
|
+
import Ho from "./hooks/useInitialValue.es.js";
|
|
20
|
+
import _o from "./hooks/useSetCursorEnd.es.js";
|
|
21
21
|
import Ko from "./hooks/useMentionLink.es.js";
|
|
22
22
|
import $o from "./hooks/useAnnotationsSync.es.js";
|
|
23
23
|
import { useBlendedCategoryColor as Go } from "./hooks/useBlendedCategoryColor.es.js";
|
|
@@ -249,7 +249,7 @@ import "../../../../components/EntityPanelUploader/EntityPanelUploader.styled.es
|
|
|
249
249
|
import "axios";
|
|
250
250
|
import "../../../../components/ReviewablesList/ReviewablesList.styled.es.js";
|
|
251
251
|
import "../../../../components/ReviewablesList/ReviewablesUpload.styled.es.js";
|
|
252
|
-
import { parseFilename as
|
|
252
|
+
import { parseFilename as S } from "../../../../components/ReviewablesList/useReviewablesUpload.es.js";
|
|
253
253
|
import "../../../../components/EntityPath/EntityPath.styled.es.js";
|
|
254
254
|
import "../../../../components/EntityPath/SegmentProvider.es.js";
|
|
255
255
|
import "../../../../components/FeaturedVersionOrder/FeaturedVersionOrder.es.js";
|
|
@@ -293,131 +293,126 @@ import "../ActivityAssigneeChange/ActivityAssigneeChange.styled.es.js";
|
|
|
293
293
|
import "../ActivityVersions/ActivityVersions.styled.es.js";
|
|
294
294
|
import "../ActivityGroup/ActivityGroup.styled.es.js";
|
|
295
295
|
import "../ActivityVersionReview/ActivityVersionReview.styled.es.js";
|
|
296
|
-
import {
|
|
296
|
+
import { VersionReviewFeedback as Et, mentionTypeOptions as V } from "./types.es.js";
|
|
297
|
+
import { ActivityCategorySelect as Jo, isCategoryHidden as Oo } from "../ActivityCategorySelect/ActivityCategorySelect.es.js";
|
|
297
298
|
import "../ActivityCategorySelect/CategoryDropdownItem.es.js";
|
|
298
299
|
import "../../Feed.styled.es.js";
|
|
299
|
-
import { VersionReviewPill as
|
|
300
|
-
var
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
id: "task"
|
|
304
|
-
},
|
|
305
|
-
"@@": {
|
|
306
|
-
id: "version"
|
|
307
|
-
},
|
|
308
|
-
"@": {
|
|
309
|
-
id: "user",
|
|
310
|
-
isCircle: !0
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
var Zo = /* @__PURE__ */ ((j) => (j.APPROVE = "approve", j.REQUEST_CHANGES = "request_changes", j))(Zo || {});
|
|
314
|
-
const Ap = ({
|
|
315
|
-
initValue: j,
|
|
300
|
+
import { VersionReviewPill as Xo } from "./VersionReviewPill.es.js";
|
|
301
|
+
var Bt = fo.import("delta");
|
|
302
|
+
const Zo = "<p><br></p>", q = ["@", "@@", "@@@"], Rp = ({
|
|
303
|
+
initValue: X,
|
|
316
304
|
initFiles: Nt = [],
|
|
317
305
|
initCategory: Ut = null,
|
|
318
|
-
data:
|
|
319
|
-
versionReview:
|
|
320
|
-
lastOwnVersionReview:
|
|
306
|
+
data: Z = {},
|
|
307
|
+
versionReview: tt,
|
|
308
|
+
lastOwnVersionReview: ot,
|
|
321
309
|
onSubmit: et,
|
|
322
|
-
|
|
323
|
-
|
|
310
|
+
onReview: L,
|
|
311
|
+
isEditing: s,
|
|
312
|
+
disabled: M,
|
|
324
313
|
isLoading: rt,
|
|
325
|
-
isOpen:
|
|
314
|
+
isOpen: a,
|
|
326
315
|
onOpen: it,
|
|
327
|
-
onClose: nt
|
|
328
|
-
onReview: $
|
|
316
|
+
onClose: nt
|
|
329
317
|
}) => {
|
|
330
318
|
const {
|
|
331
|
-
projectName:
|
|
332
|
-
entities:
|
|
333
|
-
projectInfo:
|
|
334
|
-
scope:
|
|
335
|
-
feedFilter:
|
|
336
|
-
mentionSuggestionsData:
|
|
319
|
+
projectName: k,
|
|
320
|
+
entities: H,
|
|
321
|
+
projectInfo: Vt,
|
|
322
|
+
scope: te,
|
|
323
|
+
feedFilter: qt,
|
|
324
|
+
mentionSuggestionsData: Lt,
|
|
337
325
|
categories: mt,
|
|
338
326
|
isGuest: h
|
|
339
|
-
} = zo(), { hasLicense:
|
|
327
|
+
} = zo(), { hasLicense: Ht, onPowerFeature: _t, user: Kt } = Wo(), $t = Kt?.data?.isAdmin, Gt = Yo(), {
|
|
340
328
|
users: pt,
|
|
341
329
|
teams: st,
|
|
342
330
|
versions: at,
|
|
343
331
|
tasks: lt
|
|
344
|
-
} =
|
|
345
|
-
entityId:
|
|
346
|
-
filesUploading:
|
|
347
|
-
}), [m,
|
|
348
|
-
|
|
349
|
-
}, [
|
|
350
|
-
|
|
332
|
+
} = Lt || {}, [ct, Qt] = f(88), [T, b] = f(""), [v, A] = f(Nt), [_, R] = f([]), [dt, E] = f(!1), [zt, ut] = f(!1), { annotations: D, removeAnnotation: Wt, goToAnnotation: Yt } = $o({
|
|
333
|
+
entityId: H[0]?.id,
|
|
334
|
+
filesUploading: _
|
|
335
|
+
}), [m, K] = f(null), [$, G] = f(0), [F, ft] = f(""), P = () => {
|
|
336
|
+
K(null), G(0), ft("");
|
|
337
|
+
}, [B, Jt] = f(Ut), ht = mt.filter((t) => t.accessLevel >= 20), gt = mt.find((t) => t.name === B), xt = Go(gt?.color), c = O(null), Ot = O(null), yt = O(null);
|
|
338
|
+
Ho({
|
|
351
339
|
markdownRef: yt,
|
|
352
|
-
initValue:
|
|
340
|
+
initValue: X,
|
|
353
341
|
setEditorValue: b,
|
|
354
342
|
setInitHeight: Qt,
|
|
355
|
-
isOpen:
|
|
356
|
-
filter:
|
|
357
|
-
}),
|
|
358
|
-
if (
|
|
359
|
-
if (c.current?.getEditor()?.enable(),
|
|
343
|
+
isOpen: a,
|
|
344
|
+
filter: qt
|
|
345
|
+
}), _o({ initHeight: ct, editorRef: c, isEditing: s }), Ko({ projectName: k }), It(() => {
|
|
346
|
+
if (a) {
|
|
347
|
+
if (c.current?.getEditor()?.enable(), D.length > 0 && v.length === 0)
|
|
360
348
|
return;
|
|
361
349
|
c.current?.focus();
|
|
362
350
|
}
|
|
363
|
-
}, [
|
|
364
|
-
const Ct = F + (m?.search || ""), vt =
|
|
365
|
-
() =>
|
|
351
|
+
}, [a, c]), q.sort((t, o) => o.length - t.length);
|
|
352
|
+
const Ct = F + (m?.search || ""), vt = bt(
|
|
353
|
+
() => bo(
|
|
366
354
|
m?.type,
|
|
367
355
|
{
|
|
368
|
-
"@": () =>
|
|
369
|
-
"@@": () =>
|
|
370
|
-
"@@@": () =>
|
|
356
|
+
"@": () => Ao(pt, st),
|
|
357
|
+
"@@": () => Eo(at, Gt),
|
|
358
|
+
"@@@": () => Ro(lt, Vt.taskTypes)
|
|
371
359
|
},
|
|
372
360
|
Ct || void 0
|
|
373
361
|
),
|
|
374
|
-
[
|
|
375
|
-
|
|
362
|
+
[
|
|
363
|
+
lt,
|
|
364
|
+
at,
|
|
365
|
+
pt,
|
|
366
|
+
st,
|
|
367
|
+
m?.type,
|
|
368
|
+
Ct
|
|
369
|
+
]
|
|
370
|
+
), I = vt.slice(0, 5), [Q, wt] = f();
|
|
376
371
|
It(() => {
|
|
377
|
-
|
|
378
|
-
}, [
|
|
379
|
-
const
|
|
380
|
-
const o = c.current.getEditor(), r = m.type, n = r + (m.search || ""), i = r + t.label, d = V[r], g = `${t.type || d?.id}:${t.id}`,
|
|
381
|
-
o.deleteText(
|
|
382
|
-
const l =
|
|
383
|
-
o.updateContents(new
|
|
384
|
-
},
|
|
385
|
-
|
|
386
|
-
},
|
|
372
|
+
Q && (wt(null), c.current.getEditor().setSelection(Q));
|
|
373
|
+
}, [Q]);
|
|
374
|
+
const kt = (t) => {
|
|
375
|
+
const o = c.current.getEditor(), r = m.type, n = r + (m.search || ""), i = r + t.label, d = V[r], g = `${t.type || d?.id}:${t.id}`, p = (o.getSelection(!0)?.index || 0) - n.length;
|
|
376
|
+
o.deleteText(p, n.length), o.insertText(p, i, "mention", g);
|
|
377
|
+
const l = p + i.length;
|
|
378
|
+
o.updateContents(new Bt().retain(l).insert(" ")), o.updateContents(new Bt().retain(l + 1).delete(1)), wt(l + 1), P();
|
|
379
|
+
}, Xt = (t) => {
|
|
380
|
+
kt(t);
|
|
381
|
+
}, Zt = (t, o, r, n) => {
|
|
387
382
|
let i = o.ops[0] && o.ops[0].insert || o.ops[1] && o.ops[1].insert;
|
|
388
383
|
const d = i === `
|
|
389
|
-
` || i === " ", y = vt[
|
|
384
|
+
` || i === " ", y = vt[$];
|
|
390
385
|
if (m && d && y && !h) {
|
|
391
|
-
o.ops[0] && o.ops[0].retain,
|
|
386
|
+
o.ops[0] && o.ops[0].retain, kt(y);
|
|
392
387
|
return;
|
|
393
388
|
}
|
|
394
389
|
b(t);
|
|
395
390
|
const g = o.ops.length === 2 && !!o.ops[1].delete;
|
|
396
|
-
if (!i && g && (i = n.getText(o.ops[0].retain - 1, 1)),
|
|
397
|
-
const u = o.ops.findIndex((C) => "insert" in C || "delete" in C),
|
|
391
|
+
if (!i && g && (i = n.getText(o.ops[0].retain - 1, 1)), q.includes(i)) {
|
|
392
|
+
const u = o.ops.findIndex((C) => "insert" in C || "delete" in C), p = i;
|
|
398
393
|
let l = u === 0 ? 0 : o.ops[u - 1].retain;
|
|
399
394
|
g && (l = l - 1);
|
|
400
|
-
let
|
|
401
|
-
for (const C of
|
|
402
|
-
let
|
|
403
|
-
if (C.endsWith(
|
|
395
|
+
let w = null;
|
|
396
|
+
for (const C of q) {
|
|
397
|
+
let j = !0;
|
|
398
|
+
if (C.endsWith(p))
|
|
404
399
|
for (let x = C.length - 1; x >= 0; x--) {
|
|
405
400
|
if (x === 0) continue;
|
|
406
|
-
const
|
|
407
|
-
if (n.getText(
|
|
408
|
-
|
|
401
|
+
const lo = C[x - 1], co = l - (C.length - x);
|
|
402
|
+
if (n.getText(co, 1) !== lo) {
|
|
403
|
+
j = !1;
|
|
409
404
|
break;
|
|
410
405
|
}
|
|
411
406
|
}
|
|
412
407
|
else
|
|
413
|
-
|
|
414
|
-
if (
|
|
415
|
-
|
|
408
|
+
j = !1;
|
|
409
|
+
if (j) {
|
|
410
|
+
w = C;
|
|
416
411
|
break;
|
|
417
412
|
}
|
|
418
413
|
}
|
|
419
|
-
|
|
420
|
-
type:
|
|
414
|
+
w ? K({
|
|
415
|
+
type: w,
|
|
421
416
|
retain: l
|
|
422
417
|
}) : P();
|
|
423
418
|
} else if (m) {
|
|
@@ -426,20 +421,20 @@ const Ap = ({
|
|
|
426
421
|
P();
|
|
427
422
|
return;
|
|
428
423
|
}
|
|
429
|
-
let
|
|
430
|
-
g ||
|
|
431
|
-
const l = n.getText(m.retain,
|
|
432
|
-
l.includes(" ") ? P() :
|
|
424
|
+
let p = u - m.retain;
|
|
425
|
+
g || p++;
|
|
426
|
+
const l = n.getText(m.retain, p), w = l.replace(m.type.slice(-1), "");
|
|
427
|
+
l.includes(" ") ? P() : K({
|
|
433
428
|
...m,
|
|
434
|
-
search:
|
|
429
|
+
search: w?.toLowerCase()
|
|
435
430
|
});
|
|
436
431
|
} else if (g) {
|
|
437
|
-
const u = c.current.getEditor(),
|
|
438
|
-
if (u.getFormat(
|
|
439
|
-
const [
|
|
440
|
-
if (
|
|
441
|
-
const x =
|
|
442
|
-
u.deleteText(
|
|
432
|
+
const u = c.current.getEditor(), p = u.getSelection(!1);
|
|
433
|
+
if (u.getFormat(p?.index, p?.length).mention) {
|
|
434
|
+
const [w] = u.getLine(p.index - 1) || [], j = (w?.cache?.delta?.ops || []).reverse().find((x) => x.attributes?.mention);
|
|
435
|
+
if (j) {
|
|
436
|
+
const x = j.insert.length;
|
|
437
|
+
u.deleteText(p.index - x, x);
|
|
443
438
|
}
|
|
444
439
|
}
|
|
445
440
|
}
|
|
@@ -447,73 +442,73 @@ const Ap = ({
|
|
|
447
442
|
const o = c.current.getEditor();
|
|
448
443
|
let r = o.getSelection(!0)?.index || 0;
|
|
449
444
|
const n = o.getText(r - 1, 1);
|
|
450
|
-
n !== " " && n && (o.insertText(r, " "), r++),
|
|
451
|
-
},
|
|
445
|
+
n !== " " && n && (o.insertText(r, " "), r++), Vo(o, r, t);
|
|
446
|
+
}, z = (t) => {
|
|
452
447
|
if (m) {
|
|
453
448
|
const { type: o, retain: r, search: n = "" } = m, i = c.current.getEditor(), d = o.length + n.length, y = r - o.length + 1;
|
|
454
449
|
i.deleteText(y, d);
|
|
455
450
|
}
|
|
456
451
|
to(t);
|
|
457
452
|
}, oo = () => {
|
|
458
|
-
|
|
459
|
-
},
|
|
460
|
-
(c.current.getEditor().getText().length < 2 ||
|
|
461
|
-
},
|
|
462
|
-
const r =
|
|
453
|
+
a || M || it && it();
|
|
454
|
+
}, jt = () => {
|
|
455
|
+
(c.current.getEditor().getText().length < 2 || s) && b(""), nt && nt();
|
|
456
|
+
}, W = ({ file: t, data: o }) => {
|
|
457
|
+
const r = S(t.name), n = {
|
|
463
458
|
id: o.id,
|
|
464
459
|
name: r,
|
|
465
460
|
mime: t.type,
|
|
466
461
|
size: t.size,
|
|
467
|
-
order:
|
|
462
|
+
order: v.length
|
|
468
463
|
};
|
|
469
|
-
return
|
|
470
|
-
(i) => i.filter((d) =>
|
|
464
|
+
return A((i) => [...i, n]), R(
|
|
465
|
+
(i) => i.filter((d) => S(d.name) !== r)
|
|
471
466
|
), n;
|
|
472
467
|
}, eo = (t, o, r) => {
|
|
473
|
-
r ? Wt?.(t) : (
|
|
474
|
-
},
|
|
468
|
+
r ? Wt?.(t) : (A((n) => n.filter((i) => i.id !== t)), R((n) => n.filter((i) => S(i.name) !== S(o))));
|
|
469
|
+
}, St = (t, o) => {
|
|
475
470
|
const r = Math.round(t.loaded * 100 / t.total);
|
|
476
471
|
if (r !== 100) {
|
|
477
|
-
const n =
|
|
472
|
+
const n = S(o.name), i = {
|
|
478
473
|
name: n,
|
|
479
474
|
progress: r,
|
|
480
475
|
type: o.type,
|
|
481
|
-
order:
|
|
476
|
+
order: v.length + _.length
|
|
482
477
|
};
|
|
483
|
-
|
|
478
|
+
R((d) => [...d.filter((g) => S(g.name) !== n), i]);
|
|
484
479
|
}
|
|
485
480
|
}, ro = (t) => {
|
|
486
|
-
|
|
481
|
+
E(!1), No(t, k, St, W);
|
|
487
482
|
}, io = (t) => {
|
|
488
|
-
t.preventDefault(), t.stopPropagation(),
|
|
483
|
+
t.preventDefault(), t.stopPropagation(), E(!0);
|
|
489
484
|
}, no = Qo({
|
|
490
|
-
projectName:
|
|
491
|
-
onSuccess:
|
|
492
|
-
}),
|
|
485
|
+
projectName: k,
|
|
486
|
+
onSuccess: W
|
|
487
|
+
}), Y = async () => {
|
|
493
488
|
try {
|
|
494
489
|
ut(!0);
|
|
495
490
|
let t = [], o;
|
|
496
|
-
if (
|
|
497
|
-
const { files: y, metadata: g } = await no(
|
|
491
|
+
if (D.length) {
|
|
492
|
+
const { files: y, metadata: g } = await no(D);
|
|
498
493
|
t = y;
|
|
499
|
-
const { annotations:
|
|
500
|
-
o = [...
|
|
494
|
+
const { annotations: J = [] } = Z || {};
|
|
495
|
+
o = [...J, ...g];
|
|
501
496
|
}
|
|
502
|
-
const [r] = Bo(
|
|
503
|
-
...
|
|
497
|
+
const [r] = Bo(T), n = Uo(r), i = [...v, ...t], d = {
|
|
498
|
+
...Z,
|
|
504
499
|
annotations: o,
|
|
505
500
|
// could be undefined
|
|
506
|
-
category: h ? null :
|
|
501
|
+
category: h ? null : B
|
|
507
502
|
// guests cannot set category (it is done by default on backend)
|
|
508
503
|
};
|
|
509
504
|
if ((n || i.length) && et)
|
|
510
505
|
try {
|
|
511
|
-
await et(n, i, d), b(""),
|
|
506
|
+
await et(n, i, d), b(""), A([]);
|
|
512
507
|
} catch {
|
|
513
508
|
return;
|
|
514
509
|
}
|
|
515
510
|
} catch (t) {
|
|
516
|
-
console.error(t),
|
|
511
|
+
console.error(t), At.error("Something went wrong");
|
|
517
512
|
} finally {
|
|
518
513
|
ut(!1);
|
|
519
514
|
}
|
|
@@ -527,91 +522,82 @@ const Ap = ({
|
|
|
527
522
|
const o = t.key === "ArrowUp" ? -1 : t.key === "ArrowDown" ? 1 : 0;
|
|
528
523
|
if (o) {
|
|
529
524
|
t.preventDefault();
|
|
530
|
-
let r =
|
|
531
|
-
r < 0 && (r = I.length - 1), r >= I.length && (r = 0),
|
|
525
|
+
let r = $ + o;
|
|
526
|
+
r < 0 && (r = I.length - 1), r >= I.length && (r = 0), G(r);
|
|
532
527
|
}
|
|
533
528
|
t.key;
|
|
534
529
|
}
|
|
535
|
-
t.key === "Enter" && (t.ctrlKey || t.metaKey) &&
|
|
530
|
+
t.key === "Enter" && (t.ctrlKey || t.metaKey) && Y(), t.key === "Escape" && jt();
|
|
536
531
|
};
|
|
537
|
-
let
|
|
538
|
-
|
|
539
|
-
const po =
|
|
540
|
-
() =>
|
|
532
|
+
let Mt = a ? ct + 41 : 44;
|
|
533
|
+
s && (Mt = void 0);
|
|
534
|
+
const po = bt(
|
|
535
|
+
() => qo({
|
|
541
536
|
imageUploader: {
|
|
542
|
-
projectName:
|
|
543
|
-
onUpload:
|
|
544
|
-
onUploadProgress:
|
|
537
|
+
projectName: k,
|
|
538
|
+
onUpload: W,
|
|
539
|
+
onUploadProgress: St
|
|
545
540
|
},
|
|
546
541
|
mentionTypeOptions: V
|
|
547
542
|
}),
|
|
548
|
-
[
|
|
549
|
-
),
|
|
543
|
+
[k, A, R]
|
|
544
|
+
), Tt = [...D, ...v || [], ..._].sort(
|
|
550
545
|
(t, o) => t.order - o.order
|
|
551
|
-
), so =
|
|
546
|
+
), so = Tt.length > 3;
|
|
552
547
|
let Dt = null;
|
|
553
|
-
|
|
554
|
-
const Ft = (t) =>
|
|
548
|
+
H.length && H[0].entityType === "folder" && m?.type === "@@" && (Dt = "Version mentions are disabled for folders");
|
|
549
|
+
const Ft = (t) => M ? h ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : h || !t ? "Leave a comment" : "Comment or mention with @user, @@version, @@@task...", Pt = async (t) => {
|
|
550
|
+
if (L)
|
|
551
|
+
try {
|
|
552
|
+
(T && T !== Zo || v.length > 0 || D.length > 0) && await Y(), L(t);
|
|
553
|
+
} catch (o) {
|
|
554
|
+
console.error(o), At.error("Something went wrong while submitting the review");
|
|
555
|
+
}
|
|
556
|
+
}, ao = tt && L && /* @__PURE__ */ e.jsxs(vo, { className: N("version-review-buttons", { guest: h }), children: [
|
|
555
557
|
/* @__PURE__ */ e.jsx(
|
|
556
|
-
|
|
558
|
+
Rt,
|
|
557
559
|
{
|
|
558
560
|
icon: "check",
|
|
559
561
|
variant: "tertiary",
|
|
560
562
|
"data-tooltip": "Approve",
|
|
561
|
-
onClick: () =>
|
|
562
|
-
v && v !== Bt && R(), $(
|
|
563
|
-
"approve"
|
|
564
|
-
/* APPROVE */
|
|
565
|
-
);
|
|
566
|
-
},
|
|
563
|
+
onClick: () => Pt(Et.APPROVE),
|
|
567
564
|
children: /* @__PURE__ */ e.jsx("span", { className: "label", children: "Approve" })
|
|
568
565
|
}
|
|
569
566
|
),
|
|
570
567
|
/* @__PURE__ */ e.jsx(
|
|
571
|
-
|
|
568
|
+
Rt,
|
|
572
569
|
{
|
|
573
570
|
icon: "refresh",
|
|
574
571
|
variant: "danger",
|
|
575
572
|
"data-tooltip": "Request changes",
|
|
576
|
-
onClick: () =>
|
|
577
|
-
v && v !== Bt && R(), $(
|
|
578
|
-
"request_changes"
|
|
579
|
-
/* REQUEST_CHANGES */
|
|
580
|
-
);
|
|
581
|
-
},
|
|
573
|
+
onClick: () => Pt(Et.REQUEST_CHANGES),
|
|
582
574
|
children: /* @__PURE__ */ e.jsx("span", { className: "label", children: "Request changes" })
|
|
583
575
|
}
|
|
584
576
|
)
|
|
585
577
|
] });
|
|
586
578
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
587
|
-
|
|
579
|
+
wo,
|
|
588
580
|
{
|
|
589
|
-
className:
|
|
581
|
+
className: N("comment-container", { isOpen: a, isEditing: s }),
|
|
590
582
|
onDragOver: io,
|
|
591
|
-
onDragLeave: () =>
|
|
583
|
+
onDragLeave: () => E(!1),
|
|
592
584
|
onDrop: ro,
|
|
593
|
-
onClick: () =>
|
|
585
|
+
onClick: () => E(!1),
|
|
594
586
|
onKeyDown: (t) => t.stopPropagation(),
|
|
595
587
|
children: [
|
|
596
|
-
|
|
597
|
-
Et,
|
|
598
|
-
{
|
|
599
|
-
separate: !0,
|
|
600
|
-
lastOwnVersionReview: A
|
|
601
|
-
}
|
|
602
|
-
),
|
|
588
|
+
tt && ot && /* @__PURE__ */ e.jsx(Xo, { lastOwnVersionReview: ot }),
|
|
603
589
|
/* @__PURE__ */ e.jsxs(
|
|
604
|
-
|
|
590
|
+
ko,
|
|
605
591
|
{
|
|
606
|
-
className:
|
|
607
|
-
isOpen:
|
|
608
|
-
isClosed: !
|
|
609
|
-
isEditing:
|
|
592
|
+
className: N("block-shortcuts", {
|
|
593
|
+
isOpen: a,
|
|
594
|
+
isClosed: !a || M,
|
|
595
|
+
isEditing: s,
|
|
610
596
|
isDropping: dt,
|
|
611
|
-
disabled:
|
|
597
|
+
disabled: M,
|
|
612
598
|
isLoading: rt,
|
|
613
599
|
isSubmitting: zt,
|
|
614
|
-
category: !!
|
|
600
|
+
category: !!B && !h
|
|
615
601
|
}),
|
|
616
602
|
onKeyDown: mo,
|
|
617
603
|
onClick: oo,
|
|
@@ -619,21 +605,14 @@ const Ap = ({
|
|
|
619
605
|
$categoryTertiary: xt.primary,
|
|
620
606
|
$categorySecondary: xt.secondary,
|
|
621
607
|
children: [
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
{
|
|
625
|
-
separate: !1,
|
|
626
|
-
lastOwnVersionReview: A
|
|
627
|
-
}
|
|
628
|
-
),
|
|
629
|
-
/* @__PURE__ */ e.jsx(So, { ref: yt, children: /* @__PURE__ */ e.jsx(yo, { typeOptions: V, initValue: j }) }),
|
|
630
|
-
p && /* @__PURE__ */ e.jsx(
|
|
608
|
+
/* @__PURE__ */ e.jsx(jo, { ref: yt, children: /* @__PURE__ */ e.jsx(yo, { typeOptions: V, initValue: X }) }),
|
|
609
|
+
a && /* @__PURE__ */ e.jsx(
|
|
631
610
|
Co,
|
|
632
611
|
{
|
|
633
|
-
files:
|
|
634
|
-
isCompact: so ||
|
|
612
|
+
files: Tt,
|
|
613
|
+
isCompact: so || s,
|
|
635
614
|
onRemove: eo,
|
|
636
|
-
projectName:
|
|
615
|
+
projectName: k,
|
|
637
616
|
onAnnotationClick: Yt,
|
|
638
617
|
style: {
|
|
639
618
|
borderBottom: "1px solid var(--md-sys-color-outline-variant)",
|
|
@@ -643,27 +622,27 @@ const Ap = ({
|
|
|
643
622
|
pt: {
|
|
644
623
|
file: {
|
|
645
624
|
style: {
|
|
646
|
-
height:
|
|
625
|
+
height: s ? 70 : void 0
|
|
647
626
|
}
|
|
648
627
|
}
|
|
649
628
|
}
|
|
650
629
|
}
|
|
651
630
|
),
|
|
652
|
-
|
|
631
|
+
a && !M ? /* @__PURE__ */ e.jsxs(Io, { ref: Ot, children: [
|
|
653
632
|
!h && /* @__PURE__ */ e.jsx(
|
|
654
633
|
Jo,
|
|
655
634
|
{
|
|
656
|
-
value:
|
|
635
|
+
value: B,
|
|
657
636
|
categories: ht,
|
|
658
637
|
onChange: (t) => Jt(t),
|
|
659
|
-
isCompact:
|
|
660
|
-
hasPowerpack:
|
|
661
|
-
onPowerFeature:
|
|
662
|
-
isHidden:
|
|
638
|
+
isCompact: s,
|
|
639
|
+
hasPowerpack: Ht,
|
|
640
|
+
onPowerFeature: _t,
|
|
641
|
+
isHidden: Oo(ht, { isGuest: h, isAdmin: $t }),
|
|
663
642
|
style: {
|
|
664
|
-
position:
|
|
643
|
+
position: s ? "relative" : "absolute",
|
|
665
644
|
left: 4,
|
|
666
|
-
top:
|
|
645
|
+
top: s ? 0 : 4
|
|
667
646
|
}
|
|
668
647
|
}
|
|
669
648
|
),
|
|
@@ -671,66 +650,65 @@ const Ap = ({
|
|
|
671
650
|
uo,
|
|
672
651
|
{
|
|
673
652
|
theme: "snow",
|
|
674
|
-
style: { minHeight:
|
|
653
|
+
style: { minHeight: Mt, maxHeight: 300 },
|
|
675
654
|
ref: c,
|
|
676
|
-
value:
|
|
677
|
-
onChange:
|
|
678
|
-
readOnly: !
|
|
655
|
+
value: T,
|
|
656
|
+
onChange: Zt,
|
|
657
|
+
readOnly: !a,
|
|
679
658
|
placeholder: Ft(!0),
|
|
680
659
|
modules: po,
|
|
681
|
-
formats:
|
|
660
|
+
formats: Lo
|
|
682
661
|
}
|
|
683
662
|
)
|
|
684
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
685
|
-
/* @__PURE__ */ e.jsxs(
|
|
686
|
-
!h && /* @__PURE__ */ e.jsxs(
|
|
663
|
+
] }) : /* @__PURE__ */ e.jsx(So, { children: Ft() }),
|
|
664
|
+
/* @__PURE__ */ e.jsxs(Mo, { children: [
|
|
665
|
+
!h && /* @__PURE__ */ e.jsxs(To, { children: [
|
|
687
666
|
/* @__PURE__ */ e.jsx(
|
|
688
|
-
|
|
667
|
+
U,
|
|
689
668
|
{
|
|
690
669
|
icon: "person",
|
|
691
670
|
variant: "text",
|
|
692
|
-
onClick: () =>
|
|
671
|
+
onClick: () => z("@"),
|
|
693
672
|
"data-tooltip": "Mention user",
|
|
694
673
|
"data-shortcut": "@"
|
|
695
674
|
}
|
|
696
675
|
),
|
|
697
676
|
/* @__PURE__ */ e.jsx(
|
|
698
|
-
|
|
677
|
+
U,
|
|
699
678
|
{
|
|
700
679
|
icon: "layers",
|
|
701
680
|
variant: "text",
|
|
702
|
-
onClick: () =>
|
|
681
|
+
onClick: () => z("@@"),
|
|
703
682
|
"data-tooltip": "Mention version",
|
|
704
683
|
"data-shortcut": "@@"
|
|
705
684
|
}
|
|
706
685
|
),
|
|
707
686
|
/* @__PURE__ */ e.jsx(
|
|
708
|
-
|
|
687
|
+
U,
|
|
709
688
|
{
|
|
710
689
|
icon: "check_circle",
|
|
711
690
|
variant: "text",
|
|
712
|
-
onClick: () =>
|
|
691
|
+
onClick: () => z("@@@"),
|
|
713
692
|
"data-tooltip": "Mention task",
|
|
714
693
|
"data-shortcut": "@@@"
|
|
715
694
|
}
|
|
716
695
|
)
|
|
717
696
|
] }),
|
|
718
697
|
/* @__PURE__ */ e.jsxs(Do, { children: [
|
|
719
|
-
|
|
720
|
-
a && /* @__PURE__ */ e.jsx(H, { variant: "text", onClick: St, children: "Cancel" }),
|
|
698
|
+
s && /* @__PURE__ */ e.jsx(U, { variant: "text", onClick: jt, children: "Cancel" }),
|
|
721
699
|
/* @__PURE__ */ e.jsx(
|
|
722
700
|
ho,
|
|
723
701
|
{
|
|
724
|
-
label:
|
|
702
|
+
label: s ? "Save" : "Comment",
|
|
725
703
|
className: "comment",
|
|
726
|
-
active: !!
|
|
727
|
-
onClick:
|
|
704
|
+
active: !!T || !!v.length,
|
|
705
|
+
onClick: Y,
|
|
728
706
|
disabled: rt
|
|
729
707
|
}
|
|
730
708
|
)
|
|
731
709
|
] })
|
|
732
710
|
] }),
|
|
733
|
-
/* @__PURE__ */ e.jsx(Fo, { className:
|
|
711
|
+
/* @__PURE__ */ e.jsx(Fo, { className: N({ show: dt && a }), children: /* @__PURE__ */ e.jsx(go, { icon: "cloud_upload" }) })
|
|
734
712
|
]
|
|
735
713
|
}
|
|
736
714
|
),
|
|
@@ -739,31 +717,27 @@ const Ap = ({
|
|
|
739
717
|
{
|
|
740
718
|
mention: m,
|
|
741
719
|
options: I,
|
|
742
|
-
onChange:
|
|
720
|
+
onChange: Xt,
|
|
743
721
|
onPrefixFilter: (t) => {
|
|
744
|
-
ft(t),
|
|
722
|
+
ft(t), G(0);
|
|
745
723
|
},
|
|
746
724
|
activePrefix: F ? F.replace(":", "") : void 0,
|
|
747
|
-
types:
|
|
725
|
+
types: q,
|
|
748
726
|
config: V[m?.type],
|
|
749
727
|
noneFound: !I.length && (m?.search || F),
|
|
750
728
|
noneFoundAtAll: !I.length && !m?.search && !F,
|
|
751
|
-
selectedIndex:
|
|
729
|
+
selectedIndex: $,
|
|
752
730
|
error: Dt,
|
|
753
731
|
isGuest: h
|
|
754
732
|
}
|
|
755
733
|
),
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
Pt
|
|
759
|
-
] })
|
|
734
|
+
/* @__PURE__ */ e.jsx(Po, {}),
|
|
735
|
+
ao
|
|
760
736
|
]
|
|
761
737
|
}
|
|
762
738
|
) });
|
|
763
739
|
};
|
|
764
740
|
export {
|
|
765
|
-
|
|
766
|
-
Ap as default,
|
|
767
|
-
V as mentionTypeOptions
|
|
741
|
+
Rp as default
|
|
768
742
|
};
|
|
769
743
|
//# sourceMappingURL=CommentInput.es.js.map
|