@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.
Files changed (115) hide show
  1. package/dist/_virtual/index.cjs12.js +1 -1
  2. package/dist/_virtual/index.cjs13.js +1 -1
  3. package/dist/_virtual/index.cjs15.js +1 -1
  4. package/dist/_virtual/index.cjs18.js +1 -1
  5. package/dist/_virtual/index.cjs19.js +1 -1
  6. package/dist/_virtual/index.cjs4.js +1 -1
  7. package/dist/_virtual/index.cjs6.js +1 -1
  8. package/dist/_virtual/index.cjs9.js +1 -1
  9. package/dist/_virtual/index.es12.js +5 -2
  10. package/dist/_virtual/index.es12.js.map +1 -1
  11. package/dist/_virtual/index.es13.js +5 -2
  12. package/dist/_virtual/index.es13.js.map +1 -1
  13. package/dist/_virtual/index.es14.js +2 -2
  14. package/dist/_virtual/index.es15.js +2 -2
  15. package/dist/_virtual/index.es16.js +2 -2
  16. package/dist/_virtual/index.es17.js +2 -2
  17. package/dist/_virtual/index.es18.js +2 -2
  18. package/dist/_virtual/index.es19.js +2 -2
  19. package/dist/_virtual/index.es4.js +2 -5
  20. package/dist/_virtual/index.es4.js.map +1 -1
  21. package/dist/_virtual/index.es6.js +2 -2
  22. package/dist/_virtual/index.es7.js +2 -2
  23. package/dist/_virtual/index.es9.js +2 -5
  24. package/dist/_virtual/index.es9.js.map +1 -1
  25. package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js +1 -1
  26. package/dist/node_modules/match-sorter/dist/match-sorter.esm.cjs.js.map +1 -1
  27. package/dist/node_modules/match-sorter/dist/match-sorter.esm.es.js +1 -1
  28. package/dist/node_modules/parse-numeric-range/index.cjs.js +1 -1
  29. package/dist/node_modules/parse-numeric-range/index.es.js +1 -1
  30. package/dist/node_modules/remove-accents/index.cjs.js +1 -1
  31. package/dist/node_modules/remove-accents/index.cjs.js.map +1 -1
  32. package/dist/node_modules/remove-accents/index.es.js +1 -1
  33. package/dist/shared/node_modules/@module-federation/error-codes/dist/index.cjs.js +1 -1
  34. package/dist/shared/node_modules/@module-federation/error-codes/dist/index.es.js +1 -1
  35. package/dist/shared/node_modules/@module-federation/runtime/dist/index.cjs.js +1 -1
  36. package/dist/shared/node_modules/@module-federation/runtime/dist/index.es.js +1 -1
  37. package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.cjs.js +1 -1
  38. package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.es.js +1 -1
  39. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js +1 -1
  40. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js.map +1 -1
  41. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.es.js +1 -1
  42. package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.cjs.js +1 -1
  43. package/dist/shared/node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.es.js +1 -1
  44. package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.cjs.js +1 -1
  45. package/dist/shared/node_modules/@module-federation/runtime-core/dist/remote/index.es.js +1 -1
  46. package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.cjs.js +1 -1
  47. package/dist/shared/node_modules/@module-federation/runtime-core/dist/shared/index.es.js +1 -1
  48. package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.cjs.js +1 -1
  49. package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.es.js +1 -1
  50. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.cjs.js +1 -1
  51. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/hooks/index.es.js +1 -1
  52. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js +1 -1
  53. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js.map +1 -1
  54. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.es.js +1 -1
  55. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js +1 -1
  56. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js.map +1 -1
  57. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.es.js +1 -1
  58. package/dist/shared/node_modules/@module-federation/sdk/dist/index.cjs.js +1 -1
  59. package/dist/shared/node_modules/@module-federation/sdk/dist/index.es.js +1 -1
  60. package/dist/shared/node_modules/prop-types/index.cjs.js +1 -1
  61. package/dist/shared/node_modules/prop-types/index.es.js +1 -1
  62. package/dist/shared/node_modules/react-is/index.cjs.js +1 -1
  63. package/dist/shared/node_modules/react-is/index.es.js +1 -1
  64. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
  65. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js.map +1 -1
  66. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
  67. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
  68. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js.map +1 -1
  69. package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
  70. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
  71. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js.map +1 -1
  72. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
  73. package/dist/shared/src/containers/Feed/Feed.cjs.js +1 -1
  74. package/dist/shared/src/containers/Feed/Feed.cjs.js.map +1 -1
  75. package/dist/shared/src/containers/Feed/Feed.es.js +7 -10
  76. package/dist/shared/src/containers/Feed/Feed.es.js.map +1 -1
  77. package/dist/shared/src/containers/Feed/components/ActivityComment/ActivityComment.cjs.js +1 -1
  78. package/dist/shared/src/containers/Feed/components/ActivityComment/ActivityComment.cjs.js.map +1 -1
  79. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.cjs.js +1 -1
  80. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.cjs.js.map +1 -1
  81. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.es.js +9 -5
  82. package/dist/shared/src/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.es.js.map +1 -1
  83. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.cjs.js +2 -2
  84. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.cjs.js.map +1 -1
  85. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.es.js +207 -233
  86. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.es.js.map +1 -1
  87. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.cjs.js +5 -10
  88. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.cjs.js.map +1 -1
  89. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.es.js +12 -17
  90. package/dist/shared/src/containers/Feed/components/CommentInput/CommentInput.styled.es.js.map +1 -1
  91. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.cjs.js +1 -1
  92. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.cjs.js.map +1 -1
  93. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.es.js +16 -22
  94. package/dist/shared/src/containers/Feed/components/CommentInput/VersionReviewPill.es.js.map +1 -1
  95. package/dist/shared/src/containers/Feed/components/CommentInput/types.cjs.js +2 -0
  96. package/dist/shared/src/containers/Feed/components/CommentInput/types.cjs.js.map +1 -0
  97. package/dist/shared/src/containers/Feed/components/CommentInput/types.es.js +18 -0
  98. package/dist/shared/src/containers/Feed/components/CommentInput/types.es.js.map +1 -0
  99. package/dist/shared/src/containers/Feed/hooks/useCommentMutations.cjs.js.map +1 -1
  100. package/dist/shared/src/containers/Feed/hooks/useCommentMutations.es.js.map +1 -1
  101. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
  102. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
  103. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +67 -64
  104. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
  105. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.cjs.js +1 -1
  106. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.cjs.js.map +1 -1
  107. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.es.js +13 -11
  108. package/dist/shared/src/containers/RepresentationsList/RepresentationsList.es.js.map +1 -1
  109. package/dist/types/containers/Feed/components/ActivityVersionReview/ActivityVersionReview.d.ts +1 -1
  110. package/dist/types/containers/Feed/components/CommentInput/CommentInput.d.ts +1 -16
  111. package/dist/types/containers/Feed/components/CommentInput/VersionReviewPill.d.ts +1 -2
  112. package/dist/types/containers/Feed/components/CommentInput/index.d.ts +2 -0
  113. package/dist/types/containers/Feed/components/CommentInput/types.d.ts +16 -0
  114. package/dist/types/containers/Feed/hooks/useCommentMutations.d.ts +1 -1
  115. 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 tt, useEffect as It, useMemo as At } from "react";
3
- import L from "clsx";
4
- import { toast as co } from "react-toastify";
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 H, SaveButton as ho, Icon as go } from "@ynput/ayon-react-components";
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 bt, AutoHeight as ko, Comment as jo, Markdown as So, Placeholder as Mo, Footer as To, Buttons as wo, SubmitButtons as Do, Dropzone as Fo, VersionReviewButtonsSpacer as Po } from "./CommentInput.styled.es.js";
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 Ao from "../../mentionHelpers/getMentionOptions.es.js";
13
- import bo from "../../mentionHelpers/getMentionUsers.es.js";
14
- import Eo from "../../mentionHelpers/getMentionTasks.es.js";
15
- import qo from "../../mentionHelpers/getMentionVersions.es.js";
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 { parseImages as No, handleFileDrop as Uo, typeWithDelay as Ro } from "./helpers.es.js";
18
- import { getModules as Lo, quillFormats as Ho } from "./modules/index.es.js";
19
- import _o from "./hooks/useInitialValue.es.js";
20
- import Vo from "./hooks/useSetCursorEnd.es.js";
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 w } from "../../../../components/ReviewablesList/useReviewablesUpload.es.js";
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 { ActivityCategorySelect as Jo, isCategoryHidden as Xo } from "../ActivityCategorySelect/ActivityCategorySelect.es.js";
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 Et } from "./VersionReviewPill.es.js";
300
- var qt = fo.import("delta");
301
- const Bt = "<p><br></p>", _ = ["@", "@@", "@@@"], V = {
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: ot = {},
319
- versionReview: K,
320
- lastOwnVersionReview: A,
306
+ data: Z = {},
307
+ versionReview: tt,
308
+ lastOwnVersionReview: ot,
321
309
  onSubmit: et,
322
- isEditing: a,
323
- disabled: D,
310
+ onReview: L,
311
+ isEditing: s,
312
+ disabled: M,
324
313
  isLoading: rt,
325
- isOpen: p,
314
+ isOpen: a,
326
315
  onOpen: it,
327
- onClose: nt,
328
- onReview: $
316
+ onClose: nt
329
317
  }) => {
330
318
  const {
331
- projectName: S,
332
- entities: G,
333
- projectInfo: Rt,
334
- scope: Oo,
335
- feedFilter: Lt,
336
- mentionSuggestionsData: Ht,
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: _t, onPowerFeature: Vt, user: Kt } = Wo(), $t = Kt?.data?.isAdmin, Gt = Yo(), {
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
- } = Ht || {}, [ct, Qt] = f(88), [v, b] = f(""), [M, E] = f(Nt), [Q, q] = f([]), [dt, B] = f(!1), [zt, ut] = f(!1), { annotations: N, removeAnnotation: Wt, goToAnnotation: Yt } = $o({
345
- entityId: G[0]?.id,
346
- filesUploading: Q
347
- }), [m, z] = f(null), [W, Y] = f(0), [F, ft] = f(""), P = () => {
348
- z(null), Y(0), ft("");
349
- }, [U, Jt] = f(Ut), ht = mt.filter((t) => t.accessLevel >= 20), gt = mt.find((t) => t.name === U), xt = Go(gt?.color), c = tt(null), Xt = tt(null), yt = tt(null);
350
- _o({
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: j,
340
+ initValue: X,
353
341
  setEditorValue: b,
354
342
  setInitHeight: Qt,
355
- isOpen: p,
356
- filter: Lt
357
- }), Vo({ initHeight: ct, editorRef: c, isEditing: a }), Ko({ projectName: S }), It(() => {
358
- if (p) {
359
- if (c.current?.getEditor()?.enable(), N.length > 0 && M.length === 0)
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
- }, [p, c]), _.sort((t, o) => o.length - t.length);
364
- const Ct = F + (m?.search || ""), vt = At(
365
- () => Ao(
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
- "@": () => bo(pt, st),
369
- "@@": () => qo(at, Gt),
370
- "@@@": () => Eo(lt, Rt.taskTypes)
356
+ "@": () => Ao(pt, st),
357
+ "@@": () => Eo(at, Gt),
358
+ "@@@": () => Ro(lt, Vt.taskTypes)
371
359
  },
372
360
  Ct || void 0
373
361
  ),
374
- [lt, at, pt, st, m?.type, Ct]
375
- ), I = vt.slice(0, 5), [J, kt] = f();
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
- J && (kt(null), c.current.getEditor().setSelection(J));
378
- }, [J]);
379
- const jt = (t) => {
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}`, s = (o.getSelection(!0)?.index || 0) - n.length;
381
- o.deleteText(s, n.length), o.insertText(s, i, "mention", g);
382
- const l = s + i.length;
383
- o.updateContents(new qt().retain(l).insert(" ")), o.updateContents(new qt().retain(l + 1).delete(1)), kt(l + 1), P();
384
- }, Zt = (t) => {
385
- jt(t);
386
- }, Ot = (t, o, r, n) => {
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[W];
384
+ ` || i === " ", y = vt[$];
390
385
  if (m && d && y && !h) {
391
- o.ops[0] && o.ops[0].retain, jt(y);
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)), _.includes(i)) {
397
- const u = o.ops.findIndex((C) => "insert" in C || "delete" in C), s = i;
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 k = null;
401
- for (const C of _) {
402
- let T = !0;
403
- if (C.endsWith(s))
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 ao = C[x - 1], lo = l - (C.length - x);
407
- if (n.getText(lo, 1) !== ao) {
408
- T = !1;
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
- T = !1;
414
- if (T) {
415
- k = C;
408
+ j = !1;
409
+ if (j) {
410
+ w = C;
416
411
  break;
417
412
  }
418
413
  }
419
- k ? z({
420
- type: k,
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 s = u - m.retain;
430
- g || s++;
431
- const l = n.getText(m.retain, s), k = l.replace(m.type.slice(-1), "");
432
- l.includes(" ") ? P() : z({
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: k?.toLowerCase()
429
+ search: w?.toLowerCase()
435
430
  });
436
431
  } else if (g) {
437
- const u = c.current.getEditor(), s = u.getSelection(!1);
438
- if (u.getFormat(s?.index, s?.length).mention) {
439
- const [k] = u.getLine(s.index - 1) || [], T = (k?.cache?.delta?.ops || []).reverse().find((x) => x.attributes?.mention);
440
- if (T) {
441
- const x = T.insert.length;
442
- u.deleteText(s.index - x, x);
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++), Ro(o, r, t);
451
- }, X = (t) => {
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
- p || D || it && it();
459
- }, St = () => {
460
- (c.current.getEditor().getText().length < 2 || a) && b(""), nt && nt();
461
- }, Z = ({ file: t, data: o }) => {
462
- const r = w(t.name), n = {
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: M.length
462
+ order: v.length
468
463
  };
469
- return E((i) => [...i, n]), q(
470
- (i) => i.filter((d) => w(d.name) !== r)
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) : (E((n) => n.filter((i) => i.id !== t)), q((n) => n.filter((i) => w(i.name) !== w(o))));
474
- }, Mt = (t, o) => {
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 = w(o.name), i = {
472
+ const n = S(o.name), i = {
478
473
  name: n,
479
474
  progress: r,
480
475
  type: o.type,
481
- order: M.length + Q.length
476
+ order: v.length + _.length
482
477
  };
483
- q((d) => [...d.filter((g) => w(g.name) !== n), i]);
478
+ R((d) => [...d.filter((g) => S(g.name) !== n), i]);
484
479
  }
485
480
  }, ro = (t) => {
486
- B(!1), Uo(t, S, Mt, Z);
481
+ E(!1), No(t, k, St, W);
487
482
  }, io = (t) => {
488
- t.preventDefault(), t.stopPropagation(), B(!0);
483
+ t.preventDefault(), t.stopPropagation(), E(!0);
489
484
  }, no = Qo({
490
- projectName: S,
491
- onSuccess: Z
492
- }), R = async () => {
485
+ projectName: k,
486
+ onSuccess: W
487
+ }), Y = async () => {
493
488
  try {
494
489
  ut(!0);
495
490
  let t = [], o;
496
- if (N.length) {
497
- const { files: y, metadata: g } = await no(N);
491
+ if (D.length) {
492
+ const { files: y, metadata: g } = await no(D);
498
493
  t = y;
499
- const { annotations: O = [] } = ot || {};
500
- o = [...O, ...g];
494
+ const { annotations: J = [] } = Z || {};
495
+ o = [...J, ...g];
501
496
  }
502
- const [r] = Bo(v), n = No(r), i = [...M, ...t], d = {
503
- ...ot,
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 : U
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(""), E([]);
506
+ await et(n, i, d), b(""), A([]);
512
507
  } catch {
513
508
  return;
514
509
  }
515
510
  } catch (t) {
516
- console.error(t), co.error("Something went wrong");
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 = W + o;
531
- r < 0 && (r = I.length - 1), r >= I.length && (r = 0), Y(r);
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) && R(), t.key === "Escape" && St();
530
+ t.key === "Enter" && (t.ctrlKey || t.metaKey) && Y(), t.key === "Escape" && jt();
536
531
  };
537
- let Tt = p ? ct + 41 : 44;
538
- a && (Tt = void 0);
539
- const po = At(
540
- () => Lo({
532
+ let Mt = a ? ct + 41 : 44;
533
+ s && (Mt = void 0);
534
+ const po = bt(
535
+ () => qo({
541
536
  imageUploader: {
542
- projectName: S,
543
- onUpload: Z,
544
- onUploadProgress: Mt
537
+ projectName: k,
538
+ onUpload: W,
539
+ onUploadProgress: St
545
540
  },
546
541
  mentionTypeOptions: V
547
542
  }),
548
- [S, E, q]
549
- ), wt = [...N, ...M || [], ...Q].sort(
543
+ [k, A, R]
544
+ ), Tt = [...D, ...v || [], ..._].sort(
550
545
  (t, o) => t.order - o.order
551
- ), so = wt.length > 3;
546
+ ), so = Tt.length > 3;
552
547
  let Dt = null;
553
- G.length && G[0].entityType === "folder" && m?.type === "@@" && (Dt = "Version mentions are disabled for folders");
554
- const Ft = (t) => D ? 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 = K && $ && /* @__PURE__ */ e.jsxs(vo, { className: L("version-review-buttons", { guest: h }), children: [
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
- bt,
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
- bt,
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
- ko,
579
+ wo,
588
580
  {
589
- className: L("comment-container", { isOpen: p, isEditing: a }),
581
+ className: N("comment-container", { isOpen: a, isEditing: s }),
590
582
  onDragOver: io,
591
- onDragLeave: () => B(!1),
583
+ onDragLeave: () => E(!1),
592
584
  onDrop: ro,
593
- onClick: () => B(!1),
585
+ onClick: () => E(!1),
594
586
  onKeyDown: (t) => t.stopPropagation(),
595
587
  children: [
596
- !p && K && A && /* @__PURE__ */ e.jsx(
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
- jo,
590
+ ko,
605
591
  {
606
- className: L("block-shortcuts", {
607
- isOpen: p,
608
- isClosed: !p || D,
609
- isEditing: a,
592
+ className: N("block-shortcuts", {
593
+ isOpen: a,
594
+ isClosed: !a || M,
595
+ isEditing: s,
610
596
  isDropping: dt,
611
- disabled: D,
597
+ disabled: M,
612
598
  isLoading: rt,
613
599
  isSubmitting: zt,
614
- category: !!U && !h
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
- p && K && A && /* @__PURE__ */ e.jsx(
623
- Et,
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: wt,
634
- isCompact: so || a,
612
+ files: Tt,
613
+ isCompact: so || s,
635
614
  onRemove: eo,
636
- projectName: S,
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: a ? 70 : void 0
625
+ height: s ? 70 : void 0
647
626
  }
648
627
  }
649
628
  }
650
629
  }
651
630
  ),
652
- p && !D ? /* @__PURE__ */ e.jsxs(Io, { ref: Xt, children: [
631
+ a && !M ? /* @__PURE__ */ e.jsxs(Io, { ref: Ot, children: [
653
632
  !h && /* @__PURE__ */ e.jsx(
654
633
  Jo,
655
634
  {
656
- value: U,
635
+ value: B,
657
636
  categories: ht,
658
637
  onChange: (t) => Jt(t),
659
- isCompact: a,
660
- hasPowerpack: _t,
661
- onPowerFeature: Vt,
662
- isHidden: Xo(ht, { isGuest: h, isAdmin: $t }),
638
+ isCompact: s,
639
+ hasPowerpack: Ht,
640
+ onPowerFeature: _t,
641
+ isHidden: Oo(ht, { isGuest: h, isAdmin: $t }),
663
642
  style: {
664
- position: a ? "relative" : "absolute",
643
+ position: s ? "relative" : "absolute",
665
644
  left: 4,
666
- top: a ? 0 : 4
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: Tt, maxHeight: 300 },
653
+ style: { minHeight: Mt, maxHeight: 300 },
675
654
  ref: c,
676
- value: v,
677
- onChange: Ot,
678
- readOnly: !p,
655
+ value: T,
656
+ onChange: Zt,
657
+ readOnly: !a,
679
658
  placeholder: Ft(!0),
680
659
  modules: po,
681
- formats: Ho
660
+ formats: Lo
682
661
  }
683
662
  )
684
- ] }) : /* @__PURE__ */ e.jsx(Mo, { children: Ft() }),
685
- /* @__PURE__ */ e.jsxs(To, { children: [
686
- !h && /* @__PURE__ */ e.jsxs(wo, { children: [
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
- H,
667
+ U,
689
668
  {
690
669
  icon: "person",
691
670
  variant: "text",
692
- onClick: () => X("@"),
671
+ onClick: () => z("@"),
693
672
  "data-tooltip": "Mention user",
694
673
  "data-shortcut": "@"
695
674
  }
696
675
  ),
697
676
  /* @__PURE__ */ e.jsx(
698
- H,
677
+ U,
699
678
  {
700
679
  icon: "layers",
701
680
  variant: "text",
702
- onClick: () => X("@@"),
681
+ onClick: () => z("@@"),
703
682
  "data-tooltip": "Mention version",
704
683
  "data-shortcut": "@@"
705
684
  }
706
685
  ),
707
686
  /* @__PURE__ */ e.jsx(
708
- H,
687
+ U,
709
688
  {
710
689
  icon: "check_circle",
711
690
  variant: "text",
712
- onClick: () => X("@@@"),
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
- p && Pt,
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: a ? "Save" : "Comment",
702
+ label: s ? "Save" : "Comment",
725
703
  className: "comment",
726
- active: !!v || !!M.length,
727
- onClick: R,
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: L({ show: dt && p }), children: /* @__PURE__ */ e.jsx(go, { icon: "cloud_upload" }) })
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: Zt,
720
+ onChange: Xt,
743
721
  onPrefixFilter: (t) => {
744
- ft(t), Y(0);
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: W,
729
+ selectedIndex: $,
752
730
  error: Dt,
753
731
  isGuest: h
754
732
  }
755
733
  ),
756
- !p && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
757
- /* @__PURE__ */ e.jsx(Po, {}),
758
- Pt
759
- ] })
734
+ /* @__PURE__ */ e.jsx(Po, {}),
735
+ ao
760
736
  ]
761
737
  }
762
738
  ) });
763
739
  };
764
740
  export {
765
- Zo as VersionReviewFeedback,
766
- Ap as default,
767
- V as mentionTypeOptions
741
+ Rp as default
768
742
  };
769
743
  //# sourceMappingURL=CommentInput.es.js.map